diff --git a/.clang-format b/.clang-format
new file mode 100644
index 0000000000000000000000000000000000000000..1bdc80ff8929a640ee9753cb3249805508b9259b
--- /dev/null
+++ b/.clang-format
@@ -0,0 +1,133 @@
+---
+Language:        Cpp
+# BasedOnStyle:  LLVM
+AccessModifierOffset: -4
+AlignAfterOpenBracket: Align
+AlignConsecutiveMacros: false
+AlignConsecutiveAssignments: true
+AlignConsecutiveDeclarations: false
+AlignEscapedNewlines: Right
+AlignOperands:   true
+AlignTrailingComments: true
+AllowAllArgumentsOnNextLine: true
+AllowAllConstructorInitializersOnNextLine: true
+AllowAllParametersOfDeclarationOnNextLine: true
+AllowShortBlocksOnASingleLine: Never
+AllowShortCaseLabelsOnASingleLine: false
+AllowShortFunctionsOnASingleLine: All
+AllowShortLambdasOnASingleLine: All
+AllowShortIfStatementsOnASingleLine: Never
+AllowShortLoopsOnASingleLine: false
+AlwaysBreakAfterDefinitionReturnType: None
+AlwaysBreakAfterReturnType: None
+AlwaysBreakBeforeMultilineStrings: false
+AlwaysBreakTemplateDeclarations: Yes
+BinPackArguments: true
+BinPackParameters: true
+BraceWrapping:
+  AfterCaseLabel:  false
+  AfterClass:      true
+  AfterControlStatement: Never
+  AfterEnum:       false
+  AfterFunction:   true
+  AfterNamespace:  false
+  AfterObjCDeclaration: false
+  AfterStruct:     true
+  AfterUnion:      true
+  AfterExternBlock: false
+  BeforeCatch:     false
+  BeforeElse:      false
+  IndentBraces:    false
+  SplitEmptyFunction: true
+  SplitEmptyRecord: true
+  SplitEmptyNamespace: true
+BreakBeforeBinaryOperators: None
+BreakBeforeBraces: Linux
+BreakBeforeInheritanceComma: false
+BreakInheritanceList: BeforeColon
+BreakBeforeTernaryOperators: true
+BreakConstructorInitializersBeforeComma: false
+BreakConstructorInitializers: BeforeColon
+BreakAfterJavaFieldAnnotations: false
+BreakStringLiterals: true
+ColumnLimit:     120
+CommentPragmas:  '^ IWYU pragma:'
+CompactNamespaces: false
+ConstructorInitializerAllOnOneLineOrOnePerLine: false
+ConstructorInitializerIndentWidth: 4
+ContinuationIndentWidth: 4
+Cpp11BracedListStyle: false
+DeriveLineEnding: true
+DerivePointerAlignment: false
+DisableFormat:   false
+ExperimentalAutoDetectBinPacking: false
+FixNamespaceComments: true
+ForEachMacros:
+  - foreach
+  - Q_FOREACH
+  - BOOST_FOREACH
+IncludeBlocks:   Preserve
+IncludeCategories:
+  - Regex:           '^"(llvm|llvm-c|clang|clang-c)/'
+    Priority:        2
+    SortPriority:    0
+  - Regex:           '^(<|"(gtest|gmock|isl|json)/)'
+    Priority:        3
+    SortPriority:    0
+  - Regex:           '.*'
+    Priority:        1
+    SortPriority:    0
+IncludeIsMainRegex: '(Test)?$'
+IncludeIsMainSourceRegex: ''
+IndentCaseLabels: true
+IndentGotoLabels: true
+IndentPPDirectives: None
+IndentWidth:     4
+IndentWrappedFunctionNames: false
+JavaScriptQuotes: Leave
+JavaScriptWrapImports: true
+KeepEmptyLinesAtTheStartOfBlocks: true
+MacroBlockBegin: ''
+MacroBlockEnd:   ''
+MaxEmptyLinesToKeep: 1
+NamespaceIndentation: None
+PenaltyBreakAssignment: 2
+PenaltyBreakBeforeFirstCallParameter: 19
+PenaltyBreakComment: 300
+PenaltyBreakFirstLessLess: 120
+PenaltyBreakString: 1000
+PenaltyBreakTemplateDeclaration: 10
+PenaltyExcessCharacter: 1000000
+PenaltyReturnTypeOnItsOwnLine: 60
+PointerAlignment: Right
+ReflowComments:  true
+SortIncludes:    true
+SortUsingDeclarations: true
+SpaceAfterCStyleCast: false
+SpaceAfterLogicalNot: false
+SpaceAfterTemplateKeyword: true
+SpaceBeforeAssignmentOperators: true
+SpaceBeforeCpp11BracedList: false
+SpaceBeforeCtorInitializerColon: true
+SpaceBeforeInheritanceColon: true
+SpaceBeforeParens: ControlStatements
+SpaceBeforeRangeBasedForLoopColon: true
+SpaceInEmptyBlock: false
+SpaceInEmptyParentheses: false
+SpacesBeforeTrailingComments: 1
+SpacesInAngles:  false
+SpacesInConditionalStatement: false
+SpacesInContainerLiterals: true
+SpacesInCStyleCastParentheses: false
+SpacesInParentheses: false
+SpacesInSquareBrackets: false
+SpaceBeforeSquareBrackets: false
+Standard:        Latest
+StatementMacros:
+  - Q_UNUSED
+  - QT_REQUIRE_VERSION
+TabWidth:        4
+UseCRLF:         false
+UseTab:          Never
+...
+
diff --git a/src/basics/Core/ArrayTypes.h b/src/basics/Core/ArrayTypes.h
index 2e50298ce5ba8ceb6b27743eb1842427c89a3af1..7d5d70374b04d7ad29a6443fbcac0263fd8d0ad6 100644
--- a/src/basics/Core/ArrayTypes.h
+++ b/src/basics/Core/ArrayTypes.h
@@ -5,58 +5,58 @@
 
 #include "DataTypes.h"
 
-typedef std::array< uint, 2  > uint_2 ;
-typedef std::array< uint, 3  > uint_3 ;
-typedef std::array< uint, 4  > uint_4 ;
-typedef std::array< uint, 5  > uint_5 ;
-typedef std::array< uint, 6  > uint_6 ;
-typedef std::array< uint, 7  > uint_7 ;
-typedef std::array< uint, 8  > uint_8 ;
-typedef std::array< uint, 9  > uint_9 ;
-typedef std::array< uint, 10 > uint_10;
-typedef std::array< uint, 11 > uint_11;
-typedef std::array< uint, 12 > uint_12;
-typedef std::array< uint, 13 > uint_13;
-typedef std::array< uint, 14 > uint_14;
-typedef std::array< uint, 15 > uint_15;
-typedef std::array< uint, 16 > uint_16;
-typedef std::array< uint, 17 > uint_17;
-typedef std::array< uint, 18 > uint_18;
-typedef std::array< uint, 19 > uint_19;
-typedef std::array< uint, 20 > uint_20;
-typedef std::array< uint, 21 > uint_21;
-typedef std::array< uint, 22 > uint_22;
-typedef std::array< uint, 23 > uint_23;
-typedef std::array< uint, 24 > uint_24;
-typedef std::array< uint, 25 > uint_25;
-typedef std::array< uint, 26 > uint_26;
-typedef std::array< uint, 27 > uint_27;
+typedef std::array<uint, 2> uint_2;
+typedef std::array<uint, 3> uint_3;
+typedef std::array<uint, 4> uint_4;
+typedef std::array<uint, 5> uint_5;
+typedef std::array<uint, 6> uint_6;
+typedef std::array<uint, 7> uint_7;
+typedef std::array<uint, 8> uint_8;
+typedef std::array<uint, 9> uint_9;
+typedef std::array<uint, 10> uint_10;
+typedef std::array<uint, 11> uint_11;
+typedef std::array<uint, 12> uint_12;
+typedef std::array<uint, 13> uint_13;
+typedef std::array<uint, 14> uint_14;
+typedef std::array<uint, 15> uint_15;
+typedef std::array<uint, 16> uint_16;
+typedef std::array<uint, 17> uint_17;
+typedef std::array<uint, 18> uint_18;
+typedef std::array<uint, 19> uint_19;
+typedef std::array<uint, 20> uint_20;
+typedef std::array<uint, 21> uint_21;
+typedef std::array<uint, 22> uint_22;
+typedef std::array<uint, 23> uint_23;
+typedef std::array<uint, 24> uint_24;
+typedef std::array<uint, 25> uint_25;
+typedef std::array<uint, 26> uint_26;
+typedef std::array<uint, 27> uint_27;
 
-typedef std::array< bool, 2  > bool_2 ;
-typedef std::array< bool, 3  > bool_3 ;
-typedef std::array< bool, 4  > bool_4 ;
-typedef std::array< bool, 5  > bool_5 ;
-typedef std::array< bool, 6  > bool_6 ;
-typedef std::array< bool, 7  > bool_7 ;
-typedef std::array< bool, 8  > bool_8 ;
-typedef std::array< bool, 9  > bool_9 ;
-typedef std::array< bool, 10 > bool_10;
-typedef std::array< bool, 11 > bool_11;
-typedef std::array< bool, 12 > bool_12;
-typedef std::array< bool, 13 > bool_13;
-typedef std::array< bool, 14 > bool_14;
-typedef std::array< bool, 15 > bool_15;
-typedef std::array< bool, 16 > bool_16;
-typedef std::array< bool, 17 > bool_17;
-typedef std::array< bool, 18 > bool_18;
-typedef std::array< bool, 19 > bool_19;
-typedef std::array< bool, 20 > bool_20;
-typedef std::array< bool, 21 > bool_21;
-typedef std::array< bool, 22 > bool_22;
-typedef std::array< bool, 23 > bool_23;
-typedef std::array< bool, 24 > bool_24;
-typedef std::array< bool, 25 > bool_25;
-typedef std::array< bool, 26 > bool_26;
-typedef std::array< bool, 27 > bool_27;
+typedef std::array<bool, 2> bool_2;
+typedef std::array<bool, 3> bool_3;
+typedef std::array<bool, 4> bool_4;
+typedef std::array<bool, 5> bool_5;
+typedef std::array<bool, 6> bool_6;
+typedef std::array<bool, 7> bool_7;
+typedef std::array<bool, 8> bool_8;
+typedef std::array<bool, 9> bool_9;
+typedef std::array<bool, 10> bool_10;
+typedef std::array<bool, 11> bool_11;
+typedef std::array<bool, 12> bool_12;
+typedef std::array<bool, 13> bool_13;
+typedef std::array<bool, 14> bool_14;
+typedef std::array<bool, 15> bool_15;
+typedef std::array<bool, 16> bool_16;
+typedef std::array<bool, 17> bool_17;
+typedef std::array<bool, 18> bool_18;
+typedef std::array<bool, 19> bool_19;
+typedef std::array<bool, 20> bool_20;
+typedef std::array<bool, 21> bool_21;
+typedef std::array<bool, 22> bool_22;
+typedef std::array<bool, 23> bool_23;
+typedef std::array<bool, 24> bool_24;
+typedef std::array<bool, 25> bool_25;
+typedef std::array<bool, 26> bool_26;
+typedef std::array<bool, 27> bool_27;
 
 #endif
diff --git a/src/basics/Core/DataTypes.h b/src/basics/Core/DataTypes.h
index b4fa3a0d96e10bd4e04a809c075e49e0f9867f05..1ea72d2a8ace038b5ef8de84f33aef4cff239b50 100644
--- a/src/basics/Core/DataTypes.h
+++ b/src/basics/Core/DataTypes.h
@@ -3,7 +3,6 @@
 
 #include <string>
 
-
 #ifdef VF_DOUBLE_ACCURACY
 typedef double real;
 #else
@@ -11,6 +10,6 @@ using real = float;
 #endif
 
 using uint = unsigned int;
-#define INVALID_INDEX 4294967295 //max uint
+#define INVALID_INDEX 4294967295 // max uint
 
 #endif
diff --git a/src/basics/Core/Input/ConfigData/ConfigData.h b/src/basics/Core/Input/ConfigData/ConfigData.h
index 16f789ef9f0104ce12caa630bc00181d80f06fa6..44d50557608817bff889ba9aa4316861d8ce2bca 100644
--- a/src/basics/Core/Input/ConfigData/ConfigData.h
+++ b/src/basics/Core/Input/ConfigData/ConfigData.h
@@ -11,177 +11,175 @@ class ConfigData
 public:
     virtual ~ConfigData() = default;
 
-	virtual real getViscosity() = 0;
-	virtual uint getNumberOfDevices() = 0;
-	virtual std::vector<uint> getDevices() = 0;
-	virtual std::string getOutputPath() = 0;
-	virtual std::string getPrefix() = 0;
-	virtual std::string getGridPath() = 0;
-	virtual bool getPrintOutputFiles() = 0;
-	virtual bool getGeometryValues() = 0;
-	virtual bool getCalc2ndOrderMoments() = 0;
-	virtual bool getCalc3rdOrderMoments() = 0;
-	virtual bool getCalcHighOrderMoments() = 0;
-	virtual bool getReadGeo() = 0;
-	virtual bool getCalcMedian() = 0;
-	virtual bool getCalcDragLift() = 0;
-	virtual bool getCalcCp() = 0;
-	virtual bool getWriteVeloASCIIfiles() = 0;
-	virtual bool getCalcPlaneConc() = 0;
-	virtual bool getConcFile() = 0;
-	virtual bool getStreetVelocityFile() = 0;
-	virtual bool getUseMeasurePoints() = 0;
-	virtual bool getUseWale() = 0;
-	virtual bool getUseInitNeq() = 0;
-	virtual bool getSimulatePorousMedia() = 0;
-	virtual uint getD3Qxx() = 0;
-	virtual uint getTEnd() = 0;
-	virtual uint getTOut() = 0;
-	virtual uint getTStartOut() = 0;
-	virtual uint getTimeCalcMedStart() = 0;
-	virtual uint getTimeCalcMedEnd() = 0;
-	virtual uint getPressInID() = 0;
-	virtual uint getPressOutID() = 0;
-	virtual uint getPressInZ() = 0;
-	virtual uint getPressOutZ() = 0;
-	virtual bool getDiffOn() = 0;
-	virtual uint getDiffMod() = 0;
-	virtual real getDiffusivity() = 0;
-	virtual real getTemperatureInit() = 0;
-	virtual real getTemperatureBC() = 0;
-	virtual real getVelocity() = 0;
-	virtual real getViscosityRatio() = 0;
-	virtual real getVelocityRatio() = 0;
-	virtual real getDensityRatio() = 0;
-	virtual real getPressRatio() = 0;
-	virtual real getRealX() = 0;
-	virtual real getRealY() = 0;
-	virtual real getFactorPressBC() = 0;
-	virtual std::string getGeometryFileC() = 0;
-	virtual std::string getGeometryFileM() = 0;
-	virtual std::string getGeometryFileF() = 0;
-	virtual uint getClockCycleForMP() = 0;
-	virtual uint getTimestepForMP() = 0;
-	virtual real getForcingX() = 0;
-	virtual real getForcingY() = 0;
-	virtual real getForcingZ() = 0;
-    virtual real getQuadricLimiterP() = 0;
-    virtual real getQuadricLimiterM() = 0;
-    virtual real getQuadricLimiterD() = 0;
-	virtual bool getCalcParticles() = 0;
-	virtual int getParticleBasicLevel() = 0;
-	virtual int getParticleInitLevel() = 0;
-	virtual int getNumberOfParticles() = 0;
-	virtual real getStartXHotWall() = 0;
-	virtual real getEndXHotWall() = 0;
-	virtual std::vector<std::string> getPossNeighborFilesX() = 0;
-	virtual std::vector<std::string> getPossNeighborFilesY() = 0;
-	virtual std::vector<std::string> getPossNeighborFilesZ() = 0;
-	//virtual std::vector<std::string> getPossNeighborFilesX() = 0;
-	//virtual std::vector<std::string> getPossNeighborFilesY() = 0;
-	//virtual std::vector<std::string> getPossNeighborFilesZ() = 0;
-	virtual int getTimeDoCheckPoint() = 0;
-	virtual int getTimeDoRestart() = 0;
-	virtual bool getDoCheckPoint() = 0;
-	virtual bool getDoRestart() = 0;
-	virtual uint getMaxLevel() = 0;
-	virtual std::vector<int> getGridX() = 0;
-	virtual std::vector<int> getGridY() = 0;
-	virtual std::vector<int> getGridZ() = 0;
-	virtual std::vector<int> getDistX() = 0;
-	virtual std::vector<int> getDistY() = 0;
-	virtual std::vector<int> getDistZ() = 0;
-	virtual std::vector<bool> getNeedInterface() = 0;
-	virtual std::string getMainKernel() = 0;
-	virtual bool getMultiKernelOn() = 0;
-	virtual std::vector<int> getMultiKernelLevel() = 0;
-	virtual std::vector<std::string>getMultiKernelName() = 0;
-
-	virtual bool isViscosityInConfigFile() = 0;
-	virtual bool isNumberOfDevicesInConfigFile() = 0;
-	virtual bool isDevicesInConfigFile() = 0;
-	virtual bool isOutputPathInConfigFile() = 0;
-	virtual bool isPrefixInConfigFile() = 0;
-	virtual bool isGridPathInConfigFile() = 0;
-	virtual bool isPrintOutputFilesInConfigFile() = 0;
-	virtual bool isGeometryValuesInConfigFile() = 0;
-	virtual bool isCalc2ndOrderMomentsInConfigFile() = 0;
-	virtual bool isCalc3rdOrderMomentsInConfigFile() = 0;
-	virtual bool isCalcHighOrderMomentsInConfigFile() = 0;
-	virtual bool isReadGeoInConfigFile() = 0;
-	virtual bool isCalcMedianInConfigFile() = 0;
-	virtual bool isCalcDragLiftInConfigFile() = 0;
-	virtual bool isCalcCpInConfigFile() = 0;
-	virtual bool isWriteVeloASCIIfilesInConfigFile() = 0;
-	virtual bool isCalcPlaneConcInConfigFile() = 0;
-	virtual bool isConcFileInConfigFile() = 0;
-	virtual bool isStreetVelocityFileInConfigFile() = 0;
-	virtual bool isUseMeasurePointsInConfigFile() = 0;
-	virtual bool isUseWaleInConfigFile() = 0;
-	virtual bool isUseInitNeqInConfigFile() = 0;
-	virtual bool isSimulatePorousMediaInConfigFile() = 0;
-	virtual bool isD3QxxInConfigFile() = 0;
-	virtual bool isTEndInConfigFile() = 0;
-	virtual bool isTOutInConfigFile() = 0;
-	virtual bool isTStartOutInConfigFile() = 0;
-	virtual bool isTimeCalcMedStartInConfigFile() = 0;
-	virtual bool isTimeCalcMedEndInConfigFile() = 0;
-	virtual bool isPressInIDInConfigFile() = 0;
-	virtual bool isPressOutIDInConfigFile() = 0;
-	virtual bool isPressInZInConfigFile() = 0;
-	virtual bool isPressOutZInConfigFile() = 0;
-	virtual bool isDiffOnInConfigFile() = 0;
-	virtual bool isDiffModInConfigFile() = 0;
-	virtual bool isDiffusivityInConfigFile() = 0;
-	virtual bool isTemperatureInitInConfigFile() = 0;
-	virtual bool isTemperatureBCInConfigFile() = 0;
-	//virtual bool isViscosityInConfigFile() = 0;
-	virtual bool isVelocityInConfigFile() = 0;
-	virtual bool isViscosityRatioInConfigFile() = 0;
-	virtual bool isVelocityRatioInConfigFile() = 0;
-	virtual bool isDensityRatioInConfigFile() = 0;
-	virtual bool isPressRatioInConfigFile() = 0;
-	virtual bool isRealXInConfigFile() = 0;
-	virtual bool isRealYInConfigFile() = 0;
-	virtual bool isFactorPressBCInConfigFile() = 0;
-	virtual bool isGeometryFileCInConfigFile() = 0;
-	virtual bool isGeometryFileMInConfigFile() = 0;
-	virtual bool isGeometryFileFInConfigFile() = 0;
-	virtual bool isClockCycleForMPInConfigFile() = 0;
-	virtual bool isTimestepForMPInConfigFile() = 0;
-	virtual bool isForcingXInConfigFile() = 0;
-	virtual bool isForcingYInConfigFile() = 0;
-	virtual bool isForcingZInConfigFile() = 0;
-	virtual bool isQuadricLimiterPInConfigFile() = 0;
-	virtual bool isQuadricLimiterMInConfigFile() = 0;
-	virtual bool isQuadricLimiterDInConfigFile() = 0;
-	virtual bool isCalcParticlesInConfigFile() = 0;
-	virtual bool isParticleBasicLevelInConfigFile() = 0;
-	virtual bool isParticleInitLevelInConfigFile() = 0;
-	virtual bool isNumberOfParticlesInConfigFile() = 0;
-	virtual bool isNeighborWSBInConfigFile() = 0;
-	virtual bool isStartXHotWallInConfigFile() = 0;
-	virtual bool isEndXHotWallInConfigFile() = 0;
-	virtual bool isPossNeighborFilesXInConfigFile() = 0;
-	virtual bool isPossNeighborFilesYInConfigFile() = 0;
-	virtual bool isPossNeighborFilesZInConfigFile() = 0;
-	virtual bool isTimeDoCheckPointInConfigFile() = 0;
-	virtual bool isTimeDoRestartInConfigFile() = 0;
-	virtual bool isDoCheckPointInConfigFile() = 0;
-	virtual bool isDoRestartInConfigFile() = 0;
-	virtual bool isMaxLevelInConfigFile() = 0;
-	virtual bool isGridXInConfigFile() = 0;
-	virtual bool isGridYInConfigFile() = 0;
-	virtual bool isGridZInConfigFile() = 0;
-	virtual bool isDistXInConfigFile() = 0;
-	virtual bool isDistYInConfigFile() = 0;
-	virtual bool isDistZInConfigFile() = 0;
-	virtual bool isNeedInterfaceInConfigFile() = 0;
-	virtual bool isMainKernelInConfigFile() = 0;
-	virtual bool isMultiKernelOnInConfigFile() = 0;
-	virtual bool isMultiKernelLevelInConfigFile() = 0;
-	virtual bool isMultiKernelNameInConfigFile() = 0;
-
+    virtual real getViscosity()                              = 0;
+    virtual uint getNumberOfDevices()                        = 0;
+    virtual std::vector<uint> getDevices()                   = 0;
+    virtual std::string getOutputPath()                      = 0;
+    virtual std::string getPrefix()                          = 0;
+    virtual std::string getGridPath()                        = 0;
+    virtual bool getPrintOutputFiles()                       = 0;
+    virtual bool getGeometryValues()                         = 0;
+    virtual bool getCalc2ndOrderMoments()                    = 0;
+    virtual bool getCalc3rdOrderMoments()                    = 0;
+    virtual bool getCalcHighOrderMoments()                   = 0;
+    virtual bool getReadGeo()                                = 0;
+    virtual bool getCalcMedian()                             = 0;
+    virtual bool getCalcDragLift()                           = 0;
+    virtual bool getCalcCp()                                 = 0;
+    virtual bool getWriteVeloASCIIfiles()                    = 0;
+    virtual bool getCalcPlaneConc()                          = 0;
+    virtual bool getConcFile()                               = 0;
+    virtual bool getStreetVelocityFile()                     = 0;
+    virtual bool getUseMeasurePoints()                       = 0;
+    virtual bool getUseWale()                                = 0;
+    virtual bool getUseInitNeq()                             = 0;
+    virtual bool getSimulatePorousMedia()                    = 0;
+    virtual uint getD3Qxx()                                  = 0;
+    virtual uint getTEnd()                                   = 0;
+    virtual uint getTOut()                                   = 0;
+    virtual uint getTStartOut()                              = 0;
+    virtual uint getTimeCalcMedStart()                       = 0;
+    virtual uint getTimeCalcMedEnd()                         = 0;
+    virtual uint getPressInID()                              = 0;
+    virtual uint getPressOutID()                             = 0;
+    virtual uint getPressInZ()                               = 0;
+    virtual uint getPressOutZ()                              = 0;
+    virtual bool getDiffOn()                                 = 0;
+    virtual uint getDiffMod()                                = 0;
+    virtual real getDiffusivity()                            = 0;
+    virtual real getTemperatureInit()                        = 0;
+    virtual real getTemperatureBC()                          = 0;
+    virtual real getVelocity()                               = 0;
+    virtual real getViscosityRatio()                         = 0;
+    virtual real getVelocityRatio()                          = 0;
+    virtual real getDensityRatio()                           = 0;
+    virtual real getPressRatio()                             = 0;
+    virtual real getRealX()                                  = 0;
+    virtual real getRealY()                                  = 0;
+    virtual real getFactorPressBC()                          = 0;
+    virtual std::string getGeometryFileC()                   = 0;
+    virtual std::string getGeometryFileM()                   = 0;
+    virtual std::string getGeometryFileF()                   = 0;
+    virtual uint getClockCycleForMP()                        = 0;
+    virtual uint getTimestepForMP()                          = 0;
+    virtual real getForcingX()                               = 0;
+    virtual real getForcingY()                               = 0;
+    virtual real getForcingZ()                               = 0;
+    virtual real getQuadricLimiterP()                        = 0;
+    virtual real getQuadricLimiterM()                        = 0;
+    virtual real getQuadricLimiterD()                        = 0;
+    virtual bool getCalcParticles()                          = 0;
+    virtual int getParticleBasicLevel()                      = 0;
+    virtual int getParticleInitLevel()                       = 0;
+    virtual int getNumberOfParticles()                       = 0;
+    virtual real getStartXHotWall()                          = 0;
+    virtual real getEndXHotWall()                            = 0;
+    virtual std::vector<std::string> getPossNeighborFilesX() = 0;
+    virtual std::vector<std::string> getPossNeighborFilesY() = 0;
+    virtual std::vector<std::string> getPossNeighborFilesZ() = 0;
+    // virtual std::vector<std::string> getPossNeighborFilesX() = 0;
+    // virtual std::vector<std::string> getPossNeighborFilesY() = 0;
+    // virtual std::vector<std::string> getPossNeighborFilesZ() = 0;
+    virtual int getTimeDoCheckPoint()                     = 0;
+    virtual int getTimeDoRestart()                        = 0;
+    virtual bool getDoCheckPoint()                        = 0;
+    virtual bool getDoRestart()                           = 0;
+    virtual uint getMaxLevel()                            = 0;
+    virtual std::vector<int> getGridX()                   = 0;
+    virtual std::vector<int> getGridY()                   = 0;
+    virtual std::vector<int> getGridZ()                   = 0;
+    virtual std::vector<int> getDistX()                   = 0;
+    virtual std::vector<int> getDistY()                   = 0;
+    virtual std::vector<int> getDistZ()                   = 0;
+    virtual std::vector<bool> getNeedInterface()          = 0;
+    virtual std::string getMainKernel()                   = 0;
+    virtual bool getMultiKernelOn()                       = 0;
+    virtual std::vector<int> getMultiKernelLevel()        = 0;
+    virtual std::vector<std::string> getMultiKernelName() = 0;
 
+    virtual bool isViscosityInConfigFile()            = 0;
+    virtual bool isNumberOfDevicesInConfigFile()      = 0;
+    virtual bool isDevicesInConfigFile()              = 0;
+    virtual bool isOutputPathInConfigFile()           = 0;
+    virtual bool isPrefixInConfigFile()               = 0;
+    virtual bool isGridPathInConfigFile()             = 0;
+    virtual bool isPrintOutputFilesInConfigFile()     = 0;
+    virtual bool isGeometryValuesInConfigFile()       = 0;
+    virtual bool isCalc2ndOrderMomentsInConfigFile()  = 0;
+    virtual bool isCalc3rdOrderMomentsInConfigFile()  = 0;
+    virtual bool isCalcHighOrderMomentsInConfigFile() = 0;
+    virtual bool isReadGeoInConfigFile()              = 0;
+    virtual bool isCalcMedianInConfigFile()           = 0;
+    virtual bool isCalcDragLiftInConfigFile()         = 0;
+    virtual bool isCalcCpInConfigFile()               = 0;
+    virtual bool isWriteVeloASCIIfilesInConfigFile()  = 0;
+    virtual bool isCalcPlaneConcInConfigFile()        = 0;
+    virtual bool isConcFileInConfigFile()             = 0;
+    virtual bool isStreetVelocityFileInConfigFile()   = 0;
+    virtual bool isUseMeasurePointsInConfigFile()     = 0;
+    virtual bool isUseWaleInConfigFile()              = 0;
+    virtual bool isUseInitNeqInConfigFile()           = 0;
+    virtual bool isSimulatePorousMediaInConfigFile()  = 0;
+    virtual bool isD3QxxInConfigFile()                = 0;
+    virtual bool isTEndInConfigFile()                 = 0;
+    virtual bool isTOutInConfigFile()                 = 0;
+    virtual bool isTStartOutInConfigFile()            = 0;
+    virtual bool isTimeCalcMedStartInConfigFile()     = 0;
+    virtual bool isTimeCalcMedEndInConfigFile()       = 0;
+    virtual bool isPressInIDInConfigFile()            = 0;
+    virtual bool isPressOutIDInConfigFile()           = 0;
+    virtual bool isPressInZInConfigFile()             = 0;
+    virtual bool isPressOutZInConfigFile()            = 0;
+    virtual bool isDiffOnInConfigFile()               = 0;
+    virtual bool isDiffModInConfigFile()              = 0;
+    virtual bool isDiffusivityInConfigFile()          = 0;
+    virtual bool isTemperatureInitInConfigFile()      = 0;
+    virtual bool isTemperatureBCInConfigFile()        = 0;
+    // virtual bool isViscosityInConfigFile() = 0;
+    virtual bool isVelocityInConfigFile()           = 0;
+    virtual bool isViscosityRatioInConfigFile()     = 0;
+    virtual bool isVelocityRatioInConfigFile()      = 0;
+    virtual bool isDensityRatioInConfigFile()       = 0;
+    virtual bool isPressRatioInConfigFile()         = 0;
+    virtual bool isRealXInConfigFile()              = 0;
+    virtual bool isRealYInConfigFile()              = 0;
+    virtual bool isFactorPressBCInConfigFile()      = 0;
+    virtual bool isGeometryFileCInConfigFile()      = 0;
+    virtual bool isGeometryFileMInConfigFile()      = 0;
+    virtual bool isGeometryFileFInConfigFile()      = 0;
+    virtual bool isClockCycleForMPInConfigFile()    = 0;
+    virtual bool isTimestepForMPInConfigFile()      = 0;
+    virtual bool isForcingXInConfigFile()           = 0;
+    virtual bool isForcingYInConfigFile()           = 0;
+    virtual bool isForcingZInConfigFile()           = 0;
+    virtual bool isQuadricLimiterPInConfigFile()    = 0;
+    virtual bool isQuadricLimiterMInConfigFile()    = 0;
+    virtual bool isQuadricLimiterDInConfigFile()    = 0;
+    virtual bool isCalcParticlesInConfigFile()      = 0;
+    virtual bool isParticleBasicLevelInConfigFile() = 0;
+    virtual bool isParticleInitLevelInConfigFile()  = 0;
+    virtual bool isNumberOfParticlesInConfigFile()  = 0;
+    virtual bool isNeighborWSBInConfigFile()        = 0;
+    virtual bool isStartXHotWallInConfigFile()      = 0;
+    virtual bool isEndXHotWallInConfigFile()        = 0;
+    virtual bool isPossNeighborFilesXInConfigFile() = 0;
+    virtual bool isPossNeighborFilesYInConfigFile() = 0;
+    virtual bool isPossNeighborFilesZInConfigFile() = 0;
+    virtual bool isTimeDoCheckPointInConfigFile()   = 0;
+    virtual bool isTimeDoRestartInConfigFile()      = 0;
+    virtual bool isDoCheckPointInConfigFile()       = 0;
+    virtual bool isDoRestartInConfigFile()          = 0;
+    virtual bool isMaxLevelInConfigFile()           = 0;
+    virtual bool isGridXInConfigFile()              = 0;
+    virtual bool isGridYInConfigFile()              = 0;
+    virtual bool isGridZInConfigFile()              = 0;
+    virtual bool isDistXInConfigFile()              = 0;
+    virtual bool isDistYInConfigFile()              = 0;
+    virtual bool isDistZInConfigFile()              = 0;
+    virtual bool isNeedInterfaceInConfigFile()      = 0;
+    virtual bool isMainKernelInConfigFile()         = 0;
+    virtual bool isMultiKernelOnInConfigFile()      = 0;
+    virtual bool isMultiKernelLevelInConfigFile()   = 0;
+    virtual bool isMultiKernelNameInConfigFile()    = 0;
 };
 #endif
diff --git a/src/basics/Core/Input/ConfigData/ConfigDataImp.cpp b/src/basics/Core/Input/ConfigData/ConfigDataImp.cpp
index 35652c2eb74a7d2c91123ab83c04753e648828d7..7e0e093610b6f1decde482abddb9ba331213810d 100644
--- a/src/basics/Core/Input/ConfigData/ConfigDataImp.cpp
+++ b/src/basics/Core/Input/ConfigData/ConfigDataImp.cpp
@@ -1,731 +1,483 @@
 #include "ConfigDataImp.h"
 
-
 std::shared_ptr<ConfigDataImp> ConfigDataImp::getNewInstance()
 {
-	return std::shared_ptr<ConfigDataImp>(new ConfigDataImp());
+    return std::shared_ptr<ConfigDataImp>(new ConfigDataImp());
 }
 
 ConfigDataImp::ConfigDataImp()
 {
-	this->isViscosity=false;
-	this->isNumberOfDevices=false;
-	this->isDevices=false;
-	this->isOutputPath=false;
-	this->isPrefix=false;
-	this->isGridPath=false;
-	this->isPrintOutputFiles=false;
-	this->isGeometryValues=false;
-	this->isCalc2ndOrderMoments=false;
-	this->isCalc3rdOrderMoments=false;
-	this->isCalcHighOrderMoments=false;
-	this->isReadGeo=false;
-	this->isCalcMedian=false;
-	this->isCalcDragLift = false;
-	this->isCalcCp = false;
-	this->isConcFile=false;
-	this->isUseMeasurePoints=false;
-	this->isUseWale=false;
-	this->isSimulatePorousMedia=false;
-	this->isD3Qxx=false;
-	this->isTEnd=false;
-	this->isTOut=false;
-	this->isTStartOut=false;
-	this->isTimeCalcMedStart=false;
-	this->isTimeCalcMedEnd=false;
-	this->isPressInID=false;
-	this->isPressOutID=false;
-	this->isPressInZ=false;
-	this->isPressOutZ=false;
-	this->isDiffOn=false;
-	this->isDiffMod=false;
-	this->isDiffusivity=false;
-	this->isTemperatureInit=false;
-	this->isTemperatureBC=false;
-	this->isVelocity=false;
-	this->isViscosityRatio=false;
-	this->isVelocityRatio=false;
-	this->isDensityRatio=false;
-	this->isPressRatio=false;
-	this->isRealX=false;
-	this->isRealY=false;
-	this->isFactorPressBC=false;
-	this->isGeometryFileC=false;
-	this->isGeometryFileM=false;
-	this->isGeometryFileF=false;
-	this->isClockCycleForMP=false;
-	this->isTimestepForMP=false;
-	this->isForcingX=false;
-	this->isForcingY=false;
-	this->isForcingZ=false;
-	this->isCalcParticles=false;
-	this->isParticleBasicLevel=false;
-	this->isParticleInitLevel=false;
-	this->isNumberOfParticles=false;
-	this->isNeighborWSB=false;
-	this->isStartXHotWall=false;
-	this->isEndXHotWall=false;
-	this->isPossNeighborFilesX=false;
-	this->isPossNeighborFilesY=false;
-	this->isPossNeighborFilesZ=false;
-	this->isTimeDoCheckPoint=false;
-	this->isTimeDoRestart=false;
-	this->isDoCheckPoint=false;
-	this->isDoRestart=false;
-	this->isMaxLevel=false;
-	this->isGridX=false;
-	this->isGridY=false;
-	this->isGridZ=false;
-	this->isDistX=false;
-	this->isDistY=false;
-	this->isDistZ=false;
-	this->isNeedInterface=false;
-	this->isMainKernel=false;
-	this->isMultiKernelOn=false;
-	this->isMultiKernelLevel=false;
-	this->isMultiKernelName=false;
-
+    this->isViscosity            = false;
+    this->isNumberOfDevices      = false;
+    this->isDevices              = false;
+    this->isOutputPath           = false;
+    this->isPrefix               = false;
+    this->isGridPath             = false;
+    this->isPrintOutputFiles     = false;
+    this->isGeometryValues       = false;
+    this->isCalc2ndOrderMoments  = false;
+    this->isCalc3rdOrderMoments  = false;
+    this->isCalcHighOrderMoments = false;
+    this->isReadGeo              = false;
+    this->isCalcMedian           = false;
+    this->isCalcDragLift         = false;
+    this->isCalcCp               = false;
+    this->isConcFile             = false;
+    this->isUseMeasurePoints     = false;
+    this->isUseWale              = false;
+    this->isSimulatePorousMedia  = false;
+    this->isD3Qxx                = false;
+    this->isTEnd                 = false;
+    this->isTOut                 = false;
+    this->isTStartOut            = false;
+    this->isTimeCalcMedStart     = false;
+    this->isTimeCalcMedEnd       = false;
+    this->isPressInID            = false;
+    this->isPressOutID           = false;
+    this->isPressInZ             = false;
+    this->isPressOutZ            = false;
+    this->isDiffOn               = false;
+    this->isDiffMod              = false;
+    this->isDiffusivity          = false;
+    this->isTemperatureInit      = false;
+    this->isTemperatureBC        = false;
+    this->isVelocity             = false;
+    this->isViscosityRatio       = false;
+    this->isVelocityRatio        = false;
+    this->isDensityRatio         = false;
+    this->isPressRatio           = false;
+    this->isRealX                = false;
+    this->isRealY                = false;
+    this->isFactorPressBC        = false;
+    this->isGeometryFileC        = false;
+    this->isGeometryFileM        = false;
+    this->isGeometryFileF        = false;
+    this->isClockCycleForMP      = false;
+    this->isTimestepForMP        = false;
+    this->isForcingX             = false;
+    this->isForcingY             = false;
+    this->isForcingZ             = false;
+    this->isCalcParticles        = false;
+    this->isParticleBasicLevel   = false;
+    this->isParticleInitLevel    = false;
+    this->isNumberOfParticles    = false;
+    this->isNeighborWSB          = false;
+    this->isStartXHotWall        = false;
+    this->isEndXHotWall          = false;
+    this->isPossNeighborFilesX   = false;
+    this->isPossNeighborFilesY   = false;
+    this->isPossNeighborFilesZ   = false;
+    this->isTimeDoCheckPoint     = false;
+    this->isTimeDoRestart        = false;
+    this->isDoCheckPoint         = false;
+    this->isDoRestart            = false;
+    this->isMaxLevel             = false;
+    this->isGridX                = false;
+    this->isGridY                = false;
+    this->isGridZ                = false;
+    this->isDistX                = false;
+    this->isDistY                = false;
+    this->isDistZ                = false;
+    this->isNeedInterface        = false;
+    this->isMainKernel           = false;
+    this->isMultiKernelOn        = false;
+    this->isMultiKernelLevel     = false;
+    this->isMultiKernelName      = false;
 }
 
-real ConfigDataImp::getViscosity()
-{
-	return this->viscosity;
-}
+real ConfigDataImp::getViscosity() { return this->viscosity; }
 
-uint ConfigDataImp::getNumberOfDevices()
-{
-	return this->numberOfDevices;
-}
+uint ConfigDataImp::getNumberOfDevices() { return this->numberOfDevices; }
 
-std::vector<uint> ConfigDataImp::getDevices()
-{
-	return this->devices;
-}
+std::vector<uint> ConfigDataImp::getDevices() { return this->devices; }
 
-std::string ConfigDataImp::getOutputPath()
-{
-	return this->outputPath;
-}
+std::string ConfigDataImp::getOutputPath() { return this->outputPath; }
 
-std::string ConfigDataImp::getPrefix()
-{
-	return this->prefix;
-}
+std::string ConfigDataImp::getPrefix() { return this->prefix; }
 
-std::string ConfigDataImp::getGridPath()
-{
-	return this->gridPath;
-}
+std::string ConfigDataImp::getGridPath() { return this->gridPath; }
 
-bool ConfigDataImp::getPrintOutputFiles()
-{
-	return this->printOutputFiles;
-}
+bool ConfigDataImp::getPrintOutputFiles() { return this->printOutputFiles; }
 
-bool ConfigDataImp::getGeometryValues()
-{
-	return this->geometryValues;
-}
+bool ConfigDataImp::getGeometryValues() { return this->geometryValues; }
 
-bool ConfigDataImp::getCalc2ndOrderMoments()
-{
-	return this->calc2ndOrderMoments;
-}
+bool ConfigDataImp::getCalc2ndOrderMoments() { return this->calc2ndOrderMoments; }
 
-bool ConfigDataImp::getCalc3rdOrderMoments()
-{
-	return this->calc3rdOrderMoments;
-}
+bool ConfigDataImp::getCalc3rdOrderMoments() { return this->calc3rdOrderMoments; }
 
-bool ConfigDataImp::getCalcHighOrderMoments()
-{
-	return this->calcHighOrderMoments;
-}
+bool ConfigDataImp::getCalcHighOrderMoments() { return this->calcHighOrderMoments; }
 
-bool ConfigDataImp::getReadGeo()
-{
-	return this->readGeo;
-}
+bool ConfigDataImp::getReadGeo() { return this->readGeo; }
 
-bool ConfigDataImp::getCalcMedian()
-{
-	return this->calcMedian;
-}
+bool ConfigDataImp::getCalcMedian() { return this->calcMedian; }
 
-bool ConfigDataImp::getCalcDragLift()
-{
-	return this->calcDragLift;
-}
+bool ConfigDataImp::getCalcDragLift() { return this->calcDragLift; }
 
-bool ConfigDataImp::getCalcCp()
-{
-	return this->calcCp;
-}
+bool ConfigDataImp::getCalcCp() { return this->calcCp; }
 
-bool ConfigDataImp::getWriteVeloASCIIfiles()
-{
-	return this->writeVeloASCIIfiles;
-}
+bool ConfigDataImp::getWriteVeloASCIIfiles() { return this->writeVeloASCIIfiles; }
 
-bool ConfigDataImp::getCalcPlaneConc()
-{
-	return	this->calcPlaneConc;
-}
+bool ConfigDataImp::getCalcPlaneConc() { return this->calcPlaneConc; }
 
-bool ConfigDataImp::getConcFile()
-{
-	return this->concFile;
-}
+bool ConfigDataImp::getConcFile() { return this->concFile; }
 
-bool ConfigDataImp::getStreetVelocityFile()
-{
-	return this->streetVelocityFile;
-}
+bool ConfigDataImp::getStreetVelocityFile() { return this->streetVelocityFile; }
 
-bool ConfigDataImp::getUseMeasurePoints()
-{
-	return this->useMeasurePoints;
-}
+bool ConfigDataImp::getUseMeasurePoints() { return this->useMeasurePoints; }
 
-bool ConfigDataImp::getUseWale()
-{
-	return this->useWale;
-}
+bool ConfigDataImp::getUseWale() { return this->useWale; }
 
-bool ConfigDataImp::getUseInitNeq()
-{
-    return this->useInitNeq;
-}
+bool ConfigDataImp::getUseInitNeq() { return this->useInitNeq; }
 
-bool ConfigDataImp::getSimulatePorousMedia()
-{
-	return this->simulatePorousMedia;
-}
+bool ConfigDataImp::getSimulatePorousMedia() { return this->simulatePorousMedia; }
 
-uint ConfigDataImp::getD3Qxx()
-{
-	return this->d3Qxx;
-}
+uint ConfigDataImp::getD3Qxx() { return this->d3Qxx; }
 
-uint ConfigDataImp::getTEnd()
-{
-	return this->tEnd;
-}
+uint ConfigDataImp::getTEnd() { return this->tEnd; }
 
-uint ConfigDataImp::getTOut()
-{
-	return this->tOut;
-}
+uint ConfigDataImp::getTOut() { return this->tOut; }
 
-uint ConfigDataImp::getTStartOut()
-{
-	return this->tStartOut;
-}
+uint ConfigDataImp::getTStartOut() { return this->tStartOut; }
 
-uint ConfigDataImp::getTimeCalcMedStart()
-{
-	return this->timeCalcMedStart;
-}
+uint ConfigDataImp::getTimeCalcMedStart() { return this->timeCalcMedStart; }
 
-uint ConfigDataImp::getTimeCalcMedEnd()
-{
-	return this->timeCalcMedEnd;
-}
+uint ConfigDataImp::getTimeCalcMedEnd() { return this->timeCalcMedEnd; }
 
-uint ConfigDataImp::getPressInID()
-{
-	return this->pressInID;
-}
+uint ConfigDataImp::getPressInID() { return this->pressInID; }
 
-uint ConfigDataImp::getPressOutID()
-{
-	return this->pressOutID;
-}
+uint ConfigDataImp::getPressOutID() { return this->pressOutID; }
 
-uint ConfigDataImp::getPressInZ()
-{
-	return this->pressInZ;
-}
+uint ConfigDataImp::getPressInZ() { return this->pressInZ; }
 
-uint ConfigDataImp::getPressOutZ()
-{
-	return this->pressOutZ;
-}
+uint ConfigDataImp::getPressOutZ() { return this->pressOutZ; }
 
-bool ConfigDataImp::getDiffOn()
-{
-	return this->diffOn;
-}
+bool ConfigDataImp::getDiffOn() { return this->diffOn; }
 
-uint ConfigDataImp::getDiffMod()
-{
-	return this->diffMod;
-}
+uint ConfigDataImp::getDiffMod() { return this->diffMod; }
 
-real ConfigDataImp::getDiffusivity()
-{
-	return this->diffusivity;
-}
+real ConfigDataImp::getDiffusivity() { return this->diffusivity; }
 
-real ConfigDataImp::getTemperatureInit()
-{
-	return this->temperatureInit;
-}
+real ConfigDataImp::getTemperatureInit() { return this->temperatureInit; }
 
-real ConfigDataImp::getTemperatureBC()
-{
-	return this->temperatureBC;
-}
+real ConfigDataImp::getTemperatureBC() { return this->temperatureBC; }
 
-real ConfigDataImp::getVelocity()
-{
-	return this->velocity;
-}
+real ConfigDataImp::getVelocity() { return this->velocity; }
 
-real ConfigDataImp::getViscosityRatio()
-{
-	return this->viscosityRatio;
-}
+real ConfigDataImp::getViscosityRatio() { return this->viscosityRatio; }
 
-real ConfigDataImp::getVelocityRatio()
-{
-	return this->velocityRatio;
-}
+real ConfigDataImp::getVelocityRatio() { return this->velocityRatio; }
 
-real ConfigDataImp::getDensityRatio()
-{
-	return this->densityRatio;
-}
+real ConfigDataImp::getDensityRatio() { return this->densityRatio; }
 
-real ConfigDataImp::getPressRatio()
-{
-	return this->pressRatio;
-}
+real ConfigDataImp::getPressRatio() { return this->pressRatio; }
 
-real ConfigDataImp::getRealX()
-{
-	return this->realX;
-}
+real ConfigDataImp::getRealX() { return this->realX; }
 
-real ConfigDataImp::getRealY()
-{
-	return this->realY;
-}
+real ConfigDataImp::getRealY() { return this->realY; }
 
-real ConfigDataImp::getFactorPressBC()
-{
-	return this->factorPressBC;
-}
+real ConfigDataImp::getFactorPressBC() { return this->factorPressBC; }
 
-std::string ConfigDataImp::getGeometryFileC()
-{
-	return this->geometryFileC;
-}
+std::string ConfigDataImp::getGeometryFileC() { return this->geometryFileC; }
 
-std::string ConfigDataImp::getGeometryFileM()
-{
-	return this->geometryFileM;
-}
+std::string ConfigDataImp::getGeometryFileM() { return this->geometryFileM; }
 
-std::string ConfigDataImp::getGeometryFileF()
-{
-	return this->geometryFileF;
-}
+std::string ConfigDataImp::getGeometryFileF() { return this->geometryFileF; }
 
-uint ConfigDataImp::getClockCycleForMP()
-{
-	return this->clockCycleForMP;
-}
+uint ConfigDataImp::getClockCycleForMP() { return this->clockCycleForMP; }
 
-uint ConfigDataImp::getTimestepForMP()
-{
-	return this->timestepForMP;
-}
+uint ConfigDataImp::getTimestepForMP() { return this->timestepForMP; }
 
-real ConfigDataImp::getForcingX()
-{
-	return this->forcingX;
-}
+real ConfigDataImp::getForcingX() { return this->forcingX; }
 
-real ConfigDataImp::getForcingY()
-{
-	return this->forcingY;
-}
+real ConfigDataImp::getForcingY() { return this->forcingY; }
 
-real ConfigDataImp::getForcingZ()
-{
-	return this->forcingZ;
-}
+real ConfigDataImp::getForcingZ() { return this->forcingZ; }
 
-real ConfigDataImp::getQuadricLimiterP()
-{
-    return this->quadricLimiterP;
-}
+real ConfigDataImp::getQuadricLimiterP() { return this->quadricLimiterP; }
 
-real ConfigDataImp::getQuadricLimiterM()
-{
-    return this->quadricLimiterM;
-}
+real ConfigDataImp::getQuadricLimiterM() { return this->quadricLimiterM; }
 
-real ConfigDataImp::getQuadricLimiterD()
-{
-    return this->quadricLimiterD;
-}
+real ConfigDataImp::getQuadricLimiterD() { return this->quadricLimiterD; }
 
-bool ConfigDataImp::getCalcParticles()
-{
-	return this->calcParticles;
-}
+bool ConfigDataImp::getCalcParticles() { return this->calcParticles; }
 
-int ConfigDataImp::getParticleBasicLevel()
-{
-	return this->particleBasicLevel;
-}
+int ConfigDataImp::getParticleBasicLevel() { return this->particleBasicLevel; }
 
-int ConfigDataImp::getParticleInitLevel()
-{
-	return this->particleInitLevel;
-}
+int ConfigDataImp::getParticleInitLevel() { return this->particleInitLevel; }
 
-int ConfigDataImp::getNumberOfParticles()
-{
-	return this->numberOfParticles;
-}
+int ConfigDataImp::getNumberOfParticles() { return this->numberOfParticles; }
 
-real ConfigDataImp::getStartXHotWall()
-{
-	return this->startXHotWall;
-}
+real ConfigDataImp::getStartXHotWall() { return this->startXHotWall; }
 
-real ConfigDataImp::getEndXHotWall()
-{
-	return this->endXHotWall;
-}
+real ConfigDataImp::getEndXHotWall() { return this->endXHotWall; }
 
-std::vector<std::string> ConfigDataImp::getPossNeighborFilesX()
-{
-	return this->possNeighborFilesX;
-}
+std::vector<std::string> ConfigDataImp::getPossNeighborFilesX() { return this->possNeighborFilesX; }
 
-std::vector<std::string> ConfigDataImp::getPossNeighborFilesY()
-{
-	return this->possNeighborFilesY;
-}
+std::vector<std::string> ConfigDataImp::getPossNeighborFilesY() { return this->possNeighborFilesY; }
 
-std::vector<std::string> ConfigDataImp::getPossNeighborFilesZ()
-{
-	return this->possNeighborFilesZ;
-}
+std::vector<std::string> ConfigDataImp::getPossNeighborFilesZ() { return this->possNeighborFilesZ; }
 
-int ConfigDataImp::getTimeDoCheckPoint()
-{
-	return this->timeDoCheckPoint;
-}
+int ConfigDataImp::getTimeDoCheckPoint() { return this->timeDoCheckPoint; }
 
-int ConfigDataImp::getTimeDoRestart()
-{
-	return this->timeDoRestart;
-}
+int ConfigDataImp::getTimeDoRestart() { return this->timeDoRestart; }
 
-bool ConfigDataImp::getDoCheckPoint()
-{
-	return this->doCheckPoint;
-}
+bool ConfigDataImp::getDoCheckPoint() { return this->doCheckPoint; }
 
-bool ConfigDataImp::getDoRestart()
-{
-	return this->doRestart;
-}
+bool ConfigDataImp::getDoRestart() { return this->doRestart; }
 
-uint ConfigDataImp::getMaxLevel()
-{
-	return this->maxLevel;
-}
+uint ConfigDataImp::getMaxLevel() { return this->maxLevel; }
 
-std::vector<int> ConfigDataImp::getGridX()
-{
-	return this->gridX;
-}
+std::vector<int> ConfigDataImp::getGridX() { return this->gridX; }
 
-std::vector<int> ConfigDataImp::getGridY()
-{
-	return this->gridY;
-}
+std::vector<int> ConfigDataImp::getGridY() { return this->gridY; }
 
-std::vector<int> ConfigDataImp::getGridZ()
-{
-	return this->gridZ;
-}
+std::vector<int> ConfigDataImp::getGridZ() { return this->gridZ; }
 
-std::vector<int> ConfigDataImp::getDistX()
-{
-	return this->distX;
-}
+std::vector<int> ConfigDataImp::getDistX() { return this->distX; }
 
-std::vector<int> ConfigDataImp::getDistY()
-{
-	return this->distY;
-}
+std::vector<int> ConfigDataImp::getDistY() { return this->distY; }
 
-std::vector<int> ConfigDataImp::getDistZ()
-{
-	return this->distZ;
-}
+std::vector<int> ConfigDataImp::getDistZ() { return this->distZ; }
 
-std::vector<bool> ConfigDataImp::getNeedInterface()
-{
-	return this->needInterface;
-}
+std::vector<bool> ConfigDataImp::getNeedInterface() { return this->needInterface; }
 
-std::string ConfigDataImp::getMainKernel()
-{
-	return this->mainKernel;
-}
+std::string ConfigDataImp::getMainKernel() { return this->mainKernel; }
 
-bool ConfigDataImp::getMultiKernelOn()
-{
-	return this->multiKernelOn;
-}
+bool ConfigDataImp::getMultiKernelOn() { return this->multiKernelOn; }
 
-std::vector<int> ConfigDataImp::getMultiKernelLevel()
-{
-	return this->multiKernelLevel;
-}
+std::vector<int> ConfigDataImp::getMultiKernelLevel() { return this->multiKernelLevel; }
 
-std::vector<std::string> ConfigDataImp::getMultiKernelName()
-{
-	return this->multiKernelName;
-}
+std::vector<std::string> ConfigDataImp::getMultiKernelName() { return this->multiKernelName; }
 
 void ConfigDataImp::setViscosity(real viscosity)
 {
-	this->viscosity = viscosity;
-	this->isViscosity = true;
+    this->viscosity   = viscosity;
+    this->isViscosity = true;
 }
 
 void ConfigDataImp::setNumberOfDevices(uint numberOfDevices)
 {
-	this->numberOfDevices = numberOfDevices;
-	this->isNumberOfDevices = true;
+    this->numberOfDevices   = numberOfDevices;
+    this->isNumberOfDevices = true;
 }
 
 void ConfigDataImp::setDevices(std::vector<uint> devices)
 {
-	this->devices = devices;
-	this->isDevices = true;
+    this->devices   = devices;
+    this->isDevices = true;
 }
 
 void ConfigDataImp::setOutputPath(std::string outputPath)
 {
-	this->outputPath = outputPath;
-	this->isOutputPath = true;
+    this->outputPath   = outputPath;
+    this->isOutputPath = true;
 }
 
 void ConfigDataImp::setPrefix(std::string prefix)
 {
-	this->prefix = prefix;
-	this->isPrefix = true;
+    this->prefix   = prefix;
+    this->isPrefix = true;
 }
 
 void ConfigDataImp::setGridPath(std::string gridPath)
 {
-	this->gridPath = gridPath;
-	this->isGridPath = true;
+    this->gridPath   = gridPath;
+    this->isGridPath = true;
 }
 
 void ConfigDataImp::setPrintOutputFiles(bool printOutputFiles)
 {
-	this->printOutputFiles = printOutputFiles;
-	this->isPrintOutputFiles = true;
+    this->printOutputFiles   = printOutputFiles;
+    this->isPrintOutputFiles = true;
 }
 
 void ConfigDataImp::setGeometryValues(bool geometryValues)
 {
-	this->geometryValues = geometryValues;
-	this->isGeometryValues = true;
+    this->geometryValues   = geometryValues;
+    this->isGeometryValues = true;
 }
 
 void ConfigDataImp::setCalc2ndOrderMoments(bool calc2ndOrderMoments)
 {
-	this->calc2ndOrderMoments = calc2ndOrderMoments;
-	this->isCalc2ndOrderMoments = true;
+    this->calc2ndOrderMoments   = calc2ndOrderMoments;
+    this->isCalc2ndOrderMoments = true;
 }
 
 void ConfigDataImp::setCalc3rdOrderMoments(bool calc3rdOrderMoments)
 {
-	this->calc3rdOrderMoments = calc3rdOrderMoments;
-	this->isCalc3rdOrderMoments = true;
+    this->calc3rdOrderMoments   = calc3rdOrderMoments;
+    this->isCalc3rdOrderMoments = true;
 }
 
 void ConfigDataImp::setCalcHighOrderMoments(bool calcHighOrderMoments)
 {
-	this->calcHighOrderMoments = calcHighOrderMoments;
-	this->isCalcHighOrderMoments = true;
+    this->calcHighOrderMoments   = calcHighOrderMoments;
+    this->isCalcHighOrderMoments = true;
 }
 
 void ConfigDataImp::setReadGeo(bool readGeo)
 {
-	this->readGeo = readGeo;
-	this->isReadGeo = true;
+    this->readGeo   = readGeo;
+    this->isReadGeo = true;
 }
 
 void ConfigDataImp::setCalcMedian(bool calcMedian)
 {
-	this->calcMedian = calcMedian;
-	this->isCalcMedian = true;
+    this->calcMedian   = calcMedian;
+    this->isCalcMedian = true;
 }
 
 void ConfigDataImp::setCalcDragLift(bool calcDragLift)
 {
-	this->calcDragLift = calcDragLift;
-	this->isCalcDragLift = true;
+    this->calcDragLift   = calcDragLift;
+    this->isCalcDragLift = true;
 }
 
 void ConfigDataImp::setCalcCp(bool calcCp)
 {
-	this->calcCp = calcCp;
-	this->isCalcCp = true;
+    this->calcCp   = calcCp;
+    this->isCalcCp = true;
 }
 
 void ConfigDataImp::setWriteVeloASCIIfiles(bool writeVeloASCIIfiles)
 {
-	this->writeVeloASCIIfiles = writeVeloASCIIfiles;
-	this->isWriteVeloASCII = true;
+    this->writeVeloASCIIfiles = writeVeloASCIIfiles;
+    this->isWriteVeloASCII    = true;
 }
 
 void ConfigDataImp::setCalcPlaneConc(bool calcPlaneConc)
 {
-	this->calcPlaneConc = calcPlaneConc;
-	this->isCalcPlaneConc = true;
+    this->calcPlaneConc   = calcPlaneConc;
+    this->isCalcPlaneConc = true;
 }
 
 void ConfigDataImp::setConcFile(bool concFile)
 {
-	this->concFile = concFile;
-	this->isConcFile = true;
+    this->concFile   = concFile;
+    this->isConcFile = true;
 }
 
 void ConfigDataImp::setStreetVelocityFile(bool streetVelocityFile)
 {
-	this->streetVelocityFile = streetVelocityFile;
-	this->isStreetVelocityFile = true;
+    this->streetVelocityFile   = streetVelocityFile;
+    this->isStreetVelocityFile = true;
 }
 
 void ConfigDataImp::setUseMeasurePoints(bool useMeasurePoints)
 {
-	this->useMeasurePoints = useMeasurePoints;
-	this->isUseMeasurePoints = true;
+    this->useMeasurePoints   = useMeasurePoints;
+    this->isUseMeasurePoints = true;
 }
 
 void ConfigDataImp::setUseWale(bool useWale)
 {
-	this->useWale = useWale;
-	this->isUseWale = true;
+    this->useWale   = useWale;
+    this->isUseWale = true;
 }
 
 void ConfigDataImp::setUseInitNeq(bool useInitNeq)
 {
-	this->useInitNeq = useInitNeq;
-	this->isUseInitNeq = true;
+    this->useInitNeq   = useInitNeq;
+    this->isUseInitNeq = true;
 }
 
 void ConfigDataImp::setSimulatePorousMedia(bool simulatePorousMedia)
 {
-	this->simulatePorousMedia = simulatePorousMedia;
-	this->isSimulatePorousMedia = true;
+    this->simulatePorousMedia   = simulatePorousMedia;
+    this->isSimulatePorousMedia = true;
 }
 
 void ConfigDataImp::setD3Qxx(uint d3Qxx)
 {
-	this->d3Qxx = d3Qxx;
-	this->isD3Qxx = true;
+    this->d3Qxx   = d3Qxx;
+    this->isD3Qxx = true;
 }
 
 void ConfigDataImp::setTEnd(uint tEnd)
 {
-	this->tEnd = tEnd;
-	this->isTEnd = true;
+    this->tEnd   = tEnd;
+    this->isTEnd = true;
 }
 
 void ConfigDataImp::setTOut(uint tOut)
 {
-	this->tOut = tOut;
-	this->isTOut = true;
+    this->tOut   = tOut;
+    this->isTOut = true;
 }
 
 void ConfigDataImp::setTStartOut(uint tStartOut)
 {
-	this->tStartOut = tStartOut;
-	this->isTStartOut = true;
+    this->tStartOut   = tStartOut;
+    this->isTStartOut = true;
 }
 
 void ConfigDataImp::setTimeCalcMedStart(uint timeCalcMedStart)
 {
-	this->timeCalcMedStart = timeCalcMedStart;
-	this->isTimeCalcMedStart = true;
+    this->timeCalcMedStart   = timeCalcMedStart;
+    this->isTimeCalcMedStart = true;
 }
 
 void ConfigDataImp::setTimeCalcMedEnd(uint timeCalcMedEnd)
 {
-	this->timeCalcMedEnd = timeCalcMedEnd;
-	this->isTimeCalcMedEnd = true;
+    this->timeCalcMedEnd   = timeCalcMedEnd;
+    this->isTimeCalcMedEnd = true;
 }
 
 void ConfigDataImp::setPressInID(uint pressInID)
 {
-	this->pressInID = pressInID;
-	this->isPressInID = true;
+    this->pressInID   = pressInID;
+    this->isPressInID = true;
 }
 
 void ConfigDataImp::setPressOutID(uint pressOutID)
 {
-	this->pressOutID = pressOutID;
-	this->isPressOutID = true;
+    this->pressOutID   = pressOutID;
+    this->isPressOutID = true;
 }
 
 void ConfigDataImp::setPressInZ(uint pressInZ)
 {
-	this->pressInZ = pressInZ;
-	this->isPressInZ = true;
+    this->pressInZ   = pressInZ;
+    this->isPressInZ = true;
 }
 
 void ConfigDataImp::setPressOutZ(uint pressOutZ)
 {
-	this->pressOutZ = pressOutZ;
-	this->isPressOutZ = true;
+    this->pressOutZ   = pressOutZ;
+    this->isPressOutZ = true;
 }
 
 void ConfigDataImp::setDiffOn(bool diffOn)
 {
-	this->diffOn = diffOn;
-	this->isDiffOn = true;
+    this->diffOn   = diffOn;
+    this->isDiffOn = true;
 }
 
 void ConfigDataImp::setDiffMod(uint diffMod)
 {
-	this->diffMod = diffMod;
-	this->isDiffMod = true;
+    this->diffMod   = diffMod;
+    this->isDiffMod = true;
 }
 
 void ConfigDataImp::setDiffusivity(real diffusivity)
 {
-	this->diffusivity = diffusivity;
-	this->isDiffusivity = true;
+    this->diffusivity   = diffusivity;
+    this->isDiffusivity = true;
 }
 
 void ConfigDataImp::setTemperatureInit(real temperatureInit)
 {
-	this->temperatureInit = temperatureInit;
-	this->isTemperatureInit = true;
+    this->temperatureInit   = temperatureInit;
+    this->isTemperatureInit = true;
 }
 
 void ConfigDataImp::setTemperatureBC(real temperatureBC)
 {
-	this->temperatureBC = temperatureBC;
-	this->isTemperatureBC = true;
+    this->temperatureBC   = temperatureBC;
+    this->isTemperatureBC = true;
 }
 
-//void ConfigDataImp::setViscosity(real viscosity)
+// void ConfigDataImp::setViscosity(real viscosity)
 //{
 //	this->viscosity = viscosity;
 //	this->isViscosity = true;
@@ -733,681 +485,430 @@ void ConfigDataImp::setTemperatureBC(real temperatureBC)
 
 void ConfigDataImp::setVelocity(real velocity)
 {
-	this->velocity = velocity;
-	this->isVelocity = true;
+    this->velocity   = velocity;
+    this->isVelocity = true;
 }
 
 void ConfigDataImp::setViscosityRatio(real viscosityRatio)
 {
-	this->viscosityRatio = viscosityRatio;
-	this->isViscosityRatio = true;
+    this->viscosityRatio   = viscosityRatio;
+    this->isViscosityRatio = true;
 }
 
 void ConfigDataImp::setVelocityRatio(real velocityRatio)
 {
-	this->velocityRatio = velocityRatio;
-	this->isVelocityRatio = true;
+    this->velocityRatio   = velocityRatio;
+    this->isVelocityRatio = true;
 }
 
 void ConfigDataImp::setDensityRatio(real densityRatio)
 {
-	this->densityRatio = densityRatio;
-	this->isDensityRatio = true;
+    this->densityRatio   = densityRatio;
+    this->isDensityRatio = true;
 }
 
 void ConfigDataImp::setPressRatio(real pressRatio)
 {
-	this->pressRatio = pressRatio;
-	this->isPressRatio = true;
+    this->pressRatio   = pressRatio;
+    this->isPressRatio = true;
 }
 
 void ConfigDataImp::setRealX(real realX)
 {
-	this->realX = realX;
-	this->isRealX = true;
+    this->realX   = realX;
+    this->isRealX = true;
 }
 
 void ConfigDataImp::setRealY(real realY)
 {
-	this->realY = realY;
-	this->isRealY = true;
+    this->realY   = realY;
+    this->isRealY = true;
 }
 
 void ConfigDataImp::setFactorPressBC(real factorPressBC)
 {
-	this->factorPressBC = factorPressBC;
-	this->isFactorPressBC = true;
+    this->factorPressBC   = factorPressBC;
+    this->isFactorPressBC = true;
 }
 
 void ConfigDataImp::setGeometryFileC(std::string geometryFileC)
 {
-	this->geometryFileC = geometryFileC;
-	this->isGeometryFileC = true;
+    this->geometryFileC   = geometryFileC;
+    this->isGeometryFileC = true;
 }
 
 void ConfigDataImp::setGeometryFileM(std::string geometryFileM)
 {
-	this->geometryFileM = geometryFileM;
-	this->isGeometryFileM = true;
+    this->geometryFileM   = geometryFileM;
+    this->isGeometryFileM = true;
 }
 
 void ConfigDataImp::setGeometryFileF(std::string geometryFileF)
 {
-	this->geometryFileF = geometryFileF;
-	this->isGeometryFileF = true;
+    this->geometryFileF   = geometryFileF;
+    this->isGeometryFileF = true;
 }
 
 void ConfigDataImp::setClockCycleForMP(uint clockCycleForMP)
 {
-	this->clockCycleForMP = clockCycleForMP;
-	this->isClockCycleForMP = true;
+    this->clockCycleForMP   = clockCycleForMP;
+    this->isClockCycleForMP = true;
 }
 
 void ConfigDataImp::setTimestepForMP(uint timestepForMP)
 {
-	this->timestepForMP = timestepForMP;
-	this->isTimestepForMP = true;
+    this->timestepForMP   = timestepForMP;
+    this->isTimestepForMP = true;
 }
 
 void ConfigDataImp::setForcingX(real forcingX)
 {
-	this->forcingX = forcingX;
-	this->isForcingX = true;
+    this->forcingX   = forcingX;
+    this->isForcingX = true;
 }
 
 void ConfigDataImp::setForcingY(real forcingY)
 {
-	this->forcingY = forcingY;
-	this->isForcingY = true;
+    this->forcingY   = forcingY;
+    this->isForcingY = true;
 }
 
 void ConfigDataImp::setForcingZ(real forcingZ)
 {
-	this->forcingZ = forcingZ;
-	this->isForcingZ = true;
+    this->forcingZ   = forcingZ;
+    this->isForcingZ = true;
 }
 
 void ConfigDataImp::setQuadricLimiterP(real quadricLimiterP)
 {
-	this->quadricLimiterP = quadricLimiterP;
-	this->isQuadricLimiterP = true;
+    this->quadricLimiterP   = quadricLimiterP;
+    this->isQuadricLimiterP = true;
 }
 
 void ConfigDataImp::setQuadricLimiterM(real quadricLimiterM)
 {
-	this->quadricLimiterM = quadricLimiterM;
-	this->isQuadricLimiterM = true;
+    this->quadricLimiterM   = quadricLimiterM;
+    this->isQuadricLimiterM = true;
 }
 
 void ConfigDataImp::setQuadricLimiterD(real quadricLimiterD)
 {
-	this->quadricLimiterD = quadricLimiterD;
-	this->isQuadricLimiterD = true;
+    this->quadricLimiterD   = quadricLimiterD;
+    this->isQuadricLimiterD = true;
 }
 
 void ConfigDataImp::setCalcParticles(bool calcParticles)
 {
-	this->calcParticles = calcParticles;
-	this->isCalcParticles = true;
+    this->calcParticles   = calcParticles;
+    this->isCalcParticles = true;
 }
 
 void ConfigDataImp::setParticleBasicLevel(int particleBasicLevel)
 {
-	this->particleBasicLevel = particleBasicLevel;
-	this->isParticleBasicLevel = true;
+    this->particleBasicLevel   = particleBasicLevel;
+    this->isParticleBasicLevel = true;
 }
 
 void ConfigDataImp::setParticleInitLevel(int particleInitLevel)
 {
-	this->particleInitLevel = particleInitLevel;
-	this->isParticleInitLevel = true;
+    this->particleInitLevel   = particleInitLevel;
+    this->isParticleInitLevel = true;
 }
 
 void ConfigDataImp::setNumberOfParticles(int numberOfParticles)
 {
-	this->numberOfParticles = numberOfParticles;
-	this->isNumberOfParticles = true;
+    this->numberOfParticles   = numberOfParticles;
+    this->isNumberOfParticles = true;
 }
 
 void ConfigDataImp::setStartXHotWall(real startXHotWall)
 {
-	this->startXHotWall = startXHotWall;
-	this->isStartXHotWall = true;
+    this->startXHotWall   = startXHotWall;
+    this->isStartXHotWall = true;
 }
 
 void ConfigDataImp::setEndXHotWall(real endXHotWall)
 {
-	this->endXHotWall = endXHotWall;
-	this->isEndXHotWall = true;
+    this->endXHotWall   = endXHotWall;
+    this->isEndXHotWall = true;
 }
 
 void ConfigDataImp::setPossNeighborFilesX(std::vector<std::string> possNeighborFilesX)
 {
-	this->possNeighborFilesX = possNeighborFilesX;
-	this->isPossNeighborFilesX = true;
+    this->possNeighborFilesX   = possNeighborFilesX;
+    this->isPossNeighborFilesX = true;
 }
 
 void ConfigDataImp::setPossNeighborFilesY(std::vector<std::string> possNeighborFilesY)
 {
-	this->possNeighborFilesY = possNeighborFilesY;
-	this->isPossNeighborFilesY = true;
+    this->possNeighborFilesY   = possNeighborFilesY;
+    this->isPossNeighborFilesY = true;
 }
 
 void ConfigDataImp::setPossNeighborFilesZ(std::vector<std::string> possNeighborFilesZ)
 {
-	this->possNeighborFilesZ = possNeighborFilesZ;
-	this->isPossNeighborFilesZ = true;
+    this->possNeighborFilesZ   = possNeighborFilesZ;
+    this->isPossNeighborFilesZ = true;
 }
 
 void ConfigDataImp::setTimeDoCheckPoint(int timeDoCheckPoint)
 {
-	this->timeDoCheckPoint = timeDoCheckPoint;
-	this->isTimeDoCheckPoint = true;
+    this->timeDoCheckPoint   = timeDoCheckPoint;
+    this->isTimeDoCheckPoint = true;
 }
 
 void ConfigDataImp::setTimeDoRestart(int timeDoRestart)
 {
-	this->timeDoRestart = timeDoRestart;
-	this->isTimeDoRestart = true;
+    this->timeDoRestart   = timeDoRestart;
+    this->isTimeDoRestart = true;
 }
 
 void ConfigDataImp::setDoCheckPoint(bool doCheckPoint)
 {
-	this->doCheckPoint = doCheckPoint;
-	this->isDoCheckPoint = true;
+    this->doCheckPoint   = doCheckPoint;
+    this->isDoCheckPoint = true;
 }
 
 void ConfigDataImp::setDoRestart(bool doRestart)
 {
-	this->doRestart = doRestart;
-	this->isDoRestart = true;
+    this->doRestart   = doRestart;
+    this->isDoRestart = true;
 }
 
 void ConfigDataImp::setMaxLevel(uint maxLevel)
 {
-	this->maxLevel = maxLevel;
-	this->isMaxLevel = true;
+    this->maxLevel   = maxLevel;
+    this->isMaxLevel = true;
 }
 
 void ConfigDataImp::setGridX(std::vector<int> gridX)
 {
-	this->gridX = gridX;
-	this->isGridX = true;
+    this->gridX   = gridX;
+    this->isGridX = true;
 }
 
 void ConfigDataImp::setGridY(std::vector<int> gridY)
 {
-	this->gridY = gridY;
-	this->isGridY = true;
+    this->gridY   = gridY;
+    this->isGridY = true;
 }
 
 void ConfigDataImp::setGridZ(std::vector<int> gridZ)
 {
-	this->gridZ = gridZ;
-	this->isGridZ = true;
+    this->gridZ   = gridZ;
+    this->isGridZ = true;
 }
 
 void ConfigDataImp::setDistX(std::vector<int> distX)
 {
-	this->distX = distX;
-	this->isDistX = true;
+    this->distX   = distX;
+    this->isDistX = true;
 }
 
 void ConfigDataImp::setDistY(std::vector<int> distY)
 {
-	this->distY = distY;
-	this->isDistY = true;
+    this->distY   = distY;
+    this->isDistY = true;
 }
 
 void ConfigDataImp::setDistZ(std::vector<int> distZ)
 {
-	this->distZ = distZ;
-	this->isDistZ = true;
+    this->distZ   = distZ;
+    this->isDistZ = true;
 }
 
 void ConfigDataImp::setNeedInterface(std::vector<bool> needInterface)
 {
-	this->needInterface = needInterface;
-	this->isNeedInterface = true;
+    this->needInterface   = needInterface;
+    this->isNeedInterface = true;
 }
 
 void ConfigDataImp::setMainKernel(std::string mainKernel)
 {
-	this->mainKernel = mainKernel;
-	this->isMainKernel = true;
+    this->mainKernel   = mainKernel;
+    this->isMainKernel = true;
 }
 
 void ConfigDataImp::setMultiKernelOn(bool multiKernelOn)
 {
-	this->multiKernelOn = multiKernelOn;
-	this->isMultiKernelOn = true;
+    this->multiKernelOn   = multiKernelOn;
+    this->isMultiKernelOn = true;
 }
 
 void ConfigDataImp::setMultiKernelLevel(std::vector<int> multiKernelLevel)
 {
-	this->multiKernelLevel = multiKernelLevel;
-	this->isMultiKernelLevel = true;
+    this->multiKernelLevel   = multiKernelLevel;
+    this->isMultiKernelLevel = true;
 }
 
 void ConfigDataImp::setMultiKernelName(std::vector<std::string> multiKernelName)
 {
-	this->multiKernelName = multiKernelName;
-	this->isMultiKernelName = true;
-}
-
-bool ConfigDataImp::isCalc2ndOrderMomentsInConfigFile()
-{
-	return this->isCalc2ndOrderMoments;
+    this->multiKernelName   = multiKernelName;
+    this->isMultiKernelName = true;
 }
 
-bool ConfigDataImp::isCalc3rdOrderMomentsInConfigFile()
-{
-	return this->isCalc2ndOrderMoments;
-}
+bool ConfigDataImp::isCalc2ndOrderMomentsInConfigFile() { return this->isCalc2ndOrderMoments; }
 
-bool ConfigDataImp::isCalcHighOrderMomentsInConfigFile()
-{
-	return this->isCalcHighOrderMoments;
-}
+bool ConfigDataImp::isCalc3rdOrderMomentsInConfigFile() { return this->isCalc2ndOrderMoments; }
 
-bool ConfigDataImp::isReadGeoInConfigFile()
-{
-	return this->isReadGeo;
-}
+bool ConfigDataImp::isCalcHighOrderMomentsInConfigFile() { return this->isCalcHighOrderMoments; }
 
-bool ConfigDataImp::isCalcMedianInConfigFile()
-{
-	return this->isCalcMedian;
-}
+bool ConfigDataImp::isReadGeoInConfigFile() { return this->isReadGeo; }
 
-bool ConfigDataImp::isCalcDragLiftInConfigFile()
-{
-	return this->isCalcDragLift;
-}
+bool ConfigDataImp::isCalcMedianInConfigFile() { return this->isCalcMedian; }
 
-bool ConfigDataImp::isCalcCpInConfigFile()
-{
-	return this->isCalcCp;
-}
+bool ConfigDataImp::isCalcDragLiftInConfigFile() { return this->isCalcDragLift; }
 
-bool ConfigDataImp::isWriteVeloASCIIfilesInConfigFile()
-{
-	return this->isWriteVeloASCII;
-}
+bool ConfigDataImp::isCalcCpInConfigFile() { return this->isCalcCp; }
 
-bool ConfigDataImp::isCalcPlaneConcInConfigFile()
-{
-	return this->isCalcPlaneConc;
-}
+bool ConfigDataImp::isWriteVeloASCIIfilesInConfigFile() { return this->isWriteVeloASCII; }
 
-bool ConfigDataImp::isConcFileInConfigFile()
-{
-	return this->isConcFile;
-}
+bool ConfigDataImp::isCalcPlaneConcInConfigFile() { return this->isCalcPlaneConc; }
 
-bool ConfigDataImp::isStreetVelocityFileInConfigFile()
-{
-	return this->isStreetVelocityFile;
-}
+bool ConfigDataImp::isConcFileInConfigFile() { return this->isConcFile; }
 
-bool ConfigDataImp::isUseMeasurePointsInConfigFile()
-{
-	return this->isUseMeasurePoints;
-}
+bool ConfigDataImp::isStreetVelocityFileInConfigFile() { return this->isStreetVelocityFile; }
 
-bool ConfigDataImp::isUseWaleInConfigFile()
-{
-	return this->isUseWale;
-}
+bool ConfigDataImp::isUseMeasurePointsInConfigFile() { return this->isUseMeasurePoints; }
 
-bool ConfigDataImp::isUseInitNeqInConfigFile()
-{
-    return this->isUseInitNeq;
-}
+bool ConfigDataImp::isUseWaleInConfigFile() { return this->isUseWale; }
 
-bool ConfigDataImp::isSimulatePorousMediaInConfigFile()
-{
-	return this->isSimulatePorousMedia;
-}
+bool ConfigDataImp::isUseInitNeqInConfigFile() { return this->isUseInitNeq; }
 
-bool ConfigDataImp::isD3QxxInConfigFile()
-{
-	return this->isD3Qxx;
-}
+bool ConfigDataImp::isSimulatePorousMediaInConfigFile() { return this->isSimulatePorousMedia; }
 
-bool ConfigDataImp::isTEndInConfigFile()
-{
-	return this->isTEnd;
-}
+bool ConfigDataImp::isD3QxxInConfigFile() { return this->isD3Qxx; }
 
-bool ConfigDataImp::isTOutInConfigFile()
-{
-	return this->isTOut;
-}
+bool ConfigDataImp::isTEndInConfigFile() { return this->isTEnd; }
 
-bool ConfigDataImp::isTStartOutInConfigFile()
-{
-	return this->isTStartOut;
-}
+bool ConfigDataImp::isTOutInConfigFile() { return this->isTOut; }
 
-bool ConfigDataImp::isTimeCalcMedStartInConfigFile()
-{
-	return this->isTimeCalcMedStart;
-}
+bool ConfigDataImp::isTStartOutInConfigFile() { return this->isTStartOut; }
 
-bool ConfigDataImp::isTimeCalcMedEndInConfigFile()
-{
-	return this->isTimeCalcMedEnd;
-}
+bool ConfigDataImp::isTimeCalcMedStartInConfigFile() { return this->isTimeCalcMedStart; }
 
-bool ConfigDataImp::isPressInIDInConfigFile()
-{
-	return this->isPressInID;
-}
+bool ConfigDataImp::isTimeCalcMedEndInConfigFile() { return this->isTimeCalcMedEnd; }
 
-bool ConfigDataImp::isPressOutIDInConfigFile()
-{
-	return this->isPressOutID;
-}
+bool ConfigDataImp::isPressInIDInConfigFile() { return this->isPressInID; }
 
-bool ConfigDataImp::isPressInZInConfigFile()
-{
-	return this->isPressInZ;
-}
+bool ConfigDataImp::isPressOutIDInConfigFile() { return this->isPressOutID; }
 
-bool ConfigDataImp::isPressOutZInConfigFile()
-{
-	return this->isPressOutZ;
-}
+bool ConfigDataImp::isPressInZInConfigFile() { return this->isPressInZ; }
 
-bool ConfigDataImp::isDiffOnInConfigFile()
-{
-	return this->isDiffOn;
-}
+bool ConfigDataImp::isPressOutZInConfigFile() { return this->isPressOutZ; }
 
-bool ConfigDataImp::isDiffModInConfigFile()
-{
-	return this->isDiffMod;
-}
+bool ConfigDataImp::isDiffOnInConfigFile() { return this->isDiffOn; }
 
-bool ConfigDataImp::isDiffusivityInConfigFile()
-{
-	return this->isDiffusivity;
-}
+bool ConfigDataImp::isDiffModInConfigFile() { return this->isDiffMod; }
 
-bool ConfigDataImp::isTemperatureInitInConfigFile()
-{
-	return this->isTemperatureInit;
-}
+bool ConfigDataImp::isDiffusivityInConfigFile() { return this->isDiffusivity; }
 
-bool ConfigDataImp::isTemperatureBCInConfigFile()
-{
-	return this->isTemperatureBC;
-}
+bool ConfigDataImp::isTemperatureInitInConfigFile() { return this->isTemperatureInit; }
 
-bool ConfigDataImp::isViscosityInConfigFile()
-{
-	return this->isViscosity;
-}
+bool ConfigDataImp::isTemperatureBCInConfigFile() { return this->isTemperatureBC; }
 
-bool ConfigDataImp::isNumberOfDevicesInConfigFile()
-{
-	return this->isNumberOfDevices;
-}
+bool ConfigDataImp::isViscosityInConfigFile() { return this->isViscosity; }
 
-bool ConfigDataImp::isDevicesInConfigFile()
-{
-	return this->isDevices;
-}
+bool ConfigDataImp::isNumberOfDevicesInConfigFile() { return this->isNumberOfDevices; }
 
-bool ConfigDataImp::isOutputPathInConfigFile()
-{
-	return this->isOutputPath;
-}
+bool ConfigDataImp::isDevicesInConfigFile() { return this->isDevices; }
 
-bool ConfigDataImp::isPrefixInConfigFile()
-{
-	return this->isPrefix;
-}
+bool ConfigDataImp::isOutputPathInConfigFile() { return this->isOutputPath; }
 
-bool ConfigDataImp::isGridPathInConfigFile()
-{
-	return this->isGridPath;
-}
+bool ConfigDataImp::isPrefixInConfigFile() { return this->isPrefix; }
 
-bool ConfigDataImp::isPrintOutputFilesInConfigFile()
-{
-	return this->isPrintOutputFiles;
-}
+bool ConfigDataImp::isGridPathInConfigFile() { return this->isGridPath; }
 
-bool ConfigDataImp::isGeometryValuesInConfigFile()
-{
-	return this->isGeometryValues;
-}
+bool ConfigDataImp::isPrintOutputFilesInConfigFile() { return this->isPrintOutputFiles; }
 
-bool ConfigDataImp::isVelocityInConfigFile()
-{
-	return this->isVelocity;
-}
+bool ConfigDataImp::isGeometryValuesInConfigFile() { return this->isGeometryValues; }
 
-bool ConfigDataImp::isViscosityRatioInConfigFile()
-{
-	return this->isViscosityRatio;
-}
+bool ConfigDataImp::isVelocityInConfigFile() { return this->isVelocity; }
 
-bool ConfigDataImp::isVelocityRatioInConfigFile()
-{
-	return this->isVelocityRatio;
-}
+bool ConfigDataImp::isViscosityRatioInConfigFile() { return this->isViscosityRatio; }
 
-bool ConfigDataImp::isDensityRatioInConfigFile()
-{
-	return this->isDensityRatio;
-}
+bool ConfigDataImp::isVelocityRatioInConfigFile() { return this->isVelocityRatio; }
 
-bool ConfigDataImp::isPressRatioInConfigFile()
-{
-	return this->isPressRatio;
-}
+bool ConfigDataImp::isDensityRatioInConfigFile() { return this->isDensityRatio; }
 
-bool ConfigDataImp::isRealXInConfigFile()
-{
-	return this->isRealX;
-}
+bool ConfigDataImp::isPressRatioInConfigFile() { return this->isPressRatio; }
 
-bool ConfigDataImp::isRealYInConfigFile()
-{
-	return this->isRealY;
-}
+bool ConfigDataImp::isRealXInConfigFile() { return this->isRealX; }
 
-bool ConfigDataImp::isFactorPressBCInConfigFile()
-{
-	return this->isFactorPressBC;
-}
+bool ConfigDataImp::isRealYInConfigFile() { return this->isRealY; }
 
-bool ConfigDataImp::isGeometryFileCInConfigFile()
-{
-	return this->isGeometryFileC;
-}
+bool ConfigDataImp::isFactorPressBCInConfigFile() { return this->isFactorPressBC; }
 
-bool ConfigDataImp::isGeometryFileMInConfigFile()
-{
-	return this->isGeometryFileM;
-}
+bool ConfigDataImp::isGeometryFileCInConfigFile() { return this->isGeometryFileC; }
 
-bool ConfigDataImp::isGeometryFileFInConfigFile()
-{
-	return this->isGeometryFileF;
-}
+bool ConfigDataImp::isGeometryFileMInConfigFile() { return this->isGeometryFileM; }
 
-bool ConfigDataImp::isClockCycleForMPInConfigFile()
-{
-	return this->isClockCycleForMP;
-}
+bool ConfigDataImp::isGeometryFileFInConfigFile() { return this->isGeometryFileF; }
 
-bool ConfigDataImp::isTimestepForMPInConfigFile()
-{
-	return this->isTimestepForMP;
-}
+bool ConfigDataImp::isClockCycleForMPInConfigFile() { return this->isClockCycleForMP; }
 
-bool ConfigDataImp::isForcingXInConfigFile()
-{
-	return this->isForcingX;
-}
+bool ConfigDataImp::isTimestepForMPInConfigFile() { return this->isTimestepForMP; }
 
-bool ConfigDataImp::isForcingYInConfigFile()
-{
-	return this->isForcingY;
-}
+bool ConfigDataImp::isForcingXInConfigFile() { return this->isForcingX; }
 
-bool ConfigDataImp::isForcingZInConfigFile()
-{
-	return this->isForcingZ;
-}
+bool ConfigDataImp::isForcingYInConfigFile() { return this->isForcingY; }
 
-bool ConfigDataImp::isQuadricLimiterPInConfigFile()
-{
-	return this->isQuadricLimiterP;
-}
+bool ConfigDataImp::isForcingZInConfigFile() { return this->isForcingZ; }
 
-bool ConfigDataImp::isQuadricLimiterMInConfigFile()
-{
-	return this->isQuadricLimiterM;
-}
+bool ConfigDataImp::isQuadricLimiterPInConfigFile() { return this->isQuadricLimiterP; }
 
-bool ConfigDataImp::isQuadricLimiterDInConfigFile()
-{
-	return this->isQuadricLimiterD;
-}
+bool ConfigDataImp::isQuadricLimiterMInConfigFile() { return this->isQuadricLimiterM; }
 
-bool ConfigDataImp::isCalcParticlesInConfigFile()
-{
-	return this->isCalcParticles;
-}
+bool ConfigDataImp::isQuadricLimiterDInConfigFile() { return this->isQuadricLimiterD; }
 
-bool ConfigDataImp::isParticleBasicLevelInConfigFile()
-{
-	return this->isParticleBasicLevel;
-}
+bool ConfigDataImp::isCalcParticlesInConfigFile() { return this->isCalcParticles; }
 
-bool ConfigDataImp::isParticleInitLevelInConfigFile()
-{
-	return this->isParticleInitLevel;
-}
+bool ConfigDataImp::isParticleBasicLevelInConfigFile() { return this->isParticleBasicLevel; }
 
-bool ConfigDataImp::isNumberOfParticlesInConfigFile()
-{
-	return this->isNumberOfParticles;
-}
+bool ConfigDataImp::isParticleInitLevelInConfigFile() { return this->isParticleInitLevel; }
 
-bool ConfigDataImp::isNeighborWSBInConfigFile()
-{
-	return this->isNeighborWSB;
-}
+bool ConfigDataImp::isNumberOfParticlesInConfigFile() { return this->isNumberOfParticles; }
 
-bool ConfigDataImp::isStartXHotWallInConfigFile()
-{
-	return this->isStartXHotWall;
-}
+bool ConfigDataImp::isNeighborWSBInConfigFile() { return this->isNeighborWSB; }
 
-bool ConfigDataImp::isEndXHotWallInConfigFile()
-{
-	return this->isEndXHotWall;
-}
+bool ConfigDataImp::isStartXHotWallInConfigFile() { return this->isStartXHotWall; }
 
-bool ConfigDataImp::isPossNeighborFilesXInConfigFile()
-{
-	return this->isPossNeighborFilesX;
-}
+bool ConfigDataImp::isEndXHotWallInConfigFile() { return this->isEndXHotWall; }
 
-bool ConfigDataImp::isPossNeighborFilesYInConfigFile()
-{
-	return this->isPossNeighborFilesY;
-}
+bool ConfigDataImp::isPossNeighborFilesXInConfigFile() { return this->isPossNeighborFilesX; }
 
-bool ConfigDataImp::isPossNeighborFilesZInConfigFile()
-{
-	return this->isPossNeighborFilesZ;
-}
+bool ConfigDataImp::isPossNeighborFilesYInConfigFile() { return this->isPossNeighborFilesY; }
 
-bool ConfigDataImp::isTimeDoCheckPointInConfigFile()
-{
-	return this->isTimeDoCheckPoint;
-}
+bool ConfigDataImp::isPossNeighborFilesZInConfigFile() { return this->isPossNeighborFilesZ; }
 
-bool ConfigDataImp::isTimeDoRestartInConfigFile()
-{
-	return this->isTimeDoCheckPoint;
-}
+bool ConfigDataImp::isTimeDoCheckPointInConfigFile() { return this->isTimeDoCheckPoint; }
 
-bool ConfigDataImp::isDoCheckPointInConfigFile()
-{
-	return this->isDoCheckPoint;
-}
+bool ConfigDataImp::isTimeDoRestartInConfigFile() { return this->isTimeDoCheckPoint; }
 
-bool ConfigDataImp::isDoRestartInConfigFile()
-{
-	return this->isDoRestart;
-}
+bool ConfigDataImp::isDoCheckPointInConfigFile() { return this->isDoCheckPoint; }
 
-bool ConfigDataImp::isMaxLevelInConfigFile()
-{
-	return this->isMaxLevel;
-}
+bool ConfigDataImp::isDoRestartInConfigFile() { return this->isDoRestart; }
 
-bool ConfigDataImp::isGridXInConfigFile()
-{
-	return this->isGridX;
-}
+bool ConfigDataImp::isMaxLevelInConfigFile() { return this->isMaxLevel; }
 
-bool ConfigDataImp::isGridYInConfigFile()
-{
-	return this->isGridY;
-}
+bool ConfigDataImp::isGridXInConfigFile() { return this->isGridX; }
 
-bool ConfigDataImp::isGridZInConfigFile()
-{
-	return this->isGridZ;
-}
-
-bool ConfigDataImp::isDistXInConfigFile()
-{
-	return this->isDistX;
-}
+bool ConfigDataImp::isGridYInConfigFile() { return this->isGridY; }
 
-bool ConfigDataImp::isDistYInConfigFile()
-{
-	return this->isDistY;
-}
+bool ConfigDataImp::isGridZInConfigFile() { return this->isGridZ; }
 
-bool ConfigDataImp::isDistZInConfigFile()
-{
-	return this->isDistZ;
-}
+bool ConfigDataImp::isDistXInConfigFile() { return this->isDistX; }
 
-bool ConfigDataImp::isNeedInterfaceInConfigFile()
-{
-	return this->isNeedInterface;
-}
+bool ConfigDataImp::isDistYInConfigFile() { return this->isDistY; }
 
-bool ConfigDataImp::isMainKernelInConfigFile()
-{
-	return this->isMainKernel;
-}
+bool ConfigDataImp::isDistZInConfigFile() { return this->isDistZ; }
 
-bool ConfigDataImp::isMultiKernelOnInConfigFile()
-{
-	return this->isMultiKernelOn;
-}
+bool ConfigDataImp::isNeedInterfaceInConfigFile() { return this->isNeedInterface; }
 
-bool ConfigDataImp::isMultiKernelLevelInConfigFile()
-{
-	return this->isMultiKernelLevel;
-}
+bool ConfigDataImp::isMainKernelInConfigFile() { return this->isMainKernel; }
 
-bool ConfigDataImp::isMultiKernelNameInConfigFile()
-{
-	return this->isMultiKernelName;
-}
+bool ConfigDataImp::isMultiKernelOnInConfigFile() { return this->isMultiKernelOn; }
 
+bool ConfigDataImp::isMultiKernelLevelInConfigFile() { return this->isMultiKernelLevel; }
 
+bool ConfigDataImp::isMultiKernelNameInConfigFile() { return this->isMultiKernelName; }
diff --git a/src/basics/Core/Input/ConfigData/ConfigDataImp.h b/src/basics/Core/Input/ConfigData/ConfigDataImp.h
index 94d503b78c25eb980b4f1972cfb99fc159fb3dd5..34a2a95b919f9ccd23072d0a0608aa269386ef80 100644
--- a/src/basics/Core/Input/ConfigData/ConfigDataImp.h
+++ b/src/basics/Core/Input/ConfigData/ConfigDataImp.h
@@ -6,444 +6,442 @@
 #include <memory>
 #include <string>
 
-class  ConfigDataImp : public ConfigData
+class ConfigDataImp : public ConfigData
 {
 public:
     static std::shared_ptr<ConfigDataImp> getNewInstance();
 
-	real getViscosity() override;
-	uint getNumberOfDevices() override;
-	std::vector<uint> getDevices() override;
-	std::string getOutputPath() override;
-	std::string getPrefix() override;
-	std::string getGridPath() override;
-	bool getPrintOutputFiles() override;
-	bool getGeometryValues() override;
-	bool getCalc2ndOrderMoments() override;
-	bool getCalc3rdOrderMoments() override;
-	bool getCalcHighOrderMoments() override;
-	bool getReadGeo() override;
-	bool getCalcMedian() override;
-	bool getCalcDragLift() override;
-	bool getCalcCp() override;
-	bool getWriteVeloASCIIfiles() override;
-	bool getCalcPlaneConc() override;
-	bool getConcFile() override;
-	bool getStreetVelocityFile() override;
-	bool getUseMeasurePoints() override;
-	bool getUseWale() override;
-	bool getUseInitNeq() override;
-	bool getSimulatePorousMedia() override;
-	uint getD3Qxx() override;
-	uint getTEnd() override;
-	uint getTOut() override;
-	uint getTStartOut() override;
-	uint getTimeCalcMedStart() override;
-	uint getTimeCalcMedEnd() override;
-	uint getPressInID() override;
-	uint getPressOutID() override;
-	uint getPressInZ() override;
-	uint getPressOutZ() override;
-	bool getDiffOn() override;
-	uint getDiffMod() override;
-	real getDiffusivity() override;
-	real getTemperatureInit() override;
-	real getTemperatureBC() override;
-	real getVelocity() override;
-	real getViscosityRatio() override;
-	real getVelocityRatio() override;
-	real getDensityRatio() override;
-	real getPressRatio() override;
-	real getRealX() override;
-	real getRealY() override;
-	real getFactorPressBC() override;
-	std::string getGeometryFileC() override;
-	std::string getGeometryFileM() override;
-	std::string getGeometryFileF() override;
-	uint getClockCycleForMP() override;
-	uint getTimestepForMP() override;
-	real getForcingX() override;
-	real getForcingY() override;
-	real getForcingZ() override;
+    real getViscosity() override;
+    uint getNumberOfDevices() override;
+    std::vector<uint> getDevices() override;
+    std::string getOutputPath() override;
+    std::string getPrefix() override;
+    std::string getGridPath() override;
+    bool getPrintOutputFiles() override;
+    bool getGeometryValues() override;
+    bool getCalc2ndOrderMoments() override;
+    bool getCalc3rdOrderMoments() override;
+    bool getCalcHighOrderMoments() override;
+    bool getReadGeo() override;
+    bool getCalcMedian() override;
+    bool getCalcDragLift() override;
+    bool getCalcCp() override;
+    bool getWriteVeloASCIIfiles() override;
+    bool getCalcPlaneConc() override;
+    bool getConcFile() override;
+    bool getStreetVelocityFile() override;
+    bool getUseMeasurePoints() override;
+    bool getUseWale() override;
+    bool getUseInitNeq() override;
+    bool getSimulatePorousMedia() override;
+    uint getD3Qxx() override;
+    uint getTEnd() override;
+    uint getTOut() override;
+    uint getTStartOut() override;
+    uint getTimeCalcMedStart() override;
+    uint getTimeCalcMedEnd() override;
+    uint getPressInID() override;
+    uint getPressOutID() override;
+    uint getPressInZ() override;
+    uint getPressOutZ() override;
+    bool getDiffOn() override;
+    uint getDiffMod() override;
+    real getDiffusivity() override;
+    real getTemperatureInit() override;
+    real getTemperatureBC() override;
+    real getVelocity() override;
+    real getViscosityRatio() override;
+    real getVelocityRatio() override;
+    real getDensityRatio() override;
+    real getPressRatio() override;
+    real getRealX() override;
+    real getRealY() override;
+    real getFactorPressBC() override;
+    std::string getGeometryFileC() override;
+    std::string getGeometryFileM() override;
+    std::string getGeometryFileF() override;
+    uint getClockCycleForMP() override;
+    uint getTimestepForMP() override;
+    real getForcingX() override;
+    real getForcingY() override;
+    real getForcingZ() override;
     real getQuadricLimiterP() override;
     real getQuadricLimiterM() override;
     real getQuadricLimiterD() override;
-	bool getCalcParticles() override;
-	int getParticleBasicLevel() override;
-	int getParticleInitLevel() override;
-	int getNumberOfParticles() override;
-	real getStartXHotWall() override;
-	real getEndXHotWall() override;
-	std::vector<std::string> getPossNeighborFilesX() override;
-	std::vector<std::string> getPossNeighborFilesY() override;
-	std::vector<std::string> getPossNeighborFilesZ() override;
-	//std::vector<std::string> getPossNeighborFilesX();
-	//std::vector<std::string> getPossNeighborFilesY();
-	//std::vector<std::string> getPossNeighborFilesZ();
-	int getTimeDoCheckPoint() override;
-	int getTimeDoRestart() override;
-	bool getDoCheckPoint() override;
-	bool getDoRestart() override;
-	uint getMaxLevel() override;
-	std::vector<int> getGridX() override;
-	std::vector<int> getGridY() override;
-	std::vector<int> getGridZ() override;
-	std::vector<int> getDistX() override;
-	std::vector<int> getDistY() override;
-	std::vector<int> getDistZ() override;
-	std::vector<bool> getNeedInterface() override;
-	std::string getMainKernel() override;
-	bool getMultiKernelOn() override;
-	std::vector<int> getMultiKernelLevel() override;
-	std::vector<std::string> getMultiKernelName() override;
+    bool getCalcParticles() override;
+    int getParticleBasicLevel() override;
+    int getParticleInitLevel() override;
+    int getNumberOfParticles() override;
+    real getStartXHotWall() override;
+    real getEndXHotWall() override;
+    std::vector<std::string> getPossNeighborFilesX() override;
+    std::vector<std::string> getPossNeighborFilesY() override;
+    std::vector<std::string> getPossNeighborFilesZ() override;
+    // std::vector<std::string> getPossNeighborFilesX();
+    // std::vector<std::string> getPossNeighborFilesY();
+    // std::vector<std::string> getPossNeighborFilesZ();
+    int getTimeDoCheckPoint() override;
+    int getTimeDoRestart() override;
+    bool getDoCheckPoint() override;
+    bool getDoRestart() override;
+    uint getMaxLevel() override;
+    std::vector<int> getGridX() override;
+    std::vector<int> getGridY() override;
+    std::vector<int> getGridZ() override;
+    std::vector<int> getDistX() override;
+    std::vector<int> getDistY() override;
+    std::vector<int> getDistZ() override;
+    std::vector<bool> getNeedInterface() override;
+    std::string getMainKernel() override;
+    bool getMultiKernelOn() override;
+    std::vector<int> getMultiKernelLevel() override;
+    std::vector<std::string> getMultiKernelName() override;
 
-	void setViscosity(real viscosity);
-	void setNumberOfDevices(uint numberOfDevices);
-	void setDevices(std::vector<uint> devices);
-	void setOutputPath(std::string outputPath);
-	void setPrefix(std::string prefix);
-	void setGridPath(std::string gridPath);
-	void setPrintOutputFiles(bool printOutputFiles);
-	void setGeometryValues(bool geometryValues);
-	void setCalc2ndOrderMoments(bool calc2ndOrderMoments);
-	void setCalc3rdOrderMoments(bool calc3rdOrderMoments);
-	void setCalcHighOrderMoments(bool calcHighOrderMoment);
-	void setReadGeo(bool readGeo);
-	void setCalcMedian(bool calcMedian);   
-	void setCalcDragLift(bool calcDragLift);
-	void setCalcCp(bool calcCp);
-	void setWriteVeloASCIIfiles(bool writeVeloASCIIfiles);
-	void setCalcPlaneConc(bool calcPlaneConc);
-	void setConcFile(bool concFile);
-	void setStreetVelocityFile(bool streetVelocityFile);
-	void setUseMeasurePoints(bool useMeasurePoints);
-	void setUseWale(bool useWale);
-	void setUseInitNeq(bool useInitNeq);
-	void setSimulatePorousMedia(bool simulatePorousMedia);
-	void setD3Qxx(uint d3Qxx);
-	void setTEnd(uint tEnd);
-	void setTOut(uint tOut);
-	void setTStartOut(uint tStartOut);
-	void setTimeCalcMedStart(uint timeCalcMedStart);
-	void setTimeCalcMedEnd(uint timeCalcMedEnd);   
-	void setPressInID(uint pressInID);
-	void setPressOutID(uint pressOutID);   
-	void setPressInZ(uint pressInZ);
-	void setPressOutZ(uint pressOutZ);
-	void setDiffOn(bool diffOn);	
-	void setDiffMod(uint diffMod);		
-	void setDiffusivity(real diffusivity);	
-	void setTemperatureInit(real temperatureInit);	
-	void setTemperatureBC(real temperatureBC);	
-	//void setViscosity(real viscosity);	
-	void setVelocity(real velocity);	
-	void setViscosityRatio(real viscosityRatio);	
-	void setVelocityRatio(real velocityRatio);	
-	void setDensityRatio(real fensityRatio);	
-	void setPressRatio(real pressRatio);	
-	void setRealX(real realX);	
-	void setRealY(real realY);	
-	void setFactorPressBC(real factorPressBC);	
-	void setGeometryFileC(std::string geometryFileC);
-	void setGeometryFileM(std::string geometryFileM);
-	void setGeometryFileF(std::string geometryFileF); 
-	void setClockCycleForMP(uint clockCycleForMP);
-	void setTimestepForMP(uint timestepForMP);
-	void setForcingX(real forcingX);
-	void setForcingY(real forcingY);
-	void setForcingZ(real forcingZ);
-	void setQuadricLimiterP(real quadricLimiterP);
-	void setQuadricLimiterM(real quadricLimiterM);
-	void setQuadricLimiterD(real quadricLimiterD);
-	void setCalcParticles(bool calcParticles);
-	void setParticleBasicLevel(int particleBasicLevel);
-	void setParticleInitLevel(int particleInitLevel);
-	void setNumberOfParticles(int numberOfParticles);
-	void setStartXHotWall(real startXHotWall);
-	void setEndXHotWall(real endXHotWall);
-	void setPossNeighborFilesX(std::vector<std::string> possNeighborFilesX);
-	void setPossNeighborFilesY(std::vector<std::string> possNeighborFilesY);
-	void setPossNeighborFilesZ(std::vector<std::string> possNeighborFilesZ);
-	//void setPossNeighborFilesX(std::vector<std::string> possNeighborFilesX);
-	//void setPossNeighborFilesY(std::vector<std::string> possNeighborFilesY);
-	//void setPossNeighborFilesZ(std::vector<std::string> possNeighborFilesZ);
-	void setTimeDoCheckPoint(int timeDoCheckPoint);
-	void setTimeDoRestart(int timeDoRestart);
-	void setDoCheckPoint(bool doCheckPoint);
-	void setDoRestart(bool doRestart);
-	void setMaxLevel(uint maxLevel);
-	void setGridX(std::vector<int> gridX);
-	void setGridY(std::vector<int> gridY);
-	void setGridZ(std::vector<int> gridZ);
-	void setDistX(std::vector<int> distX);
-	void setDistY(std::vector<int> distY);
-	void setDistZ(std::vector<int> distZ);
-	void setNeedInterface(std::vector<bool> needInterface);
-	void setMainKernel(std::string mainKernel);
-	void setMultiKernelOn(bool multiKernelOn);
-	void setMultiKernelLevel(std::vector<int> multiKernelLevel);
-	void setMultiKernelName(std::vector<std::string> multiKernelName);
-
-	bool isViscosityInConfigFile() override;
-	bool isNumberOfDevicesInConfigFile() override;
-	bool isDevicesInConfigFile() override;
-	bool isOutputPathInConfigFile() override;
-	bool isPrefixInConfigFile() override;
-	bool isGridPathInConfigFile() override;
-	bool isPrintOutputFilesInConfigFile() override;
-	bool isGeometryValuesInConfigFile() override;
-	bool isCalc2ndOrderMomentsInConfigFile() override;
-	bool isCalc3rdOrderMomentsInConfigFile() override;
-	bool isCalcHighOrderMomentsInConfigFile() override;
-	bool isReadGeoInConfigFile() override;
-	bool isCalcMedianInConfigFile() override;
-	bool isCalcDragLiftInConfigFile() override;
-	bool isCalcCpInConfigFile() override;
-	bool isWriteVeloASCIIfilesInConfigFile() override;
-	bool isCalcPlaneConcInConfigFile() override;
-	bool isConcFileInConfigFile() override;
-	bool isStreetVelocityFileInConfigFile() override;
-	bool isUseMeasurePointsInConfigFile() override;
-	bool isUseWaleInConfigFile() override;
-	bool isUseInitNeqInConfigFile() override;
-	bool isSimulatePorousMediaInConfigFile() override;
-	bool isD3QxxInConfigFile() override;
-	bool isTEndInConfigFile() override;
-	bool isTOutInConfigFile() override;
-	bool isTStartOutInConfigFile() override;
-	bool isTimeCalcMedStartInConfigFile() override;
-	bool isTimeCalcMedEndInConfigFile() override;
-	bool isPressInIDInConfigFile() override;
-	bool isPressOutIDInConfigFile() override;
-	bool isPressInZInConfigFile() override;
-	bool isPressOutZInConfigFile() override;
-	bool isDiffOnInConfigFile() override;
-	bool isDiffModInConfigFile() override;
-	bool isDiffusivityInConfigFile() override;
-	bool isTemperatureInitInConfigFile() override;
-	bool isTemperatureBCInConfigFile() override;
-	//bool isViscosityInConfigFile();
-	bool isVelocityInConfigFile() override;
-	bool isViscosityRatioInConfigFile() override;
-	bool isVelocityRatioInConfigFile() override;
-	bool isDensityRatioInConfigFile() override;
-	bool isPressRatioInConfigFile() override;
-	bool isRealXInConfigFile() override;
-	bool isRealYInConfigFile() override;
-	bool isFactorPressBCInConfigFile() override;
-	bool isGeometryFileCInConfigFile() override;
-	bool isGeometryFileMInConfigFile() override;
-	bool isGeometryFileFInConfigFile() override;
-	bool isClockCycleForMPInConfigFile() override;
-	bool isTimestepForMPInConfigFile() override;
-	bool isForcingXInConfigFile() override;
-	bool isForcingYInConfigFile() override;
-	bool isForcingZInConfigFile() override;
-	bool isQuadricLimiterPInConfigFile() override;
-	bool isQuadricLimiterMInConfigFile() override;
-	bool isQuadricLimiterDInConfigFile() override;
-	bool isCalcParticlesInConfigFile() override;
-	bool isParticleBasicLevelInConfigFile() override;
-	bool isParticleInitLevelInConfigFile() override;
-	bool isNumberOfParticlesInConfigFile() override;
-	bool isNeighborWSBInConfigFile() override;
-	bool isStartXHotWallInConfigFile() override;
-	bool isEndXHotWallInConfigFile() override;
-	bool isPossNeighborFilesXInConfigFile() override;
-	bool isPossNeighborFilesYInConfigFile() override;
-	bool isPossNeighborFilesZInConfigFile() override;
-	bool isTimeDoCheckPointInConfigFile() override;
-	bool isTimeDoRestartInConfigFile() override;
-	bool isDoCheckPointInConfigFile() override;
-	bool isDoRestartInConfigFile() override;
-	bool isMaxLevelInConfigFile() override;
-	bool isGridXInConfigFile() override;
-	bool isGridYInConfigFile() override;
-	bool isGridZInConfigFile() override;
-	bool isDistXInConfigFile() override;
-	bool isDistYInConfigFile() override;
-	bool isDistZInConfigFile() override;
-	bool isNeedInterfaceInConfigFile() override;
-	bool isMainKernelInConfigFile() override;
-	bool isMultiKernelOnInConfigFile() override;
-	bool isMultiKernelLevelInConfigFile() override;
-	bool isMultiKernelNameInConfigFile() override;
+    void setViscosity(real viscosity);
+    void setNumberOfDevices(uint numberOfDevices);
+    void setDevices(std::vector<uint> devices);
+    void setOutputPath(std::string outputPath);
+    void setPrefix(std::string prefix);
+    void setGridPath(std::string gridPath);
+    void setPrintOutputFiles(bool printOutputFiles);
+    void setGeometryValues(bool geometryValues);
+    void setCalc2ndOrderMoments(bool calc2ndOrderMoments);
+    void setCalc3rdOrderMoments(bool calc3rdOrderMoments);
+    void setCalcHighOrderMoments(bool calcHighOrderMoment);
+    void setReadGeo(bool readGeo);
+    void setCalcMedian(bool calcMedian);
+    void setCalcDragLift(bool calcDragLift);
+    void setCalcCp(bool calcCp);
+    void setWriteVeloASCIIfiles(bool writeVeloASCIIfiles);
+    void setCalcPlaneConc(bool calcPlaneConc);
+    void setConcFile(bool concFile);
+    void setStreetVelocityFile(bool streetVelocityFile);
+    void setUseMeasurePoints(bool useMeasurePoints);
+    void setUseWale(bool useWale);
+    void setUseInitNeq(bool useInitNeq);
+    void setSimulatePorousMedia(bool simulatePorousMedia);
+    void setD3Qxx(uint d3Qxx);
+    void setTEnd(uint tEnd);
+    void setTOut(uint tOut);
+    void setTStartOut(uint tStartOut);
+    void setTimeCalcMedStart(uint timeCalcMedStart);
+    void setTimeCalcMedEnd(uint timeCalcMedEnd);
+    void setPressInID(uint pressInID);
+    void setPressOutID(uint pressOutID);
+    void setPressInZ(uint pressInZ);
+    void setPressOutZ(uint pressOutZ);
+    void setDiffOn(bool diffOn);
+    void setDiffMod(uint diffMod);
+    void setDiffusivity(real diffusivity);
+    void setTemperatureInit(real temperatureInit);
+    void setTemperatureBC(real temperatureBC);
+    // void setViscosity(real viscosity);
+    void setVelocity(real velocity);
+    void setViscosityRatio(real viscosityRatio);
+    void setVelocityRatio(real velocityRatio);
+    void setDensityRatio(real fensityRatio);
+    void setPressRatio(real pressRatio);
+    void setRealX(real realX);
+    void setRealY(real realY);
+    void setFactorPressBC(real factorPressBC);
+    void setGeometryFileC(std::string geometryFileC);
+    void setGeometryFileM(std::string geometryFileM);
+    void setGeometryFileF(std::string geometryFileF);
+    void setClockCycleForMP(uint clockCycleForMP);
+    void setTimestepForMP(uint timestepForMP);
+    void setForcingX(real forcingX);
+    void setForcingY(real forcingY);
+    void setForcingZ(real forcingZ);
+    void setQuadricLimiterP(real quadricLimiterP);
+    void setQuadricLimiterM(real quadricLimiterM);
+    void setQuadricLimiterD(real quadricLimiterD);
+    void setCalcParticles(bool calcParticles);
+    void setParticleBasicLevel(int particleBasicLevel);
+    void setParticleInitLevel(int particleInitLevel);
+    void setNumberOfParticles(int numberOfParticles);
+    void setStartXHotWall(real startXHotWall);
+    void setEndXHotWall(real endXHotWall);
+    void setPossNeighborFilesX(std::vector<std::string> possNeighborFilesX);
+    void setPossNeighborFilesY(std::vector<std::string> possNeighborFilesY);
+    void setPossNeighborFilesZ(std::vector<std::string> possNeighborFilesZ);
+    // void setPossNeighborFilesX(std::vector<std::string> possNeighborFilesX);
+    // void setPossNeighborFilesY(std::vector<std::string> possNeighborFilesY);
+    // void setPossNeighborFilesZ(std::vector<std::string> possNeighborFilesZ);
+    void setTimeDoCheckPoint(int timeDoCheckPoint);
+    void setTimeDoRestart(int timeDoRestart);
+    void setDoCheckPoint(bool doCheckPoint);
+    void setDoRestart(bool doRestart);
+    void setMaxLevel(uint maxLevel);
+    void setGridX(std::vector<int> gridX);
+    void setGridY(std::vector<int> gridY);
+    void setGridZ(std::vector<int> gridZ);
+    void setDistX(std::vector<int> distX);
+    void setDistY(std::vector<int> distY);
+    void setDistZ(std::vector<int> distZ);
+    void setNeedInterface(std::vector<bool> needInterface);
+    void setMainKernel(std::string mainKernel);
+    void setMultiKernelOn(bool multiKernelOn);
+    void setMultiKernelLevel(std::vector<int> multiKernelLevel);
+    void setMultiKernelName(std::vector<std::string> multiKernelName);
 
+    bool isViscosityInConfigFile() override;
+    bool isNumberOfDevicesInConfigFile() override;
+    bool isDevicesInConfigFile() override;
+    bool isOutputPathInConfigFile() override;
+    bool isPrefixInConfigFile() override;
+    bool isGridPathInConfigFile() override;
+    bool isPrintOutputFilesInConfigFile() override;
+    bool isGeometryValuesInConfigFile() override;
+    bool isCalc2ndOrderMomentsInConfigFile() override;
+    bool isCalc3rdOrderMomentsInConfigFile() override;
+    bool isCalcHighOrderMomentsInConfigFile() override;
+    bool isReadGeoInConfigFile() override;
+    bool isCalcMedianInConfigFile() override;
+    bool isCalcDragLiftInConfigFile() override;
+    bool isCalcCpInConfigFile() override;
+    bool isWriteVeloASCIIfilesInConfigFile() override;
+    bool isCalcPlaneConcInConfigFile() override;
+    bool isConcFileInConfigFile() override;
+    bool isStreetVelocityFileInConfigFile() override;
+    bool isUseMeasurePointsInConfigFile() override;
+    bool isUseWaleInConfigFile() override;
+    bool isUseInitNeqInConfigFile() override;
+    bool isSimulatePorousMediaInConfigFile() override;
+    bool isD3QxxInConfigFile() override;
+    bool isTEndInConfigFile() override;
+    bool isTOutInConfigFile() override;
+    bool isTStartOutInConfigFile() override;
+    bool isTimeCalcMedStartInConfigFile() override;
+    bool isTimeCalcMedEndInConfigFile() override;
+    bool isPressInIDInConfigFile() override;
+    bool isPressOutIDInConfigFile() override;
+    bool isPressInZInConfigFile() override;
+    bool isPressOutZInConfigFile() override;
+    bool isDiffOnInConfigFile() override;
+    bool isDiffModInConfigFile() override;
+    bool isDiffusivityInConfigFile() override;
+    bool isTemperatureInitInConfigFile() override;
+    bool isTemperatureBCInConfigFile() override;
+    // bool isViscosityInConfigFile();
+    bool isVelocityInConfigFile() override;
+    bool isViscosityRatioInConfigFile() override;
+    bool isVelocityRatioInConfigFile() override;
+    bool isDensityRatioInConfigFile() override;
+    bool isPressRatioInConfigFile() override;
+    bool isRealXInConfigFile() override;
+    bool isRealYInConfigFile() override;
+    bool isFactorPressBCInConfigFile() override;
+    bool isGeometryFileCInConfigFile() override;
+    bool isGeometryFileMInConfigFile() override;
+    bool isGeometryFileFInConfigFile() override;
+    bool isClockCycleForMPInConfigFile() override;
+    bool isTimestepForMPInConfigFile() override;
+    bool isForcingXInConfigFile() override;
+    bool isForcingYInConfigFile() override;
+    bool isForcingZInConfigFile() override;
+    bool isQuadricLimiterPInConfigFile() override;
+    bool isQuadricLimiterMInConfigFile() override;
+    bool isQuadricLimiterDInConfigFile() override;
+    bool isCalcParticlesInConfigFile() override;
+    bool isParticleBasicLevelInConfigFile() override;
+    bool isParticleInitLevelInConfigFile() override;
+    bool isNumberOfParticlesInConfigFile() override;
+    bool isNeighborWSBInConfigFile() override;
+    bool isStartXHotWallInConfigFile() override;
+    bool isEndXHotWallInConfigFile() override;
+    bool isPossNeighborFilesXInConfigFile() override;
+    bool isPossNeighborFilesYInConfigFile() override;
+    bool isPossNeighborFilesZInConfigFile() override;
+    bool isTimeDoCheckPointInConfigFile() override;
+    bool isTimeDoRestartInConfigFile() override;
+    bool isDoCheckPointInConfigFile() override;
+    bool isDoRestartInConfigFile() override;
+    bool isMaxLevelInConfigFile() override;
+    bool isGridXInConfigFile() override;
+    bool isGridYInConfigFile() override;
+    bool isGridZInConfigFile() override;
+    bool isDistXInConfigFile() override;
+    bool isDistYInConfigFile() override;
+    bool isDistZInConfigFile() override;
+    bool isNeedInterfaceInConfigFile() override;
+    bool isMainKernelInConfigFile() override;
+    bool isMultiKernelOnInConfigFile() override;
+    bool isMultiKernelLevelInConfigFile() override;
+    bool isMultiKernelNameInConfigFile() override;
 
 private:
-	ConfigDataImp();
-
-	real viscosity;
-	uint numberOfDevices;
-	std::vector<uint> devices;
-	std::string outputPath;
-	std::string prefix;
-	std::string gridPath;
-	bool printOutputFiles;
-	bool geometryValues;
-	bool calc2ndOrderMoments;
-	bool calc3rdOrderMoments;
-	bool calcHighOrderMoments;
-	bool readGeo;
-	bool calcMedian;
-	bool calcDragLift;
-	bool calcCp;
-	bool writeVeloASCIIfiles;
-	bool calcPlaneConc;
-	bool concFile;
-	bool streetVelocityFile;
-	bool useMeasurePoints;
-	bool useWale;
-	bool useInitNeq;
-	bool simulatePorousMedia;
-	uint d3Qxx;
-	uint tEnd;
-	uint tOut;
-	uint tStartOut;
-	uint timeCalcMedStart;
-	uint timeCalcMedEnd;
-	uint pressInID;
-	uint pressOutID;
-	uint pressInZ;
-	uint pressOutZ;
-	bool diffOn;
-	uint diffMod;
-	real diffusivity;
-	real temperatureInit;
-	real temperatureBC;
-	//real viscosity;
-	real velocity;
-	real viscosityRatio;
-	real velocityRatio;
-	real densityRatio;
-	real pressRatio;
-	real realX;
-	real realY;
-	real factorPressBC;
-	std::string geometryFileC;
-	std::string geometryFileM;
-	std::string geometryFileF;
-	uint clockCycleForMP;
-	uint timestepForMP;
-	real forcingX;
-	real forcingY;
-	real forcingZ;
-	real quadricLimiterP;
-	real quadricLimiterM;
-	real quadricLimiterD;
-	bool calcParticles;
-	int particleBasicLevel;
-	int particleInitLevel;
-	int numberOfParticles;
-	real startXHotWall;
-	real endXHotWall;
-	std::vector<std::string> possNeighborFilesX;
-	std::vector<std::string> possNeighborFilesY;
-	std::vector<std::string> possNeighborFilesZ;
-	//std::vector<std::string> possNeighborFilesX;
-	//std::vector<std::string> possNeighborFilesY;
-	//std::vector<std::string> possNeighborFilesZ;
-	int timeDoCheckPoint;
-	int timeDoRestart;
-	bool doCheckPoint;
-	bool doRestart;
-	int maxLevel;
-	std::vector<int> gridX;
-	std::vector<int> gridY;
-	std::vector<int> gridZ;
-	std::vector<int> distX;
-	std::vector<int> distY;
-	std::vector<int> distZ;
-	std::vector<bool> needInterface;
-	std::string mainKernel;
-	bool multiKernelOn;
-	std::vector<int> multiKernelLevel;
-	std::vector<std::string> multiKernelName;
+    ConfigDataImp();
 
-	bool isViscosity;
-	bool isNumberOfDevices;
-	bool isDevices;
-	bool isOutputPath;
-	bool isPrefix;
-	bool isGridPath;
-	bool isPrintOutputFiles;
-	bool isGeometryValues;
-	bool isCalc2ndOrderMoments;
-	bool isCalc3rdOrderMoments;
-	bool isCalcHighOrderMoments;
-	bool isReadGeo;
-	bool isCalcMedian;
-	bool isCalcDragLift;
-	bool isCalcCp;
-	bool isWriteVeloASCII;
-	bool isCalcPlaneConc;
-	bool isConcFile;
-	bool isStreetVelocityFile;
-	bool isUseMeasurePoints;
-	bool isUseWale;
-	bool isUseInitNeq;
-	bool isSimulatePorousMedia;
-	bool isD3Qxx;
-	bool isTEnd;
-	bool isTOut;
-	bool isTStartOut;
-	bool isTimeCalcMedStart;
-	bool isTimeCalcMedEnd;
-	bool isPressInID;
-	bool isPressOutID;
-	bool isPressInZ;
-	bool isPressOutZ;
-	bool isDiffOn;
-	bool isDiffMod;
-	bool isDiffusivity;
-	bool isTemperatureInit;
-	bool isTemperatureBC;
-	//bool isViscosity;
-	bool isVelocity;
-	bool isViscosityRatio;
-	bool isVelocityRatio;
-	bool isDensityRatio;
-	bool isPressRatio;
-	bool isRealX;
-	bool isRealY;
-	bool isFactorPressBC;
-	bool isGeometryFileC;
-	bool isGeometryFileM;
-	bool isGeometryFileF;
-	bool isClockCycleForMP;
-	bool isTimestepForMP;
-	bool isForcingX;
-	bool isForcingY;
-	bool isForcingZ;
-	bool isQuadricLimiterP;
-	bool isQuadricLimiterM;
-	bool isQuadricLimiterD;
-	bool isCalcParticles;
-	bool isParticleBasicLevel;
-	bool isParticleInitLevel;
-	bool isNumberOfParticles;
-	bool isNeighborWSB;
-	bool isStartXHotWall;
-	bool isEndXHotWall;
-	bool isPossNeighborFilesX;
-	bool isPossNeighborFilesY;
-	bool isPossNeighborFilesZ;
-	bool isTimeDoCheckPoint;
-	bool isTimeDoRestart;
-	bool isDoCheckPoint;
-	bool isDoRestart;
-	bool isMaxLevel;
-	bool isGridX;
-	bool isGridY;
-	bool isGridZ;
-	bool isDistX;
-	bool isDistY;
-	bool isDistZ;
-	bool isNeedInterface;
-	bool isMainKernel;
-	bool isMultiKernelOn;
-	bool isMultiKernelLevel;
-	bool isMultiKernelName;
+    real viscosity;
+    uint numberOfDevices;
+    std::vector<uint> devices;
+    std::string outputPath;
+    std::string prefix;
+    std::string gridPath;
+    bool printOutputFiles;
+    bool geometryValues;
+    bool calc2ndOrderMoments;
+    bool calc3rdOrderMoments;
+    bool calcHighOrderMoments;
+    bool readGeo;
+    bool calcMedian;
+    bool calcDragLift;
+    bool calcCp;
+    bool writeVeloASCIIfiles;
+    bool calcPlaneConc;
+    bool concFile;
+    bool streetVelocityFile;
+    bool useMeasurePoints;
+    bool useWale;
+    bool useInitNeq;
+    bool simulatePorousMedia;
+    uint d3Qxx;
+    uint tEnd;
+    uint tOut;
+    uint tStartOut;
+    uint timeCalcMedStart;
+    uint timeCalcMedEnd;
+    uint pressInID;
+    uint pressOutID;
+    uint pressInZ;
+    uint pressOutZ;
+    bool diffOn;
+    uint diffMod;
+    real diffusivity;
+    real temperatureInit;
+    real temperatureBC;
+    // real viscosity;
+    real velocity;
+    real viscosityRatio;
+    real velocityRatio;
+    real densityRatio;
+    real pressRatio;
+    real realX;
+    real realY;
+    real factorPressBC;
+    std::string geometryFileC;
+    std::string geometryFileM;
+    std::string geometryFileF;
+    uint clockCycleForMP;
+    uint timestepForMP;
+    real forcingX;
+    real forcingY;
+    real forcingZ;
+    real quadricLimiterP;
+    real quadricLimiterM;
+    real quadricLimiterD;
+    bool calcParticles;
+    int particleBasicLevel;
+    int particleInitLevel;
+    int numberOfParticles;
+    real startXHotWall;
+    real endXHotWall;
+    std::vector<std::string> possNeighborFilesX;
+    std::vector<std::string> possNeighborFilesY;
+    std::vector<std::string> possNeighborFilesZ;
+    // std::vector<std::string> possNeighborFilesX;
+    // std::vector<std::string> possNeighborFilesY;
+    // std::vector<std::string> possNeighborFilesZ;
+    int timeDoCheckPoint;
+    int timeDoRestart;
+    bool doCheckPoint;
+    bool doRestart;
+    int maxLevel;
+    std::vector<int> gridX;
+    std::vector<int> gridY;
+    std::vector<int> gridZ;
+    std::vector<int> distX;
+    std::vector<int> distY;
+    std::vector<int> distZ;
+    std::vector<bool> needInterface;
+    std::string mainKernel;
+    bool multiKernelOn;
+    std::vector<int> multiKernelLevel;
+    std::vector<std::string> multiKernelName;
 
+    bool isViscosity;
+    bool isNumberOfDevices;
+    bool isDevices;
+    bool isOutputPath;
+    bool isPrefix;
+    bool isGridPath;
+    bool isPrintOutputFiles;
+    bool isGeometryValues;
+    bool isCalc2ndOrderMoments;
+    bool isCalc3rdOrderMoments;
+    bool isCalcHighOrderMoments;
+    bool isReadGeo;
+    bool isCalcMedian;
+    bool isCalcDragLift;
+    bool isCalcCp;
+    bool isWriteVeloASCII;
+    bool isCalcPlaneConc;
+    bool isConcFile;
+    bool isStreetVelocityFile;
+    bool isUseMeasurePoints;
+    bool isUseWale;
+    bool isUseInitNeq;
+    bool isSimulatePorousMedia;
+    bool isD3Qxx;
+    bool isTEnd;
+    bool isTOut;
+    bool isTStartOut;
+    bool isTimeCalcMedStart;
+    bool isTimeCalcMedEnd;
+    bool isPressInID;
+    bool isPressOutID;
+    bool isPressInZ;
+    bool isPressOutZ;
+    bool isDiffOn;
+    bool isDiffMod;
+    bool isDiffusivity;
+    bool isTemperatureInit;
+    bool isTemperatureBC;
+    // bool isViscosity;
+    bool isVelocity;
+    bool isViscosityRatio;
+    bool isVelocityRatio;
+    bool isDensityRatio;
+    bool isPressRatio;
+    bool isRealX;
+    bool isRealY;
+    bool isFactorPressBC;
+    bool isGeometryFileC;
+    bool isGeometryFileM;
+    bool isGeometryFileF;
+    bool isClockCycleForMP;
+    bool isTimestepForMP;
+    bool isForcingX;
+    bool isForcingY;
+    bool isForcingZ;
+    bool isQuadricLimiterP;
+    bool isQuadricLimiterM;
+    bool isQuadricLimiterD;
+    bool isCalcParticles;
+    bool isParticleBasicLevel;
+    bool isParticleInitLevel;
+    bool isNumberOfParticles;
+    bool isNeighborWSB;
+    bool isStartXHotWall;
+    bool isEndXHotWall;
+    bool isPossNeighborFilesX;
+    bool isPossNeighborFilesY;
+    bool isPossNeighborFilesZ;
+    bool isTimeDoCheckPoint;
+    bool isTimeDoRestart;
+    bool isDoCheckPoint;
+    bool isDoRestart;
+    bool isMaxLevel;
+    bool isGridX;
+    bool isGridY;
+    bool isGridZ;
+    bool isDistX;
+    bool isDistY;
+    bool isDistZ;
+    bool isNeedInterface;
+    bool isMainKernel;
+    bool isMultiKernelOn;
+    bool isMultiKernelLevel;
+    bool isMultiKernelName;
 };
 #endif
diff --git a/src/basics/Core/Input/ConfigFileReader/ConfigFileReader.cpp b/src/basics/Core/Input/ConfigFileReader/ConfigFileReader.cpp
index 4bdf8669b1ed481e64d1059d1479f05cae7e164d..dce44b5551d2aedcf0c0d70a21dbcd9e8b071c8d 100644
--- a/src/basics/Core/Input/ConfigFileReader/ConfigFileReader.cpp
+++ b/src/basics/Core/Input/ConfigFileReader/ConfigFileReader.cpp
@@ -1,275 +1,265 @@
 #include "ConfigFileReader.h"
+#include "../../StringUtilities/StringUtil.h"
 #include "../ConfigData/ConfigDataImp.h"
 #include "../Input.h"
-#include "../../StringUtilities/StringUtil.h"
 
-#include <iostream>
 #include <fstream>
-
+#include <iostream>
 
 BASICS_EXPORT std::shared_ptr<ConfigFileReader> ConfigFileReader::getNewInstance()
 {
-	return std::shared_ptr<ConfigFileReader>(new ConfigFileReader());
+    return std::shared_ptr<ConfigFileReader>(new ConfigFileReader());
 }
 
-ConfigFileReader::ConfigFileReader()
-= default;
+ConfigFileReader::ConfigFileReader() = default;
 
-BASICS_EXPORT ConfigFileReader::~ConfigFileReader()
-= default;
+BASICS_EXPORT ConfigFileReader::~ConfigFileReader() = default;
 
 BASICS_EXPORT std::shared_ptr<ConfigData> ConfigFileReader::readConfigFile(const std::string &filePath) const
 {
-	std::shared_ptr<ConfigDataImp> data = ConfigDataImp::getNewInstance();
-	std::ifstream stream;
-	stream.open(filePath.c_str(), std::ios::in);
-	if (stream.fail())
-		throw std::runtime_error("can not open config file!"); 
-	std::unique_ptr<input::Input> input = input::Input::makeInput(stream, "config");
-
-	if (input->getValue("NumberOfDevices") != "")
-		data->setNumberOfDevices(StringUtil::toInt(input->getValue("NumberOfDevices")));
-
-	if (input->getValue("Devices") != "")
-		data->setDevices(StringUtil::toUintVector(input->getValue("Devices")));
-
-	if (input->getValue("Path") != "")
-		data->setOutputPath(input->getValue("Path"));
+    std::shared_ptr<ConfigDataImp> data = ConfigDataImp::getNewInstance();
+    std::ifstream stream;
+    stream.open(filePath.c_str(), std::ios::in);
+    if (stream.fail())
+        throw std::runtime_error("can not open config file!");
+    std::unique_ptr<input::Input> input = input::Input::makeInput(stream, "config");
 
-	if (input->getValue("Prefix") != "")
-		data->setPrefix(input->getValue("Prefix"));
+    if (input->getValue("NumberOfDevices") != "")
+        data->setNumberOfDevices(StringUtil::toInt(input->getValue("NumberOfDevices")));
 
-	if (input->getValue("GridPath") != "")
-		data->setGridPath(input->getValue("GridPath"));
-	else
-	{
-		std::cout << "GridPath has to be defined!" << std::endl;
-		exit(1);
-	}
+    if (input->getValue("Devices") != "")
+        data->setDevices(StringUtil::toUintVector(input->getValue("Devices")));
 
+    if (input->getValue("Path") != "")
+        data->setOutputPath(input->getValue("Path"));
 
-	if (input->getValue("WriteGrid") != "")
-		data->setPrintOutputFiles(StringUtil::toBool(input->getValue("WriteGrid")));
+    if (input->getValue("Prefix") != "")
+        data->setPrefix(input->getValue("Prefix"));
 
-	if (input->getValue("GeometryValues") != "")
-		data->setGeometryValues(StringUtil::toBool(input->getValue("GeometryValues")));
+    if (input->getValue("GridPath") != "")
+        data->setGridPath(input->getValue("GridPath"));
+    else {
+        std::cout << "GridPath has to be defined!" << std::endl;
+        exit(1);
+    }
 
-	if (input->getValue("calc2ndOrderMoments") != "")
-		data->setCalc2ndOrderMoments(StringUtil::toBool(input->getValue("calc2ndOrderMoments")));
+    if (input->getValue("WriteGrid") != "")
+        data->setPrintOutputFiles(StringUtil::toBool(input->getValue("WriteGrid")));
 
-	if (input->getValue("calc3rdOrderMoments") != "")
-		data->setCalc3rdOrderMoments(StringUtil::toBool(input->getValue("calc3rdOrderMoments")));
+    if (input->getValue("GeometryValues") != "")
+        data->setGeometryValues(StringUtil::toBool(input->getValue("GeometryValues")));
 
-	if (input->getValue("calcHigherOrderMoments") != "")
-		data->setCalcHighOrderMoments(StringUtil::toBool(input->getValue("calcHigherOrderMoments")));
+    if (input->getValue("calc2ndOrderMoments") != "")
+        data->setCalc2ndOrderMoments(StringUtil::toBool(input->getValue("calc2ndOrderMoments")));
 
-	if (input->getValue("ReadGeometry") != "")
-		data->setReadGeo(StringUtil::toBool(input->getValue("ReadGeometry")));
+    if (input->getValue("calc3rdOrderMoments") != "")
+        data->setCalc3rdOrderMoments(StringUtil::toBool(input->getValue("calc3rdOrderMoments")));
 
-	if (input->getValue("calcMedian") != "")
-		data->setCalcMedian(StringUtil::toBool(input->getValue("calcMedian")));
+    if (input->getValue("calcHigherOrderMoments") != "")
+        data->setCalcHighOrderMoments(StringUtil::toBool(input->getValue("calcHigherOrderMoments")));
 
-	if (input->getValue("UseConcFile") != "")
-		data->setConcFile(StringUtil::toBool(input->getValue("UseConcFile")));
+    if (input->getValue("ReadGeometry") != "")
+        data->setReadGeo(StringUtil::toBool(input->getValue("ReadGeometry")));
 
-	if (input->getValue("UseStreetVelocityFile") != "")
-		data->setStreetVelocityFile(StringUtil::toBool(input->getValue("UseStreetVelocityFile")));
+    if (input->getValue("calcMedian") != "")
+        data->setCalcMedian(StringUtil::toBool(input->getValue("calcMedian")));
 
-	if (input->getValue("UseMeasurePoints") != "")
-		data->setUseMeasurePoints(StringUtil::toBool(input->getValue("UseMeasurePoints")));
+    if (input->getValue("UseConcFile") != "")
+        data->setConcFile(StringUtil::toBool(input->getValue("UseConcFile")));
 
-	if (input->getValue("UseWale") != "")
-		data->setUseWale(StringUtil::toBool(input->getValue("UseWale")));
+    if (input->getValue("UseStreetVelocityFile") != "")
+        data->setStreetVelocityFile(StringUtil::toBool(input->getValue("UseStreetVelocityFile")));
 
-	if (input->getValue("UseInitNeq") != "")
-		data->setUseInitNeq(StringUtil::toBool(input->getValue("UseInitNeq")));
+    if (input->getValue("UseMeasurePoints") != "")
+        data->setUseMeasurePoints(StringUtil::toBool(input->getValue("UseMeasurePoints")));
 
-	if (input->getValue("SimulatePorousMedia") != "")
-		data->setSimulatePorousMedia(StringUtil::toBool(input->getValue("SimulatePorousMedia")));
+    if (input->getValue("UseWale") != "")
+        data->setUseWale(StringUtil::toBool(input->getValue("UseWale")));
 
-	if (input->getValue("D3Qxx") != "")
-		data->setD3Qxx(StringUtil::toInt(input->getValue("D3Qxx")));
+    if (input->getValue("UseInitNeq") != "")
+        data->setUseInitNeq(StringUtil::toBool(input->getValue("UseInitNeq")));
 
-	if (input->getValue("TimeEnd") != "")
-		data->setTEnd(StringUtil::toInt(input->getValue("TimeEnd")));
+    if (input->getValue("SimulatePorousMedia") != "")
+        data->setSimulatePorousMedia(StringUtil::toBool(input->getValue("SimulatePorousMedia")));
 
-	if (input->getValue("TimeOut") != "")
-		data->setTOut(StringUtil::toInt(input->getValue("TimeOut")));
-	
-	if (input->getValue("TimeStartOut") != "")
-		data->setTStartOut(StringUtil::toInt(input->getValue("TimeStartOut")));
+    if (input->getValue("D3Qxx") != "")
+        data->setD3Qxx(StringUtil::toInt(input->getValue("D3Qxx")));
 
-	if (input->getValue("TimeStartCalcMedian") != "")
-		data->setTimeCalcMedStart(StringUtil::toInt(input->getValue("TimeStartCalcMedian")));
+    if (input->getValue("TimeEnd") != "")
+        data->setTEnd(StringUtil::toInt(input->getValue("TimeEnd")));
 
-	if (input->getValue("TimeEndCalcMedian") != "")
-		data->setTimeCalcMedEnd(StringUtil::toInt(input->getValue("TimeEndCalcMedian")));
+    if (input->getValue("TimeOut") != "")
+        data->setTOut(StringUtil::toInt(input->getValue("TimeOut")));
 
-	if (input->getValue("PressInID") != "")
-		data->setPressInID(StringUtil::toInt(input->getValue("PressInID")));
+    if (input->getValue("TimeStartOut") != "")
+        data->setTStartOut(StringUtil::toInt(input->getValue("TimeStartOut")));
 
-	if (input->getValue("PressOutID") != "")
-		data->setPressOutID(StringUtil::toInt(input->getValue("PressOutID")));
+    if (input->getValue("TimeStartCalcMedian") != "")
+        data->setTimeCalcMedStart(StringUtil::toInt(input->getValue("TimeStartCalcMedian")));
 
-	if (input->getValue("PressInZ") != "")
-		data->setPressInZ(StringUtil::toInt(input->getValue("PressInZ")));
+    if (input->getValue("TimeEndCalcMedian") != "")
+        data->setTimeCalcMedEnd(StringUtil::toInt(input->getValue("TimeEndCalcMedian")));
 
-	if (input->getValue("PressOutZ") != "")
-		data->setPressOutZ(StringUtil::toInt(input->getValue("PressOutZ")));
-	//////////////////////////////////////////////////////////////////////////
-	if (input->getValue("DiffOn") != "")
-		data->setDiffOn(StringUtil::toBool(input->getValue("DiffOn")));
+    if (input->getValue("PressInID") != "")
+        data->setPressInID(StringUtil::toInt(input->getValue("PressInID")));
 
-	if (input->getValue("DiffMod") != "")
-		data->setDiffMod(StringUtil::toInt(input->getValue("DiffMod")));
+    if (input->getValue("PressOutID") != "")
+        data->setPressOutID(StringUtil::toInt(input->getValue("PressOutID")));
 
-	if (input->getValue("Diffusivity") != "")
-		data->setDiffusivity(StringUtil::toFloat(input->getValue("Diffusivity")));
+    if (input->getValue("PressInZ") != "")
+        data->setPressInZ(StringUtil::toInt(input->getValue("PressInZ")));
 
-	if (input->getValue("Temp") != "")
-		data->setTemperatureInit(StringUtil::toFloat(input->getValue("Temp")));
+    if (input->getValue("PressOutZ") != "")
+        data->setPressOutZ(StringUtil::toInt(input->getValue("PressOutZ")));
+    //////////////////////////////////////////////////////////////////////////
+    if (input->getValue("DiffOn") != "")
+        data->setDiffOn(StringUtil::toBool(input->getValue("DiffOn")));
 
-	if (input->getValue("TempBC") != "")
-		data->setTemperatureBC(StringUtil::toFloat(input->getValue("TempBC")));
-	//////////////////////////////////////////////////////////////////////////
-	if (input->getValue("Viscosity_LB") != "")
-		data->setViscosity(StringUtil::toFloat(input->getValue("Viscosity_LB")));
+    if (input->getValue("DiffMod") != "")
+        data->setDiffMod(StringUtil::toInt(input->getValue("DiffMod")));
 
-	if (input->getValue("Velocity_LB") != "")
-		data->setVelocity(StringUtil::toFloat(input->getValue("Velocity_LB")));
+    if (input->getValue("Diffusivity") != "")
+        data->setDiffusivity(StringUtil::toFloat(input->getValue("Diffusivity")));
 
-	if (input->getValue("Viscosity_Ratio_World_to_LB") != "")
-		data->setViscosityRatio(StringUtil::toFloat(input->getValue("Viscosity_Ratio_World_to_LB")));
+    if (input->getValue("Temp") != "")
+        data->setTemperatureInit(StringUtil::toFloat(input->getValue("Temp")));
 
-	if (input->getValue("Velocity_Ratio_World_to_LB") != "")
-		data->setVelocityRatio(StringUtil::toFloat(input->getValue("Velocity_Ratio_World_to_LB")));
+    if (input->getValue("TempBC") != "")
+        data->setTemperatureBC(StringUtil::toFloat(input->getValue("TempBC")));
+    //////////////////////////////////////////////////////////////////////////
+    if (input->getValue("Viscosity_LB") != "")
+        data->setViscosity(StringUtil::toFloat(input->getValue("Viscosity_LB")));
 
-	if (input->getValue("Density_Ratio_World_to_LB") != "")
-		data->setDensityRatio(StringUtil::toFloat(input->getValue("Density_Ratio_World_to_LB")));
+    if (input->getValue("Velocity_LB") != "")
+        data->setVelocity(StringUtil::toFloat(input->getValue("Velocity_LB")));
 
-	if (input->getValue("Delta_Press") != "")
-		data->setPressRatio(StringUtil::toFloat(input->getValue("Delta_Press")));
+    if (input->getValue("Viscosity_Ratio_World_to_LB") != "")
+        data->setViscosityRatio(StringUtil::toFloat(input->getValue("Viscosity_Ratio_World_to_LB")));
 
-	if (input->getValue("SliceRealX") != "")
-		data->setRealX(StringUtil::toFloat(input->getValue("SliceRealX")));
+    if (input->getValue("Velocity_Ratio_World_to_LB") != "")
+        data->setVelocityRatio(StringUtil::toFloat(input->getValue("Velocity_Ratio_World_to_LB")));
 
-	if (input->getValue("SliceRealY") != "")
-		data->setRealY(StringUtil::toFloat(input->getValue("SliceRealY")));
+    if (input->getValue("Density_Ratio_World_to_LB") != "")
+        data->setDensityRatio(StringUtil::toFloat(input->getValue("Density_Ratio_World_to_LB")));
 
-	if (input->getValue("FactorPressBC") != "")
-		data->setFactorPressBC(StringUtil::toFloat(input->getValue("FactorPressBC")));
+    if (input->getValue("Delta_Press") != "")
+        data->setPressRatio(StringUtil::toFloat(input->getValue("Delta_Press")));
 
-	if (input->getValue("GeometryC") != "")
-		data->setGeometryFileC(input->getValue("GeometryC"));
+    if (input->getValue("SliceRealX") != "")
+        data->setRealX(StringUtil::toFloat(input->getValue("SliceRealX")));
 
-	if (input->getValue("GeometryM") != "")
-		data->setGeometryFileM(input->getValue("GeometryM"));
+    if (input->getValue("SliceRealY") != "")
+        data->setRealY(StringUtil::toFloat(input->getValue("SliceRealY")));
 
-	if (input->getValue("GeometryF") != "")
-		data->setGeometryFileF(input->getValue("GeometryF"));
-	//////////////////////////////////////////////////////////////////////////
-	if (input->getValue("measureClockCycle") != "")
-		data->setClockCycleForMP(StringUtil::toInt(input->getValue("measureClockCycle")));
+    if (input->getValue("FactorPressBC") != "")
+        data->setFactorPressBC(StringUtil::toFloat(input->getValue("FactorPressBC")));
 
-	if (input->getValue("measureTimestep") != "")
-		data->setTimestepForMP(StringUtil::toInt(input->getValue("measureTimestep")));
-	//////////////////////////////////////////////////////////////////////////
-	//Forcing
-	if (input->getValue("ForcingX") != "")
-		data->setForcingX(StringUtil::toFloat(input->getValue("ForcingX")));
-	if (input->getValue("ForcingY") != "")
-		data->setForcingY(StringUtil::toFloat(input->getValue("ForcingY")));
-	if (input->getValue("ForcingZ") != "")
-		data->setForcingZ(StringUtil::toFloat(input->getValue("ForcingZ")));
-	//////////////////////////////////////////////////////////////////////////
-	//Quadric Limiters
-	if (input->getValue("QuadricLimiterP") != "")
-		data->setQuadricLimiterP(StringUtil::toFloat(input->getValue("QuadricLimiterP")));
-	if (input->getValue("QuadricLimiterM") != "")
-		data->setQuadricLimiterM(StringUtil::toFloat(input->getValue("QuadricLimiterM")));
-	if (input->getValue("QuadricLimiterD") != "")
-		data->setQuadricLimiterD(StringUtil::toFloat(input->getValue("QuadricLimiterD")));
-	//////////////////////////////////////////////////////////////////////////
-	//Particles
-	if (input->getValue("calcParticles") != "")
-		data->setCalcParticles(StringUtil::toBool(input->getValue("calcParticles")));
+    if (input->getValue("GeometryC") != "")
+        data->setGeometryFileC(input->getValue("GeometryC"));
 
-	if (input->getValue("baseLevel") != "")
-		data->setParticleBasicLevel(StringUtil::toInt(input->getValue("baseLevel")));
+    if (input->getValue("GeometryM") != "")
+        data->setGeometryFileM(input->getValue("GeometryM"));
 
-	if (input->getValue("initLevel") != "")
-		data->setParticleInitLevel(StringUtil::toInt(input->getValue("initLevel")));
+    if (input->getValue("GeometryF") != "")
+        data->setGeometryFileF(input->getValue("GeometryF"));
+    //////////////////////////////////////////////////////////////////////////
+    if (input->getValue("measureClockCycle") != "")
+        data->setClockCycleForMP(StringUtil::toInt(input->getValue("measureClockCycle")));
 
-	if (input->getValue("numberOfParticles") != "")
-		data->setNumberOfParticles(StringUtil::toInt(input->getValue("numberOfParticles")));
+    if (input->getValue("measureTimestep") != "")
+        data->setTimestepForMP(StringUtil::toInt(input->getValue("measureTimestep")));
+    //////////////////////////////////////////////////////////////////////////
+    // Forcing
+    if (input->getValue("ForcingX") != "")
+        data->setForcingX(StringUtil::toFloat(input->getValue("ForcingX")));
+    if (input->getValue("ForcingY") != "")
+        data->setForcingY(StringUtil::toFloat(input->getValue("ForcingY")));
+    if (input->getValue("ForcingZ") != "")
+        data->setForcingZ(StringUtil::toFloat(input->getValue("ForcingZ")));
+    //////////////////////////////////////////////////////////////////////////
+    // Quadric Limiters
+    if (input->getValue("QuadricLimiterP") != "")
+        data->setQuadricLimiterP(StringUtil::toFloat(input->getValue("QuadricLimiterP")));
+    if (input->getValue("QuadricLimiterM") != "")
+        data->setQuadricLimiterM(StringUtil::toFloat(input->getValue("QuadricLimiterM")));
+    if (input->getValue("QuadricLimiterD") != "")
+        data->setQuadricLimiterD(StringUtil::toFloat(input->getValue("QuadricLimiterD")));
+    //////////////////////////////////////////////////////////////////////////
+    // Particles
+    if (input->getValue("calcParticles") != "")
+        data->setCalcParticles(StringUtil::toBool(input->getValue("calcParticles")));
 
-	if (input->getValue("startXHotWall") != "")
-		data->setStartXHotWall(real(StringUtil::toDouble(input->getValue("startXHotWall"))));
-
-	if (input->getValue("endXHotWall") != "")
-		data->setEndXHotWall(real(StringUtil::toDouble(input->getValue("endXHotWall"))));
-	////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-	//Restart
-	if (input->getValue("TimeDoCheckPoint") != "")
-		data->setTimeDoCheckPoint(StringUtil::toInt(input->getValue("TimeDoCheckPoint")));
-
-	if (input->getValue("TimeDoRestart") != "")
-		data->setTimeDoRestart(StringUtil::toInt(input->getValue("TimeDoRestart")));
-
-	if (input->getValue("DoCheckPoint") != "")
-		data->setDoCheckPoint(StringUtil::toBool(input->getValue("DoCheckPoint")));
-
-	if (input->getValue("DoRestart") != "")
-		data->setDoRestart(StringUtil::toBool(input->getValue("DoRestart")));
-	////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-	if (input->getValue("NOGL") != "")
-		data->setMaxLevel(StringUtil::toInt(input->getValue("NOGL")));
-
-	if (input->getValue("GridX") != "")
-		data->setGridX(StringUtil::toIntVector(input->getValue("GridX")));
-
-	if (input->getValue("GridY") != "")
-		data->setGridY(StringUtil::toIntVector(input->getValue("GridY")));
-
-	if (input->getValue("GridZ") != "")
-		data->setGridZ(StringUtil::toIntVector(input->getValue("GridZ")));
-
-	if (input->getValue("DistX") != "")
-		data->setDistX(StringUtil::toIntVector(input->getValue("DistX")));
-
-	if (input->getValue("DistY") != "")
-		data->setDistY(StringUtil::toIntVector(input->getValue("DistY")));
-
-	if (input->getValue("DistZ") != "")
-		data->setDistZ(StringUtil::toIntVector(input->getValue("DistZ")));
-
-	if (input->getValue("NeedInterface") != "")
-		data->setNeedInterface(StringUtil::toBoolVector(input->getValue("NeedInterface")));
-	////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-	// Kernel
-	if (input->getValue("MainKernelName") != "")
-		data->setMainKernel(input->getValue("MainKernelName"));
-
-	if (input->getValue("MultiKernelOn") != "")
-		data->setMultiKernelOn(StringUtil::toBool(input->getValue("MultiKernelOn")));
-
-	if (input->getValue("MultiKernelLevel") != "")
-		data->setMultiKernelLevel(StringUtil::toIntVector(input->getValue("MultiKernelLevel")));
-
-	if (input->getValue("MultiKernelName") != "")
-		data->setMultiKernelName(StringUtil::toStringVector(input->getValue("MultiKernelName")));
-
-	if (StringUtil::toStringVector(input->getValue("MultiKernelName")).size() != StringUtil::toIntVector(input->getValue("MultiKernelLevel")).size())
-	{
-		std::cout << "MultiKernelName and MultiKernelLevel has to be of same size!" << std::endl;
-		exit(1);
-	}
-	////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
-	return data;
+    if (input->getValue("baseLevel") != "")
+        data->setParticleBasicLevel(StringUtil::toInt(input->getValue("baseLevel")));
 
+    if (input->getValue("initLevel") != "")
+        data->setParticleInitLevel(StringUtil::toInt(input->getValue("initLevel")));
+
+    if (input->getValue("numberOfParticles") != "")
+        data->setNumberOfParticles(StringUtil::toInt(input->getValue("numberOfParticles")));
+
+    if (input->getValue("startXHotWall") != "")
+        data->setStartXHotWall(real(StringUtil::toDouble(input->getValue("startXHotWall"))));
+
+    if (input->getValue("endXHotWall") != "")
+        data->setEndXHotWall(real(StringUtil::toDouble(input->getValue("endXHotWall"))));
+    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+    // Restart
+    if (input->getValue("TimeDoCheckPoint") != "")
+        data->setTimeDoCheckPoint(StringUtil::toInt(input->getValue("TimeDoCheckPoint")));
+
+    if (input->getValue("TimeDoRestart") != "")
+        data->setTimeDoRestart(StringUtil::toInt(input->getValue("TimeDoRestart")));
+
+    if (input->getValue("DoCheckPoint") != "")
+        data->setDoCheckPoint(StringUtil::toBool(input->getValue("DoCheckPoint")));
+
+    if (input->getValue("DoRestart") != "")
+        data->setDoRestart(StringUtil::toBool(input->getValue("DoRestart")));
+    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+    if (input->getValue("NOGL") != "")
+        data->setMaxLevel(StringUtil::toInt(input->getValue("NOGL")));
+
+    if (input->getValue("GridX") != "")
+        data->setGridX(StringUtil::toIntVector(input->getValue("GridX")));
+
+    if (input->getValue("GridY") != "")
+        data->setGridY(StringUtil::toIntVector(input->getValue("GridY")));
+
+    if (input->getValue("GridZ") != "")
+        data->setGridZ(StringUtil::toIntVector(input->getValue("GridZ")));
+
+    if (input->getValue("DistX") != "")
+        data->setDistX(StringUtil::toIntVector(input->getValue("DistX")));
+
+    if (input->getValue("DistY") != "")
+        data->setDistY(StringUtil::toIntVector(input->getValue("DistY")));
+
+    if (input->getValue("DistZ") != "")
+        data->setDistZ(StringUtil::toIntVector(input->getValue("DistZ")));
+
+    if (input->getValue("NeedInterface") != "")
+        data->setNeedInterface(StringUtil::toBoolVector(input->getValue("NeedInterface")));
+    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+    // Kernel
+    if (input->getValue("MainKernelName") != "")
+        data->setMainKernel(input->getValue("MainKernelName"));
+
+    if (input->getValue("MultiKernelOn") != "")
+        data->setMultiKernelOn(StringUtil::toBool(input->getValue("MultiKernelOn")));
+
+    if (input->getValue("MultiKernelLevel") != "")
+        data->setMultiKernelLevel(StringUtil::toIntVector(input->getValue("MultiKernelLevel")));
+
+    if (input->getValue("MultiKernelName") != "")
+        data->setMultiKernelName(StringUtil::toStringVector(input->getValue("MultiKernelName")));
+
+    if (StringUtil::toStringVector(input->getValue("MultiKernelName")).size() !=
+        StringUtil::toIntVector(input->getValue("MultiKernelLevel")).size()) {
+        std::cout << "MultiKernelName and MultiKernelLevel has to be of same size!" << std::endl;
+        exit(1);
+    }
+    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+    return data;
 }
-
-
-
-
diff --git a/src/basics/Core/Input/ConfigFileReader/ConfigFileReader.h b/src/basics/Core/Input/ConfigFileReader/ConfigFileReader.h
index 6dd241967652c9246640458e4fd1283766c32701..9d88dfce6a7337d8ffaa7c4ffe43a4fd63949914 100644
--- a/src/basics/Core/Input/ConfigFileReader/ConfigFileReader.h
+++ b/src/basics/Core/Input/ConfigFileReader/ConfigFileReader.h
@@ -7,7 +7,7 @@
 
 class ConfigData;
 
-class  ConfigFileReader
+class ConfigFileReader
 {
 public:
     BASICS_EXPORT static std::shared_ptr<ConfigFileReader> getNewInstance();
@@ -16,6 +16,6 @@ public:
     BASICS_EXPORT std::shared_ptr<ConfigData> readConfigFile(const std::string &filePath) const;
 
 private:
-	ConfigFileReader();
+    ConfigFileReader();
 };
 #endif
diff --git a/src/basics/Core/Input/ConfigInput/ConfigInput.cpp b/src/basics/Core/Input/ConfigInput/ConfigInput.cpp
index d894bcc28bd179e0c63b0f2ddf26adc9c070de36..1fdff1e8794b5cb58f6b1a8a2e97a536531df829 100644
--- a/src/basics/Core/Input/ConfigInput/ConfigInput.cpp
+++ b/src/basics/Core/Input/ConfigInput/ConfigInput.cpp
@@ -1,263 +1,222 @@
 #include "ConfigInput.h"
-#include <cerrno>
 #include <algorithm>
-#include <sstream>
+#include <cerrno>
 #include <iostream>
+#include <sstream>
 #include <string>
 
 #define COMMENT '#'
 
 namespace input
 {
-    // Trim the given characters from the beginning and end of a string.
-    // the default is to trim whitespace. If the string is empty or contains
-    // only the trim characters, an empty string is returned.
-    std::string trim(const std::string &instring, const std::string &trimstring = std::string(" \t\n"))
-    {
-        if (trimstring.size() == 0)
-            return instring;
-        std::string temp = "";
-        std::string::size_type begpos = instring.find_first_not_of(trimstring);
-        if (begpos == std::string::npos)
-        {
-            return temp;
-        }
-        else
-        {
-            std::string::size_type endpos = instring.find_last_not_of(trimstring);
-            temp = instring.substr(begpos, endpos - begpos + 1);
-        }
+// Trim the given characters from the beginning and end of a string.
+// the default is to trim whitespace. If the string is empty or contains
+// only the trim characters, an empty string is returned.
+std::string trim(const std::string &instring, const std::string &trimstring = std::string(" \t\n"))
+{
+    if (trimstring.size() == 0)
+        return instring;
+    std::string temp              = "";
+    std::string::size_type begpos = instring.find_first_not_of(trimstring);
+    if (begpos == std::string::npos) {
         return temp;
+    } else {
+        std::string::size_type endpos = instring.find_last_not_of(trimstring);
+        temp                          = instring.substr(begpos, endpos - begpos + 1);
     }
+    return temp;
+}
 
-    ConfigInput::ConfigInput(std::istream &stream) : stream(stream)
-    {
-        while (!stream.eof())
-            this->setTokenValuePair();
-    }
+ConfigInput::ConfigInput(std::istream &stream) : stream(stream)
+{
+    while (!stream.eof())
+        this->setTokenValuePair();
+}
 
-    ConfigInput::~ConfigInput()
-    = default;
+ConfigInput::~ConfigInput() = default;
 
-    bool ConfigInput::hasValue(const std::string &key) const
-    {
-        bool valueFound = false;
-        std::string keyCopy = key;
-        this->makeLower(keyCopy);
-        if (configEntries.find(keyCopy.c_str()) != configEntries.end())
-            valueFound = true;
+bool ConfigInput::hasValue(const std::string &key) const
+{
+    bool valueFound     = false;
+    std::string keyCopy = key;
+    this->makeLower(keyCopy);
+    if (configEntries.find(keyCopy.c_str()) != configEntries.end())
+        valueFound = true;
 
-        return valueFound;
-    }
+    return valueFound;
+}
 
-    std::string ConfigInput::getValue(const std::string &key)
-    {
-        std::string keyCopy = key;
-        this->makeLower(keyCopy);
-        if (configEntries.find(keyCopy.c_str()) != configEntries.end())
-            return (*configEntries.find(keyCopy.c_str())).second;
-        return "";
-    }
+std::string ConfigInput::getValue(const std::string &key)
+{
+    std::string keyCopy = key;
+    this->makeLower(keyCopy);
+    if (configEntries.find(keyCopy.c_str()) != configEntries.end())
+        return (*configEntries.find(keyCopy.c_str())).second;
+    return "";
+}
 
-    //////////////////////////////////////////////////////////////////////////
-    //                        private methods                               //
-    //////////////////////////////////////////////////////////////////////////
+//////////////////////////////////////////////////////////////////////////
+//                        private methods                               //
+//////////////////////////////////////////////////////////////////////////
 
-    void ConfigInput::makeLower(std::string &value) const
-    {
-        for (size_t i = 0; i < value.size(); i++)
-            value[i] = tolower(value[i]);
-    }
+void ConfigInput::makeLower(std::string &value) const
+{
+    for (size_t i = 0; i < value.size(); i++)
+        value[i] = tolower(value[i]);
+}
 
-    void ConfigInput::setTokenValuePair()
-    {
-        this->eatWhiteAndComments(true);
+void ConfigInput::setTokenValuePair()
+{
+    this->eatWhiteAndComments(true);
 
-        std::string token;
-        if(!this->setToken(token))
-            return;
+    std::string token;
+    if (!this->setToken(token))
+        return;
 
-        std::string value;
-        this->setValue(value);
+    std::string value;
+    this->setValue(value);
 
-        configEntries.insert(String_Pair(token, value));
-    }
+    configEntries.insert(String_Pair(token, value));
+}
 
-    bool ConfigInput::setToken(std::string &token)
-    {
-        char tokenChar[1024];
-        bool foundEqualSign = false;
-        int charIndex = 0;
+bool ConfigInput::setToken(std::string &token)
+{
+    char tokenChar[1024];
+    bool foundEqualSign = false;
+    int charIndex       = 0;
 
-        this->findToken(foundEqualSign, tokenChar, charIndex);
+    this->findToken(foundEqualSign, tokenChar, charIndex);
 
-        if (!isToken(charIndex, foundEqualSign))
-            return false;
+    if (!isToken(charIndex, foundEqualSign))
+        return false;
 
-        this->nullTerminate(tokenChar, charIndex);
-        token = tokenChar;
-        makeLower(token);
-        return true;
-    }
+    this->nullTerminate(tokenChar, charIndex);
+    token = tokenChar;
+    makeLower(token);
+    return true;
+}
 
-    void ConfigInput::findToken(bool &foundEqualSign, char *token, int &i)
-    {
-        char ch;
-        while (!(stream.get(ch)).fail())
-        {
-            if ((ch != '\t'))
-            {
-                if ((ch == '=') || (ch == ' ') || (ch == '\n') || (ch == '\r') || (ch == '\t'))
-                {
-                    foundEqualSign = true;
-                    break;
-                }
-                token[i++] = ch;
+void ConfigInput::findToken(bool &foundEqualSign, char *token, int &i)
+{
+    char ch;
+    while (!(stream.get(ch)).fail()) {
+        if ((ch != '\t')) {
+            if ((ch == '=') || (ch == ' ') || (ch == '\n') || (ch == '\r') || (ch == '\t')) {
+                foundEqualSign = true;
+                break;
             }
+            token[i++] = ch;
         }
     }
+}
 
-
-    bool ConfigInput::isToken(int charIndex, bool foundEqualSign)
-    {
-        if (charIndex == 0)
-        {
-            configEntries.insert(String_Pair("", ""));
-            return false;
-        }
-
-        if (!foundEqualSign && !advanceToEqualSignOnLine())
-        {
-            configEntries.insert(String_Pair("", ""));
-            return false;
-        }
-        return true;
+bool ConfigInput::isToken(int charIndex, bool foundEqualSign)
+{
+    if (charIndex == 0) {
+        configEntries.insert(String_Pair("", ""));
+        return false;
     }
 
-    void ConfigInput::setValue(std::string &value)
-    {
-        int charIndex = 0;
-        char valueChar[1024];
-        this->findValue(charIndex, valueChar);
-
-        if (charIndex == 0)
-            value = "";
-        else
-        {
-            this->nullTerminate(valueChar, charIndex);
-            value = valueChar;
-            value = trim(value);
-            this->stripLeadingAndTrailingQuotes(value);
-        }
+    if (!foundEqualSign && !advanceToEqualSignOnLine()) {
+        configEntries.insert(String_Pair("", ""));
+        return false;
     }
+    return true;
+}
 
+void ConfigInput::setValue(std::string &value)
+{
+    int charIndex = 0;
+    char valueChar[1024];
+    this->findValue(charIndex, valueChar);
+
+    if (charIndex == 0)
+        value = "";
+    else {
+        this->nullTerminate(valueChar, charIndex);
+        value = valueChar;
+        value = trim(value);
+        this->stripLeadingAndTrailingQuotes(value);
+    }
+}
 
-    int ConfigInput::findValue(int &charIndex, char * value)
-    {
-        char ch;
-        char c = eatWhiteAndComments(false);
-        if (c != '\n')
-        {
-            charIndex = 0;
-            while (!(stream.get(ch)).fail())
-            {
-                if ((ch == '\t') || (ch == '\r') || (ch == '\n') || (ch == '#'))
-                {
-                    while (ch != '\n')
-                    {
-                        if (stream.get(ch).fail()) break;
-                    }
-                    break;
-                }
-                else
-                {
-                    value[charIndex++] = ch;
+int ConfigInput::findValue(int &charIndex, char *value)
+{
+    char ch;
+    char c = eatWhiteAndComments(false);
+    if (c != '\n') {
+        charIndex = 0;
+        while (!(stream.get(ch)).fail()) {
+            if ((ch == '\t') || (ch == '\r') || (ch == '\n') || (ch == '#')) {
+                while (ch != '\n') {
+                    if (stream.get(ch).fail())
+                        break;
                 }
+                break;
+            } else {
+                value[charIndex++] = ch;
             }
-        }       
-        return charIndex;
+        }
     }
+    return charIndex;
+}
 
+void ConfigInput::stripLeadingAndTrailingQuotes(std::string &m_value)
+{
+    if (m_value[0] == '"')
+        m_value = m_value.substr(1);
+    if (m_value[m_value.length() - 1] == '"')
+        m_value = m_value.substr(0, m_value.length() - 1);
+}
 
+void ConfigInput::nullTerminate(char *value, int &i) { value[i++] = '\0'; }
 
-    void ConfigInput::stripLeadingAndTrailingQuotes(std::string &m_value)
-    {
-        if (m_value[0] == '"')
-            m_value = m_value.substr(1);
-        if (m_value[m_value.length() - 1] == '"')
-            m_value = m_value.substr(0, m_value.length() - 1);
-    }
-
-    void ConfigInput::nullTerminate(char *value, int &i)
-    {
-        value[i++] = '\0';
-    }
-
-    bool ConfigInput::advanceToEqualSignOnLine()
-    {
-        char ch;
-        bool foundEqual = false;
-        while (!(stream.get(ch)).fail())
-        {
-            if (isNewLine(ch) || isCarriageReturn(ch)) 
-                break;
-            if (isEqualSign(ch))
-            {
-                foundEqual = true;
-                break;
-            }
+bool ConfigInput::advanceToEqualSignOnLine()
+{
+    char ch;
+    bool foundEqual = false;
+    while (!(stream.get(ch)).fail()) {
+        if (isNewLine(ch) || isCarriageReturn(ch))
+            break;
+        if (isEqualSign(ch)) {
+            foundEqual = true;
+            break;
         }
-        return foundEqual;
     }
+    return foundEqual;
+}
 
-    char ConfigInput::eatWhiteAndComments(bool traverseNewlines)
-    {
-        char ch;
-        bool isComment = false;
-
-        while (!(stream.get(ch)).fail())
-        {
-            if (isCommentSign(ch))
-                isComment = true;
-            else if (isNewLine(ch))
-            {
-                isComment = false;
-                if (!traverseNewlines)
-                    return(ch);
-            }
-            else if (isRegularChar(isComment, ch))
-            {
-                stream.putback(ch);
-                return 0;
-            }
+char ConfigInput::eatWhiteAndComments(bool traverseNewlines)
+{
+    char ch;
+    bool isComment = false;
+
+    while (!(stream.get(ch)).fail()) {
+        if (isCommentSign(ch))
+            isComment = true;
+        else if (isNewLine(ch)) {
+            isComment = false;
+            if (!traverseNewlines)
+                return (ch);
+        } else if (isRegularChar(isComment, ch)) {
+            stream.putback(ch);
+            return 0;
         }
-        return 0;
-    }
-
-    bool ConfigInput::isRegularChar(bool isComment, char ch)
-    {
-        return (!isComment) && (ch != ' ') && (ch != '\t') && (ch != '\r');
     }
+    return 0;
+}
 
-    bool ConfigInput::isCommentSign(char ch)
-    {
-        return ch == COMMENT;
-    }
+bool ConfigInput::isRegularChar(bool isComment, char ch)
+{
+    return (!isComment) && (ch != ' ') && (ch != '\t') && (ch != '\r');
+}
 
-    bool ConfigInput::isEqualSign(char ch)
-    {
-        return ch == '=';
-    }
+bool ConfigInput::isCommentSign(char ch) { return ch == COMMENT; }
 
-    bool ConfigInput::isNewLine(char ch)
-    {
-        return ch == '\n';
-    }
+bool ConfigInput::isEqualSign(char ch) { return ch == '='; }
 
-    bool ConfigInput::isCarriageReturn(char ch)
-    {
-        return ch == '\r';
-    }
+bool ConfigInput::isNewLine(char ch) { return ch == '\n'; }
 
+bool ConfigInput::isCarriageReturn(char ch) { return ch == '\r'; }
 
-}
+} // namespace input
diff --git a/src/basics/Core/Input/ConfigInput/ConfigInput.h b/src/basics/Core/Input/ConfigInput/ConfigInput.h
index d01e1b8128366ad5bd4287937b8f7c5577237528..aee9242ca7cb63ac259fe27869c0d4f9d5036b05 100644
--- a/src/basics/Core/Input/ConfigInput/ConfigInput.h
+++ b/src/basics/Core/Input/ConfigInput/ConfigInput.h
@@ -1,48 +1,48 @@
 #ifndef ConfigInput_H
 #define ConfigInput_H
-#include <string>
-#include <vector>
 #include <istream>
-#include <memory>
-#include <map>
 #include <list>
+#include <map>
+#include <memory>
+#include <string>
+#include <vector>
 
-#include "basics_export.h"
 #include "../Input.h"
+#include "basics_export.h"
 
-namespace input 
+namespace input
+{
+class ConfigInput : public Input
 {
-    class  ConfigInput : public Input
-    {
-    public:
-        BASICS_EXPORT ConfigInput(std::istream &stream);
-        BASICS_EXPORT ~ConfigInput() override;
-   
-        BASICS_EXPORT bool hasValue(const std::string &key) const override;
-        BASICS_EXPORT std::string getValue(const std::string &key) override;
+public:
+    BASICS_EXPORT ConfigInput(std::istream &stream);
+    BASICS_EXPORT ~ConfigInput() override;
+
+    BASICS_EXPORT bool hasValue(const std::string &key) const override;
+    BASICS_EXPORT std::string getValue(const std::string &key) override;
 
-    protected:
-        virtual void setTokenValuePair();
-        void setValue(std::string &value);
-        bool setToken(std::string &token);
-        bool isToken(int charIndex, bool foundEqualSign);
-        int findValue(int &charIndex, char * value);
-        void stripLeadingAndTrailingQuotes(std::string &m_value);
-        void nullTerminate(char * token, int &i);
-        void findToken(bool &foundEqualSign, char * token, int &i);
-        char eatWhiteAndComments(bool traverse_newlines = true);
-        bool isRegularChar(bool isComment, char ch);
-        bool isNewLine(char ch);
-        bool isCommentSign(char ch);
-        bool advanceToEqualSignOnLine();
-        bool isCarriageReturn(char ch);
-        bool isEqualSign(char ch);
-        void makeLower(std::string &instring) const;
+protected:
+    virtual void setTokenValuePair();
+    void setValue(std::string &value);
+    bool setToken(std::string &token);
+    bool isToken(int charIndex, bool foundEqualSign);
+    int findValue(int &charIndex, char *value);
+    void stripLeadingAndTrailingQuotes(std::string &m_value);
+    void nullTerminate(char *token, int &i);
+    void findToken(bool &foundEqualSign, char *token, int &i);
+    char eatWhiteAndComments(bool traverse_newlines = true);
+    bool isRegularChar(bool isComment, char ch);
+    bool isNewLine(char ch);
+    bool isCommentSign(char ch);
+    bool advanceToEqualSignOnLine();
+    bool isCarriageReturn(char ch);
+    bool isEqualSign(char ch);
+    void makeLower(std::string &instring) const;
 
-    protected:
-        std::istream &stream;
-        using String_Pair = std::pair <std::string, std::string>;
-        std::map<std::string, std::string> configEntries;
-    };
-}
+protected:
+    std::istream &stream;
+    using String_Pair = std::pair<std::string, std::string>;
+    std::map<std::string, std::string> configEntries;
+};
+} // namespace input
 #endif
diff --git a/src/basics/Core/Input/Input.cpp b/src/basics/Core/Input/Input.cpp
index 4d2aee7de00d2e74727246f3720616a653aabc81..f971dd2260d97c28c6e84f60d9b0415eb971ea16 100644
--- a/src/basics/Core/Input/Input.cpp
+++ b/src/basics/Core/Input/Input.cpp
@@ -11,15 +11,14 @@
 namespace input
 {
 
-    std::unique_ptr<input::Input> Input::makeInput(std::istream &stream, const std::string & /*inputType*/)
-    {
+std::unique_ptr<input::Input> Input::makeInput(std::istream &stream, const std::string & /*inputType*/)
+{
 #ifdef BUILD_JSONCPP
-        if(inputType == "json")
-            return std::unique_ptr<Input>(new JsonInput(stream));
+    if (inputType == "json")
+        return std::unique_ptr<Input>(new JsonInput(stream));
 #endif
 
-        return std::make_unique<ConfigInput>(stream);
-    }
-
+    return std::make_unique<ConfigInput>(stream);
 }
 
+} // namespace input
diff --git a/src/basics/Core/Input/Input.h b/src/basics/Core/Input/Input.h
index 9c95e2a167139b9ba3bab2937ed5d666ba1e1022..3b07b8b32d99293c3216e1a14dc9df9fc9688bea 100644
--- a/src/basics/Core/Input/Input.h
+++ b/src/basics/Core/Input/Input.h
@@ -3,23 +3,22 @@
 
 #include "basics_export.h"
 
-
-#include <string>
-#include <memory>
 #include <istream>
+#include <memory>
+#include <string>
 
 namespace input
 {
-	class Input
-	{
-	public:
-        static BASICS_EXPORT std::unique_ptr<Input> makeInput(std::istream &stream, const std::string &inputType);
+class Input
+{
+public:
+    static BASICS_EXPORT std::unique_ptr<Input> makeInput(std::istream &stream, const std::string &inputType);
 
-        virtual ~Input() = default;
+    virtual ~Input() = default;
 
-        virtual bool hasValue(const std::string &key) const = 0;
-        virtual std::string getValue(const std::string &key) = 0;
-	};
-}
+    virtual bool hasValue(const std::string &key) const  = 0;
+    virtual std::string getValue(const std::string &key) = 0;
+};
+} // namespace input
 
 #endif
diff --git a/src/basics/Core/Input/JsonInput/JsonInput.cpp b/src/basics/Core/Input/JsonInput/JsonInput.cpp
index 9524e87ed3e069cac68658803ff8614b1f4ffec7..34a1d154a386d267c4d086e28b5f7e5f64c302cc 100644
--- a/src/basics/Core/Input/JsonInput/JsonInput.cpp
+++ b/src/basics/Core/Input/JsonInput/JsonInput.cpp
@@ -3,64 +3,65 @@
 #include "JsonInput.h"
 
 #include <fstream>
-#include <string>
+#include <iterator>
 #include <sstream>
+#include <string>
 #include <vector>
-#include <iterator>
 
 namespace input
 {
-    template<typename Out>
-    void split(const std::string &s, char delim, Out result) {
-        std::stringstream ss;
-        ss.str(s);
-        std::string item;
-        while (std::getline(ss, item, delim)) {
-            *(result++) = item;
-        }
-    }
-
-    std::vector<std::string> split(const std::string &s, char delim) {
-        std::vector<std::string> elems;
-        split(s, delim, std::back_inserter(elems));
-        return elems;
-    }
-
-    JsonInput::JsonInput(std::istream &stream)
-    {
-        Json::Reader reader;
-        reader.parse(stream, jsonValue);
+template <typename Out>
+void split(const std::string &s, char delim, Out result)
+{
+    std::stringstream ss;
+    ss.str(s);
+    std::string item;
+    while (std::getline(ss, item, delim)) {
+        *(result++) = item;
     }
+}
 
-    bool JsonInput::hasValue(const std::string &key) const
-    {
-        auto keys = split(key, ' ');
+std::vector<std::string> split(const std::string &s, char delim)
+{
+    std::vector<std::string> elems;
+    split(s, delim, std::back_inserter(elems));
+    return elems;
+}
 
-        if (keys.size() == 1 && !jsonValue[keys[0]].isNull())
-            return true;
-        else if (keys.size() == 2 && !jsonValue[keys[0]][keys[1]].isNull())
-            return true;
-        else if (keys.size() == 3 && !jsonValue[keys[0]][keys[1]][keys[2]].isNull())
-            return true;
-        else
-            return false;
-    }
+JsonInput::JsonInput(std::istream &stream)
+{
+    Json::Reader reader;
+    reader.parse(stream, jsonValue);
+}
 
-    std::string JsonInput::getValue(const std::string &key)
-    {
-        auto keys = split(key, ' ');
+bool JsonInput::hasValue(const std::string &key) const
+{
+    auto keys = split(key, ' ');
 
-        if(keys.size() == 1)
-            return jsonValue[keys[0]].asString();
-        else if (keys.size() == 2)
-            return jsonValue[keys[0]][keys[1]].asString();
-        else if (keys.size() == 3)
-            return jsonValue[keys[0]][keys[1]][keys[2]].asString();
-        else
-            return "";
-    }
+    if (keys.size() == 1 && !jsonValue[keys[0]].isNull())
+        return true;
+    else if (keys.size() == 2 && !jsonValue[keys[0]][keys[1]].isNull())
+        return true;
+    else if (keys.size() == 3 && !jsonValue[keys[0]][keys[1]][keys[2]].isNull())
+        return true;
+    else
+        return false;
+}
 
+std::string JsonInput::getValue(const std::string &key)
+{
+    auto keys = split(key, ' ');
 
+    if (keys.size() == 1)
+        return jsonValue[keys[0]].asString();
+    else if (keys.size() == 2)
+        return jsonValue[keys[0]][keys[1]].asString();
+    else if (keys.size() == 3)
+        return jsonValue[keys[0]][keys[1]][keys[2]].asString();
+    else
+        return "";
 }
 
+} // namespace input
+
 #endif
diff --git a/src/basics/Core/Input/JsonInput/JsonInput.h b/src/basics/Core/Input/JsonInput/JsonInput.h
index 5e1d81e688db6aeb514a3950d344f5f057c17119..8a33e99bfe2904caff82349caaf2579049892b15 100644
--- a/src/basics/Core/Input/JsonInput/JsonInput.h
+++ b/src/basics/Core/Input/JsonInput/JsonInput.h
@@ -3,31 +3,27 @@
 #ifndef JsonInput_H
 #define JsonInput_H
 
-
-#include <string>
 #include <json/json.h>
-
+#include <string>
 
 #include "basics_export.h"
 
-
 #include "../Input.h"
 
 namespace input
 {
-	class JsonInput : public Input
-	{
-	public:
-        BASICS_EXPORT JsonInput(std::istream &stream);
-
-        BASICS_EXPORT virtual bool hasValue(const std::string &key) const override;
-        BASICS_EXPORT virtual std::string getValue(const std::string &key) override;
+class JsonInput : public Input
+{
+public:
+    BASICS_EXPORT JsonInput(std::istream &stream);
 
-    private:
-        Json::Value jsonValue;
+    BASICS_EXPORT virtual bool hasValue(const std::string &key) const override;
+    BASICS_EXPORT virtual std::string getValue(const std::string &key) override;
 
-    };
-}
+private:
+    Json::Value jsonValue;
+};
+} // namespace input
 
 #endif
 
diff --git a/src/basics/Core/LbmOrGks.h b/src/basics/Core/LbmOrGks.h
index 96ef76a5a76cb029ab8aef7767574f18906c451a..ae4a17cad6488ee8ec95c19c3e3766abd408b0bf 100644
--- a/src/basics/Core/LbmOrGks.h
+++ b/src/basics/Core/LbmOrGks.h
@@ -1,28 +1,28 @@
 //=======================================================================================
-// ____          ____    __    ______     __________   __      __       __        __         
-// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |        
-//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |        
-//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |        
-//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____    
-//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|   
-//      \    \  |    |   ________________________________________________________________    
-//       \    \ |    |  |  ______________________________________________________________|   
-//        \    \|    |  |  |         __          __     __     __     ______      _______    
-//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)   
-//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______    
+// ____          ____    __    ______     __________   __      __       __        __
+// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |
+//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |
+//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |
+//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____
+//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|
+//      \    \  |    |   ________________________________________________________________
+//       \    \ |    |  |  ______________________________________________________________|
+//        \    \|    |  |  |         __          __     __     __     ______      _______
+//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)
+//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______
 //           \       |  |  |        |  |_____   |   \_/   |   |  |   |  |_/  /    _____  |
-//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/   
+//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/
 //
-//  This file is part of VirtualFluids. VirtualFluids is free software: you can 
+//  This file is part of VirtualFluids. VirtualFluids is free software: you can
 //  redistribute it and/or modify it under the terms of the GNU General Public
-//  License as published by the Free Software Foundation, either version 3 of 
+//  License as published by the Free Software Foundation, either version 3 of
 //  the License, or (at your option) any later version.
-//  
-//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT 
-//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
-//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License 
+//
+//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT
+//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 //  for more details.
-//  
+//
 //  You should have received a copy of the GNU General Public License along
 //  with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>.
 //
@@ -33,10 +33,6 @@
 #ifndef LBMORGKS_H
 #define LBMORGKS_H
 
-enum LbmOrGks
-{
-	LBM,
-	GKS
-};
+enum LbmOrGks { LBM, GKS };
 
 #endif
diff --git a/src/basics/Core/Logger/Logger.cpp b/src/basics/Core/Logger/Logger.cpp
index f7a9b2a1ec2ceb788840d918bbe08fff1e757795..6ee96cba58ad6a4c95e25792963027b2e53a4df7 100644
--- a/src/basics/Core/Logger/Logger.cpp
+++ b/src/basics/Core/Logger/Logger.cpp
@@ -1,86 +1,61 @@
 #include "Logger.h"
 //#include "mpi.h"
-#include <memory>
 #include <iostream>
+#include <memory>
 
 #include "implementations/LoggerImp.h"
 
+namespace logging
+{
 
+std::shared_ptr<Logger> out = nullptr;
 
-namespace logging {
-
-    std::shared_ptr<Logger> out = nullptr;
+logging::Logger::Level logging::Logger::globalLogLevel = logging::Logger::INFO_LOW;
+logging::Logger::Level logging::Logger::localLogLevel  = logging::Logger::INFO_LOW;
+bool logging::Logger::printRankNumber                  = false;
+bool logging::Logger::timeStampEnabled                 = false;
 
-    logging::Logger::Level logging::Logger::globalLogLevel = logging::Logger::INFO_LOW;
-    logging::Logger::Level logging::Logger::localLogLevel = logging::Logger::INFO_LOW;
-    bool logging::Logger::printRankNumber = false;
-    bool logging::Logger::timeStampEnabled = false;
-   
+logging::Logger::Logger(std::ostream *stream) { streams.push_back(stream); }
 
-    logging::Logger::Logger(std::ostream* stream)
-    {
-        streams.push_back(stream);
-    }
+logging::Logger::~Logger() = default;
 
-    logging::Logger::~Logger()
-    = default;
-
-    void Logger::addStreamToList(std::ostream* stream)
-    {
-        streams.push_back(stream);
-    }
-
-    void Logger::resetStreamList()
-    {
-        streams.clear();
-    }
+void Logger::addStreamToList(std::ostream *stream) { streams.push_back(stream); }
 
+void Logger::resetStreamList() { streams.clear(); }
 
 //-----------static methods----------------//
-    void logging::Logger::resetStreams()
-    {
-        if (!out)
-            out = std::make_shared<LoggerImp>(&std::cout);
+void logging::Logger::resetStreams()
+{
+    if (!out)
+        out = std::make_shared<LoggerImp>(&std::cout);
 
-        out->resetStreamList();
-    }
+    out->resetStreamList();
+}
 
-    void logging::Logger::setStream(std::ostream* stream)
-    {
-        out = std::make_shared<LoggerImp>(stream);
-    }
+void logging::Logger::setStream(std::ostream *stream) { out = std::make_shared<LoggerImp>(stream); }
 
-    void logging::Logger::addStream(std::ostream* stream)
-    {
-        if (!out)
-            out = std::make_shared<LoggerImp>(stream);
-        else
-            out->addStreamToList(stream);
-    }
+void logging::Logger::addStream(std::ostream *stream)
+{
+    if (!out)
+        out = std::make_shared<LoggerImp>(stream);
+    else
+        out->addStreamToList(stream);
+}
 
-    void logging::Logger::timeStamp(TimeStamp timeStamp)
-    {
-        switch(timeStamp)
-        {
+void logging::Logger::timeStamp(TimeStamp timeStamp)
+{
+    switch (timeStamp) {
         case ENABLE:
             timeStampEnabled = true;
             break;
         case DISABLE:
             timeStampEnabled = false;
             break;
-        }
     }
+}
 
+void logging::Logger::setDebugLevel(const Level &level) { globalLogLevel = level; }
 
+void logging::Logger::enablePrintedRankNumbers(bool print) { printRankNumber = print; }
 
-    void logging::Logger::setDebugLevel(const Level &level)
-    {
-        globalLogLevel = level;
-    }
-
-    void logging::Logger::enablePrintedRankNumbers(bool print)
-    {
-        printRankNumber = print;
-    }
-
-}
+} // namespace logging
diff --git a/src/basics/Core/Logger/Logger.h b/src/basics/Core/Logger/Logger.h
index fa8a00040b63a4c9c8063be91376f500e2c96ba0..d0cd91938868283ec7d13faa7439cf22d7c00729 100644
--- a/src/basics/Core/Logger/Logger.h
+++ b/src/basics/Core/Logger/Logger.h
@@ -3,68 +3,54 @@
 
 #include "basics_export.h"
 
-#include <string>
 #include <memory>
 #include <ostream>
+#include <string>
 #include <vector>
 
-namespace logging 
+namespace logging
 {
-    class BASICS_EXPORT Logger
-    {
-    protected:
-        Logger(std::ostream* stream);
-
-    public:
-        virtual ~Logger();
-
-		enum Level
-		{
-			INFO_LOW = 3,
-			INFO_INTERMEDIATE = 2,
-			INFO_HIGH = 1,
-			WARNING = 0,
-			LOGGER_ERROR = -1
-		};
-
-        enum TimeStamp
-        {
-            ENABLE,
-            DISABLE
-		};
+class BASICS_EXPORT Logger
+{
+protected:
+    Logger(std::ostream *stream);
 
-        static void setStream(std::ostream* stream);
-        static void addStream(std::ostream* stream);
-        static void resetStreams();
+public:
+    virtual ~Logger();
 
-        static void timeStamp(TimeStamp timeStamp);
+    enum Level { INFO_LOW = 3, INFO_INTERMEDIATE = 2, INFO_HIGH = 1, WARNING = 0, LOGGER_ERROR = -1 };
 
-        static void setDebugLevel(const Level &level = Level::LOGGER_ERROR);
-        static void enablePrintedRankNumbers(bool printRankNumbers);
+    enum TimeStamp { ENABLE, DISABLE };
 
-        virtual Logger& operator<<(const Level &level) = 0;
-        virtual Logger& operator<<(const std::string &log) = 0;
-        virtual Logger& operator<<(const int &log) = 0;
-        virtual Logger& operator<<(const unsigned int &log) = 0;
-        virtual Logger& operator<<(const unsigned long& log) = 0;
-        virtual Logger& operator<<(const float &log) = 0;
-        virtual Logger& operator<<(const double &log) = 0;
+    static void setStream(std::ostream *stream);
+    static void addStream(std::ostream *stream);
+    static void resetStreams();
 
-    protected:
-        void addStreamToList(std::ostream* stream);
-        void resetStreamList();
+    static void timeStamp(TimeStamp timeStamp);
 
-        std::vector<std::ostream*> streams;
+    static void setDebugLevel(const Level &level = Level::LOGGER_ERROR);
+    static void enablePrintedRankNumbers(bool printRankNumbers);
 
-        static Level globalLogLevel;
-        static Level localLogLevel;
-        static bool printRankNumber;
-        static bool timeStampEnabled;
+    virtual Logger &operator<<(const Level &level)       = 0;
+    virtual Logger &operator<<(const std::string &log)   = 0;
+    virtual Logger &operator<<(const int &log)           = 0;
+    virtual Logger &operator<<(const unsigned int &log)  = 0;
+    virtual Logger &operator<<(const unsigned long &log) = 0;
+    virtual Logger &operator<<(const float &log)         = 0;
+    virtual Logger &operator<<(const double &log)        = 0;
 
-    };
-    extern BASICS_EXPORT std::shared_ptr<Logger> out;
-}
+protected:
+    void addStreamToList(std::ostream *stream);
+    void resetStreamList();
 
+    std::vector<std::ostream *> streams;
 
+    static Level globalLogLevel;
+    static Level localLogLevel;
+    static bool printRankNumber;
+    static bool timeStampEnabled;
+};
+extern BASICS_EXPORT std::shared_ptr<Logger> out;
+} // namespace logging
 
 #endif
diff --git a/src/basics/Core/Logger/implementations/LoggerImp.cpp b/src/basics/Core/Logger/implementations/LoggerImp.cpp
index 48ad23a3082539706fa70b5d4ae895b35b0a7782..f002fdc59ee0a92bdc1be79a74aa347f0451600d 100644
--- a/src/basics/Core/Logger/implementations/LoggerImp.cpp
+++ b/src/basics/Core/Logger/implementations/LoggerImp.cpp
@@ -1,68 +1,52 @@
 #include "LoggerImp.h"
 
+#include <chrono>
+#include <iomanip>
+#include <iostream>
 #include <mpi.h>
 #include <sstream>
-#include <iostream>
-#include <iomanip>
-#include <chrono>
 
-
-logging::LoggerImp::LoggerImp(std::ostream* stream) : logging::Logger(stream)
+logging::LoggerImp::LoggerImp(std::ostream *stream) : logging::Logger(stream)
 {
     levelString[Level::WARNING]           = "[WARNING]          ";
-    levelString[Level::LOGGER_ERROR]           = "[ERROR]            ";
+    levelString[Level::LOGGER_ERROR]      = "[ERROR]            ";
     levelString[Level::INFO_LOW]          = "[INFO_LOW]         ";
     levelString[Level::INFO_INTERMEDIATE] = "[INFO_INTERMEDIATE]";
     levelString[Level::INFO_HIGH]         = "[INFO_HIGH]        ";
 }
 
-logging::LoggerImp::~LoggerImp()
-= default;
+logging::LoggerImp::~LoggerImp() = default;
 
-logging::Logger& logging::LoggerImp::operator<<(const Level &level)
+logging::Logger &logging::LoggerImp::operator<<(const Level &level)
 {
     localLogLevel = level;
     return *this;
 }
 
+logging::Logger &logging::LoggerImp::operator<<(const std::string &message) { return this->log(message); }
 
-logging::Logger& logging::LoggerImp::operator<<(const std::string &message)
-{
-    return this->log(message);
-}
-
-logging::Logger& logging::LoggerImp::operator<<(const int &message)
-{
-    return this->log(std::to_string(message));
-}
+logging::Logger &logging::LoggerImp::operator<<(const int &message) { return this->log(std::to_string(message)); }
 
-logging::Logger& logging::LoggerImp::operator<<(const unsigned int &message)
+logging::Logger &logging::LoggerImp::operator<<(const unsigned int &message)
 {
     return this->log(std::to_string(message));
 }
 
-logging::Logger& logging::LoggerImp::operator<<(const unsigned long &message)
+logging::Logger &logging::LoggerImp::operator<<(const unsigned long &message)
 {
     return this->log(std::to_string(message));
 }
 
-logging::Logger& logging::LoggerImp::operator<<(const float &message)
-{
-    return this->log(std::to_string(message));
-}
+logging::Logger &logging::LoggerImp::operator<<(const float &message) { return this->log(std::to_string(message)); }
 
-logging::Logger& logging::LoggerImp::operator<<(const double &message)
-{
-    return this->log(std::to_string(message));
-}
+logging::Logger &logging::LoggerImp::operator<<(const double &message) { return this->log(std::to_string(message)); }
 
-logging::Logger& logging::LoggerImp::log(const std::string &message)
+logging::Logger &logging::LoggerImp::log(const std::string &message)
 {
-    if (shouldBeLogged())
-    {
+    if (shouldBeLogged()) {
         std::string modifiedMessage = message;
         addDebugInformation(modifiedMessage);
-        for(auto stream : streams)
+        for (auto stream : streams)
             *stream << modifiedMessage << std::flush;
     }
     std::size_t found = message.find(std::string("\n"));
@@ -74,43 +58,37 @@ logging::Logger& logging::LoggerImp::log(const std::string &message)
     return *this;
 }
 
-bool logging::LoggerImp::shouldBeLogged()
-{
-    return localLogLevel <= globalLogLevel;
-}
+bool logging::LoggerImp::shouldBeLogged() { return localLogLevel <= globalLogLevel; }
 
-void logging::LoggerImp::addDebugInformation(std::string& message)
+void logging::LoggerImp::addDebugInformation(std::string &message)
 {
     if (newLoggingLine) {
         std::stringstream os;
-        os << levelString[localLogLevel] << getTimeStamp() << " "  << message;
+        os << levelString[localLogLevel] << getTimeStamp() << " " << message;
         message = os.str();
     }
 }
 
-
 std::string logging::LoggerImp::getTimeStamp()
 {
     if (!timeStampEnabled)
         return "";
 
     const auto now = std::chrono::system_clock::now();
-    time_t tt = std::chrono::system_clock::to_time_t(now);
-    //const tm utc_tm = *gmtime(&tt);
+    time_t tt      = std::chrono::system_clock::to_time_t(now);
+    // const tm utc_tm = *gmtime(&tt);
     const tm local_tm = *localtime(&tt);
 
     std::stringstream os;
     os << " [" << std::setw(2) << std::setfill('0') << local_tm.tm_hour << ":";
-    os         << std::setw(2) << std::setfill('0') << local_tm.tm_min  << ":";
-    os         << std::setw(2) << std::setfill('0') << local_tm.tm_sec  << "]";
+    os << std::setw(2) << std::setfill('0') << local_tm.tm_min << ":";
+    os << std::setw(2) << std::setfill('0') << local_tm.tm_sec << "]";
     return os.str();
 }
 
-
 std::string logging::LoggerImp::getRankString()
 {
     int rank;
     MPI_Comm_rank(MPI_COMM_WORLD, &rank);
     return printRankNumber ? "[" + std::to_string(rank) + "] " : "";
 }
-
diff --git a/src/basics/Core/Logger/implementations/LoggerImp.h b/src/basics/Core/Logger/implementations/LoggerImp.h
index 851f294640d887be8d4ac32d17130c6713d13eac..45b64b6dc2208991ca3c1ac67ad80af0b2ea6f22 100644
--- a/src/basics/Core/Logger/implementations/LoggerImp.h
+++ b/src/basics/Core/Logger/implementations/LoggerImp.h
@@ -1,7 +1,6 @@
 #ifndef LoggerImp_H
 #define LoggerImp_H
 
-
 #include "basics_export.h"
 
 #include <string>
@@ -12,35 +11,33 @@
 namespace logging
 {
 
-    class BASICS_EXPORT LoggerImp : public Logger
-    {
-    public:
-        LoggerImp(std::ostream* stream);
-        ~LoggerImp() override;
-
-        Logger& operator<<(const Level &level) override;
-        Logger& operator<<(const std::string &message) override;
-        Logger& operator<<(const int &message) override;
-        Logger& operator<<(const unsigned int &message) override;
-        Logger& operator<<(const unsigned long& log) override;
-        Logger& operator<<(const float &message) override;
-        Logger& operator<<(const double &message) override;
-
-
-    private:
-        std::string getRankString();
-        static bool shouldBeLogged();
-
-        static std::string getTimeStamp();
-        void addDebugInformation(std::string& message);
-        logging::Logger& log(const std::string &message);
-
-    private:
-        std::map<Logger::Level, std::string> levelString;
-        bool newLoggingLine = true;
-    };
-
-}
-
+class BASICS_EXPORT LoggerImp : public Logger
+{
+public:
+    LoggerImp(std::ostream *stream);
+    ~LoggerImp() override;
+
+    Logger &operator<<(const Level &level) override;
+    Logger &operator<<(const std::string &message) override;
+    Logger &operator<<(const int &message) override;
+    Logger &operator<<(const unsigned int &message) override;
+    Logger &operator<<(const unsigned long &log) override;
+    Logger &operator<<(const float &message) override;
+    Logger &operator<<(const double &message) override;
+
+private:
+    std::string getRankString();
+    static bool shouldBeLogged();
+
+    static std::string getTimeStamp();
+    void addDebugInformation(std::string &message);
+    logging::Logger &log(const std::string &message);
+
+private:
+    std::map<Logger::Level, std::string> levelString;
+    bool newLoggingLine = true;
+};
+
+} // namespace logging
 
 #endif
diff --git a/src/basics/Core/Logger/implementations/LoggerTest.cpp b/src/basics/Core/Logger/implementations/LoggerTest.cpp
index a3b97d6975a592a1638e7c636b319f4d72789564..2c4e4e6819a19497c3061caddbfa4c2a54953054 100644
--- a/src/basics/Core/Logger/implementations/LoggerTest.cpp
+++ b/src/basics/Core/Logger/implementations/LoggerTest.cpp
@@ -4,7 +4,6 @@
 
 #include "../Logger.h"
 
-
 TEST(DISABLED_LoggerTest, logStringWithoutSettingLevels_WillPutTheLogMesssageIntoTheStream)
 {
     std::ostringstream stream;
@@ -21,7 +20,8 @@ TEST(DISABLED_LoggerTest, logStringWithHighDebugLevel_logOnlyHighLevelMessages)
     logging::Logger::setStream(&stream);
 
     logging::Logger::setDebugLevel(logging::Logger::INFO_HIGH);
-    *logging::out << logging::Logger::INFO_LOW << "Low Debug Message\n" << logging::Logger::INFO_HIGH << "HIGH Debug Message\n";
+    *logging::out << logging::Logger::INFO_LOW << "Low Debug Message\n"
+                  << logging::Logger::INFO_HIGH << "HIGH Debug Message\n";
 
     EXPECT_THAT(stream.str(), "[HIGH] HIGH Debug Message\n");
 }
@@ -35,7 +35,7 @@ TEST(DISABLED_LoggerTest, addTwoStreams_shouldWriteToBoth)
     logging::out->addStream(&stream2);
     logging::Logger::setDebugLevel(logging::Logger::INFO_LOW);
 
-    *logging::out << logging::Logger::INFO_LOW <<"Hello World\n";
+    *logging::out << logging::Logger::INFO_LOW << "Hello World\n";
 
     EXPECT_THAT(stream1.str(), "[LOW] Hello World\n");
     EXPECT_THAT(stream2.str(), "[LOW] Hello World\n");
@@ -46,7 +46,8 @@ TEST(DISABLED_LoggerTest, splittetOutputShouldHaveDebugInformationOnce)
     std::ostringstream stream;
     logging::Logger::setStream(&stream);
 
-    *logging::out << logging::Logger::INFO_LOW << "Hello" << " World\n";
+    *logging::out << logging::Logger::INFO_LOW << "Hello"
+                  << " World\n";
 
     EXPECT_THAT(stream.str(), "[LOW] Hello World\n");
 }
@@ -57,8 +58,8 @@ TEST(DISABLED_LoggerTest, enableTimeStampInOutput)
     logging::Logger::setStream(&stream);
     logging::Logger::timeStamp(logging::Logger::TimeStamp::ENABLE);
 
-    *logging::out << logging::Logger::INFO_LOW << "Hello" << " World\n";
-    
+    *logging::out << logging::Logger::INFO_LOW << "Hello"
+                  << " World\n";
+
     EXPECT_THAT(stream.str(), testing::StrNe("[LOW] Hello World\n"));
 }
-
diff --git a/src/basics/Core/NonCreatable.h b/src/basics/Core/NonCreatable.h
index a93e4db68676cc64733feab5edbad910f88c18ff..b25fc808bf0607a047b46643b412b23fb71037b0 100644
--- a/src/basics/Core/NonCreatable.h
+++ b/src/basics/Core/NonCreatable.h
@@ -1,18 +1,16 @@
 /*
-*  Author: S. Peters
-*  mail: peters@irmb.tu-bs.de
-*/
+ *  Author: S. Peters
+ *  mail: peters@irmb.tu-bs.de
+ */
 #ifndef NON_CREATABLE_H
 #define NON_CREATABLE_H
 
-
 class NonCreatable
 {
 private:
-   NonCreatable() = delete;                                
-   NonCreatable( const NonCreatable& ) = delete;
-   NonCreatable& operator=( const NonCreatable& ) = delete;
+    NonCreatable()                     = delete;
+    NonCreatable(const NonCreatable &) = delete;
+    NonCreatable &operator=(const NonCreatable &) = delete;
 };
-  
 
 #endif
diff --git a/src/basics/Core/RealConstants.h b/src/basics/Core/RealConstants.h
index b63ff444f5d86dd67accaf83611ebeb6410f036b..d353a341c9f75d58d11ede3048f3cb0521be40b3 100644
--- a/src/basics/Core/RealConstants.h
+++ b/src/basics/Core/RealConstants.h
@@ -1,227 +1,223 @@
 #ifndef REAL_CONSTANT_H
 #define REAL_CONSTANT_H
 
-
-
 #ifdef VF_DOUBLE_ACCURACY
-#define c1o2		0.5
-#define c3o2		1.5
-#define c1o3		0.333333333333333
-#define c2o3		0.666666666666667
-#define c1o4		0.25
-#define c3o4		0.75
-#define c1o6		0.166666666666667
-#define c1o7		0.142857142857143
-#define c1o8		0.125
-#define c1o9		0.111111111111111
-#define c2o9		0.222222222222222
-#define c4o9		0.444444444444444
-#define c1o10		0.1
-#define c1o12		0.083333333333333
-#define c1o16		0.0625
-#define c3o16		0.1875
-#define c9o16		0.5625
-#define c1o18		0.055555555555556
-#define c1o20		0.05
-#define c19o20		0.95
-#define c21o20		1.05
-#define c1o24		0.041666666666667
-#define c1o27		0.037037037037037
-#define c3o32		0.09375
-#define c4o32		0.125
-#define c1o36		0.027777777777778
-#define c1o48		0.020833333333333
-#define c1o64		0.015625
-#define c3o64		0.046875
-#define c9o64		0.140625
-#define c27o64		0.421875
-#define c1o66		0.015151515151515
-#define c1o72		0.013888888888889
-#define c1o264		0.003787878787879
-#define c8o27		0.296296296296296
-#define c2o27		0.074074074074074
-#define c1o54		0.018518518518519
-#define c1o100		0.01
-#define c99o100		0.99
-#define c1o126		0.007936507936508
-#define c1o216		0.004629629629630
-#define c5o4		1.25
-#define c9o4		2.25
-#define c5o2		2.5
-#define c9o2		4.5
+#define c1o2 0.5
+#define c3o2 1.5
+#define c1o3 0.333333333333333
+#define c2o3 0.666666666666667
+#define c1o4 0.25
+#define c3o4 0.75
+#define c1o6 0.166666666666667
+#define c1o7 0.142857142857143
+#define c1o8 0.125
+#define c1o9 0.111111111111111
+#define c2o9 0.222222222222222
+#define c4o9 0.444444444444444
+#define c1o10 0.1
+#define c1o12 0.083333333333333
+#define c1o16 0.0625
+#define c3o16 0.1875
+#define c9o16 0.5625
+#define c1o18 0.055555555555556
+#define c1o20 0.05
+#define c19o20 0.95
+#define c21o20 1.05
+#define c1o24 0.041666666666667
+#define c1o27 0.037037037037037
+#define c3o32 0.09375
+#define c4o32 0.125
+#define c1o36 0.027777777777778
+#define c1o48 0.020833333333333
+#define c1o64 0.015625
+#define c3o64 0.046875
+#define c9o64 0.140625
+#define c27o64 0.421875
+#define c1o66 0.015151515151515
+#define c1o72 0.013888888888889
+#define c1o264 0.003787878787879
+#define c8o27 0.296296296296296
+#define c2o27 0.074074074074074
+#define c1o54 0.018518518518519
+#define c1o100 0.01
+#define c99o100 0.99
+#define c1o126 0.007936507936508
+#define c1o216 0.004629629629630
+#define c5o4 1.25
+#define c9o4 2.25
+#define c5o2 2.5
+#define c9o2 4.5
 
-#define c0o1		0.
-#define c1o1		1.
-#define c2o1		2.
-#define c3o1		3.
-#define c4o1		4.
-#define c5o1		5.
-#define c6o1		6.
-#define c7o1		7.
-#define c8o1		8.
-#define c9o1		9.
-#define c10o1 		10.
-#define c11o1  		11.
-#define c12o1  		12.
-#define c13o1		13.
-#define c14o1		14.
-#define c15o1		15.
-#define c16o1 		16.
-#define c17o1 		17.
-#define c18o1		18.
-#define c21o1		21.
-#define c24o1		24.
-#define c25o1 		25.
-#define c26o1		26.
-#define c27o1		27.
-#define c28o1		28.
-#define c29o1		29.
-#define c30o1  		30.
-#define c32o1		32.
-#define c33o1		33.
-#define c34o1		34.
-#define c36o1		36.
-#define c40o1		40.
-#define c42o1		42.
-#define c46o1		46.
-#define c48o1		48.
-#define c50o1		50.
-#define c52o1		52.
-#define c54o1		54.
-#define c56o1		56.
-#define c64o1		64.
-#define c66o1		66.
-#define c68o1		68.
-#define c69o1		69.
-#define c72o1		72.
-#define c84o1		84.
-#define c88o1		88.
-#define c96o1		96.
-#define c100o1		100.0
-#define c130o1		130.0
-#define c152o1		152.0
-#define c166o1		166.0
-#define c195o1		195.0
-#define c216o1		216.0
-#define c264o1		264.0
-#define c290o1		290.0
-#define c367o1		367.0
+#define c0o1 0.
+#define c1o1 1.
+#define c2o1 2.
+#define c3o1 3.
+#define c4o1 4.
+#define c5o1 5.
+#define c6o1 6.
+#define c7o1 7.
+#define c8o1 8.
+#define c9o1 9.
+#define c10o1 10.
+#define c11o1 11.
+#define c12o1 12.
+#define c13o1 13.
+#define c14o1 14.
+#define c15o1 15.
+#define c16o1 16.
+#define c17o1 17.
+#define c18o1 18.
+#define c21o1 21.
+#define c24o1 24.
+#define c25o1 25.
+#define c26o1 26.
+#define c27o1 27.
+#define c28o1 28.
+#define c29o1 29.
+#define c30o1 30.
+#define c32o1 32.
+#define c33o1 33.
+#define c34o1 34.
+#define c36o1 36.
+#define c40o1 40.
+#define c42o1 42.
+#define c46o1 46.
+#define c48o1 48.
+#define c50o1 50.
+#define c52o1 52.
+#define c54o1 54.
+#define c56o1 56.
+#define c64o1 64.
+#define c66o1 66.
+#define c68o1 68.
+#define c69o1 69.
+#define c72o1 72.
+#define c84o1 84.
+#define c88o1 88.
+#define c96o1 96.
+#define c100o1 100.0
+#define c130o1 130.0
+#define c152o1 152.0
+#define c166o1 166.0
+#define c195o1 195.0
+#define c216o1 216.0
+#define c264o1 264.0
+#define c290o1 290.0
+#define c367o1 367.0
 
-#define Op0000002   0.0000002
-#define c10eM30		1e-30
-#define c10eM10		1e-10
+#define Op0000002 0.0000002
+#define c10eM30 1e-30
+#define c10eM10 1e-10
 #define smallSingle 0.0000000002
 
-
 #else
-#define c1o2		0.5f
-#define c3o2		1.5f
-#define c1o3		(1.0f/3.0f)
-#define c2o3		(2.0f/3.0f)
-#define c1o4		0.25f
-#define c3o4		0.75f
-#define c1o6		(1.0f/6.0f)
-#define c1o7		(1.0f/7.0f)
-#define c1o8		0.125f
-#define c1o9		(1.0f/9.0f)
-#define c2o9		(2.0f/9.0f)
-#define c4o9		(4.0f/9.0f)
-#define c1o10		0.1f
-#define c1o12		(1.0f/12.0f)
-#define c1o16		0.0625f
-#define c3o16		0.1875f
-#define c9o16		0.5625f
-#define c1o18		(1.0f/18.0f)
-#define c1o20		0.05f
-#define c19o20		0.95f
-#define c21o20		1.05f
-#define c1o24		(1.0f/24.0f)
-#define c1o27		(1.0f/27.0f)
-#define c3o32		0.09375f
-#define c4o32		0.125f
-#define c1o36		(1.0f/36.0f)
-#define c1o48		(1.0f/48.0f)
-#define c1o64		0.015625f
-#define c3o64		0.046875f
-#define c9o64		0.140625f
-#define c27o64		0.421875f
-#define c1o66		(1.0f/66.0f)
-#define c1o72		(1.0f/72.0f)
-#define c1o264		(1.0f/264.0f)
-#define c8o27		(8.0f/27.0f)
-#define c2o27		(2.0f/27.0f)
-#define c1o54		(1.0f/54.0f)
-#define c1o100		0.01f
-#define c99o100		0.99f
-#define c1o126		(1.0f/126.0f)
-#define c1o216		(1.0f/216.0f)
-#define c5o4		1.25f
-#define c9o4		2.25f
-#define c5o2		2.5f
-#define c9o2		4.5f
+#define c1o2 0.5f
+#define c3o2 1.5f
+#define c1o3 (1.0f / 3.0f)
+#define c2o3 (2.0f / 3.0f)
+#define c1o4 0.25f
+#define c3o4 0.75f
+#define c1o6 (1.0f / 6.0f)
+#define c1o7 (1.0f / 7.0f)
+#define c1o8 0.125f
+#define c1o9 (1.0f / 9.0f)
+#define c2o9 (2.0f / 9.0f)
+#define c4o9 (4.0f / 9.0f)
+#define c1o10 0.1f
+#define c1o12 (1.0f / 12.0f)
+#define c1o16 0.0625f
+#define c3o16 0.1875f
+#define c9o16 0.5625f
+#define c1o18 (1.0f / 18.0f)
+#define c1o20 0.05f
+#define c19o20 0.95f
+#define c21o20 1.05f
+#define c1o24 (1.0f / 24.0f)
+#define c1o27 (1.0f / 27.0f)
+#define c3o32 0.09375f
+#define c4o32 0.125f
+#define c1o36 (1.0f / 36.0f)
+#define c1o48 (1.0f / 48.0f)
+#define c1o64 0.015625f
+#define c3o64 0.046875f
+#define c9o64 0.140625f
+#define c27o64 0.421875f
+#define c1o66 (1.0f / 66.0f)
+#define c1o72 (1.0f / 72.0f)
+#define c1o264 (1.0f / 264.0f)
+#define c8o27 (8.0f / 27.0f)
+#define c2o27 (2.0f / 27.0f)
+#define c1o54 (1.0f / 54.0f)
+#define c1o100 0.01f
+#define c99o100 0.99f
+#define c1o126 (1.0f / 126.0f)
+#define c1o216 (1.0f / 216.0f)
+#define c5o4 1.25f
+#define c9o4 2.25f
+#define c5o2 2.5f
+#define c9o2 4.5f
 
-#define c0o1		0.f
-#define c1o1		1.f
-#define c2o1		2.f
-#define c3o1		3.f
-#define c4o1		4.f
-#define c5o1		5.f
-#define c6o1		6.f
-#define c7o1		7.f
-#define c8o1		8.f
-#define c9o1		9.f
-#define c10o1 		10.f
-#define c11o1  		11.f
-#define c12o1  		12.f
-#define c13o1		13.f
-#define c14o1		14.f
-#define c15o1		15.f
-#define c16o1 		16.f
-#define c17o1 		17.f
-#define c18o1		18.f
-#define c21o1		21.f
-#define c24o1		24.f
-#define c25o1 		25.f
-#define c26o1		26.f
-#define c27o1		27.f
-#define c28o1		28.f
-#define c29o1		29.f
-#define c30o1  		30.f
-#define c32o1		32.f
-#define c33o1		33.f
-#define c34o1		34.f
-#define c36o1		36.f
-#define c40o1		40.f
-#define c42o1		42.f
-#define c46o1		46.f
-#define c48o1		48.f
-#define c50o1		50.f
-#define c52o1		52.f
-#define c54o1		54.f
-#define c56o1		56.f
-#define c64o1		64.f
-#define c66o1		66.f
-#define c68o1		68.f
-#define c69o1		69.f
-#define c72o1		72.f
-#define c84o1		84.f
-#define c88o1		88.f
-#define c96o1		96.f
-#define c100o1		100.0f
-#define c130o1		130.0f
-#define c152o1		152.0f
-#define c166o1		166.0f
-#define c195o1		195.0f
-#define c216o1		216.0f
-#define c264o1		264.0f
-#define c290o1		290.0f
-#define c367o1		367.0f
+#define c0o1 0.f
+#define c1o1 1.f
+#define c2o1 2.f
+#define c3o1 3.f
+#define c4o1 4.f
+#define c5o1 5.f
+#define c6o1 6.f
+#define c7o1 7.f
+#define c8o1 8.f
+#define c9o1 9.f
+#define c10o1 10.f
+#define c11o1 11.f
+#define c12o1 12.f
+#define c13o1 13.f
+#define c14o1 14.f
+#define c15o1 15.f
+#define c16o1 16.f
+#define c17o1 17.f
+#define c18o1 18.f
+#define c21o1 21.f
+#define c24o1 24.f
+#define c25o1 25.f
+#define c26o1 26.f
+#define c27o1 27.f
+#define c28o1 28.f
+#define c29o1 29.f
+#define c30o1 30.f
+#define c32o1 32.f
+#define c33o1 33.f
+#define c34o1 34.f
+#define c36o1 36.f
+#define c40o1 40.f
+#define c42o1 42.f
+#define c46o1 46.f
+#define c48o1 48.f
+#define c50o1 50.f
+#define c52o1 52.f
+#define c54o1 54.f
+#define c56o1 56.f
+#define c64o1 64.f
+#define c66o1 66.f
+#define c68o1 68.f
+#define c69o1 69.f
+#define c72o1 72.f
+#define c84o1 84.f
+#define c88o1 88.f
+#define c96o1 96.f
+#define c100o1 100.0f
+#define c130o1 130.0f
+#define c152o1 152.0f
+#define c166o1 166.0f
+#define c195o1 195.0f
+#define c216o1 216.0f
+#define c264o1 264.0f
+#define c290o1 290.0f
+#define c367o1 367.0f
 
-#define Op0000002   0.0000002f
-#define c10eM30		1e-30
-#define c10eM10		1e-10
+#define Op0000002 0.0000002f
+#define c10eM30 1e-30
+#define c10eM10 1e-10
 #define smallSingle 0.0000000002f
 #endif
 
-
 #endif
\ No newline at end of file
diff --git a/src/basics/Core/StringUtilities/StringUtil.cpp b/src/basics/Core/StringUtilities/StringUtil.cpp
index 8fd31c718b9426086ffa3866083f7f4949b1efdc..31496beae5953159c8d9a08a25fb5e808d9efea3 100644
--- a/src/basics/Core/StringUtilities/StringUtil.cpp
+++ b/src/basics/Core/StringUtilities/StringUtil.cpp
@@ -3,7 +3,7 @@
 #include <regex>
 #include <sstream>
 
-std::string StringUtil::findAndReplace(const std::string &source, const std::string& find, const std::string& replace)
+std::string StringUtil::findAndReplace(const std::string &source, const std::string &find, const std::string &replace)
 {
     std::string output = source;
     size_t j;
@@ -12,26 +12,23 @@ std::string StringUtil::findAndReplace(const std::string &source, const std::str
     return output;
 }
 
-std::string StringUtil::makeUpper(const std::string& instring)
+std::string StringUtil::makeUpper(const std::string &instring)
 {
     std::string output = instring;
     transform(output.begin(), output.end(), output.begin(), ::toupper);
     return output;
 }
 
-std::string StringUtil::makeLower(const std::string& instring)
+std::string StringUtil::makeLower(const std::string &instring)
 {
     std::string output = instring;
     transform(output.begin(), output.end(), output.begin(), ::tolower);
     return output;
 }
 
-bool StringUtil::contains(const std::string& source, const char *find)
-{
-    return (0 != strstr(source.c_str(), find));
-}
+bool StringUtil::contains(const std::string &source, const char *find) { return (0 != strstr(source.c_str(), find)); }
 
-std::string StringUtil::pad(const std::string& input, char pad, int length)
+std::string StringUtil::pad(const std::string &input, char pad, int length)
 {
     std::string outstring = input;
     for (int i = (int)outstring.length(); i < length; ++i)
@@ -43,51 +40,39 @@ std::string StringUtil::trim(const std::string &input, const std::string &trim /
 {
     if (input.size() == 0)
         return input;
-    std::string temp = "";
+    std::string temp              = "";
     std::string::size_type begpos = input.find_first_not_of(trim);
-    if (begpos == std::string::npos)
-    {
+    if (begpos == std::string::npos) {
         return temp;
-    }
-    else
-    {
+    } else {
         std::string::size_type endpos = input.find_last_not_of(trim);
-        temp = input.substr(begpos, endpos - begpos + 1);
+        temp                          = input.substr(begpos, endpos - begpos + 1);
     }
     return temp;
 }
 
-int StringUtil::toInt(const std::string &input)
-{
-    return std::stoi(input);
-}
+int StringUtil::toInt(const std::string &input) { return std::stoi(input); }
 
-float StringUtil::toFloat(const std::string &input)
-{
-    return std::stof(input);
-}
+float StringUtil::toFloat(const std::string &input) { return std::stof(input); }
 
-double StringUtil::toDouble(const std::string &input)
-{
-    return std::stod(input);
-}
+double StringUtil::toDouble(const std::string &input) { return std::stod(input); }
 
 bool StringUtil::toBool(const std::string &input)
 {
-    bool b {false};
+    bool b{ false };
     std::string trimmedInput = trim(input);
     if (!toBool(b, trimmedInput, std::boolalpha))
         throw "StringUtils::toBool() - Not a bool: " + trimmedInput;
     return b;
 }
 
-bool StringUtil::toBool(bool &t, const std::string &input, std::ios_base &(*f)(std::ios_base&))
+bool StringUtil::toBool(bool &t, const std::string &input, std::ios_base &(*f)(std::ios_base &))
 {
     std::istringstream iss(input);
     return !(iss >> f >> t).fail();
 }
 
-std::vector<std::string> split(const std::string& str, char delim = ' ')
+std::vector<std::string> split(const std::string &str, char delim = ' ')
 {
     std::stringstream ss(str);
     std::string token;
@@ -98,91 +83,84 @@ std::vector<std::string> split(const std::string& str, char delim = ' ')
     return list;
 }
 
-std::vector<std::string> StringUtil::split(const std::string& input, const std::string& delim/*= " "*/)
+std::vector<std::string> StringUtil::split(const std::string &input, const std::string &delim /*= " "*/)
 {
     std::stringstream ss;
     ss << "[" << delim << "]";
 
     std::regex re(ss.str());
-    std::sregex_token_iterator first{input.begin(), input.end(), re, -1}, last; //the '-1' is what makes the regex split (-1 := what was not matched)
-    std::vector<std::string> tokens{first, last};
-    tokens.erase(std::remove_if(tokens.begin(), tokens.end(), [](std::string& token)
-    {
-        return token.empty();
-    }), tokens.end());
+    std::sregex_token_iterator first{ input.begin(), input.end(), re, -1 },
+        last; // the '-1' is what makes the regex split (-1 := what was not matched)
+    std::vector<std::string> tokens{ first, last };
+    tokens.erase(std::remove_if(tokens.begin(), tokens.end(), [](std::string &token) { return token.empty(); }),
+                 tokens.end());
 
     return tokens;
 }
 
-std::vector<int> StringUtil::toIntVector(const std::string& input)
+std::vector<int> StringUtil::toIntVector(const std::string &input)
 {
     std::vector<int> v;
     std::vector<std::string> inputEntries;
     inputEntries = split(input, " \n\t");
-    for(std::string entry : inputEntries)
+    for (std::string entry : inputEntries)
         if (entry != "")
             v.push_back(toInt(entry));
     return v;
 }
 
-std::vector<unsigned int> StringUtil::toUintVector(const std::string & input)
+std::vector<unsigned int> StringUtil::toUintVector(const std::string &input)
 {
-	std::vector<unsigned int> v;
-	std::vector<std::string> inputEntries;
+    std::vector<unsigned int> v;
+    std::vector<std::string> inputEntries;
     inputEntries = split(input, " \n\t");
-	for(std::string entry : inputEntries)
-		if (entry != "")
-			v.push_back(toInt(entry));
-	return v;
+    for (std::string entry : inputEntries)
+        if (entry != "")
+            v.push_back(toInt(entry));
+    return v;
 }
 
-std::vector<bool> StringUtil::toBoolVector(const std::string & input)
+std::vector<bool> StringUtil::toBoolVector(const std::string &input)
 {
-	std::vector<bool> v;
-	std::vector<std::string> inputEntries;
+    std::vector<bool> v;
+    std::vector<std::string> inputEntries;
     inputEntries = split(input, " \n\t");
-	for(std::string entry : inputEntries)
-	{
-		bool b {false};
-		std::string trimmedInput = trim(input);
-		if (toBool(b, trimmedInput, std::noboolalpha))
-			v.push_back(b);
-	}
-	return v;
+    for (std::string entry : inputEntries) {
+        bool b{ false };
+        std::string trimmedInput = trim(input);
+        if (toBool(b, trimmedInput, std::noboolalpha))
+            v.push_back(b);
+    }
+    return v;
 }
 
-std::vector<std::string> StringUtil::toStringVector(const std::string & input)
-{
-    return split(input, " \n\t");
-}
+std::vector<std::string> StringUtil::toStringVector(const std::string &input) { return split(input, " \n\t"); }
 
-BASICS_EXPORT std::vector<double> StringUtil::toDoubleVector(const std::string & input)
+BASICS_EXPORT std::vector<double> StringUtil::toDoubleVector(const std::string &input)
 {
-	std::vector<double> v;
-	std::vector<std::string> inputEntries;
+    std::vector<double> v;
+    std::vector<std::string> inputEntries;
     inputEntries = split(input, " \n\t");
-	for(std::string entry : inputEntries)
-		if (entry != "")
-			v.push_back(toDouble(entry));
-	return v;
+    for (std::string entry : inputEntries)
+        if (entry != "")
+            v.push_back(toDouble(entry));
+    return v;
 }
 
-template<typename T>
-std::string StringUtil::toString(const T& t)
+template <typename T>
+std::string StringUtil::toString(const T &t)
 {
     std::ostringstream stream;
     stream << t;
     return stream.str();
 }
 
-template BASICS_EXPORT std::string StringUtil::toString<int>(const int& t);
-
-
+template BASICS_EXPORT std::string StringUtil::toString<int>(const int &t);
 
 bool StringUtil::endsWith(const std::string &input, const std::string &end)
 {
     if (input.length() >= end.length()) {
-        return (0 == input.compare (input.length() - end.length(), end.length(), end));
+        return (0 == input.compare(input.length() - end.length(), end.length(), end));
     } else {
         return false;
     }
diff --git a/src/basics/Core/StringUtilities/StringUtil.h b/src/basics/Core/StringUtilities/StringUtil.h
index 63ee9e965737e6fdfdb91d17bd6b158c76634453..cdf8dce290110848d5e6c50eb2fac35822dddf76 100644
--- a/src/basics/Core/StringUtilities/StringUtil.h
+++ b/src/basics/Core/StringUtilities/StringUtil.h
@@ -2,47 +2,49 @@
 #define STRINGUTIL_H
 
 #include <algorithm>
-#include <sstream>
 #include <iostream>
+#include <sstream>
 #include <string>
 #include <vector>
 
 #include "basics_export.h"
 
-#define SSTR( x ) static_cast< std::ostringstream & >( \
-        ( std::ostringstream() << std::dec << x ) ).str()
+#define SSTR(x) static_cast<std::ostringstream &>((std::ostringstream() << std::dec << x)).str()
 
 class StringUtil
 {
 public:
-    static BASICS_EXPORT std::string findAndReplace(const std::string &source, const std::string& find, const std::string& replace);
-    static BASICS_EXPORT std::string makeUpper(const std::string& instring);
-    static BASICS_EXPORT std::string makeLower(const std::string& instring);
-    static BASICS_EXPORT std::vector<std::string> split(const std::string& input, const std::string& delim = " ");
-    static BASICS_EXPORT bool contains(const std::string& source, const char *find);
-    static BASICS_EXPORT std::string pad(const std::string& input, char pad, int length);
+    static BASICS_EXPORT std::string findAndReplace(const std::string &source, const std::string &find,
+                                                    const std::string &replace);
+    static BASICS_EXPORT std::string makeUpper(const std::string &instring);
+    static BASICS_EXPORT std::string makeLower(const std::string &instring);
+    static BASICS_EXPORT std::vector<std::string> split(const std::string &input, const std::string &delim = " ");
+    static BASICS_EXPORT bool contains(const std::string &source, const char *find);
+    static BASICS_EXPORT std::string pad(const std::string &input, char pad, int length);
     static BASICS_EXPORT std::string trim(const std::string &input, const std::string &trim = std::string(" \t\n"));
     static BASICS_EXPORT int toInt(const std::string &input);
     static BASICS_EXPORT float toFloat(const std::string &input);
     static BASICS_EXPORT double toDouble(const std::string &input);
     static BASICS_EXPORT bool toBool(const std::string &input);
-    static BASICS_EXPORT std::vector<int> toIntVector(const std::string& s);
-	static BASICS_EXPORT std::vector<unsigned int> toUintVector(const std::string& s);
-	static BASICS_EXPORT std::vector<bool> toBoolVector(const std::string& s);
-	static BASICS_EXPORT std::vector<std::string> toStringVector(const std::string& s);
-	static BASICS_EXPORT std::vector<double> toDoubleVector(const std::string& s);
-    template<typename T>
-    static BASICS_EXPORT std::string toString(const T& t);
+    static BASICS_EXPORT std::vector<int> toIntVector(const std::string &s);
+    static BASICS_EXPORT std::vector<unsigned int> toUintVector(const std::string &s);
+    static BASICS_EXPORT std::vector<bool> toBoolVector(const std::string &s);
+    static BASICS_EXPORT std::vector<std::string> toStringVector(const std::string &s);
+    static BASICS_EXPORT std::vector<double> toDoubleVector(const std::string &s);
+    template <typename T>
+    static BASICS_EXPORT std::string toString(const T &t);
 
     static BASICS_EXPORT bool endsWith(const std::string &input, const std::string &end);
 
 private:
-    StringUtil() = default;;
-    StringUtil(const StringUtil&) = default;;
-    virtual ~StringUtil() = default;;
-
-    static bool toBool(bool &t, const std::string &input, std::ios_base &(*f)(std::ios_base&));
+    StringUtil() = default;
+    ;
+    StringUtil(const StringUtil &) = default;
+    ;
+    virtual ~StringUtil() = default;
+    ;
+
+    static bool toBool(bool &t, const std::string &input, std::ios_base &(*f)(std::ios_base &));
 };
 
 #endif
-
diff --git a/src/basics/Core/StringUtilities/StringUtilTest.cpp b/src/basics/Core/StringUtilities/StringUtilTest.cpp
index e87e15423ec74258f3be9a565c118954355aff38..52f9511b3774a03f6d6f1e19536839825eff1394 100644
--- a/src/basics/Core/StringUtilities/StringUtilTest.cpp
+++ b/src/basics/Core/StringUtilities/StringUtilTest.cpp
@@ -15,47 +15,47 @@ int main(int argc, char *argv[])
 
 TEST(StringUtilTest, endsWith_shouldReturnTrue)
 {
-    const std::string input {"input_string"};
-    const std::string ends_with {"string"};
+    const std::string input{ "input_string" };
+    const std::string ends_with{ "string" };
 
     ASSERT_TRUE(StringUtil::endsWith(input, ends_with));
 }
 
 TEST(StringUtilTest, endsWith_shouldReturnFalse)
 {
-    const std::string input {"input_string"};
-    const std::string ends_with {"string_"};
+    const std::string input{ "input_string" };
+    const std::string ends_with{ "string_" };
 
     ASSERT_FALSE(StringUtil::endsWith(input, ends_with));
 }
 
 TEST(StringUtilTest, toIntVector)
 {
-    const std::string input {"1   2\n3 4"};
-    std::vector<int> expected_result {1, 2, 3, 4};
+    const std::string input{ "1   2\n3 4" };
+    std::vector<int> expected_result{ 1, 2, 3, 4 };
 
     auto result = StringUtil::toIntVector(input);
 
-    ASSERT_THAT(result,testing::Eq(expected_result));
+    ASSERT_THAT(result, testing::Eq(expected_result));
 }
 
 TEST(StringUtilTest, splitIntoStringsWithDelimeter)
 {
-    const std::string input {"1   2\n3 4\t5"};
-    const std::string delimeter {" \n\t"};
-    std::vector<std::string> expected_result {"1", "2", "3", "4", "5"};
+    const std::string input{ "1   2\n3 4\t5" };
+    const std::string delimeter{ " \n\t" };
+    std::vector<std::string> expected_result{ "1", "2", "3", "4", "5" };
 
     auto result = StringUtil::split(input, delimeter);
 
-    ASSERT_THAT(result,testing::Eq(expected_result));
+    ASSERT_THAT(result, testing::Eq(expected_result));
 }
 
 TEST(StringUtilTest, toStringVector)
 {
-    const std::string input {"1   2\n3 4\t5"};
-    std::vector<std::string> expected_result {"1", "2", "3", "4", "5"};
+    const std::string input{ "1   2\n3 4\t5" };
+    std::vector<std::string> expected_result{ "1", "2", "3", "4", "5" };
 
     auto result = StringUtil::toStringVector(input);
 
-    ASSERT_THAT(result,testing::Eq(expected_result));
+    ASSERT_THAT(result, testing::Eq(expected_result));
 }
\ No newline at end of file
diff --git a/src/basics/Core/Timer/Timer.h b/src/basics/Core/Timer/Timer.h
index 702cfafb4b2eaef7cf779136d58ce7c37bc1b1e5..e8a97000fb8cc3967490e60edca1c564cc8431c7 100644
--- a/src/basics/Core/Timer/Timer.h
+++ b/src/basics/Core/Timer/Timer.h
@@ -13,11 +13,10 @@ public:
     static SPtr<Timer> makeStart();
 
     virtual void start() = 0;
-    virtual void end() = 0;
+    virtual void end()   = 0;
 
-    virtual real getTimeInSeconds() const = 0;
+    virtual real getTimeInSeconds() const           = 0;
     virtual real getCurrentRuntimeInSeconds() const = 0;
 };
 
 #endif
-
diff --git a/src/basics/Core/Timer/TimerImp.cpp b/src/basics/Core/Timer/TimerImp.cpp
index 7942f970a8b2f3e1047ef93dbf484fbd019611ea..7aef3e999c0d5466fb69b08eafa32fa95370383b 100644
--- a/src/basics/Core/Timer/TimerImp.cpp
+++ b/src/basics/Core/Timer/TimerImp.cpp
@@ -1,22 +1,18 @@
 #include "TimerImp.h"
 
+void TimerImp::start() { this->startTime = std::chrono::high_resolution_clock::now(); }
 
-void TimerImp::start()
-{
-    this->startTime = std::chrono::high_resolution_clock::now();
-}
-
-void TimerImp::end()
-{
-    this->endTime = std::chrono::high_resolution_clock::now();
-}
+void TimerImp::end() { this->endTime = std::chrono::high_resolution_clock::now(); }
 
 real TimerImp::getTimeInSeconds() const
 {
-    return real(std::chrono::duration_cast<std::chrono::microseconds>( endTime - startTime ).count() / 1000000.0);
+    return real(std::chrono::duration_cast<std::chrono::microseconds>(endTime - startTime).count() / 1000000.0);
 }
 
 real TimerImp::getCurrentRuntimeInSeconds() const
 {
-    return real(std::chrono::duration_cast<std::chrono::microseconds>( std::chrono::high_resolution_clock::now() - startTime ).count() / 1000000.0);
+    return real(
+        std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::high_resolution_clock::now() - startTime)
+            .count() /
+        1000000.0);
 }
diff --git a/src/basics/Core/Timer/TimerImp.h b/src/basics/Core/Timer/TimerImp.h
index 9759b9daac566fe23c04235105357ea9770457a7..bcc078db9a4f00eb23abe93a9a1e16509c948820 100644
--- a/src/basics/Core/Timer/TimerImp.h
+++ b/src/basics/Core/Timer/TimerImp.h
@@ -5,10 +5,8 @@
 
 #include <chrono>
 
-
 #include "DataTypes.h"
 
-
 class BASICS_EXPORT TimerImp : public Timer
 {
 public:
@@ -26,4 +24,3 @@ private:
 };
 
 #endif
-
diff --git a/src/basics/Core/VectorTypes.cpp b/src/basics/Core/VectorTypes.cpp
index 59c3d80c8cbfae3f177484a8378edf50bfdbb86e..dab2675093415ec103d1bf7ffd3666d57b0977f5 100644
--- a/src/basics/Core/VectorTypes.cpp
+++ b/src/basics/Core/VectorTypes.cpp
@@ -1,20 +1,8 @@
 #include "VectorTypes.h"
 
-//Vec3 Vec3::operator+( Vec3& left, Vec3& right ){
-Vec3 Vec3::operator+( Vec3& right ){
-    return { this->x + right.x, 
-                 this->y + right.y, 
-                 this->z + right.z };
-}
+// Vec3 Vec3::operator+( Vec3& left, Vec3& right ){
+Vec3 Vec3::operator+(Vec3 &right) { return { this->x + right.x, this->y + right.y, this->z + right.z }; }
 
-Vec3 Vec3::operator-( Vec3& right ){
-    return { this->x - right.x, 
-                 this->y - right.y, 
-                 this->z - right.z };
-}
+Vec3 Vec3::operator-(Vec3 &right) { return { this->x - right.x, this->y - right.y, this->z - right.z }; }
 
-Vec3 operator*( real scalar, Vec3& vec ){
-    return { scalar * vec.x, 
-                 scalar * vec.y, 
-                 scalar * vec.z };
-}
+Vec3 operator*(real scalar, Vec3 &vec) { return { scalar * vec.x, scalar * vec.y, scalar * vec.z }; }
diff --git a/src/basics/Core/VectorTypes.h b/src/basics/Core/VectorTypes.h
index d59771bf9934d59431ed3c3f408defc7950c02cd..0256a960ddf53a6d4fb8efee8b54e5d4679987f1 100644
--- a/src/basics/Core/VectorTypes.h
+++ b/src/basics/Core/VectorTypes.h
@@ -16,21 +16,19 @@
 #include "RealConstants.h"
 
 struct BASICS_EXPORT Vec3 {
-    real x{c0o1}, y{c0o1}, z{c0o1}; 
+    real x{ c0o1 }, y{ c0o1 }, z{ c0o1 };
 
     __host__ __device__ Vec3(real x, real y, real z) : x(x), y(y), z(z) {}
-    __host__ __device__ Vec3()  = default;
+    __host__ __device__ Vec3() = default;
 
-    __host__ __device__ real length() {
-        return std::sqrt( x*x + y*y + z*z );
-    }
+    __host__ __device__ real length() { return std::sqrt(x * x + y * y + z * z); }
 
-    Vec3 operator+( Vec3& right );
-    Vec3 operator-( Vec3& right );
+    Vec3 operator+(Vec3 &right);
+    Vec3 operator-(Vec3 &right);
 };
 
-//BASICS_EXPORT Vec3 operator+( Vec3& left, Vec3& right );
-//BASICS_EXPORT Vec3 operator-( Vec3& left, Vec3& right );
-BASICS_EXPORT Vec3 operator*( real scalar, Vec3& vec );
+// BASICS_EXPORT Vec3 operator+( Vec3& left, Vec3& right );
+// BASICS_EXPORT Vec3 operator-( Vec3& left, Vec3& right );
+BASICS_EXPORT Vec3 operator*(real scalar, Vec3 &vec);
 
 #endif
diff --git a/src/basics/Core/buildInfo.h b/src/basics/Core/buildInfo.h
index b9ba18ec0ff31f6bee344fbd7901a0d1ffd0ee49..a5499518c7a13ea52d470895b702ca0aab1294e0 100644
--- a/src/basics/Core/buildInfo.h
+++ b/src/basics/Core/buildInfo.h
@@ -1,26 +1,23 @@
 #ifndef buildInfo_H
 #define buildInfo_H
 
-
 namespace buildInfo
 {
-    const char * gitCommitHash();
-    const char * gitBranch();
-    const char * buildType();
-    const char * compilerFlags();
-    const char * buildMachine();
-    const char * projectDir();
-    const char * binaryDir();
-}
-
-#define GIT_COMMIT_HASH   buildinfo::gitCommitHash()
-#define GIT_BRANCH        buildinfo::gitBranch()
-#define BUILD_MACHINE     buildinfo::buildMachine()
-#define PROJECT_DIR       buildinfo::projectDir()
-#define BINARY_DIR        buildinfo::binaryDir()
-#define COMPILER_FLAGS    buildinfo::compilerFlags()
-#define BUILD_TYPE        buildinfo::buildType()
-
+const char *gitCommitHash();
+const char *gitBranch();
+const char *buildType();
+const char *compilerFlags();
+const char *buildMachine();
+const char *projectDir();
+const char *binaryDir();
+} // namespace buildInfo
 
+#define GIT_COMMIT_HASH buildinfo::gitCommitHash()
+#define GIT_BRANCH buildinfo::gitBranch()
+#define BUILD_MACHINE buildinfo::buildMachine()
+#define PROJECT_DIR buildinfo::projectDir()
+#define BINARY_DIR buildinfo::binaryDir()
+#define COMPILER_FLAGS buildinfo::compilerFlags()
+#define BUILD_TYPE buildinfo::buildType()
 
 #endif
diff --git a/src/basics/Core/buildInfo.in.cpp b/src/basics/Core/buildInfo.in.cpp
index 2cd55e8654c5a021d95ed584a8fb6d5def2014ee..56f302208256ba86d7f814bfa6711f704aea3479 100644
--- a/src/basics/Core/buildInfo.in.cpp
+++ b/src/basics/Core/buildInfo.in.cpp
@@ -2,14 +2,13 @@
 
 #include "basics_export.h"
 
-
 namespace buildInfo
 {
-    BASICS_EXPORT const char *gitCommitHash() { return "@git_commit_hash@";  }
-    BASICS_EXPORT const char *gitBranch()     { return "@git_branch@";       }
-    BASICS_EXPORT const char *buildType()     { return "@CMAKE_BUILD_TYPE@"; }
-    BASICS_EXPORT const char *compilerFlags() { return "@COMPILER_FLAGS@";   }
-    BASICS_EXPORT const char *buildMachine()  { return "@BUILD_computerName@";}
-    BASICS_EXPORT const char *projectDir()    { return "@CMAKE_SOURCE_DIR@"; }
-    BASICS_EXPORT const char *binaryDir()     { return "@CMAKE_BINARY_DIR@"; }
-}
+BASICS_EXPORT const char *gitCommitHash() { return "@git_commit_hash@"; }
+BASICS_EXPORT const char *gitBranch() { return "@git_branch@"; }
+BASICS_EXPORT const char *buildType() { return "@CMAKE_BUILD_TYPE@"; }
+BASICS_EXPORT const char *compilerFlags() { return "@COMPILER_FLAGS@"; }
+BASICS_EXPORT const char *buildMachine() { return "@BUILD_computerName@"; }
+BASICS_EXPORT const char *projectDir() { return "@CMAKE_SOURCE_DIR@"; }
+BASICS_EXPORT const char *binaryDir() { return "@CMAKE_BINARY_DIR@"; }
+} // namespace buildInfo
diff --git a/src/basics/PointerDefinitions.h b/src/basics/PointerDefinitions.h
index 07462b89eca7f3248ee311a849ba185261597204..4b8657025cc5100c6623b5172cbab3484bc2f8a1 100644
--- a/src/basics/PointerDefinitions.h
+++ b/src/basics/PointerDefinitions.h
@@ -1,13 +1,12 @@
 /*
-*  Author: S. Peters
-*  mail: peters@irmb.tu-bs.de
-*/
+ *  Author: S. Peters
+ *  mail: peters@irmb.tu-bs.de
+ */
 #ifndef SHARED_POINTER_H
 #define SHARED_POINTER_H
 
 #include <memory>
 
-
 template <class T>
 using SPtr = std::shared_ptr<T>;
 
@@ -18,7 +17,7 @@ template <class T>
 using UPtr = std::unique_ptr<T>;
 
 template <class T>
-using RPtr = T*;
+using RPtr = T *;
 
 template <class T>
 using enableSharedFromThis = std::enable_shared_from_this<T>;
diff --git a/src/basics/basics/container/CbArray2D.h b/src/basics/basics/container/CbArray2D.h
index 107bc386f964b2276ccb0ece2bf022d139b757c6..79e8a9c3ac21ae050938f3c420eeafd51d0074cd 100644
--- a/src/basics/basics/container/CbArray2D.h
+++ b/src/basics/basics/container/CbArray2D.h
@@ -1,28 +1,28 @@
 //=======================================================================================
-// ____          ____    __    ______     __________   __      __       __        __         
-// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |        
-//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |        
-//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |        
-//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____    
-//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|   
-//      \    \  |    |   ________________________________________________________________    
-//       \    \ |    |  |  ______________________________________________________________|   
-//        \    \|    |  |  |         __          __     __     __     ______      _______    
-//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)   
-//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______    
+// ____          ____    __    ______     __________   __      __       __        __
+// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |
+//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |
+//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |
+//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____
+//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|
+//      \    \  |    |   ________________________________________________________________
+//       \    \ |    |  |  ______________________________________________________________|
+//        \    \|    |  |  |         __          __     __     __     ______      _______
+//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)
+//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______
 //           \       |  |  |        |  |_____   |   \_/   |   |  |   |  |_/  /    _____  |
-//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/   
+//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/
 //
-//  This file is part of VirtualFluids. VirtualFluids is free software: you can 
+//  This file is part of VirtualFluids. VirtualFluids is free software: you can
 //  redistribute it and/or modify it under the terms of the GNU General Public
-//  License as published by the Free Software Foundation, either version 3 of 
+//  License as published by the Free Software Foundation, either version 3 of
 //  the License, or (at your option) any later version.
-//  
-//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT 
-//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
-//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License 
+//
+//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT
+//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 //  for more details.
-//  
+//
 //  You should have received a copy of the GNU General Public License along
 //  with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>.
 //
@@ -35,58 +35,63 @@
 
 #include <iomanip>
 
-#include <basics/utilities/UbException.h>
-#include <basics/utilities/UbEqual.h>
 #include <algorithm>
+#include <basics/utilities/UbEqual.h>
+#include <basics/utilities/UbException.h>
 #include <typeinfo>
 
 //////////////////////////////////////////////////////////////////////////
 //////////////////////////////////////////////////////////////////////////
 // IndexClasses
 
-//IndexerX2X1:
+// IndexerX2X1:
 //        4 5 6
 // Array  1 2 3  -->  vector 1 2 3 4 5 6
-//optimaler schleifendurchlauf
-//for(alle X2)
+// optimaler schleifendurchlauf
+// for(alle X2)
 //  for(alle X1)
 class IndexerX2X1
 {
 public:
-   using size_type = int;
+    using size_type = int;
+
 public:
-   inline std::size_t getIndex(const size_type& x1, const size_type& x2, const size_type& nx1, const size_type&  /*nx2*/) const
-   {
-      return nx1* x2 + x1;
-   }
-   inline std::size_t getStartIndexOfSortedArray(const size_type&  /*x1*/, const size_type& x2, const size_type& nx1, const size_type&  /*nx2*/) const
-   {
-      return  nx1* x2;
-   }
+    inline std::size_t getIndex(const size_type &x1, const size_type &x2, const size_type &nx1,
+                                const size_type & /*nx2*/) const
+    {
+        return nx1 * x2 + x1;
+    }
+    inline std::size_t getStartIndexOfSortedArray(const size_type & /*x1*/, const size_type &x2, const size_type &nx1,
+                                                  const size_type & /*nx2*/) const
+    {
+        return nx1 * x2;
+    }
 };
 
-//IndexerX1X2:
+// IndexerX1X2:
 //        4 5 6
 // Array  1 2 3  -->  vector 1 4 2 5 3 6
-//optimaler schleifendurchlauf
-//for(alle X1)
+// optimaler schleifendurchlauf
+// for(alle X1)
 //  for(alle X2)
 class IndexerX1X2
 {
 public:
-   using size_type = int;
+    using size_type = int;
+
 public:
-   inline std::size_t getIndex(const size_type& x1, const size_type& x2, const size_type&  /*nx1*/,const size_type& nx2) const
-   {
-      return nx2* x1+ x2;
-   }
-   inline std::size_t getStartIndexOfSortedArray(const size_type& x1, const size_type&  /*x2*/, const size_type&  /*nx1*/, const size_type& nx2) const
-   {
-      return  nx2* x1;
-   }
+    inline std::size_t getIndex(const size_type &x1, const size_type &x2, const size_type & /*nx1*/,
+                                const size_type &nx2) const
+    {
+        return nx2 * x1 + x2;
+    }
+    inline std::size_t getStartIndexOfSortedArray(const size_type &x1, const size_type & /*x2*/,
+                                                  const size_type & /*nx1*/, const size_type &nx2) const
+    {
+        return nx2 * x1;
+    }
 };
 
-
 //////////////////////////////////////////////////////////////////////////
 //////////////////////////////////////////////////////////////////////////
 // CbArray2D
@@ -100,311 +105,284 @@ public:
 //!
 //! -release: not defined "NO_CB_RANGECHECK" && defined "CB_RANGECHECK"
 //////////////////////////////////////////////////////////////////////////
-template<typename T, typename IndexClass = IndexerX2X1>
+template <typename T, typename IndexClass = IndexerX2X1>
 class CbArray2D
 {
 public:
-   using value_type = T;
-   using indexer_type = IndexClass;
-   using size_type = typename IndexClass::size_type;
-   using reference = typename std::vector<value_type>::reference;
-   using const_reference = typename std::vector<value_type>::const_reference;
-   using pointer = typename std::vector<value_type>::pointer;
-   using const_pointer = typename std::vector<value_type>::const_pointer;
+    using value_type      = T;
+    using indexer_type    = IndexClass;
+    using size_type       = typename IndexClass::size_type;
+    using reference       = typename std::vector<value_type>::reference;
+    using const_reference = typename std::vector<value_type>::const_reference;
+    using pointer         = typename std::vector<value_type>::pointer;
+    using const_pointer   = typename std::vector<value_type>::const_pointer;
 
 private:
-   template< typename value_type2, typename IndexClass2 > friend class CbArray2D;
+    template <typename value_type2, typename IndexClass2>
+    friend class CbArray2D;
 
 public:
-   /*=======================================================================*/
-   CbArray2D()
-   {
-      this->resize(0,0);
-   }
-   /*=======================================================================*/
-   CbArray2D(const size_type& nx2, const size_type& nx1)
-   {
-      this->resize(nx2,nx1);
-   }
-   /*=======================================================================*/
-   CbArray2D(const size_type& nx2, const size_type& nx1, const value_type& val)
-   {
-      this->resize(nx2,nx1,val);
-   }
-   /*=======================================================================*/
-   CbArray2D(const size_type& uniformDimensionSize /*nx1==nx2*/)
-   {
-      this->resize(uniformDimensionSize,uniformDimensionSize);
-   }
-   /*=======================================================================*/
-   //ssbernimmt vector als daten vector! (erstellt KEINE kopie!!!, vec ist anschlieueend leer, da swap verwendet wird)
-   CbArray2D(std::vector<value_type>& vec, const size_type& nx1,const size_type& nx2)
-   {
-      assert( (nx1*nx2)==vec.size() );
-      this->data.swap(vec);
-      this->resize(nx1,nx2);
-   }
-   /*=======================================================================*/
-   CbArray2D(const CbArray2D& src)
-      :  nx1(src.nx1)
-       , nx2(src.nx2)
-       , data(src.data)
-   {
-   }
-   /*=======================================================================*/
-   template< typename value_type2 >
-   CbArray2D(const CbArray2D< value_type2 >& src)
-      :  nx1(src.nx1)
-       , nx2(src.nx2)
-   {
-      //Sourcedaten kopieren
-      this->data.resize( src.data.size() );
-      for(std::size_t i=0; i<data.size(); ++i)
-         this->data[i] = src.data[i];
-   }
-   /*=======================================================================*/
-   virtual ~CbArray2D() = default;
-   /*=======================================================================*/
-   CbArray2D& operator= (const CbArray2D& rhs)
-   {
-      if(this == &rhs) return *this;
+    /*=======================================================================*/
+    CbArray2D() { this->resize(0, 0); }
+    /*=======================================================================*/
+    CbArray2D(const size_type &nx2, const size_type &nx1) { this->resize(nx2, nx1); }
+    /*=======================================================================*/
+    CbArray2D(const size_type &nx2, const size_type &nx1, const value_type &val) { this->resize(nx2, nx1, val); }
+    /*=======================================================================*/
+    CbArray2D(const size_type &uniformDimensionSize /*nx1==nx2*/)
+    {
+        this->resize(uniformDimensionSize, uniformDimensionSize);
+    }
+    /*=======================================================================*/
+    // ssbernimmt vector als daten vector! (erstellt KEINE kopie!!!, vec ist anschlieueend leer, da swap verwendet wird)
+    CbArray2D(std::vector<value_type> &vec, const size_type &nx1, const size_type &nx2)
+    {
+        assert((nx1 * nx2) == vec.size());
+        this->data.swap(vec);
+        this->resize(nx1, nx2);
+    }
+    /*=======================================================================*/
+    CbArray2D(const CbArray2D &src) : nx1(src.nx1), nx2(src.nx2), data(src.data) {}
+    /*=======================================================================*/
+    template <typename value_type2>
+    CbArray2D(const CbArray2D<value_type2> &src) : nx1(src.nx1), nx2(src.nx2)
+    {
+        // Sourcedaten kopieren
+        this->data.resize(src.data.size());
+        for (std::size_t i = 0; i < data.size(); ++i)
+            this->data[i] = src.data[i];
+    }
+    /*=======================================================================*/
+    virtual ~CbArray2D() = default;
+    /*=======================================================================*/
+    CbArray2D &operator=(const CbArray2D &rhs)
+    {
+        if (this == &rhs)
+            return *this;
 
-      this->nx1 = rhs.nx1;
-      this->nx2 = rhs.nx2;
+        this->nx1 = rhs.nx1;
+        this->nx2 = rhs.nx2;
 
-      //Laenge anpassen
-      this->data.resize(rhs.data.size());
-      //gespeicherte Datenelemente loeschen
-      this->data.clear();
+        // Laenge anpassen
+        this->data.resize(rhs.data.size());
+        // gespeicherte Datenelemente loeschen
+        this->data.clear();
 
-      //Sourcedaten kopieren
-      this->data  = rhs.data;
+        // Sourcedaten kopieren
+        this->data = rhs.data;
 
-      return *this;
-   }
-   /*=======================================================================*/
-   //durch value_type2 kann man z.B. ein float array einem double array zuweisen!
-   template< typename value_type2, typename IndexClass2 >
-   CbArray2D& operator= (const CbArray2D< value_type2, IndexClass2 >& rhs)
-   {
-      this->nx1 = rhs.nx1;
-      this->nx2 = rhs.nx2;
+        return *this;
+    }
+    /*=======================================================================*/
+    // durch value_type2 kann man z.B. ein float array einem double array zuweisen!
+    template <typename value_type2, typename IndexClass2>
+    CbArray2D &operator=(const CbArray2D<value_type2, IndexClass2> &rhs)
+    {
+        this->nx1 = rhs.nx1;
+        this->nx2 = rhs.nx2;
 
-      //gespeicherte Datenelemente loeschen
-      this->data.clear();
-      //Laenge anpassen
-      this->data.resize(rhs.data.size());
+        // gespeicherte Datenelemente loeschen
+        this->data.clear();
+        // Laenge anpassen
+        this->data.resize(rhs.data.size());
 
-      //Sourcedaten kopieren (!! koennte anderen Indexer besitzen!!! -> operator() benutzen)
-      //ACHTUNG: fuer diese Konvertierung muss bei Klassen der demenstrechende operator
-      //         implementiert sein, e.g.: class value_type2 {public: inline operator value_type2() const { return value_type2(); }
-      for(int x1=0; x1<this->nx1; x1++)
-         for(int x2=0; x2<this->nx2; x2++)
-               this->operator()(x1,x2) = static_cast< value_type >( rhs.operator()(x1,x2) );
+        // Sourcedaten kopieren (!! koennte anderen Indexer besitzen!!! -> operator() benutzen)
+        // ACHTUNG: fuer diese Konvertierung muss bei Klassen der demenstrechende operator
+        //         implementiert sein, e.g.: class value_type2 {public: inline operator value_type2() const { return
+        //         value_type2(); }
+        for (int x1 = 0; x1 < this->nx1; x1++)
+            for (int x2 = 0; x2 < this->nx2; x2++)
+                this->operator()(x1, x2) = static_cast<value_type>(rhs.operator()(x1, x2));
 
-      return *this;
-   }
-   /*=======================================================================*/
-   bool operator== (const CbArray2D& rhs) const
-   {
-      if( this == &rhs ) return true;
+        return *this;
+    }
+    /*=======================================================================*/
+    bool operator==(const CbArray2D &rhs) const
+    {
+        if (this == &rhs)
+            return true;
 
-      if(   this->nx1!=rhs.nx1
-         || this->nx2!=rhs.nx2
-         || this->data.size() != rhs.data.size() )
-      {
-         return false;
-      }
+        if (this->nx1 != rhs.nx1 || this->nx2 != rhs.nx2 || this->data.size() != rhs.data.size()) {
+            return false;
+        }
 
-      return std::equal( this->data.begin(), this->data.end(), rhs.data.begin(), UbEqual<value_type, value_type >() );
-   }
-   /*=======================================================================*/
-   template< typename value_type2, typename IndexClass2 >
-   bool operator== (const CbArray2D< value_type2, IndexClass2 >& rhs) const
-   {
-      if( this->data.size() != rhs.data.size() ) return false;
+        return std::equal(this->data.begin(), this->data.end(), rhs.data.begin(), UbEqual<value_type, value_type>());
+    }
+    /*=======================================================================*/
+    template <typename value_type2, typename IndexClass2>
+    bool operator==(const CbArray2D<value_type2, IndexClass2> &rhs) const
+    {
+        if (this->data.size() != rhs.data.size())
+            return false;
 
-      //Sourcedaten einzeln checken (!! koennte anderen Indexer besitzen!!! -> operator() benutzen)
-      for(int x1=0; x1<this->nx1; x1++)
-         for(int x2=0; x2<this->nx2; x2++)
-            if( !isUbEqual(this->operator()(x1,x2), rhs.operator()(x1,x2)) )
-               return false;
+        // Sourcedaten einzeln checken (!! koennte anderen Indexer besitzen!!! -> operator() benutzen)
+        for (int x1 = 0; x1 < this->nx1; x1++)
+            for (int x2 = 0; x2 < this->nx2; x2++)
+                if (!isUbEqual(this->operator()(x1, x2), rhs.operator()(x1, x2)))
+                    return false;
 
-      return true;
-   }
-   /*=======================================================================*/
-   bool operator!= (const CbArray2D& rhs) const
-   {
-      return !(*this==rhs);
-   }
-   /*=======================================================================*/
-   template< typename value_type2, typename IndexClass2 >
-   bool operator!= (const CbArray2D< value_type2, IndexClass2 >& rhs) const
-   {
-      return !(*this==rhs);
-   }
-   /*=======================================================================*/
-   reference operator() (const size_type& x1,const size_type& x2)
-   {
-      #if !defined(NO_CB_RANGECHECK) && ( defined(_DEBUG) || defined(CB_RANGECHECK) )
-         if( !this->indicesInRange(x1,x2) )
-            UB_THROW( UbException(UB_EXARGS,getExceptionErrorString(x1,x2)) );
-      #endif
+        return true;
+    }
+    /*=======================================================================*/
+    bool operator!=(const CbArray2D &rhs) const { return !(*this == rhs); }
+    /*=======================================================================*/
+    template <typename value_type2, typename IndexClass2>
+    bool operator!=(const CbArray2D<value_type2, IndexClass2> &rhs) const
+    {
+        return !(*this == rhs);
+    }
+    /*=======================================================================*/
+    reference operator()(const size_type &x1, const size_type &x2)
+    {
+#if !defined(NO_CB_RANGECHECK) && (defined(_DEBUG) || defined(CB_RANGECHECK))
+        if (!this->indicesInRange(x1, x2))
+            UB_THROW(UbException(UB_EXARGS, getExceptionErrorString(x1, x2)));
+#endif
 
-      return this->data[indexer.getIndex(x1,x2,nx1,nx2)];
-   }
-   /*=======================================================================*/
-   const_reference operator() (const size_type& x1,const size_type& x2)	const
-   {
-      #if !defined(NO_CB_RANGECHECK) && ( defined(_DEBUG) || defined(CB_RANGECHECK) )
-         if( !this->indicesInRange(x1,x2) )
-            UB_THROW( UbException(UB_EXARGS,getExceptionErrorString(x1,x2)) );
-      #endif
+        return this->data[indexer.getIndex(x1, x2, nx1, nx2)];
+    }
+    /*=======================================================================*/
+    const_reference operator()(const size_type &x1, const size_type &x2) const
+    {
+#if !defined(NO_CB_RANGECHECK) && (defined(_DEBUG) || defined(CB_RANGECHECK))
+        if (!this->indicesInRange(x1, x2))
+            UB_THROW(UbException(UB_EXARGS, getExceptionErrorString(x1, x2)));
+#endif
 
-      return this->data[indexer.getIndex(x1,x2,nx1,nx2)];
-   }
-   /*=======================================================================*/
-   pointer getStartAdressOfSortedArray(const size_type& x1, const size_type& x2)
-   {
-      #if !defined(NO_CB_RANGECHECK) && ( defined(_DEBUG) || defined(CB_RANGECHECK) )
-         if( !this->indicesInRange(x1,x2) )
-            UB_THROW( UbException(UB_EXARGS,getExceptionErrorString(x1,x2)) );
-      #endif
-      return &this->data[indexer.getStartIndexOfSortedArray(x1,x2,nx1,nx2)];
-   }
-   /*=======================================================================*/
-   const_pointer getStartAdressOfSortedArray(const size_type& x1, const size_type& x2) const
-   {
-      #if !defined(NO_CB_RANGECHECK) && ( defined(_DEBUG) || defined(CB_RANGECHECK) )
-         if( !this->indicesInRange(x1,x2) )
-            UB_THROW( UbException(UB_EXARGS,getExceptionErrorString(x1,x2)) );
-      #endif
-      return &this->data[indexer.getStartIndexOfSortedArray(x1,x2,nx1,nx2)];
-   }
-   /*=======================================================================*/
-   void setObject(const size_type& x1,const size_type& x2,const value_type& value)
-   {
-      #if !defined(NO_CB_RANGECHECK) && ( defined(_DEBUG) || defined(CB_RANGECHECK) )
-         if( !this->indicesInRange(x1,x2) )
-            UB_THROW( UbException(UB_EXARGS,getExceptionErrorString(x1,x2)) );
-      #endif
-      this->data[indexer.getIndex(x1,x2,nx1,nx2)] = value;
-   }
-   /*=======================================================================*/
-   reference getObject(const size_type& x1, const size_type& x2)
-   {
-      #if !defined(NO_CB_RANGECHECK) && ( defined(_DEBUG) || defined(CB_RANGECHECK) )
-         if( !this->indicesInRange(x1,x2) )
-            UB_THROW( UbException(UB_EXARGS,getExceptionErrorString(x1,x2)) );
-      #endif
-      return this->data[indexer.getIndex(x1,x2,nx1,nx2)] ;
-   }
-   /*=======================================================================*/
-   typename std::vector<value_type>::const_reference getObject(const size_type& x1, const size_type& x2) const
-   {
-      return this->operator()(x1,x2);
-   }
-   /*=======================================================================*/
-   bool      isEmpty() const { return data.empty(); }
-   size_type getNX1()  const { return this->nx1;    }
-   size_type getNX2()  const { return this->nx2;    }
-   /*=======================================================================*/
-   void reset(const T& val)
-   {
-      std::fill( this->data.begin(), this->data.end(), val );
-   }
-   /*=======================================================================*/
-   std::string toString() const
-   {
-      std::stringstream text;
-      for(size_type x2=0; x2<this->nx2; x2++)
-      {
-         for(size_type x1=0; x1<this->nx1; x1++)
-         {
-            //hier kommts zum Konflikt ab  und an ...
-            text<<this->getObject(x1,x2)<<", ";
-         }
-         text<<"\n";
-      }
+        return this->data[indexer.getIndex(x1, x2, nx1, nx2)];
+    }
+    /*=======================================================================*/
+    pointer getStartAdressOfSortedArray(const size_type &x1, const size_type &x2)
+    {
+#if !defined(NO_CB_RANGECHECK) && (defined(_DEBUG) || defined(CB_RANGECHECK))
+        if (!this->indicesInRange(x1, x2))
+            UB_THROW(UbException(UB_EXARGS, getExceptionErrorString(x1, x2)));
+#endif
+        return &this->data[indexer.getStartIndexOfSortedArray(x1, x2, nx1, nx2)];
+    }
+    /*=======================================================================*/
+    const_pointer getStartAdressOfSortedArray(const size_type &x1, const size_type &x2) const
+    {
+#if !defined(NO_CB_RANGECHECK) && (defined(_DEBUG) || defined(CB_RANGECHECK))
+        if (!this->indicesInRange(x1, x2))
+            UB_THROW(UbException(UB_EXARGS, getExceptionErrorString(x1, x2)));
+#endif
+        return &this->data[indexer.getStartIndexOfSortedArray(x1, x2, nx1, nx2)];
+    }
+    /*=======================================================================*/
+    void setObject(const size_type &x1, const size_type &x2, const value_type &value)
+    {
+#if !defined(NO_CB_RANGECHECK) && (defined(_DEBUG) || defined(CB_RANGECHECK))
+        if (!this->indicesInRange(x1, x2))
+            UB_THROW(UbException(UB_EXARGS, getExceptionErrorString(x1, x2)));
+#endif
+        this->data[indexer.getIndex(x1, x2, nx1, nx2)] = value;
+    }
+    /*=======================================================================*/
+    reference getObject(const size_type &x1, const size_type &x2)
+    {
+#if !defined(NO_CB_RANGECHECK) && (defined(_DEBUG) || defined(CB_RANGECHECK))
+        if (!this->indicesInRange(x1, x2))
+            UB_THROW(UbException(UB_EXARGS, getExceptionErrorString(x1, x2)));
+#endif
+        return this->data[indexer.getIndex(x1, x2, nx1, nx2)];
+    }
+    /*=======================================================================*/
+    typename std::vector<value_type>::const_reference getObject(const size_type &x1, const size_type &x2) const
+    {
+        return this->operator()(x1, x2);
+    }
+    /*=======================================================================*/
+    bool isEmpty() const { return data.empty(); }
+    size_type getNX1() const { return this->nx1; }
+    size_type getNX2() const { return this->nx2; }
+    /*=======================================================================*/
+    void reset(const T &val) { std::fill(this->data.begin(), this->data.end(), val); }
+    /*=======================================================================*/
+    std::string toString() const
+    {
+        std::stringstream text;
+        for (size_type x2 = 0; x2 < this->nx2; x2++) {
+            for (size_type x1 = 0; x1 < this->nx1; x1++) {
+                // hier kommts zum Konflikt ab  und an ...
+                text << this->getObject(x1, x2) << ", ";
+            }
+            text << "\n";
+        }
 
-      return text.str();
-   }
-   /*=======================================================================*/
-   std::string getInfo() const
-   {
-      std::stringstream text;
-      text<<"CbArray2D< storageType="<<typeid(T).name()<<", indexer="<<typeid(IndexClass).name()<<" >";
-      text<<"( nx1="<<this->nx1<<", nx2="<<this->nx2<<")";
-      return text.str();
-   }
-   /*=======================================================================*/
-   void resize(const size_type& uniformDimensionSize)
-   {
-      this->resize(uniformDimensionSize,uniformDimensionSize);
-   }
-   /*=======================================================================*/
-   void resize(const size_type& nx1,const size_type& nx2)
-   {
-      this->nx1 = nx1;
-      this->nx2 = nx2;
-      this->data.resize(nx1*nx2);
-   }
-   /*=======================================================================*/
-   void resize(const size_type& nx1, const size_type& nx2, const value_type& initVal )
-   {
-      this->nx1 = nx1;
-      this->nx2 = nx2;
-      this->data.resize(nx1*nx2,initVal);
-   }
-   /*=======================================================================*/
-   void clear()
-   {
-      this->nx1 = 0;
-      this->nx2 = 0;
-      this->data.clear();
-   }
-   /*=======================================================================*/
-   std::vector< value_type >& getDataVector() { return this->data; }
-   /*=======================================================================*/
-   const std::vector< value_type >& getDataVector() const { return this->data; }
-   /*=======================================================================*/
-   inline size_type getDataVectorIndex(const size_type& x1, const size_type& x2) const
-   {
-      #if !defined(NO_CB_RANGECHECK) && ( defined(_DEBUG) || defined(CB_RANGECHECK) )
-         if( !this->indicesInRange(x1,x2) )
-            UB_THROW( UbException(UB_EXARGS,getExceptionErrorString(x1,x2)) );
-      #endif
+        return text.str();
+    }
+    /*=======================================================================*/
+    std::string getInfo() const
+    {
+        std::stringstream text;
+        text << "CbArray2D< storageType=" << typeid(T).name() << ", indexer=" << typeid(IndexClass).name() << " >";
+        text << "( nx1=" << this->nx1 << ", nx2=" << this->nx2 << ")";
+        return text.str();
+    }
+    /*=======================================================================*/
+    void resize(const size_type &uniformDimensionSize) { this->resize(uniformDimensionSize, uniformDimensionSize); }
+    /*=======================================================================*/
+    void resize(const size_type &nx1, const size_type &nx2)
+    {
+        this->nx1 = nx1;
+        this->nx2 = nx2;
+        this->data.resize(nx1 * nx2);
+    }
+    /*=======================================================================*/
+    void resize(const size_type &nx1, const size_type &nx2, const value_type &initVal)
+    {
+        this->nx1 = nx1;
+        this->nx2 = nx2;
+        this->data.resize(nx1 * nx2, initVal);
+    }
+    /*=======================================================================*/
+    void clear()
+    {
+        this->nx1 = 0;
+        this->nx2 = 0;
+        this->data.clear();
+    }
+    /*=======================================================================*/
+    std::vector<value_type> &getDataVector() { return this->data; }
+    /*=======================================================================*/
+    const std::vector<value_type> &getDataVector() const { return this->data; }
+    /*=======================================================================*/
+    inline size_type getDataVectorIndex(const size_type &x1, const size_type &x2) const
+    {
+#if !defined(NO_CB_RANGECHECK) && (defined(_DEBUG) || defined(CB_RANGECHECK))
+        if (!this->indicesInRange(x1, x2))
+            UB_THROW(UbException(UB_EXARGS, getExceptionErrorString(x1, x2)));
+#endif
 
-      return indexer.getIndex(x1,x2,nx1,nx2);
-   }
+        return indexer.getIndex(x1, x2, nx1, nx2);
+    }
 
 protected:
-   /*=======================================================================*/
-   //success -> true
-   //else    -> false
-   inline bool indicesInRange(const size_type& x1, const size_type& x2) const
-   {
-      if(   x1 < 0 || x1 >= this->nx1
-         || x2 < 0 || x2 >= this->nx2 )
-      {
-         return false;
-      }
-      return true;
-   }
-   /*=======================================================================*/
-   std::string getExceptionErrorString(const size_type& x1, const size_type& x2) const
-   {
-      std::stringstream out("index out of range - ");
-      out<<"("<<x1<<","<<x2<<") not in ("<<nx1<<","<<nx2<<")";
-      return out.str();
-   }
-   /*=======================================================================*/
+    /*=======================================================================*/
+    // success -> true
+    // else    -> false
+    inline bool indicesInRange(const size_type &x1, const size_type &x2) const
+    {
+        if (x1 < 0 || x1 >= this->nx1 || x2 < 0 || x2 >= this->nx2) {
+            return false;
+        }
+        return true;
+    }
+    /*=======================================================================*/
+    std::string getExceptionErrorString(const size_type &x1, const size_type &x2) const
+    {
+        std::stringstream out("index out of range - ");
+        out << "(" << x1 << "," << x2 << ") not in (" << nx1 << "," << nx2 << ")";
+        return out.str();
+    }
+    /*=======================================================================*/
 
 protected:
-   size_type    nx1;
-   size_type    nx2;
-   indexer_type indexer;
-   std::vector< value_type > data;
+    size_type nx1;
+    size_type nx2;
+    indexer_type indexer;
+    std::vector<value_type> data;
 };
 
-#endif //CBARRAY2D_H
+#endif // CBARRAY2D_H
diff --git a/src/basics/basics/container/CbArray3D.h b/src/basics/basics/container/CbArray3D.h
index 103cc6110574328bfc673843d78c02563fdd5b66..f7fb495f78ca45a9fee431ed8b2a67783fc01f8f 100644
--- a/src/basics/basics/container/CbArray3D.h
+++ b/src/basics/basics/container/CbArray3D.h
@@ -1,28 +1,28 @@
 //=======================================================================================
-// ____          ____    __    ______     __________   __      __       __        __         
-// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |        
-//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |        
-//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |        
-//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____    
-//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|   
-//      \    \  |    |   ________________________________________________________________    
-//       \    \ |    |  |  ______________________________________________________________|   
-//        \    \|    |  |  |         __          __     __     __     ______      _______    
-//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)   
-//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______    
+// ____          ____    __    ______     __________   __      __       __        __
+// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |
+//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |
+//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |
+//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____
+//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|
+//      \    \  |    |   ________________________________________________________________
+//       \    \ |    |  |  ______________________________________________________________|
+//        \    \|    |  |  |         __          __     __     __     ______      _______
+//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)
+//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______
 //           \       |  |  |        |  |_____   |   \_/   |   |  |   |  |_/  /    _____  |
-//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/   
+//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/
 //
-//  This file is part of VirtualFluids. VirtualFluids is free software: you can 
+//  This file is part of VirtualFluids. VirtualFluids is free software: you can
 //  redistribute it and/or modify it under the terms of the GNU General Public
-//  License as published by the Free Software Foundation, either version 3 of 
+//  License as published by the Free Software Foundation, either version 3 of
 //  the License, or (at your option) any later version.
-//  
-//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT 
-//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
-//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License 
+//
+//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT
+//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 //  for more details.
-//  
+//
 //  You should have received a copy of the GNU General Public License along
 //  with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>.
 //
@@ -35,90 +35,97 @@
 
 #include <iomanip>
 
-#include <basics/utilities/UbException.h>
-#include <basics/utilities/UbEqual.h>
+#include "PointerDefinitions.h"
 #include <algorithm>
+#include <basics/utilities/UbEqual.h>
+#include <basics/utilities/UbException.h>
 #include <typeinfo>
-#include "PointerDefinitions.h"
 
 //////////////////////////////////////////////////////////////////////////
 //////////////////////////////////////////////////////////////////////////
 // IndexClasses
 
-//IndexerX3X2X1:
+// IndexerX3X2X1:
 //                4 5 6          10 11 12
 // Array  ebene A 1 2 3  ebene B  7  8  9 -->  vector 1 2 3 4 5 6 7 8 9 10 11 12
-//x1-reihen "liegen am stueck" im speicher
-//optimaler schleifendurchlauf
-//for(alle X3)
+// x1-reihen "liegen am stueck" im speicher
+// optimaler schleifendurchlauf
+// for(alle X3)
 //  for(alle X2)
 //    for(alle X1)
-class IndexerX3X2X1// FunctorX1SortedForX1X2Plane
+class IndexerX3X2X1 // FunctorX1SortedForX1X2Plane
 {
 public:
-   using size_type = size_t;
+    using size_type = size_t;
+
 public:
-   inline std::size_t getIndex(  const size_type& x1 , const size_type& x2 , const size_type& x3
-                               , const size_type& nx1, const size_type& nx2, const size_type&  /*nx3*/ ) const
-   {
-      return  nx1 * ( nx2 * x3 + x2) + x1 ;
-   }
-   inline std::size_t getStartIndexOfSortedArray(  const size_type&  /*x1*/ , const size_type& x2 , const size_type& x3
-                                                 , const size_type& nx1, const size_type& nx2, const size_type&  /*nx3*/ ) const
-   {
-      return  nx1 * ( nx2 * x3 + x2);
-   }
+    inline std::size_t getIndex(const size_type &x1, const size_type &x2, const size_type &x3, const size_type &nx1,
+                                const size_type &nx2, const size_type & /*nx3*/) const
+    {
+        return nx1 * (nx2 * x3 + x2) + x1;
+    }
+    inline std::size_t getStartIndexOfSortedArray(const size_type & /*x1*/, const size_type &x2, const size_type &x3,
+                                                  const size_type &nx1, const size_type &nx2,
+                                                  const size_type & /*nx3*/) const
+    {
+        return nx1 * (nx2 * x3 + x2);
+    }
 };
 
-//IndexerX1X2X3:
+// IndexerX1X2X3:
 //                4 5 6          10 11 12
 // Array  ebene A 1 2 3  ebene B  7  8  9 -->
-//optimaler schleifendurchlauf
-//for(alle X1)
+// optimaler schleifendurchlauf
+// for(alle X1)
 //  for(alle X2)
 //    for(alle X3)
-class IndexerX1X2X3 //FunctorX3SortedForX3X2Plane
+class IndexerX1X2X3 // FunctorX3SortedForX3X2Plane
 {
 public:
-   using size_type = size_t;
+    using size_type = size_t;
+
 public:
-   inline std::size_t getIndex(  const size_type& x1 , const size_type& x2 , const size_type& x3
-                               , const size_type&  /*nx1*/, const size_type& nx2, const size_type& nx3 ) const
-   {
-      return  nx3 * ( nx2 * x1 + x2) + x3 ;
-   }
-   inline std::size_t getStartIndexOfSortedArray(  const size_type& x1 , const size_type& x2 , const size_type&  /*x3*/
-                                                 , const size_type&  /*nx1*/, const size_type& nx2, const size_type& nx3 ) const
-   {
-      return  nx3 * ( nx2 * x1 + x2);
-   }
+    inline std::size_t getIndex(const size_type &x1, const size_type &x2, const size_type &x3,
+                                const size_type & /*nx1*/, const size_type &nx2, const size_type &nx3) const
+    {
+        return nx3 * (nx2 * x1 + x2) + x3;
+    }
+    inline std::size_t getStartIndexOfSortedArray(const size_type &x1, const size_type &x2, const size_type & /*x3*/
+                                                  ,
+                                                  const size_type & /*nx1*/, const size_type &nx2,
+                                                  const size_type &nx3) const
+    {
+        return nx3 * (nx2 * x1 + x2);
+    }
 };
 
-//IndexerX2X1X3:
+// IndexerX2X1X3:
 //                4 5 6          10 11 12
 // Array  ebene A 1 2 3  ebene B  7  8  9 -->  vector 1 7 2 8 3 9 4 10 5 11 6 12
-//optimaler schleifendurchlauf
-//for(alle X2)
+// optimaler schleifendurchlauf
+// for(alle X2)
 //  for(alle X1)
 //    for(alle X3)
 class IndexerX2X1X3
 {
 public:
-   using size_type = size_t;
+    using size_type = size_t;
+
 public:
-   inline std::size_t getIndex(  const size_type& x1 , const size_type& x2 , const size_type& x3
-                               , const size_type& nx1, const size_type&  /*nx2*/, const size_type& nx3 ) const
-   {
-      return  nx3* ( nx1 * x2 + x1) + x3 ;
-   }
-   inline std::size_t getStartIndexOfSortedArray(  const size_type& x1 , const size_type& x2 , const size_type&  /*x3*/
-                                                 , const size_type& nx1, const size_type&  /*nx2*/, const size_type& nx3 ) const
-   {
-      return  nx3* ( nx1 * x2 + x1);
-   }
+    inline std::size_t getIndex(const size_type &x1, const size_type &x2, const size_type &x3, const size_type &nx1,
+                                const size_type & /*nx2*/, const size_type &nx3) const
+    {
+        return nx3 * (nx1 * x2 + x1) + x3;
+    }
+    inline std::size_t getStartIndexOfSortedArray(const size_type &x1, const size_type &x2, const size_type & /*x3*/
+                                                  ,
+                                                  const size_type &nx1, const size_type & /*nx2*/,
+                                                  const size_type &nx3) const
+    {
+        return nx3 * (nx1 * x2 + x1);
+    }
 };
 
-
 //////////////////////////////////////////////////////////////////////////
 //////////////////////////////////////////////////////////////////////////
 // CbArray3D
@@ -132,334 +139,307 @@ public:
 //!
 //! -release: not defined "NO_CB_RANGECHECK" && defined "CB_RANGECHECK"
 //////////////////////////////////////////////////////////////////////////
-template<typename T, typename IndexClass = IndexerX3X2X1>
+template <typename T, typename IndexClass = IndexerX3X2X1>
 class CbArray3D
 {
 public:
-   using CbArray3DPtr = SPtr<CbArray3D<T, IndexClass> >;
+    using CbArray3DPtr = SPtr<CbArray3D<T, IndexClass>>;
 
-   using value_type = T;
-   using indexer_type = IndexClass;
-   using size_type = typename IndexClass::size_type;
-   using reference = typename std::vector<value_type>::reference;
-   using const_reference = typename std::vector<value_type>::const_reference;
-   using pointer = typename std::vector<value_type>::pointer;
-   using const_pointer = typename std::vector<value_type>::const_pointer;
+    using value_type      = T;
+    using indexer_type    = IndexClass;
+    using size_type       = typename IndexClass::size_type;
+    using reference       = typename std::vector<value_type>::reference;
+    using const_reference = typename std::vector<value_type>::const_reference;
+    using pointer         = typename std::vector<value_type>::pointer;
+    using const_pointer   = typename std::vector<value_type>::const_pointer;
 
 private:
-   template< typename value_type2, typename IndexClass2 > friend class CbArray3D;
+    template <typename value_type2, typename IndexClass2>
+    friend class CbArray3D;
 
 public:
-   /*=======================================================================*/
-   CbArray3D()
-   {
-      this->resize(0,0,0);
-   }
-   /*=======================================================================*/
-   CbArray3D(const size_type& nx1,const size_type& nx2, const size_type& nx3, const value_type& val)
-   {
-      this->resize(nx1,nx2,nx3,val);
-   }
-   /*=======================================================================*/
-    CbArray3D(const size_type& nx1,const size_type& nx2, const size_type& nx3)
+    /*=======================================================================*/
+    CbArray3D() { this->resize(0, 0, 0); }
+    /*=======================================================================*/
+    CbArray3D(const size_type &nx1, const size_type &nx2, const size_type &nx3, const value_type &val)
     {
-       this->resize(nx1,nx2,nx3);
+        this->resize(nx1, nx2, nx3, val);
+    }
+    /*=======================================================================*/
+    CbArray3D(const size_type &nx1, const size_type &nx2, const size_type &nx3) { this->resize(nx1, nx2, nx3); }
+    /*=======================================================================*/
+    CbArray3D(const size_type &uniformDimensionSize /*nx1==nx2==nx3*/)
+    {
+        this->resize(uniformDimensionSize, uniformDimensionSize, uniformDimensionSize);
+    }
+    /*=======================================================================*/
+    // ssbernimmt vector als daten vector! (erstellt KEINE kopie!!!, vec ist anschliessend leer, da swap verwendet wird)
+    CbArray3D(std::vector<value_type> &vec, const size_type &nx1, const size_type &nx2, const size_type &nx3)
+    {
+        assert((nx1 * nx2 * nx3) == vec.size());
+        this->data.swap(vec);
+        this->resize(nx1, nx2, nx3);
+    }
+    /*=======================================================================*/
+    CbArray3D(const CbArray3D &src) : nx1(src.nx1), nx2(src.nx2), nx3(src.nx3), data(src.data) {}
+    /*=======================================================================*/
+    template <typename value_type2>
+    CbArray3D(const CbArray3D<value_type2> &src) : nx1(src.nx1), nx2(src.nx2), nx3(src.nx3)
+    {
+        // Sourcedaten kopieren
+        this->data.resize(src.data.size());
+        for (std::size_t i = 0; i < data.size(); ++i)
+            this->data[i] = src.data[i];
+    }
+    /*=======================================================================*/
+    virtual ~CbArray3D() = default;
+    /*=======================================================================*/
+    CbArray3D &operator=(const CbArray3D &rhs)
+    {
+        if (this == &rhs)
+            return *this;
+
+        this->nx1 = rhs.nx1;
+        this->nx2 = rhs.nx2;
+        this->nx3 = rhs.nx3;
+
+        // gespeicherte Datenelemente loeschen
+        // Laenge anpassen
+        this->data.resize(rhs.data.size());
+        // gespeicherte Datenelemente loeschen
+        this->data.clear();
+
+        // Sourcedaten kopieren
+        this->data = rhs.data;
+
+        return *this;
+    }
+    /*=======================================================================*/
+    // durch value_type2 kann man z.B. ein float array einer double array zuweisen!
+    template <typename value_type2, typename IndexClass2>
+    CbArray3D &operator=(const CbArray3D<value_type2, IndexClass2> &rhs)
+    {
+        this->nx1 = rhs.nx1;
+        this->nx2 = rhs.nx2;
+        this->nx3 = rhs.nx3;
+
+        // gespeicherte Datenelemente loeschen
+        this->data.clear();
+        // Laenge anpassen
+        this->data.resize(rhs.data.size());
+
+        // Sourcedaten kopieren (!! koennte anderen Indexer besitzen!!! -> operator() benutzen)
+        for (int x3 = 0; x3 < this->nx3; x3++)
+            for (int x2 = 0; x2 < this->nx2; x2++)
+                for (int x1 = 0; x1 < this->nx1; x1++)
+                    this->operator()(x1, x2, x3) = static_cast<value_type>(rhs.operator()(x1, x2, x3));
+
+        return *this;
+    }
+    /*=======================================================================*/
+    bool operator==(const CbArray3D &rhs) const
+    {
+        if (this == &rhs)
+            return true;
+
+        if (this->nx1 != rhs.nx1 || this->nx2 != rhs.nx2 || this->nx3 != rhs.nx3 ||
+            this->data.size() != rhs.data.size()) {
+            return false;
+        }
+
+        return std::equal(this->data.begin(), this->data.end(), rhs.data.begin(), UbEqual<value_type, value_type>());
+    }
+    /*=======================================================================*/
+    template <typename value_type2, typename IndexClass2>
+    bool operator==(const CbArray3D<value_type2, IndexClass2> &rhs) const
+    {
+        if (this->data.size() != rhs.data.size())
+            return false;
+
+        // Sourcedaten einzeln checken (!! koennte anderen Indexer besitzen!!! -> operator() benutzen)
+        for (int x3 = 0; x3 < this->nx3; x3++)
+            for (int x2 = 0; x2 < this->nx2; x2++)
+                for (int x1 = 0; x1 < this->nx1; x1++)
+                    if (!isUbEqual(this->operator()(x1, x2, x3), rhs.operator()(x1, x2, x3)))
+                        return false;
+
+        return true;
+    }
+    /*=======================================================================*/
+    bool operator!=(const CbArray3D &src) const { return !(*this == src); }
+    /*=======================================================================*/
+    template <typename value_type2, typename IndexClass2>
+    bool operator!=(const CbArray3D<value_type2, IndexClass2> &rhs) const
+    {
+        return !(*this == rhs);
+    }
+    /*=======================================================================*/
+    reference operator()(const size_type &x1, const size_type &x2, const size_type &x3)
+    {
+#if !defined(NO_CB_RANGECHECK) && (defined(_DEBUG) || defined(CB_RANGECHECK))
+        if (!this->indicesInRange(x1, x2, x3))
+            UB_THROW(UbException(UB_EXARGS, getExceptionErrorString(x1, x2, x3)));
+#endif
+
+        return this->data[indexer.getIndex(x1, x2, x3, nx1, nx2, nx3)];
+    }
+    /*=======================================================================*/
+    const_reference operator()(const size_type &x1, const size_type &x2, const size_type &x3) const
+    {
+#if !defined(NO_CB_RANGECHECK) && (defined(_DEBUG) || defined(CB_RANGECHECK))
+        if (!this->indicesInRange(x1, x2, x3))
+            UB_THROW(UbException(UB_EXARGS, getExceptionErrorString(x1, x2, x3)));
+#endif
+
+        return this->data[indexer.getIndex(x1, x2, x3, nx1, nx2, nx3)];
+    }
+    /*=======================================================================*/
+    pointer getStartAdressOfSortedArray(const size_type &x1, const size_type &x2, const size_type &x3)
+    {
+#if !defined(NO_CB_RANGECHECK) && (defined(_DEBUG) || defined(CB_RANGECHECK))
+        if (!this->indicesInRange(x1, x2, x3))
+            UB_THROW(UbException(UB_EXARGS, getExceptionErrorString(x1, x2, x3)));
+#endif
+
+        return &this->data[indexer.getStartIndexOfSortedArray(x1, x2, x3, nx1, nx2, nx3)];
+    }
+    /*=======================================================================*/
+    const_pointer getStartAdressOfSortedArray(const size_type &x1, const size_type &x2, const size_type &x3) const
+    {
+#if !defined(NO_CB_RANGECHECK) && (defined(_DEBUG) || defined(CB_RANGECHECK))
+        if (!this->indicesInRange(x1, x2, x3))
+            UB_THROW(UbException(UB_EXARGS, getExceptionErrorString(x1, x2, x3)));
+#endif
+
+        return &this->data[indexer.getStartIndexOfSortedArray(x1, x2, x3, nx1, nx2, nx3)];
+    }
+    /*=======================================================================*/
+    void setObject(const size_type &x1, const size_type &x2, const size_type &x3, const value_type &value)
+    {
+#if !defined(NO_CB_RANGECHECK) && (defined(_DEBUG) || defined(CB_RANGECHECK))
+        if (!this->indicesInRange(x1, x2, x3))
+            UB_THROW(UbException(UB_EXARGS, getExceptionErrorString(x1, x2, x3)));
+#endif
+
+        this->data[indexer.getIndex(x1, x2, x3, nx1, nx2, nx3)] = value;
+    }
+    /*=======================================================================*/
+    reference getObject(const size_type &x1, const size_type &x2, const size_type &x3)
+    {
+#if !defined(NO_CB_RANGECHECK) && (defined(_DEBUG) || defined(CB_RANGECHECK))
+        if (!this->indicesInRange(x1, x2, x3))
+            UB_THROW(UbException(UB_EXARGS, getExceptionErrorString(x1, x2, x3)));
+#endif
+
+        return this->data[indexer.getIndex(x1, x2, x3, nx1, nx2, nx3)];
+    }
+    /*=======================================================================*/
+    const_reference getObject(const size_type &x1, const size_type &x2, const size_type &x3) const
+    {
+        return (*this)(x1, x2, x3);
+    }
+    /*=======================================================================*/
+    bool isEmpty() const { return data.empty(); }
+    size_type getNX1() const { return this->nx1; }
+    size_type getNX2() const { return this->nx2; }
+    size_type getNX3() const { return this->nx3; }
+    /*=======================================================================*/
+    void reset(const value_type &val) { std::fill(this->data.begin(), this->data.end(), val); }
+    /*=======================================================================*/
+    std::string toString() const
+    {
+        std::stringstream text;
+        for (size_type x1 = 0; x1 < this->nx1; x1++) {
+            for (size_type x2 = 0; x2 < this->nx2; x2++) {
+                for (size_type x3 = 0; x3 < this->nx3; x3++) {
+                    text << (*this)(x1, x2, x3) << ", ";
+                }
+                text << std::endl;
+            }
+            text << std::endl << std::endl;
+        }
+
+        return text.str();
+    }
+    /*=======================================================================*/
+    std::string getInfo() const
+    {
+        std::stringstream text;
+        text << "CbArray3D< storageType=" << typeid(T).name() << ", indexer=" << typeid(IndexClass).name() << " >";
+        text << "( nx1=" << this->nx1 << ", nx2=" << this->nx2 << ", nx3=" << this->nx3 << ")";
+        return text.str();
+    }
+    /*=======================================================================*/
+    void resize(const int &uniformDimensionSize)
+    {
+        this->resize(uniformDimensionSize, uniformDimensionSize, uniformDimensionSize);
+    }
+    /*=======================================================================*/
+    void resize(const size_type &nx1, const size_type &nx2, const size_type &nx3)
+    {
+        this->nx1 = nx1;
+        this->nx2 = nx2;
+        this->nx3 = nx3;
+        this->data.resize(nx1 * nx2 * nx3);
+    }
+    /*=======================================================================*/
+    void resize(const size_type &nx1, const size_type &nx2, const size_type &nx3, const value_type &val)
+    {
+        this->nx1 = nx1;
+        this->nx2 = nx2;
+        this->nx3 = nx3;
+        this->data.resize(nx1 * nx2 * nx3, val);
+    }
+    /*=======================================================================*/
+    void clear()
+    {
+        this->nx1 = 0;
+        this->nx2 = 0;
+        this->nx3 = 0;
+        this->data.clear();
+    }
+    /*=======================================================================*/
+    std::vector<value_type> &getDataVector() { return this->data; }
+    /*=======================================================================*/
+    const std::vector<value_type> &getDataVector() const { return this->data; }
+    /*=======================================================================*/
+    inline std::size_t getDataVectorIndex(const size_type &x1, const size_type &x2, const size_type &x3) const
+    {
+#if !defined(NO_CB_RANGECHECK) && (defined(_DEBUG) || defined(CB_RANGECHECK))
+        if (!this->indicesInRange(x1, x2, x3))
+            UB_THROW(UbException(UB_EXARGS, getExceptionErrorString(x1, x2, x3)));
+#endif
+
+        return indexer.getIndex(x1, x2, x3, nx1, nx2, nx3);
+    }
+
+    /*=======================================================================*/
+    // success -> true
+    // else    -> false
+    inline bool indicesInRange(const size_type &x1, const size_type &x2, const size_type &x3) const
+    {
+        if (x1 < 0 || x1 >= this->nx1 || x2 < 0 || x2 >= this->nx2 || x3 < 0 || x3 >= this->nx3) {
+            return false;
+        }
+        return true;
     }
-   /*=======================================================================*/
-   CbArray3D(const size_type& uniformDimensionSize /*nx1==nx2==nx3*/)
-   {
-      this->resize(uniformDimensionSize,uniformDimensionSize,uniformDimensionSize);
-   }
-   /*=======================================================================*/
-   //ssbernimmt vector als daten vector! (erstellt KEINE kopie!!!, vec ist anschliessend leer, da swap verwendet wird)
-   CbArray3D(std::vector<value_type>& vec, const size_type& nx1,const size_type& nx2, const size_type& nx3)
-   {
-      assert( (nx1*nx2*nx3)==vec.size() );
-      this->data.swap(vec);
-      this->resize(nx1,nx2,nx3);
-   }
-   /*=======================================================================*/
-   CbArray3D(const CbArray3D& src)
-      :  nx1(src.nx1)
-       , nx2(src.nx2)
-       , nx3(src.nx3)
-       , data(src.data)
-   {
-   }
-   /*=======================================================================*/
-   template< typename value_type2 >
-   CbArray3D(const CbArray3D< value_type2 >& src)
-      :  nx1(src.nx1)
-       , nx2(src.nx2)
-       , nx3(src.nx3)
-   {
-      //Sourcedaten kopieren
-      this->data.resize( src.data.size() );
-      for(std::size_t i=0; i<data.size(); ++i)
-         this->data[i] = src.data[i];
-   }
-   /*=======================================================================*/
-   virtual ~CbArray3D() = default;
-   /*=======================================================================*/
-   CbArray3D& operator= (const CbArray3D& rhs)
-   {
-      if(this == &rhs) return *this;
-
-      this->nx1 = rhs.nx1;
-      this->nx2 = rhs.nx2;
-      this->nx3 = rhs.nx3;
-
-      //gespeicherte Datenelemente loeschen
-      //Laenge anpassen
-      this->data.resize(rhs.data.size());
-      //gespeicherte Datenelemente loeschen
-      this->data.clear();
-
-      //Sourcedaten kopieren
-      this->data = rhs.data;
-
-      return *this;
-   }
-   /*=======================================================================*/
-   //durch value_type2 kann man z.B. ein float array einer double array zuweisen!
-   template< typename value_type2, typename IndexClass2 >
-   CbArray3D& operator= (const CbArray3D< value_type2, IndexClass2 >& rhs)
-   {
-      this->nx1 = rhs.nx1;
-      this->nx2 = rhs.nx2;
-      this->nx3 = rhs.nx3;
-
-      //gespeicherte Datenelemente loeschen
-      this->data.clear();
-      //Laenge anpassen
-      this->data.resize(rhs.data.size());
-
-      //Sourcedaten kopieren (!! koennte anderen Indexer besitzen!!! -> operator() benutzen)
-      for(int x3=0; x3<this->nx3; x3++)
-         for(int x2=0; x2<this->nx2; x2++)
-            for(int x1=0; x1<this->nx1; x1++)
-               this->operator()(x1,x2,x3) = static_cast< value_type >( rhs.operator()(x1,x2,x3) );
-
-      return *this;
-   }
-   /*=======================================================================*/
-   bool operator== (const CbArray3D& rhs) const
-   {
-      if(this == &rhs) return true;
-
-      if(   this->nx1!=rhs.nx1
-         || this->nx2!=rhs.nx2
-         || this->nx3!=rhs.nx3
-         || this->data.size() != rhs.data.size() )
-      {
-         return false;
-      }
-
-      return std::equal( this->data.begin(), this->data.end(), rhs.data.begin(), UbEqual<value_type, value_type >() );
-   }
-   /*=======================================================================*/
-   template< typename value_type2, typename IndexClass2 >
-   bool operator== (const CbArray3D< value_type2, IndexClass2 >& rhs) const
-   {
-      if( this->data.size() != rhs.data.size() ) return false;
-
-      //Sourcedaten einzeln checken (!! koennte anderen Indexer besitzen!!! -> operator() benutzen)
-      for(int x3=0; x3<this->nx3; x3++)
-         for(int x2=0; x2<this->nx2; x2++)
-            for(int x1=0; x1<this->nx1; x1++)
-               if( !isUbEqual(this->operator()(x1,x2,x3), rhs.operator()(x1,x2,x3)) )
-               return false;
-
-      return true;
-   }
-   /*=======================================================================*/
-   bool operator!= (const CbArray3D& src) const
-   {
-      return !(*this==src);
-   }
-   /*=======================================================================*/
-   template< typename value_type2, typename IndexClass2 >
-   bool operator!= (const CbArray3D< value_type2, IndexClass2 >& rhs) const
-   {
-      return !(*this==rhs);
-   }
-   /*=======================================================================*/
-   reference operator() (const size_type& x1, const size_type& x2, const size_type& x3)
-   {
-      #if !defined(NO_CB_RANGECHECK) && ( defined(_DEBUG) || defined(CB_RANGECHECK) )
-         if( !this->indicesInRange(x1,x2,x3) )
-            UB_THROW( UbException(UB_EXARGS,getExceptionErrorString(x1,x2,x3)) );
-      #endif
-
-      return this->data[ indexer.getIndex(x1,x2,x3,nx1,nx2,nx3) ];
-   }
-   /*=======================================================================*/
-   const_reference operator() (const size_type& x1, const size_type& x2, const size_type& x3)	const
-   {
-      #if !defined(NO_CB_RANGECHECK) && ( defined(_DEBUG) || defined(CB_RANGECHECK) )
-         if( !this->indicesInRange(x1,x2,x3) )
-            UB_THROW( UbException(UB_EXARGS,getExceptionErrorString(x1,x2,x3)) );
-      #endif
-
-      return this->data[ indexer.getIndex(x1,x2,x3,nx1,nx2,nx3) ];
-   }
-   /*=======================================================================*/
-   pointer getStartAdressOfSortedArray(const size_type& x1, const size_type& x2, const size_type& x3)
-   {
-      #if !defined(NO_CB_RANGECHECK) && ( defined(_DEBUG) || defined(CB_RANGECHECK) )
-         if( !this->indicesInRange(x1,x2,x3) )
-            UB_THROW( UbException(UB_EXARGS,getExceptionErrorString(x1,x2,x3)) );
-      #endif
-
-      return &this->data[indexer.getStartIndexOfSortedArray(x1,x2,x3,nx1,nx2,nx3)];
-   }
-   /*=======================================================================*/
-   const_pointer getStartAdressOfSortedArray(const size_type& x1, const size_type& x2, const size_type& x3)  const
-   {
-      #if !defined(NO_CB_RANGECHECK) && ( defined(_DEBUG) || defined(CB_RANGECHECK) )
-         if( !this->indicesInRange(x1,x2,x3) )
-            UB_THROW( UbException(UB_EXARGS,getExceptionErrorString(x1,x2,x3)) );
-      #endif
-
-      return &this->data[indexer.getStartIndexOfSortedArray(x1,x2,x3,nx1,nx2,nx3)];
-   }
-   /*=======================================================================*/
-   void setObject(const size_type& x1, const size_type& x2, const size_type& x3, const value_type& value)
-   {
-      #if !defined(NO_CB_RANGECHECK) && ( defined(_DEBUG) || defined(CB_RANGECHECK) )
-         if( !this->indicesInRange(x1,x2,x3) )
-            UB_THROW( UbException(UB_EXARGS,getExceptionErrorString(x1,x2,x3)) );
-      #endif
-
-      this->data[ indexer.getIndex(x1,x2,x3,nx1,nx2,nx3) ] = value;
-   }
-   /*=======================================================================*/
-   reference getObject(const size_type& x1, const size_type& x2, const size_type& x3)
-   {
-      #if !defined(NO_CB_RANGECHECK) && ( defined(_DEBUG) || defined(CB_RANGECHECK) )
-         if( !this->indicesInRange(x1,x2,x3) )
-            UB_THROW( UbException(UB_EXARGS,getExceptionErrorString(x1,x2,x3)) );
-      #endif
-
-      return this->data[ indexer.getIndex(x1,x2,x3,nx1,nx2,nx3) ] ;
-   }
-   /*=======================================================================*/
-   const_reference getObject(const size_type& x1, const size_type& x2, const size_type& x3) const
-   {
-      return (*this)(x1,x2,x3);
-   }
-   /*=======================================================================*/
-   bool      isEmpty() const { return data.empty(); }
-   size_type getNX1()  const { return this->nx1;    }
-   size_type getNX2()  const { return this->nx2;    }
-   size_type getNX3()  const { return this->nx3;    }
-   /*=======================================================================*/
-   void reset(const value_type& val)
-   {
-      std::fill( this->data.begin(), this->data.end(), val );
-   }
-   /*=======================================================================*/
-   std::string toString() const
-   {
-      std::stringstream text;
-      for(size_type x1=0; x1<this->nx1; x1++)
-      {
-      	for(size_type x2=0; x2<this->nx2; x2++)
-      	{
-         	for(size_type x3=0; x3<this->nx3; x3++)
-         	{
-            	text<<(*this)(x1,x2,x3)<<", ";
-         	}
-         	text<<std::endl;
-      	}
-      	text<<std::endl<<std::endl;
-      }
-
-      return text.str();
-   }
-   /*=======================================================================*/
-   std::string getInfo() const
-   {
-      std::stringstream text;
-      text<<"CbArray3D< storageType="<<typeid(T).name()<<", indexer="<<typeid(IndexClass).name()<<" >";
-      text<<"( nx1="<<this->nx1<<", nx2="<<this->nx2<<", nx3="<<this->nx3<<")";
-      return text.str();
-   }
-   /*=======================================================================*/
-   void resize(const int& uniformDimensionSize)
-   {
-      this->resize(uniformDimensionSize,uniformDimensionSize,uniformDimensionSize);
-   }
-   /*=======================================================================*/
-   void resize(const size_type& nx1,const size_type& nx2, const size_type& nx3)
-   {
-      this->nx1 = nx1;
-      this->nx2 = nx2;
-      this->nx3 = nx3;
-      this->data.resize(nx1*nx2*nx3);
-   }
-   /*=======================================================================*/
-   void resize(const size_type& nx1,const size_type& nx2, const size_type& nx3,const value_type& val)
-   {
-      this->nx1 = nx1;
-      this->nx2 = nx2;
-      this->nx3 = nx3;
-      this->data.resize(nx1*nx2*nx3,val);
-   }
-   /*=======================================================================*/
-   void clear()
-   {
-      this->nx1 = 0;
-      this->nx2 = 0;
-      this->nx3 = 0;
-      this->data.clear();
-   }
-   /*=======================================================================*/
-   std::vector< value_type >& getDataVector() { return this->data; }
-   /*=======================================================================*/
-   const std::vector< value_type >& getDataVector() const { return this->data; }
-   /*=======================================================================*/
-   inline std::size_t getDataVectorIndex(const size_type& x1, const size_type& x2, const size_type& x3) const
-   {
-      #if !defined(NO_CB_RANGECHECK) && ( defined(_DEBUG) || defined(CB_RANGECHECK) )
-         if( !this->indicesInRange(x1,x2,x3) )
-            UB_THROW( UbException(UB_EXARGS,getExceptionErrorString(x1,x2,x3)) );
-      #endif
-
-      return indexer.getIndex(x1,x2,x3,nx1,nx2,nx3);
-   }
-
-
-   /*=======================================================================*/
-   //success -> true
-   //else    -> false
-   inline bool indicesInRange(const size_type& x1, const size_type& x2, const size_type& x3) const
-   {
-      if(   x1 < 0 || x1 >= this->nx1
-         || x2 < 0 || x2 >= this->nx2
-         || x3 < 0 || x3 >= this->nx3 )
-      {
-         return false;
-      }
-      return true;
-   }
-protected:
-   /*=======================================================================*/
-   std::string getExceptionErrorString(const size_type& x1, const size_type& x2, const size_type& x3) const
-   {
-      std::stringstream out("index out of range - ");
-      out<<"("<<x1<<","<<x2<<","<<x3<<") not in ("<<nx1<<","<<nx2<<","<<nx3<<")";
-      return out.str();
-   }
-   /*=======================================================================*/
 
 protected:
-   size_type    nx1;
-   size_type    nx2;
-   size_type    nx3;
-   indexer_type indexer;
-   std::vector< value_type > data;
+    /*=======================================================================*/
+    std::string getExceptionErrorString(const size_type &x1, const size_type &x2, const size_type &x3) const
+    {
+        std::stringstream out("index out of range - ");
+        out << "(" << x1 << "," << x2 << "," << x3 << ") not in (" << nx1 << "," << nx2 << "," << nx3 << ")";
+        return out.str();
+    }
+    /*=======================================================================*/
 
+protected:
+    size_type nx1;
+    size_type nx2;
+    size_type nx3;
+    indexer_type indexer;
+    std::vector<value_type> data;
 };
 
-#endif //CBARRAY3D_H
+#endif // CBARRAY3D_H
diff --git a/src/basics/basics/container/CbArray4D.h b/src/basics/basics/container/CbArray4D.h
index 16c5542323de11ab72c3598e5b6fa03ed475e18e..31238e1b8c1d4acd875737b8f45803f20d78c7fc 100644
--- a/src/basics/basics/container/CbArray4D.h
+++ b/src/basics/basics/container/CbArray4D.h
@@ -1,28 +1,28 @@
 //=======================================================================================
-// ____          ____    __    ______     __________   __      __       __        __         
-// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |        
-//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |        
-//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |        
-//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____    
-//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|   
-//      \    \  |    |   ________________________________________________________________    
-//       \    \ |    |  |  ______________________________________________________________|   
-//        \    \|    |  |  |         __          __     __     __     ______      _______    
-//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)   
-//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______    
+// ____          ____    __    ______     __________   __      __       __        __
+// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |
+//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |
+//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |
+//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____
+//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|
+//      \    \  |    |   ________________________________________________________________
+//       \    \ |    |  |  ______________________________________________________________|
+//        \    \|    |  |  |         __          __     __     __     ______      _______
+//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)
+//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______
 //           \       |  |  |        |  |_____   |   \_/   |   |  |   |  |_/  /    _____  |
-//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/   
+//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/
 //
-//  This file is part of VirtualFluids. VirtualFluids is free software: you can 
+//  This file is part of VirtualFluids. VirtualFluids is free software: you can
 //  redistribute it and/or modify it under the terms of the GNU General Public
-//  License as published by the Free Software Foundation, either version 3 of 
+//  License as published by the Free Software Foundation, either version 3 of
 //  the License, or (at your option) any later version.
-//  
-//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT 
-//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
-//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License 
+//
+//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT
+//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 //  for more details.
-//  
+//
 //  You should have received a copy of the GNU General Public License along
 //  with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>.
 //
@@ -33,67 +33,73 @@
 #ifndef CBARRAY4D_H
 #define CBARRAY4D_H
 
-
-
-#include <iomanip>
-#include <basics/utilities/UbException.h>
-#include <basics/utilities/UbEqual.h>
+#include "PointerDefinitions.h"
 #include <algorithm>
+#include <basics/utilities/UbEqual.h>
+#include <basics/utilities/UbException.h>
+#include <iomanip>
 #include <typeinfo>
-#include "PointerDefinitions.h"
 
 //////////////////////////////////////////////////////////////////////////
 //////////////////////////////////////////////////////////////////////////
 // IndexClasses
 
-//IndexerX1X2X3X4:
-//x4-reihen "liegen am stueck" im speicher
-//optimaler schleifendurchlauf
-//for(alle X1)
+// IndexerX1X2X3X4:
+// x4-reihen "liegen am stueck" im speicher
+// optimaler schleifendurchlauf
+// for(alle X1)
 //  for(alle X2)
 //    for(alle X3)
 //      for(alle X4)
 class IndexerX1X2X3X4
 {
 public:
-   using size_type = int;
+    using size_type = int;
+
 public:
-   inline std::size_t getIndex( const size_type& x1 , const size_type& x2 , const size_type& x3 , const size_type& x4
-                            , const size_type&  /*nx1*/, const size_type& nx2, const size_type& nx3, const size_type& nx4 )  const
-   {
-      return nx4*(nx3*(nx2*x1+ x2)+x3)+x4 ;
-   }
-   inline std::size_t getStartIndexOfSortedArray(  const size_type& x1 , const size_type& x2 , const size_type& x3 , const size_type&  /*x4*/
-                                               , const size_type&  /*nx1*/, const size_type& nx2, const size_type& nx3, const size_type& nx4 )  const
-   {
-      return  nx4*(nx3*(nx2*x1+ x2)+x3);
-   }
+    inline std::size_t getIndex(const size_type &x1, const size_type &x2, const size_type &x3, const size_type &x4,
+                                const size_type & /*nx1*/, const size_type &nx2, const size_type &nx3,
+                                const size_type &nx4) const
+    {
+        return nx4 * (nx3 * (nx2 * x1 + x2) + x3) + x4;
+    }
+    inline std::size_t getStartIndexOfSortedArray(const size_type &x1, const size_type &x2, const size_type &x3,
+                                                  const size_type & /*x4*/
+                                                  ,
+                                                  const size_type & /*nx1*/, const size_type &nx2, const size_type &nx3,
+                                                  const size_type &nx4) const
+    {
+        return nx4 * (nx3 * (nx2 * x1 + x2) + x3);
+    }
 };
 //////////////////////////////////////////////////////////////////////////
 // IndexClasses
 
-//IndexerX4X3X2X1:
-//x1-reihen "liegen am stueck" im speicher
-//optimaler schleifendurchlauf
-//for(alle X4)
+// IndexerX4X3X2X1:
+// x1-reihen "liegen am stueck" im speicher
+// optimaler schleifendurchlauf
+// for(alle X4)
 //  for(alle X3)
 //    for(alle X2)
 //      for(alle X1)
 class IndexerX4X3X2X1
 {
 public:
-   using size_type = size_t;
+    using size_type = size_t;
+
 public:
-   inline std::size_t getIndex( const size_type& x1 , const size_type& x2 , const size_type& x3 , const size_type& x4
-      , const size_type& nx1, const size_type& nx2, const size_type& nx3, const size_type&  /*nx4*/ )  const
-   {
-      return nx1*(nx2*(nx3*x4+ x3)+x2)+x1;
-   }
-   inline std::size_t getStartIndexOfSortedArray(  const size_type&  /*x1*/ , const size_type& x2 , const size_type& x3 , const size_type& x4
-      , const size_type& nx1, const size_type& nx2, const size_type& nx3, const size_type&  /*nx4*/ )  const
-   {
-      return  nx1*(nx2*(nx3*x4+ x3)+x2);
-   }
+    inline std::size_t getIndex(const size_type &x1, const size_type &x2, const size_type &x3, const size_type &x4,
+                                const size_type &nx1, const size_type &nx2, const size_type &nx3,
+                                const size_type & /*nx4*/) const
+    {
+        return nx1 * (nx2 * (nx3 * x4 + x3) + x2) + x1;
+    }
+    inline std::size_t getStartIndexOfSortedArray(const size_type & /*x1*/, const size_type &x2, const size_type &x3,
+                                                  const size_type &x4, const size_type &nx1, const size_type &nx2,
+                                                  const size_type &nx3, const size_type & /*nx4*/) const
+    {
+        return nx1 * (nx2 * (nx3 * x4 + x3) + x2);
+    }
 };
 //////////////////////////////////////////////////////////////////////////
 // CbArray4D
@@ -106,343 +112,327 @@ public:
 //!
 //! -release: not defined "NO_CB_RANGECHECK" && defined "CB_RANGECHECK"
 //////////////////////////////////////////////////////////////////////////
-template<typename T, typename IndexClass = IndexerX4X3X2X1>
+template <typename T, typename IndexClass = IndexerX4X3X2X1>
 class CbArray4D
 {
 public:
-   using CbArray4DPtr = SPtr<CbArray4D<T, IndexClass> >;
+    using CbArray4DPtr = SPtr<CbArray4D<T, IndexClass>>;
 
-   using value_type = T;
-   using indexer_type = IndexClass;
-   using size_type = typename IndexClass::size_type;
-   using reference = typename std::vector<value_type>::reference;
-   using const_reference = typename std::vector<value_type>::const_reference;
-   using pointer = typename std::vector<value_type>::pointer;
-   using const_pointer = typename std::vector<value_type>::const_pointer;
+    using value_type      = T;
+    using indexer_type    = IndexClass;
+    using size_type       = typename IndexClass::size_type;
+    using reference       = typename std::vector<value_type>::reference;
+    using const_reference = typename std::vector<value_type>::const_reference;
+    using pointer         = typename std::vector<value_type>::pointer;
+    using const_pointer   = typename std::vector<value_type>::const_pointer;
 
 private:
-   template< typename value_type2, typename IndexClass2 > friend class CbArray4D;
+    template <typename value_type2, typename IndexClass2>
+    friend class CbArray4D;
 
 public:
-   /*=======================================================================*/
-   CbArray4D()
-   {
-      this->resize(0,0,0,0);
-   }
-   /*=======================================================================*/
-   CbArray4D(const size_type& nx1,const size_type& nx2, const size_type& nx3, const size_type& nx4)
-   {
-      this->resize(nx1,nx2,nx3,nx4);
-   }
-   /*=======================================================================*/
-   CbArray4D(const size_type& nx1,const size_type& nx2, const size_type& nx3, const size_type& nx4, const value_type& val)
-   {
-      this->resize(nx1,nx2,nx3,nx4,val);
-   }
-   /*=======================================================================*/
-   CbArray4D(const size_type& uniformDimensionSize /*nx1=nx2=nx3=nx4*/)
-   {
-      this->resize(uniformDimensionSize,uniformDimensionSize,uniformDimensionSize,uniformDimensionSize);
-   }
-   /*=======================================================================*/
-   //ubernimmt vector als daten vector! (erstellt KEINE kopie!!!, vec ist anschliessend leer, da swap verwendet wird)
-   CbArray4D(std::vector<value_type>& vec, const size_type& nx1,const size_type& nx2, const size_type& nx3, const size_type& nx4)
-   {
-      assert( (nx1*nx2*nx3*nx4)==vec.size() );
-      this->data.swap(vec);
-      this->resize(nx1,nx2,nx3,nx4);
-   }
-   /*=======================================================================*/
-   CbArray4D(const CbArray4D& src)
-      :  nx1(src.nx1)
-       , nx2(src.nx2)
-       , nx3(src.nx3)
-       , nx4(src.nx4)
-       , data(src.data)
-   {
-   }
-   /*=======================================================================*/
-   template< typename value_type2 >
-   CbArray4D(const CbArray4D< value_type2 >& src)
-      :  nx1(src.nx1)
-       , nx2(src.nx2)
-       , nx3(src.nx3)
-       , nx4(src.nx4)
-   {
-      //Sourcedaten kopieren
-      this->data.resize( src.data.size() );
-      for(std::size_t i=0; i<data.size(); ++i)
-         this->data[i] = src.data[i];
-   }
-   /*=======================================================================*/
-   virtual ~CbArray4D()= default;
-   /*=======================================================================*/
-   CbArray4D& operator= (const CbArray4D& rhs)
-   {
-      if(this == &rhs) return *this;
-
-      this->nx1 = rhs.nx1;
-      this->nx2 = rhs.nx2;
-      this->nx3 = rhs.nx3;
-      this->nx4 = rhs.nx4;
-
-      //gespeicherte Datenelemente loeschen
-      //Laenge anpassen
-      this->data.resize(rhs.data.size());
-      //gespeicherte Datenelemente loeschen
-      this->data.clear();
-
-      //Sourcedaten kopieren
-      this->data = rhs.data;
-
-      return *this;
-   }
-   /*=======================================================================*/
-   //durch value_type2 kann man z.B. ein float Array einem double Array zuweisen!
-   template< typename value_type2, typename IndexClass2 >
-   CbArray4D& operator= (const CbArray4D< value_type2, IndexClass2 >& rhs)
-   {
-      this->nx1 = rhs.nx1;
-      this->nx2 = rhs.nx2;
-      this->nx3 = rhs.nx3;
-      this->nx4 = rhs.nx4;
-
-      //gespeicherte Datenelemente loeschen
-      this->data.clear();
-      //Laenge anpassen
-      this->data.resize(rhs.data.size());
-
-      //Sourcedaten kopieren (!! koennte anderen Indexer besitzen!!! -> operator() benutzen)
-      for(int x1=0; x1<this->nx1; x1++)
-         for(int x2=0; x2<this->nx2; x2++)
-            for(int x3=0; x3<this->nx3; x3++)
-               for(int x4=0; x4<this->nx4; x4++)
-                  this->operator()(x1,x2,x3,x4) = static_cast< value_type >( rhs.operator()(x1,x2,x3,x4));
-
-      return *this;
-   }
-   /*=======================================================================*/
-   bool operator== (const CbArray4D& rhs) const
-   {
-      if( this == &rhs ) return true;
-
-      if(   this->nx1!=rhs.nx1
-         || this->nx2!=rhs.nx2
-         || this->nx3!=rhs.nx3
-         || this->nx4!=rhs.nx4
-         || this->data.size() != rhs.data.size() )
-      {
-         return false;
-      }
-
-      return std::equal( this->data.begin(), this->data.end(), rhs.data.begin(), UbEqual<value_type, value_type >() );
-   }
-   /*=======================================================================*/
-   template< typename value_type2, typename IndexClass2 >
-   bool operator== (const CbArray4D< value_type2, IndexClass2 >& rhs) const
-   {
-      if( this->data.size() != rhs.data.size() ) return false;
-
-      //Sourcedaten einzeln checken (!! koennte anderen Indexer besitzen!!! -> operator() benutzen)
-      for(int x4=0; x4<this->nx4; x4++)
-         for(int x3=0; x3<this->nx3; x3++)
-            for(int x2=0; x2<this->nx2; x2++)
-             for(int x1=0; x1<this->nx1; x1++)
-               if( !isUbEqual(this->operator()(x1,x2,x3,x4), rhs.operator()(x1,x2,x3,x4)) )
-                  return false;
-
-      return true;
-   }
-   /*=======================================================================*/
-   bool operator!= (const CbArray4D& rhs) const
-   {
-      return !(*this==rhs);
-   }
-   /*=======================================================================*/
-   template< typename value_type2, typename IndexClass2 >
-   bool operator!= (const CbArray4D< value_type2, IndexClass2 >& rhs) const
-   {
-      return !(*this==rhs);
-   }
-   /*=======================================================================*/
-   reference operator() (const size_type& x1, const size_type& x2, const size_type& x3, const size_type& x4)
-   {
-      #if !defined(NO_CB_RANGECHECK) && ( defined(_DEBUG) || defined(CB_RANGECHECK) )
-         if( !this->indicesInRange(x1,x2,x3,x4) )
-            UB_THROW( UbException(UB_EXARGS,getExceptionErrorString(x1,x2,x3,x4)) );
-      #endif
-
-      return this->data[indexer.getIndex(x1,x2,x3,x4,nx1,nx2,nx3,nx4)];
-   }
-   /*=======================================================================*/
-   const_reference operator() (const size_type& x1, const size_type& x2, const size_type& x3, const size_type& x4)	const
-   {
-      #ifdef CbArray4D_RANGECHECKING
-         if( !this->indicesInRange(x1,x2,x3,x4) )
-            UB_THROW( UbException(UB_EXARGS,getExceptionErrorString(x1,x2,x3,x4)) );
-      #endif
-
-      return this->data[indexer.getIndex(x1,x2,x3,x4,nx1,nx2,nx3,nx4)];
-   }
-   /*=======================================================================*/
-   pointer getStartAdressOfSortedArray(const size_type& x1, const size_type& x2, const size_type& x3, const size_type& x4)
-   {
-      #if !defined(NO_CB_RANGECHECK) && ( defined(_DEBUG) || defined(CB_RANGECHECK) )
-         if( !this->indicesInRange(x1,x2,x3,x4) )
-            UB_THROW( UbException(UB_EXARGS,getExceptionErrorString(x1,x2,x3,x4)) );
-      #endif
-
-      return &this->data[indexer.getStartIndexOfSortedArray(x1,x2,x3,x4,nx1,nx2,nx3,nx4)];
-   }
-   /*=======================================================================*/
-   const_pointer getStartAdressOfSortedArray(const size_type& x1, const size_type& x2, const size_type& x3, const size_type& x4)  const
-   {
-      #if !defined(NO_CB_RANGECHECK) && ( defined(_DEBUG) || defined(CB_RANGECHECK) )
-         if( !this->indicesInRange(x1,x2,x3,x4) )
-            UB_THROW( UbException(UB_EXARGS,getExceptionErrorString(x1,x2,x3,x4)) );
-      #endif
-
-      return &this->data[indexer.getStartIndexOfSortedArray(x1,x2,x3,x4,nx1,nx2,nx3,nx4)];
-   }
-   /*=======================================================================*/
-   void setObject(const size_type& x1, const size_type& x2, const size_type& x3, const size_type& x4, const value_type& value)
-   {
-      #if !defined(NO_CB_RANGECHECK) && ( defined(_DEBUG) || defined(CB_RANGECHECK) )
-         if( !this->indicesInRange(x1,x2,x3,x4) )
-            UB_THROW( UbException(UB_EXARGS,getExceptionErrorString(x1,x2,x3,x4)) );
-      #endif
-
-      this->data[indexer.getIndex(x1,x2,x3,x4,nx1,nx2,nx3,nx4)] = value;
-   }
-   /*=======================================================================*/
-   reference getObject(const size_type& x1, const size_type& x2, const size_type& x3, const size_type& x4)
-   {
-      #if !defined(NO_CB_RANGECHECK) && ( defined(_DEBUG) || defined(CB_RANGECHECK) )
-         if( !this->indicesInRange(x1,x2,x3,x4) )
-            UB_THROW( UbException(UB_EXARGS,getExceptionErrorString(x1,x2,x3,x4)) );
-      #endif
-
-      return this->data[indexer.getIndex(x1,x2,x3,x4,nx1,nx2,nx3,nx4)];
-   }
-   /*=======================================================================*/
-   const_reference getObject(const size_type& x1, const size_type& x2, const size_type& x3, const size_type& x4) const
-   {
-      #if !defined(NO_CB_RANGECHECK) && ( defined(_DEBUG) || defined(CB_RANGECHECK) )
-         if( !this->indicesInRange(x1,x2,x3,x4) )
-            UB_THROW( UbException(UB_EXARGS,getExceptionErrorString(x1,x2,x3,x4)) );
-      #endif
-      return (*this)(x1,x2,x3,x4,nx1,nx2,nx3,nx4);
-   }
-   /*=======================================================================*/
-   bool      isEmpty() const { return data.empty(); }
-   size_type getNX1()  const { return this->nx1;    }
-   size_type getNX2()  const { return this->nx2;    }
-   size_type getNX3()  const { return this->nx3;    }
-   size_type getNX4()  const { return this->nx4;    }
-   /*=======================================================================*/
-   void reset(const value_type& val)
-   {
-      std::fill( this->data.begin(), this->data.end(), val );
-   }
-   /*=======================================================================*/
-   std::string toString() const
-   {
-      std::stringstream text;
-      text<<std::setprecision(19);
-      for(size_type x1=0; x1<this->nx1; x1++)
-      {
-      	for(size_type x2=0; x2<this->nx2; x2++)
-      	{
-         	for(size_type x3=0; x3<this->nx3; x3++)
-         	{
-               for(size_type x4=0; x4<this->nx4; x4++)
-               {
-                 	text<<(*this)(x1,x2,x3,x4)<<", ";
-               }
-               text<<std::endl;
-         	}
-         	text<<std::endl;
-      	}
-      	text<<std::endl<<std::endl;
-      }
-
-      return text.str();
-   }
-   /*=======================================================================*/
-   std::string getInfo() const
-   {
-      std::stringstream text;
-      text<<"CbArray4D< storageType="<<typeid(T).name()<<", indexer="<<typeid(IndexClass).name()<<" >";
-      text<<"( nx1="<<this->nx1<<", nx2="<<this->nx2<<", nx3="<<this->nx3<<", nx4="<<this->nx4<<")";
-      return text.str();
-   }
-   /*=======================================================================*/
-   void resize(const size_type& uniformDimensionSize) { this->resize(uniformDimensionSize,uniformDimensionSize,uniformDimensionSize); }
-   /*=======================================================================*/
-   void resize(const size_type& nx1, const size_type& nx2, const size_type& nx3, const size_type& nx4)
-   {
-      this->nx1 = nx1;
-      this->nx2 = nx2;
-      this->nx3 = nx3;
-      this->nx4 = nx4;
-      this->data.resize(nx1*nx2*nx3*nx4);
-   }
-   /*=======================================================================*/
-   void resize(const size_type& nx1, const size_type& nx2, const size_type& nx3, const size_type& nx4, const value_type& val)
-   {
-      this->nx1 = nx1;
-      this->nx2 = nx2;
-      this->nx3 = nx3;
-      this->nx4 = nx4;
-      this->data.resize(nx1*nx2*nx3*nx4,val);
-   }
-   /*=======================================================================*/
-   std::vector< value_type >& getDataVector() { return this->data; }
-   /*=======================================================================*/
-   const std::vector< value_type >& getDataVector() const { return this->data; }
-   /*=======================================================================*/
-   inline std::size_t getDataVectorIndex(const size_type& x1, const size_type& x2, const size_type& x3, const size_type& x4) const
-   {
-      #if !defined(NO_CB_RANGECHECK) && ( defined(_DEBUG) || defined(CB_RANGECHECK) )
-         if( !this->indicesInRange(x1,x2,x3,x4) )
-            UB_THROW( UbException(UB_EXARGS,getExceptionErrorString(x1,x2,x3,x4)) );
-      #endif
-
-      return indexer.getIndex(x1,x2,x3,x4,nx1,nx2,nx3,nx4);
-   }
+    /*=======================================================================*/
+    CbArray4D() { this->resize(0, 0, 0, 0); }
+    /*=======================================================================*/
+    CbArray4D(const size_type &nx1, const size_type &nx2, const size_type &nx3, const size_type &nx4)
+    {
+        this->resize(nx1, nx2, nx3, nx4);
+    }
+    /*=======================================================================*/
+    CbArray4D(const size_type &nx1, const size_type &nx2, const size_type &nx3, const size_type &nx4,
+              const value_type &val)
+    {
+        this->resize(nx1, nx2, nx3, nx4, val);
+    }
+    /*=======================================================================*/
+    CbArray4D(const size_type &uniformDimensionSize /*nx1=nx2=nx3=nx4*/)
+    {
+        this->resize(uniformDimensionSize, uniformDimensionSize, uniformDimensionSize, uniformDimensionSize);
+    }
+    /*=======================================================================*/
+    // ubernimmt vector als daten vector! (erstellt KEINE kopie!!!, vec ist anschliessend leer, da swap verwendet wird)
+    CbArray4D(std::vector<value_type> &vec, const size_type &nx1, const size_type &nx2, const size_type &nx3,
+              const size_type &nx4)
+    {
+        assert((nx1 * nx2 * nx3 * nx4) == vec.size());
+        this->data.swap(vec);
+        this->resize(nx1, nx2, nx3, nx4);
+    }
+    /*=======================================================================*/
+    CbArray4D(const CbArray4D &src) : nx1(src.nx1), nx2(src.nx2), nx3(src.nx3), nx4(src.nx4), data(src.data) {}
+    /*=======================================================================*/
+    template <typename value_type2>
+    CbArray4D(const CbArray4D<value_type2> &src) : nx1(src.nx1), nx2(src.nx2), nx3(src.nx3), nx4(src.nx4)
+    {
+        // Sourcedaten kopieren
+        this->data.resize(src.data.size());
+        for (std::size_t i = 0; i < data.size(); ++i)
+            this->data[i] = src.data[i];
+    }
+    /*=======================================================================*/
+    virtual ~CbArray4D() = default;
+    /*=======================================================================*/
+    CbArray4D &operator=(const CbArray4D &rhs)
+    {
+        if (this == &rhs)
+            return *this;
+
+        this->nx1 = rhs.nx1;
+        this->nx2 = rhs.nx2;
+        this->nx3 = rhs.nx3;
+        this->nx4 = rhs.nx4;
+
+        // gespeicherte Datenelemente loeschen
+        // Laenge anpassen
+        this->data.resize(rhs.data.size());
+        // gespeicherte Datenelemente loeschen
+        this->data.clear();
+
+        // Sourcedaten kopieren
+        this->data = rhs.data;
+
+        return *this;
+    }
+    /*=======================================================================*/
+    // durch value_type2 kann man z.B. ein float Array einem double Array zuweisen!
+    template <typename value_type2, typename IndexClass2>
+    CbArray4D &operator=(const CbArray4D<value_type2, IndexClass2> &rhs)
+    {
+        this->nx1 = rhs.nx1;
+        this->nx2 = rhs.nx2;
+        this->nx3 = rhs.nx3;
+        this->nx4 = rhs.nx4;
+
+        // gespeicherte Datenelemente loeschen
+        this->data.clear();
+        // Laenge anpassen
+        this->data.resize(rhs.data.size());
+
+        // Sourcedaten kopieren (!! koennte anderen Indexer besitzen!!! -> operator() benutzen)
+        for (int x1 = 0; x1 < this->nx1; x1++)
+            for (int x2 = 0; x2 < this->nx2; x2++)
+                for (int x3 = 0; x3 < this->nx3; x3++)
+                    for (int x4 = 0; x4 < this->nx4; x4++)
+                        this->operator()(x1, x2, x3, x4) = static_cast<value_type>(rhs.operator()(x1, x2, x3, x4));
+
+        return *this;
+    }
+    /*=======================================================================*/
+    bool operator==(const CbArray4D &rhs) const
+    {
+        if (this == &rhs)
+            return true;
+
+        if (this->nx1 != rhs.nx1 || this->nx2 != rhs.nx2 || this->nx3 != rhs.nx3 || this->nx4 != rhs.nx4 ||
+            this->data.size() != rhs.data.size()) {
+            return false;
+        }
+
+        return std::equal(this->data.begin(), this->data.end(), rhs.data.begin(), UbEqual<value_type, value_type>());
+    }
+    /*=======================================================================*/
+    template <typename value_type2, typename IndexClass2>
+    bool operator==(const CbArray4D<value_type2, IndexClass2> &rhs) const
+    {
+        if (this->data.size() != rhs.data.size())
+            return false;
+
+        // Sourcedaten einzeln checken (!! koennte anderen Indexer besitzen!!! -> operator() benutzen)
+        for (int x4 = 0; x4 < this->nx4; x4++)
+            for (int x3 = 0; x3 < this->nx3; x3++)
+                for (int x2 = 0; x2 < this->nx2; x2++)
+                    for (int x1 = 0; x1 < this->nx1; x1++)
+                        if (!isUbEqual(this->operator()(x1, x2, x3, x4), rhs.operator()(x1, x2, x3, x4)))
+                            return false;
+
+        return true;
+    }
+    /*=======================================================================*/
+    bool operator!=(const CbArray4D &rhs) const { return !(*this == rhs); }
+    /*=======================================================================*/
+    template <typename value_type2, typename IndexClass2>
+    bool operator!=(const CbArray4D<value_type2, IndexClass2> &rhs) const
+    {
+        return !(*this == rhs);
+    }
+    /*=======================================================================*/
+    reference operator()(const size_type &x1, const size_type &x2, const size_type &x3, const size_type &x4)
+    {
+#if !defined(NO_CB_RANGECHECK) && (defined(_DEBUG) || defined(CB_RANGECHECK))
+        if (!this->indicesInRange(x1, x2, x3, x4))
+            UB_THROW(UbException(UB_EXARGS, getExceptionErrorString(x1, x2, x3, x4)));
+#endif
+
+        return this->data[indexer.getIndex(x1, x2, x3, x4, nx1, nx2, nx3, nx4)];
+    }
+    /*=======================================================================*/
+    const_reference operator()(const size_type &x1, const size_type &x2, const size_type &x3, const size_type &x4) const
+    {
+#ifdef CbArray4D_RANGECHECKING
+        if (!this->indicesInRange(x1, x2, x3, x4))
+            UB_THROW(UbException(UB_EXARGS, getExceptionErrorString(x1, x2, x3, x4)));
+#endif
+
+        return this->data[indexer.getIndex(x1, x2, x3, x4, nx1, nx2, nx3, nx4)];
+    }
+    /*=======================================================================*/
+    pointer getStartAdressOfSortedArray(const size_type &x1, const size_type &x2, const size_type &x3,
+                                        const size_type &x4)
+    {
+#if !defined(NO_CB_RANGECHECK) && (defined(_DEBUG) || defined(CB_RANGECHECK))
+        if (!this->indicesInRange(x1, x2, x3, x4))
+            UB_THROW(UbException(UB_EXARGS, getExceptionErrorString(x1, x2, x3, x4)));
+#endif
+
+        return &this->data[indexer.getStartIndexOfSortedArray(x1, x2, x3, x4, nx1, nx2, nx3, nx4)];
+    }
+    /*=======================================================================*/
+    const_pointer getStartAdressOfSortedArray(const size_type &x1, const size_type &x2, const size_type &x3,
+                                              const size_type &x4) const
+    {
+#if !defined(NO_CB_RANGECHECK) && (defined(_DEBUG) || defined(CB_RANGECHECK))
+        if (!this->indicesInRange(x1, x2, x3, x4))
+            UB_THROW(UbException(UB_EXARGS, getExceptionErrorString(x1, x2, x3, x4)));
+#endif
+
+        return &this->data[indexer.getStartIndexOfSortedArray(x1, x2, x3, x4, nx1, nx2, nx3, nx4)];
+    }
+    /*=======================================================================*/
+    void setObject(const size_type &x1, const size_type &x2, const size_type &x3, const size_type &x4,
+                   const value_type &value)
+    {
+#if !defined(NO_CB_RANGECHECK) && (defined(_DEBUG) || defined(CB_RANGECHECK))
+        if (!this->indicesInRange(x1, x2, x3, x4))
+            UB_THROW(UbException(UB_EXARGS, getExceptionErrorString(x1, x2, x3, x4)));
+#endif
+
+        this->data[indexer.getIndex(x1, x2, x3, x4, nx1, nx2, nx3, nx4)] = value;
+    }
+    /*=======================================================================*/
+    reference getObject(const size_type &x1, const size_type &x2, const size_type &x3, const size_type &x4)
+    {
+#if !defined(NO_CB_RANGECHECK) && (defined(_DEBUG) || defined(CB_RANGECHECK))
+        if (!this->indicesInRange(x1, x2, x3, x4))
+            UB_THROW(UbException(UB_EXARGS, getExceptionErrorString(x1, x2, x3, x4)));
+#endif
+
+        return this->data[indexer.getIndex(x1, x2, x3, x4, nx1, nx2, nx3, nx4)];
+    }
+    /*=======================================================================*/
+    const_reference getObject(const size_type &x1, const size_type &x2, const size_type &x3, const size_type &x4) const
+    {
+#if !defined(NO_CB_RANGECHECK) && (defined(_DEBUG) || defined(CB_RANGECHECK))
+        if (!this->indicesInRange(x1, x2, x3, x4))
+            UB_THROW(UbException(UB_EXARGS, getExceptionErrorString(x1, x2, x3, x4)));
+#endif
+        return (*this)(x1, x2, x3, x4, nx1, nx2, nx3, nx4);
+    }
+    /*=======================================================================*/
+    bool isEmpty() const { return data.empty(); }
+    size_type getNX1() const { return this->nx1; }
+    size_type getNX2() const { return this->nx2; }
+    size_type getNX3() const { return this->nx3; }
+    size_type getNX4() const { return this->nx4; }
+    /*=======================================================================*/
+    void reset(const value_type &val) { std::fill(this->data.begin(), this->data.end(), val); }
+    /*=======================================================================*/
+    std::string toString() const
+    {
+        std::stringstream text;
+        text << std::setprecision(19);
+        for (size_type x1 = 0; x1 < this->nx1; x1++) {
+            for (size_type x2 = 0; x2 < this->nx2; x2++) {
+                for (size_type x3 = 0; x3 < this->nx3; x3++) {
+                    for (size_type x4 = 0; x4 < this->nx4; x4++) {
+                        text << (*this)(x1, x2, x3, x4) << ", ";
+                    }
+                    text << std::endl;
+                }
+                text << std::endl;
+            }
+            text << std::endl << std::endl;
+        }
+
+        return text.str();
+    }
+    /*=======================================================================*/
+    std::string getInfo() const
+    {
+        std::stringstream text;
+        text << "CbArray4D< storageType=" << typeid(T).name() << ", indexer=" << typeid(IndexClass).name() << " >";
+        text << "( nx1=" << this->nx1 << ", nx2=" << this->nx2 << ", nx3=" << this->nx3 << ", nx4=" << this->nx4 << ")";
+        return text.str();
+    }
+    /*=======================================================================*/
+    void resize(const size_type &uniformDimensionSize)
+    {
+        this->resize(uniformDimensionSize, uniformDimensionSize, uniformDimensionSize);
+    }
+    /*=======================================================================*/
+    void resize(const size_type &nx1, const size_type &nx2, const size_type &nx3, const size_type &nx4)
+    {
+        this->nx1 = nx1;
+        this->nx2 = nx2;
+        this->nx3 = nx3;
+        this->nx4 = nx4;
+        this->data.resize(nx1 * nx2 * nx3 * nx4);
+    }
+    /*=======================================================================*/
+    void resize(const size_type &nx1, const size_type &nx2, const size_type &nx3, const size_type &nx4,
+                const value_type &val)
+    {
+        this->nx1 = nx1;
+        this->nx2 = nx2;
+        this->nx3 = nx3;
+        this->nx4 = nx4;
+        this->data.resize(nx1 * nx2 * nx3 * nx4, val);
+    }
+    /*=======================================================================*/
+    std::vector<value_type> &getDataVector() { return this->data; }
+    /*=======================================================================*/
+    const std::vector<value_type> &getDataVector() const { return this->data; }
+    /*=======================================================================*/
+    inline std::size_t getDataVectorIndex(const size_type &x1, const size_type &x2, const size_type &x3,
+                                          const size_type &x4) const
+    {
+#if !defined(NO_CB_RANGECHECK) && (defined(_DEBUG) || defined(CB_RANGECHECK))
+        if (!this->indicesInRange(x1, x2, x3, x4))
+            UB_THROW(UbException(UB_EXARGS, getExceptionErrorString(x1, x2, x3, x4)));
+#endif
+
+        return indexer.getIndex(x1, x2, x3, x4, nx1, nx2, nx3, nx4);
+    }
 
 protected:
-   /*=======================================================================*/
-   //success -> true
-   //else    -> false
-   inline bool indicesInRange(const size_type& x1, const size_type& x2, const size_type& x3, const size_type& x4) const
-   {
-      if(   x1 < 0 || x1 >= this->nx1
-         || x2 < 0 || x2 >= this->nx2
-         || x3 < 0 || x3 >= this->nx3
-         || x4 < 0 || x4 >= this->nx4 )
-      {
-         return false;
-      }
-      return true;
-   }
-   /*=======================================================================*/
-   std::string getExceptionErrorString(const size_type& x1, const size_type& x2, const size_type& x3, const size_type& x4) const
-   {
-      std::stringstream out("index out of range - ");
-      out<<"("<<x1<<","<<x2<<","<<x3<<","<<x4<<") not in ("<<nx1<<","<<nx2<<","<<nx3<<","<<nx4<<")";
-      return out.str();
-   }
-   /*=======================================================================*/
+    /*=======================================================================*/
+    // success -> true
+    // else    -> false
+    inline bool indicesInRange(const size_type &x1, const size_type &x2, const size_type &x3, const size_type &x4) const
+    {
+        if (x1 < 0 || x1 >= this->nx1 || x2 < 0 || x2 >= this->nx2 || x3 < 0 || x3 >= this->nx3 || x4 < 0 ||
+            x4 >= this->nx4) {
+            return false;
+        }
+        return true;
+    }
+    /*=======================================================================*/
+    std::string getExceptionErrorString(const size_type &x1, const size_type &x2, const size_type &x3,
+                                        const size_type &x4) const
+    {
+        std::stringstream out("index out of range - ");
+        out << "(" << x1 << "," << x2 << "," << x3 << "," << x4 << ") not in (" << nx1 << "," << nx2 << "," << nx3
+            << "," << nx4 << ")";
+        return out.str();
+    }
+    /*=======================================================================*/
 
 protected:
-   size_type    nx1;
-   size_type    nx2;
-   size_type    nx3;
-   size_type    nx4;
-   indexer_type indexer;
-   std::vector< value_type > data;
-
+    size_type nx1;
+    size_type nx2;
+    size_type nx3;
+    size_type nx4;
+    indexer_type indexer;
+    std::vector<value_type> data;
 };
 
-#endif //CBARRAY4D_H
+#endif // CBARRAY4D_H
diff --git a/src/basics/basics/container/CbVector.h b/src/basics/basics/container/CbVector.h
index 49ccfcfacbd25d47bcfafa1c52f10cfe6a0c139c..3cf88151ee15efb7eee52a5d1092b9956b8003fe 100644
--- a/src/basics/basics/container/CbVector.h
+++ b/src/basics/basics/container/CbVector.h
@@ -1,28 +1,28 @@
 //=======================================================================================
-// ____          ____    __    ______     __________   __      __       __        __         
-// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |        
-//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |        
-//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |        
-//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____    
-//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|   
-//      \    \  |    |   ________________________________________________________________    
-//       \    \ |    |  |  ______________________________________________________________|   
-//        \    \|    |  |  |         __          __     __     __     ______      _______    
-//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)   
-//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______    
+// ____          ____    __    ______     __________   __      __       __        __
+// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |
+//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |
+//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |
+//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____
+//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|
+//      \    \  |    |   ________________________________________________________________
+//       \    \ |    |  |  ______________________________________________________________|
+//        \    \|    |  |  |         __          __     __     __     ______      _______
+//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)
+//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______
 //           \       |  |  |        |  |_____   |   \_/   |   |  |   |  |_/  /    _____  |
-//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/   
+//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/
 //
-//  This file is part of VirtualFluids. VirtualFluids is free software: you can 
+//  This file is part of VirtualFluids. VirtualFluids is free software: you can
 //  redistribute it and/or modify it under the terms of the GNU General Public
-//  License as published by the Free Software Foundation, either version 3 of 
+//  License as published by the Free Software Foundation, either version 3 of
 //  the License, or (at your option) any later version.
-//  
-//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT 
-//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
-//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License 
+//
+//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT
+//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 //  for more details.
-//  
+//
 //  You should have received a copy of the GNU General Public License along
 //  with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>.
 //
@@ -33,22 +33,24 @@
 #ifndef CBVECTOR_H
 #define CBVECTOR_H
 
+#include <PointerDefinitions.h> //for memcopy
+#include <algorithm>            //for std::swap
+#include <typeinfo>             //for typeid
 #include <vector>
-#include <algorithm> //for std::swap
-#include <typeinfo>  //for typeid
-#include <PointerDefinitions.h>    //for memcopy
 
-#include <basics/utilities/UbSystem.h>
 #include <basics/utilities/UbEqual.h>
+#include <basics/utilities/UbSystem.h>
 
-template< typename T > class CbVectorAllocator;
-template< typename T > class CbVectorAllocatorStd;
+template <typename T>
+class CbVectorAllocator;
+template <typename T>
+class CbVectorAllocatorStd;
 
 //=========================================================================
 //! \brief A class implements a container like a vector
 //! \details
 //! For this class it was required to ave only the type as template argument.
-//! Hence, the allocator must be an abstract class. With out this requirement, 
+//! Hence, the allocator must be an abstract class. With out this requirement,
 //! an allocator as second template argument would have been possible, as in the
 //! STL vector. This would lead to the compiler generating two different classes
 //! for the same data type with different allocators during compile time. Here it
@@ -59,250 +61,250 @@ template< typename T > class CbVectorAllocatorStd;
 //! -release: not defined "NO_CB_RANGECHECK" && defined "CB_RANGECHECK"
 //=========================================================================
 //////////////////////////////////////////////////////////////////////////
-template< typename T >
+template <typename T>
 class CbVector
 {
 public:
-   using value_type = T;
-   using pointer = value_type *;
-   using size_type = std::size_t;
+    using value_type = T;
+    using pointer    = value_type *;
+    using size_type  = std::size_t;
 
-   friend class CbVectorAllocator<value_type>; //um auf ptrData und dataSize zugreifen zu koennen!
+    friend class CbVectorAllocator<value_type>; // um auf ptrData und dataSize zugreifen zu koennen!
+
+    CbVector<value_type>(const CbVector<value_type> &src) = delete;
 
-    CbVector<value_type>(const CbVector<value_type>& src) = delete;
 public:
-   /*==========================================================*/
-   CbVector( CbVectorAllocator<value_type>* const& allocator = new CbVectorAllocatorStd<value_type> )
-      :  ptrData(NULL)
-       , 
-        allocator(allocator)
-   {
-      this->allocator->alloc(*this,0,value_type());
-   }
-   /*==========================================================*/
-   CbVector( const size_type size, CbVectorAllocator<value_type>* const& allocator = new CbVectorAllocatorStd<value_type>, const value_type& value=value_type() )
-      :  ptrData(NULL)
-       , 
-        allocator(allocator)
-   {
-      this->allocator->alloc(*this,size,value);
-   }
-   /*==========================================================*/
-   virtual ~CbVector()
-   {
-      if(allocator)
-      {
-         this->allocator->dealloc(*this);
-         delete allocator;
-         allocator=NULL;
-      }
-   }
-   /*=======================================================================*/
-   CbVector& operator= (const CbVector& src)
-   {
-      if(this == &src)
-          return *this;
+    /*==========================================================*/
+    CbVector(CbVectorAllocator<value_type> *const &allocator = new CbVectorAllocatorStd<value_type>)
+        : ptrData(NULL), allocator(allocator)
+    {
+        this->allocator->alloc(*this, 0, value_type());
+    }
+    /*==========================================================*/
+    CbVector(const size_type size,
+             CbVectorAllocator<value_type> *const &allocator = new CbVectorAllocatorStd<value_type>,
+             const value_type &value                         = value_type())
+        : ptrData(NULL), allocator(allocator)
+    {
+        this->allocator->alloc(*this, size, value);
+    }
+    /*==========================================================*/
+    virtual ~CbVector()
+    {
+        if (allocator) {
+            this->allocator->dealloc(*this);
+            delete allocator;
+            allocator = NULL;
+        }
+    }
+    /*=======================================================================*/
+    CbVector &operator=(const CbVector &src)
+    {
+        if (this == &src)
+            return *this;
 
-      //gespeicherte Datenelemente loeschen
-      //Laenge anpassen
-      this->allocator->resize(*this, src.size());
+        // gespeicherte Datenelemente loeschen
+        // Laenge anpassen
+        this->allocator->resize(*this, src.size());
 
-      //gespeicherte Datenelemente kopieren
-      if( !src.empty() ) 
-      {
-         memcpy( (char*)ptrData, (char*)&src[0], src.size()*sizeof(value_type) ); 
-         //for(size_type i=0; i<src.size(); i++)
-         //   (*this)[i] = src[i];
-      }
+        // gespeicherte Datenelemente kopieren
+        if (!src.empty()) {
+            memcpy((char *)ptrData, (char *)&src[0], src.size() * sizeof(value_type));
+            // for(size_type i=0; i<src.size(); i++)
+            //   (*this)[i] = src[i];
+        }
 
-      return *this;
-   }
-   /*=======================================================================*/
-   CbVector& operator= (const std::vector< value_type >& src)
-   {
-      //gespeicherte Datenelemente loeschen
-      //Laenge anpassen
-      this->allocator->resize(*this, src.size());
+        return *this;
+    }
+    /*=======================================================================*/
+    CbVector &operator=(const std::vector<value_type> &src)
+    {
+        // gespeicherte Datenelemente loeschen
+        // Laenge anpassen
+        this->allocator->resize(*this, src.size());
 
-      //gespeicherte Datenelemente kopieren
-      if( !src.empty() ) 
-      {
-         memcpy( (char*)ptrData, (char*)&src[0], src.size()*sizeof(value_type) ); 
-         //for(size_type i=0; i<src.size(); i++)
-         //   (*this)[i] = src[i];
-      }
-      
-      return *this;
-   }
-   /*=======================================================================*/
-   bool operator== (const CbVector& rhs) const
-   {
-      if( this           == &rhs         ) return true;
-      if( this->dataSize != rhs.dataSize ) return false;
+        // gespeicherte Datenelemente kopieren
+        if (!src.empty()) {
+            memcpy((char *)ptrData, (char *)&src[0], src.size() * sizeof(value_type));
+            // for(size_type i=0; i<src.size(); i++)
+            //   (*this)[i] = src[i];
+        }
 
-      for(size_type i=0; i<rhs.size(); i++)
-         if( !isUbEqual( this->operator[](i), rhs.operator[](i) ) )
+        return *this;
+    }
+    /*=======================================================================*/
+    bool operator==(const CbVector &rhs) const
+    {
+        if (this == &rhs)
+            return true;
+        if (this->dataSize != rhs.dataSize)
             return false;
 
-      return true;
-   }
-   /*==========================================================*/
-   void setAllocator( CbVectorAllocator<value_type>* const& allocator )
-   {
-      if(this->allocator)
-      {
-         if(this->allocator==allocator) return;
-         this->allocator->dealloc(*this);
-         delete this->allocator;
-      }
-      this->allocator = allocator;
-      this->allocator->alloc(*this,0);
-   }
-   /*==========================================================*/
-   size_type size() const { return dataSize; }
-   /*==========================================================*/
-   bool empty() const { return dataSize==0; }
-   /*==========================================================*/
-   bool resize(const size_type& dataSize)
-   {
-      return allocator->resize(*this, dataSize);
-   }
-   /*==========================================================*/
-   bool resize(const size_type& dataSize, const value_type& value)
-   {
-      return allocator->resize(*this, dataSize, value);
-   }
-   /*==========================================================*/
-   void swap(CbVector& rhs)
-   {
-      if( this == &rhs ) return;
+        for (size_type i = 0; i < rhs.size(); i++)
+            if (!isUbEqual(this->operator[](i), rhs.operator[](i)))
+                return false;
+
+        return true;
+    }
+    /*==========================================================*/
+    void setAllocator(CbVectorAllocator<value_type> *const &allocator)
+    {
+        if (this->allocator) {
+            if (this->allocator == allocator)
+                return;
+            this->allocator->dealloc(*this);
+            delete this->allocator;
+        }
+        this->allocator = allocator;
+        this->allocator->alloc(*this, 0);
+    }
+    /*==========================================================*/
+    size_type size() const { return dataSize; }
+    /*==========================================================*/
+    bool empty() const { return dataSize == 0; }
+    /*==========================================================*/
+    bool resize(const size_type &dataSize) { return allocator->resize(*this, dataSize); }
+    /*==========================================================*/
+    bool resize(const size_type &dataSize, const value_type &value)
+    {
+        return allocator->resize(*this, dataSize, value);
+    }
+    /*==========================================================*/
+    void swap(CbVector &rhs)
+    {
+        if (this == &rhs)
+            return;
 
-      std::swap( this->ptrData  , rhs.ptrData   );
-      std::swap( this->dataSize , rhs.dataSize  );
-      std::swap( this->allocator, rhs.allocator );
-   }
-   /*==========================================================*/
-   value_type& operator[](const size_type& i)
-   {
-      #if !defined(NO_CB_RANGECHECK) && ( defined(_DEBUG) || defined(CB_RANGECHECK) )
-         if(i>=dataSize) 
-            UB_THROW( UbException(UB_EXARGS,"T="+(std::string)typeid(*this).name()+UbSystem::toString(i)+" out of range (size="+UbSystem::toString(dataSize)+")") );
-      #endif // _DEBUG
+        std::swap(this->ptrData, rhs.ptrData);
+        std::swap(this->dataSize, rhs.dataSize);
+        std::swap(this->allocator, rhs.allocator);
+    }
+    /*==========================================================*/
+    value_type &operator[](const size_type &i)
+    {
+#if !defined(NO_CB_RANGECHECK) && (defined(_DEBUG) || defined(CB_RANGECHECK))
+        if (i >= dataSize)
+            UB_THROW(UbException(UB_EXARGS, "T=" + (std::string) typeid(*this).name() + UbSystem::toString(i) +
+                                                " out of range (size=" + UbSystem::toString(dataSize) + ")"));
+#endif // _DEBUG
 
-      return ptrData[i];
-   }
-   /*==========================================================*/
-   const value_type& operator[](const size_type& i) const
-   {
-      #if !defined(NO_CB_RANGECHECK) && ( defined(_DEBUG) || defined(CB_RANGECHECK) )
-         if(i>=dataSize) 
-            UB_THROW( UbException(UB_EXARGS,"T="+(std::string)typeid(*this).name()+UbSystem::toString(i)+" out of range (size="+UbSystem::toString(dataSize)+")") );
-      #endif // _DEBUG
+        return ptrData[i];
+    }
+    /*==========================================================*/
+    const value_type &operator[](const size_type &i) const
+    {
+#if !defined(NO_CB_RANGECHECK) && (defined(_DEBUG) || defined(CB_RANGECHECK))
+        if (i >= dataSize)
+            UB_THROW(UbException(UB_EXARGS, "T=" + (std::string) typeid(*this).name() + UbSystem::toString(i) +
+                                                " out of range (size=" + UbSystem::toString(dataSize) + ")"));
+#endif // _DEBUG
 
-      return ptrData[i];
-   }
-   /*==========================================================*/
-   CbVectorAllocator<value_type>* getAllocator() const { return allocator; }
-   /*==========================================================*/
+        return ptrData[i];
+    }
+    /*==========================================================*/
+    CbVectorAllocator<value_type> *getAllocator() const { return allocator; }
+    /*==========================================================*/
 
 private:
-   value_type* ptrData;
-   size_type   dataSize{0};
-   CbVectorAllocator<value_type>* allocator;
-   //CbVector<value_type>& operator=(const CbVector<value_type>& src);
+    value_type *ptrData;
+    size_type dataSize{ 0 };
+    CbVectorAllocator<value_type> *allocator;
+    // CbVector<value_type>& operator=(const CbVector<value_type>& src);
 };
 
 //////////////////////////////////////////////////////////////////////////
 // CbVectorAllocator-Interface
 //////////////////////////////////////////////////////////////////////////
-template< typename T >
+template <typename T>
 class CbVectorAllocator
 {
 public:
-   using value_type = typename CbVector<T>::value_type;
-   using size_type = typename CbVector<value_type>::size_type;
+    using value_type = typename CbVector<T>::value_type;
+    using size_type  = typename CbVector<value_type>::size_type;
 
 public:
-   CbVectorAllocator() = default;
-   virtual ~CbVectorAllocator() = default;
+    CbVectorAllocator()          = default;
+    virtual ~CbVectorAllocator() = default;
 
-   virtual bool alloc(CbVector< value_type >& vec, const size_type& dataSize, const value_type& value=value_type()) = 0;
-   virtual bool resize(CbVector< value_type >& vec, const size_type& dataSize, const value_type& value=value_type()) = 0;
-   virtual bool dealloc(CbVector< value_type >& vec) = 0;
+    virtual bool alloc(CbVector<value_type> &vec, const size_type &dataSize,
+                       const value_type &value = value_type())  = 0;
+    virtual bool resize(CbVector<value_type> &vec, const size_type &dataSize,
+                        const value_type &value = value_type()) = 0;
+    virtual bool dealloc(CbVector<value_type> &vec)             = 0;
 
 protected:
-   //folgende Methoden ersparen eine friend Deklaierung aller moeglichen Allocatoren
-   //denn durch diese beiden Methoden haben sie exklusive Zugriffsrechte!
-   //**********************************************************************************//
-   inline value_type*& ptrDataOf( CbVector< value_type >& vec )
-   {
-      if( vec.getAllocator()!=this ) UB_THROW( UbException(UB_EXARGS,"allocator is not member of vec!") );
-      return vec.ptrData;
-   }
-   //**********************************************************************************//
-   inline size_type& dataSizeOf( CbVector< value_type >& vec )
-   {
-      if( vec.getAllocator()!=this ) UB_THROW( UbException(UB_EXARGS,"allocator is not member of vec!") );
-      return vec.dataSize;
-   }
+    // folgende Methoden ersparen eine friend Deklaierung aller moeglichen Allocatoren
+    // denn durch diese beiden Methoden haben sie exklusive Zugriffsrechte!
+    //**********************************************************************************//
+    inline value_type *&ptrDataOf(CbVector<value_type> &vec)
+    {
+        if (vec.getAllocator() != this)
+            UB_THROW(UbException(UB_EXARGS, "allocator is not member of vec!"));
+        return vec.ptrData;
+    }
+    //**********************************************************************************//
+    inline size_type &dataSizeOf(CbVector<value_type> &vec)
+    {
+        if (vec.getAllocator() != this)
+            UB_THROW(UbException(UB_EXARGS, "allocator is not member of vec!"));
+        return vec.dataSize;
+    }
 };
 
 //////////////////////////////////////////////////////////////////////////
 // CbVectorAllocatorStd
 //////////////////////////////////////////////////////////////////////////
-template< typename T >
+template <typename T>
 class CbVectorAllocatorStd : public CbVectorAllocator<T>
 {
 public:
-   //typedefs wiederholen, da Basisklasse = template -> "Dependent-Base"-Problem
-   using value_type = typename CbVector<T>::value_type;
-   using size_type = typename CbVector<value_type>::size_type;
+    // typedefs wiederholen, da Basisklasse = template -> "Dependent-Base"-Problem
+    using value_type = typename CbVector<T>::value_type;
+    using size_type  = typename CbVector<value_type>::size_type;
 
 public:
-   CbVectorAllocatorStd() : CbVectorAllocator<value_type>()
-   {
-
-   }
-   /*==========================================================*/
-   bool alloc(CbVector< value_type >& src, const size_type& dataSize, const value_type& value=value_type()) override
-   {
-      return this->resize(src,dataSize,value);
-   }
-   /*==========================================================*/
-   bool resize(CbVector< value_type >& vec, const size_type& dataSize, const value_type& value=value_type()) override
-   {
-      if( CbVectorAllocatorStd< value_type >::dataSizeOf(vec) == dataSize) return false;
+    CbVectorAllocatorStd() : CbVectorAllocator<value_type>() {}
+    /*==========================================================*/
+    bool alloc(CbVector<value_type> &src, const size_type &dataSize, const value_type &value = value_type()) override
+    {
+        return this->resize(src, dataSize, value);
+    }
+    /*==========================================================*/
+    bool resize(CbVector<value_type> &vec, const size_type &dataSize, const value_type &value = value_type()) override
+    {
+        if (CbVectorAllocatorStd<value_type>::dataSizeOf(vec) == dataSize)
+            return false;
 
-      //new array
-      value_type* new_data = new value_type[dataSize];
-      //copy existing data to array
-      if( this->ptrDataOf(vec) )
-      {
-         for(size_type i=0; (i<vec.size() && i<dataSize); ++i) new_data[i] = CbVectorAllocatorStd< value_type >::ptrDataOf(vec)[i];
-         delete[] this->ptrDataOf(vec);
-      }
-      this->ptrDataOf(vec) = new_data;
-      //new value for new items
-      for(size_type i=this->dataSizeOf(vec); i<dataSize; ++i) this->ptrDataOf(vec)[i] = value;
-      //assign new dataSize
-      this->dataSizeOf(vec) = dataSize;
+        // new array
+        value_type *new_data = new value_type[dataSize];
+        // copy existing data to array
+        if (this->ptrDataOf(vec)) {
+            for (size_type i = 0; (i < vec.size() && i < dataSize); ++i)
+                new_data[i] = CbVectorAllocatorStd<value_type>::ptrDataOf(vec)[i];
+            delete[] this->ptrDataOf(vec);
+        }
+        this->ptrDataOf(vec) = new_data;
+        // new value for new items
+        for (size_type i = this->dataSizeOf(vec); i < dataSize; ++i)
+            this->ptrDataOf(vec)[i] = value;
+        // assign new dataSize
+        this->dataSizeOf(vec) = dataSize;
 
-      return true;
-   }
-   /*==========================================================*/
-   bool dealloc(CbVector< value_type >& vec) override
-   {
-      if( this->ptrDataOf(vec) )
-      {
-         delete[] this->ptrDataOf(vec);
-         this->ptrDataOf(vec) = NULL;
-      }
-      this->dataSizeOf(vec) = 0;
-      return true;
-   }
-   /*==========================================================*/
+        return true;
+    }
+    /*==========================================================*/
+    bool dealloc(CbVector<value_type> &vec) override
+    {
+        if (this->ptrDataOf(vec)) {
+            delete[] this->ptrDataOf(vec);
+            this->ptrDataOf(vec) = NULL;
+        }
+        this->dataSizeOf(vec) = 0;
+        return true;
+    }
+    /*==========================================================*/
 
 private:
 };
 
-#endif //CBVECTOR_H
+#endif // CBVECTOR_H
diff --git a/src/basics/basics/container/CbVectorPool.h b/src/basics/basics/container/CbVectorPool.h
index a025016672bd7999de7fc4060804b52620da4ced..85ce16ab652bd65dd5856913cd866bce7eccf400 100644
--- a/src/basics/basics/container/CbVectorPool.h
+++ b/src/basics/basics/container/CbVectorPool.h
@@ -8,16 +8,16 @@
 #define CBVECTORPOOL_H
 
 #include <iostream>
-#include <sstream>
-#include <vector>
-#include <map>
 #include <limits>
+#include <map>
+#include <sstream>
 #include <typeinfo>
+#include <vector>
 
+#include <basics/container/CbVector.h>
 #include <basics/utilities/UbException.h>
-#include <basics/utilities/UbTuple.h>
 #include <basics/utilities/UbLogger.h>
-#include <basics/container/CbVector.h>
+#include <basics/utilities/UbTuple.h>
 
 //#include "MPICommunicator.h"
 //
@@ -58,409 +58,417 @@ hier ganz normal der Datenspeicher wieder freigegen und der Poolvektor verk�rz
 //////////////////////////////////////////////////////////////////////////
 //////////////////////////////////////////////////////////////////////////
 
-
-template<typename T> class CbVectorAllocatorPool;
+template <typename T>
+class CbVectorAllocatorPool;
 
 /*==================================================================*/
-template<typename T>
+template <typename T>
 class CbVectorPool
 {
 public:
-   using value_type = typename CbVector<T>::value_type;
-   using size_type = typename CbVector<T>::size_type;
-   using Pool = std::vector<value_type>;
+    using value_type = typename CbVector<T>::value_type;
+    using size_type  = typename CbVector<T>::size_type;
+    using Pool       = std::vector<value_type>;
 
-   using CbVectorKey = std::string;
-   using CbVectorMap = std::map<CbVectorKey, CbVector<value_type> *>;
-   using CbVectorMapIter = typename CbVectorMap::iterator;
+    using CbVectorKey     = std::string;
+    using CbVectorMap     = std::map<CbVectorKey, CbVector<value_type> *>;
+    using CbVectorMapIter = typename CbVectorMap::iterator;
 
 public:
-   //////////////////////////////////////////////////////////////////////////
-   CbVectorPool( const size_type& startPoolSize = 20000) //startPoolSize*sizeof(T)/1024/1024 [MB]
-      :  poolStartAdress(NULL)
-       , nextCbVectorStartIndexInPool(0)
-       , nextCbVectorKey()
-   {
-      pool.reserve(startPoolSize);
-   }
-   /*==================================================================*/
-   virtual ~CbVectorPool()
-   {
-      //hier werden lediglich ihre datenvektoren "resetet"
-      for(CbVectorMapIter it=cbVectorMap.begin(); it!=cbVectorMap.end(); ++it)
-      {
-         CbVector< value_type >& vec = *it->second;
-         CbVectorAllocatorPool< value_type >& allocator = dynamic_cast< CbVectorAllocatorPool< value_type >& >(*vec.getAllocator() );
-         //FIXME: //if(allocator.ptrVectorPool != this) UB_THROW( UbException(UB_EXARGS,"CbVectorAllocator is part of different Pool") );
-
-         //allocator daten reseten
-         allocator.ptrVectorPool    = NULL;
-         allocator.key              = CbVectorKey();
-         allocator.startIndexInPool = 0;
-
-         //Datenzeiger/-groessen reseten
-         allocator.ptrDataOf(vec)  = NULL;
-         allocator.dataSizeOf(vec) = 0;
-      }
-   }
-   /*==========================================================*/
-   CbVectorKey getNextCbVectorKey() const
-   {
-      return this->nextCbVectorKey;
-   }
-   /*==================================================================*/
-   bool allocVectorData(CbVector<value_type>& vec, const size_type& dataSize, const value_type& value=value_type() )
-   {
-      //pool-allocator holen
-      CbVectorAllocatorPool< value_type >& allocator = dynamic_cast< CbVectorAllocatorPool< value_type >& >(*vec.getAllocator() );
-      if(allocator.ptrVectorPool != this) UB_THROW( UbException(UB_EXARGS,"CbVectorAllocator is part of different Pool") );
-
-      //alloc nur wenn cbVector noch kein Element von Pool!
-      if( cbVectorMap.find(allocator.key)==cbVectorMap.end()   )
-      {
-         return this->allocData(allocator, vec, dataSize, value );
-      }
-
-      UB_THROW( UbException(UB_EXARGS,"vector-key="+UbSystem::toString(allocator.key)+" bereits vergeben!") );
-   }
-   /*==================================================================*/
-   bool resizeVectorData(CbVector<value_type>& vec, const size_type& dataSize, const value_type& value=value_type() )
-   {
-      CbVectorAllocatorPool< value_type >& allocator = dynamic_cast< CbVectorAllocatorPool< value_type >& >(*vec.getAllocator() );
-      if(allocator.ptrVectorPool != this) UB_THROW( UbException(UB_EXARGS,"CbVectorAllocator is part of different Pool") );
-
-      //cbVector noch nicht in map?
-      CbVectorMapIter pos = cbVectorMap.find(allocator.key);
-
-      if( pos!=cbVectorMap.end()  ) //cbVector vorhanden
-      {
-         //wenn bei alloc keine Laenge zugewiesen wurde, so erfolgt das nun
-         if( allocator.startIndexInPool==0 && allocator.ptrDataOf(vec)==NULL )
-            return this->allocData(allocator, vec, dataSize, value ) ;
-         else
-            return this->resizeData(allocator, vec, dataSize, value );
-      }
-
-      UB_THROW( UbException(UB_EXARGS,"vector gehoert laut allocator zum pool aber den key gibt s nicht... wie kann das sein?") );
-   }
-   /*==================================================================*/
-   bool deallocVectorData(CbVector<value_type>& vec)
-   {
-      CbVectorAllocatorPool< value_type >& allocator = dynamic_cast< CbVectorAllocatorPool< value_type >& >(*vec.getAllocator() );
-      if(allocator.ptrVectorPool != this) UB_THROW( UbException(UB_EXARGS,"CbVectorAllocator is part of different Pool") );
-
-      //nur wenn vector auch teil des
-      if( cbVectorMap.erase(allocator.key) > 0 )
-      {
-         if( this->resizeData(allocator,vec,0,0) )
-         {
+    //////////////////////////////////////////////////////////////////////////
+    CbVectorPool(const size_type &startPoolSize = 20000) // startPoolSize*sizeof(T)/1024/1024 [MB]
+        : poolStartAdress(NULL), nextCbVectorStartIndexInPool(0), nextCbVectorKey()
+    {
+        pool.reserve(startPoolSize);
+    }
+    /*==================================================================*/
+    virtual ~CbVectorPool()
+    {
+        // hier werden lediglich ihre datenvektoren "resetet"
+        for (CbVectorMapIter it = cbVectorMap.begin(); it != cbVectorMap.end(); ++it) {
+            CbVector<value_type> &vec = *it->second;
+            CbVectorAllocatorPool<value_type> &allocator =
+                dynamic_cast<CbVectorAllocatorPool<value_type> &>(*vec.getAllocator());
+            // FIXME: //if(allocator.ptrVectorPool != this) UB_THROW( UbException(UB_EXARGS,"CbVectorAllocator is part
+            // of different Pool") );
+
+            // allocator daten reseten
             allocator.ptrVectorPool    = NULL;
             allocator.key              = CbVectorKey();
             allocator.startIndexInPool = 0;
 
-            //das Datenzeiger/-groessen reseten wird bereits in resize durchgefuehrt
-            return true;
-         }
-         else UB_THROW( UbException(UB_EXARGS,"unknown error") );
-      }
-
-      
-      //SPtr<Communicator> comm = MPICommunicator::getInstance();
-      //int myid = comm->getProcessID();
-
-//      // Get the name of the processor
-//      char machinename[MPI_MAX_PROCESSOR_NAME];
-//      int name_len;
-//      MPI_Get_processor_name(machinename, &name_len);
-//      UBLOG(logINFO, "PID = " << myid << " host name: " << machinename);
-//
-//      int j, nptrs;
-//#define SIZE 100
-//      void *buffer[100];
-//      char **strings;
-//
-//      nptrs = backtrace(buffer, SIZE);
-//      printf("backtrace() returned %d addresses\n", nptrs);
-//
-//      /* The call backtrace_symbols_fd(buffer, nptrs, STDOUT_FILENO)
-//      would produce similar output to the following: */
-//
-//      strings = backtrace_symbols(buffer, nptrs);
-//      if (strings == NULL)
-//      {
-//         perror("backtrace_symbols");
-//         exit(EXIT_FAILURE);
-//      }
-//
-//      for (j = 0; j < nptrs; j++)
-//         printf("%s\n", strings[j]);
-//
-//      free(strings);
-
-      UB_THROW(UbException(UB_EXARGS, "vector gehoert laut allocator zum pool aber den key gibt s nicht... wie kann das sein?"));
-   }
-   /*==================================================================*/
-   friend std::ostream& operator<<(std::ostream& os, const CbVectorPool& cbPool)
-   {
-      os<<"map"<<std::endl;
-      for(CbVectorMapIter pos=cbPool.cbVectorMap.begin(); pos!=cbPool.cbVectorMap.end(); ++pos)
-      {
-         CbVectorAllocatorPool< value_type >& tmpAllocator = dynamic_cast< CbVectorAllocatorPool<value_type>& >(*pos->second->getAllocator());
-         os<<"vector-size="<<pos->second->size()<<"vector-Adress="<<tmpAllocator->ptrDataOf(*pos->second)<<", allocator(key="<<tmpAllocator.key<<", startIndex="<<tmpAllocator.startIndexInPool<<")"<<std::endl;
-         for(size_type i=0; i<pos->second->size(); i++) os<<(*pos->second)[i]<<","; 
-         os<<std::endl;
-      }
-      os<<"pool"<<std::endl;
-      for(size_type i=0; i<cbPool.pool.size(); i++) {
-         os<<cbPool.pool[i]<<",";
-         os<<std::endl;
-      }
-
-      return os;
-   }
-   /*==================================================================*/
-   typename CbVectorMap::size_type getNofStoredVectors() const
-   {
-      return this->cbVectorMap.size();
-   }
-   /*==================================================================*/
-   typename Pool::size_type getPoolSize() const
-   {
-      return this->pool.size();
-   }
-   /*==================================================================*/
-   // checks if all vectors have one to one pool-entries
-   bool consistencyCheck()
-   {
-      std::vector<int> pool2(pool.size(),0);
-      for(CbVectorMapIter it=cbVectorMap.begin(); it!=cbVectorMap.end(); ++it)
-      {
-         CbVector< value_type >& tmpVec = *it->second;
-         CbVectorAllocatorPool< value_type >& tmpAllocator = dynamic_cast< CbVectorAllocatorPool<value_type>& >(*tmpVec.getAllocator());
-         for(size_type i=tmpAllocator.startIndexInPool; i<tmpAllocator.startIndexInPool+tmpVec.size(); ++i)
-         {
-            pool2.at(i)++;
-         }
-      }
-      for( size_type i=0; i<pool2.size(); ++i )
-      {
-         if(pool2.at(i) > 1 ) { UBLOG(logERROR,UB_FUNCTION<<" - test failed typo 1"); return false; }
-         if(pool2.at(i) < 1 ) { UBLOG(logERROR,UB_FUNCTION<<" - test failed typo 2"); return false; }
-      }
-      return true;
-   }
+            // Datenzeiger/-groessen reseten
+            allocator.ptrDataOf(vec)  = NULL;
+            allocator.dataSizeOf(vec) = 0;
+        }
+    }
+    /*==========================================================*/
+    CbVectorKey getNextCbVectorKey() const { return this->nextCbVectorKey; }
+    /*==================================================================*/
+    bool allocVectorData(CbVector<value_type> &vec, const size_type &dataSize, const value_type &value = value_type())
+    {
+        // pool-allocator holen
+        CbVectorAllocatorPool<value_type> &allocator =
+            dynamic_cast<CbVectorAllocatorPool<value_type> &>(*vec.getAllocator());
+        if (allocator.ptrVectorPool != this)
+            UB_THROW(UbException(UB_EXARGS, "CbVectorAllocator is part of different Pool"));
+
+        // alloc nur wenn cbVector noch kein Element von Pool!
+        if (cbVectorMap.find(allocator.key) == cbVectorMap.end()) {
+            return this->allocData(allocator, vec, dataSize, value);
+        }
+
+        UB_THROW(UbException(UB_EXARGS, "vector-key=" + UbSystem::toString(allocator.key) + " bereits vergeben!"));
+    }
+    /*==================================================================*/
+    bool resizeVectorData(CbVector<value_type> &vec, const size_type &dataSize, const value_type &value = value_type())
+    {
+        CbVectorAllocatorPool<value_type> &allocator =
+            dynamic_cast<CbVectorAllocatorPool<value_type> &>(*vec.getAllocator());
+        if (allocator.ptrVectorPool != this)
+            UB_THROW(UbException(UB_EXARGS, "CbVectorAllocator is part of different Pool"));
+
+        // cbVector noch nicht in map?
+        CbVectorMapIter pos = cbVectorMap.find(allocator.key);
+
+        if (pos != cbVectorMap.end()) // cbVector vorhanden
+        {
+            // wenn bei alloc keine Laenge zugewiesen wurde, so erfolgt das nun
+            if (allocator.startIndexInPool == 0 && allocator.ptrDataOf(vec) == NULL)
+                return this->allocData(allocator, vec, dataSize, value);
+            else
+                return this->resizeData(allocator, vec, dataSize, value);
+        }
+
+        UB_THROW(UbException(UB_EXARGS,
+                             "vector gehoert laut allocator zum pool aber den key gibt s nicht... wie kann das sein?"));
+    }
+    /*==================================================================*/
+    bool deallocVectorData(CbVector<value_type> &vec)
+    {
+        CbVectorAllocatorPool<value_type> &allocator =
+            dynamic_cast<CbVectorAllocatorPool<value_type> &>(*vec.getAllocator());
+        if (allocator.ptrVectorPool != this)
+            UB_THROW(UbException(UB_EXARGS, "CbVectorAllocator is part of different Pool"));
+
+        // nur wenn vector auch teil des
+        if (cbVectorMap.erase(allocator.key) > 0) {
+            if (this->resizeData(allocator, vec, 0, 0)) {
+                allocator.ptrVectorPool    = NULL;
+                allocator.key              = CbVectorKey();
+                allocator.startIndexInPool = 0;
+
+                // das Datenzeiger/-groessen reseten wird bereits in resize durchgefuehrt
+                return true;
+            } else
+                UB_THROW(UbException(UB_EXARGS, "unknown error"));
+        }
+
+        // SPtr<Communicator> comm = MPICommunicator::getInstance();
+        // int myid = comm->getProcessID();
+
+        //      // Get the name of the processor
+        //      char machinename[MPI_MAX_PROCESSOR_NAME];
+        //      int name_len;
+        //      MPI_Get_processor_name(machinename, &name_len);
+        //      UBLOG(logINFO, "PID = " << myid << " host name: " << machinename);
+        //
+        //      int j, nptrs;
+        //#define SIZE 100
+        //      void *buffer[100];
+        //      char **strings;
+        //
+        //      nptrs = backtrace(buffer, SIZE);
+        //      printf("backtrace() returned %d addresses\n", nptrs);
+        //
+        //      /* The call backtrace_symbols_fd(buffer, nptrs, STDOUT_FILENO)
+        //      would produce similar output to the following: */
+        //
+        //      strings = backtrace_symbols(buffer, nptrs);
+        //      if (strings == NULL)
+        //      {
+        //         perror("backtrace_symbols");
+        //         exit(EXIT_FAILURE);
+        //      }
+        //
+        //      for (j = 0; j < nptrs; j++)
+        //         printf("%s\n", strings[j]);
+        //
+        //      free(strings);
+
+        UB_THROW(UbException(UB_EXARGS,
+                             "vector gehoert laut allocator zum pool aber den key gibt s nicht... wie kann das sein?"));
+    }
+    /*==================================================================*/
+    friend std::ostream &operator<<(std::ostream &os, const CbVectorPool &cbPool)
+    {
+        os << "map" << std::endl;
+        for (CbVectorMapIter pos = cbPool.cbVectorMap.begin(); pos != cbPool.cbVectorMap.end(); ++pos) {
+            CbVectorAllocatorPool<value_type> &tmpAllocator =
+                dynamic_cast<CbVectorAllocatorPool<value_type> &>(*pos->second->getAllocator());
+            os << "vector-size=" << pos->second->size() << "vector-Adress=" << tmpAllocator->ptrDataOf(*pos->second)
+               << ", allocator(key=" << tmpAllocator.key << ", startIndex=" << tmpAllocator.startIndexInPool << ")"
+               << std::endl;
+            for (size_type i = 0; i < pos->second->size(); i++)
+                os << (*pos->second)[i] << ",";
+            os << std::endl;
+        }
+        os << "pool" << std::endl;
+        for (size_type i = 0; i < cbPool.pool.size(); i++) {
+            os << cbPool.pool[i] << ",";
+            os << std::endl;
+        }
+
+        return os;
+    }
+    /*==================================================================*/
+    typename CbVectorMap::size_type getNofStoredVectors() const { return this->cbVectorMap.size(); }
+    /*==================================================================*/
+    typename Pool::size_type getPoolSize() const { return this->pool.size(); }
+    /*==================================================================*/
+    // checks if all vectors have one to one pool-entries
+    bool consistencyCheck()
+    {
+        std::vector<int> pool2(pool.size(), 0);
+        for (CbVectorMapIter it = cbVectorMap.begin(); it != cbVectorMap.end(); ++it) {
+            CbVector<value_type> &tmpVec = *it->second;
+            CbVectorAllocatorPool<value_type> &tmpAllocator =
+                dynamic_cast<CbVectorAllocatorPool<value_type> &>(*tmpVec.getAllocator());
+            for (size_type i = tmpAllocator.startIndexInPool; i < tmpAllocator.startIndexInPool + tmpVec.size(); ++i) {
+                pool2.at(i)++;
+            }
+        }
+        for (size_type i = 0; i < pool2.size(); ++i) {
+            if (pool2.at(i) > 1) {
+                UBLOG(logERROR, UB_FUNCTION << " - test failed typo 1");
+                return false;
+            }
+            if (pool2.at(i) < 1) {
+                UBLOG(logERROR, UB_FUNCTION << " - test failed typo 2");
+                return false;
+            }
+        }
+        return true;
+    }
+
 protected:
-   /*==================================================================*/
-   inline bool allocData(CbVectorAllocatorPool< value_type >& allocator, CbVector< value_type >& vec, const size_type& dataSize, const value_type& value )
-   {
-      //safety checks
-      if(    allocator.startIndexInPool!=0
-          || allocator.ptrDataOf(vec)!=NULL
-          || allocator.dataSizeOf(vec)!=0   )
-      {
-         UB_THROW( UbException(UB_EXARGS,"zu allokierender vector ist nicht ganz sauber!!") );
-      }
-
-      //poolVector vergroessern
-      if( dataSize>0 )
-      {
-         pool.resize( pool.size() + dataSize, value );
-
-         //Zeiger der vorhandenen CbVectoren neu setzen, wenn Pool im Speicher verschoben wurde
-         if( poolStartAdress != &pool.front() )
-         {
+    /*==================================================================*/
+    inline bool allocData(CbVectorAllocatorPool<value_type> &allocator, CbVector<value_type> &vec,
+                          const size_type &dataSize, const value_type &value)
+    {
+        // safety checks
+        if (allocator.startIndexInPool != 0 || allocator.ptrDataOf(vec) != NULL || allocator.dataSizeOf(vec) != 0) {
+            UB_THROW(UbException(UB_EXARGS, "zu allokierender vector ist nicht ganz sauber!!"));
+        }
+
+        // poolVector vergroessern
+        if (dataSize > 0) {
+            pool.resize(pool.size() + dataSize, value);
+
+            // Zeiger der vorhandenen CbVectoren neu setzen, wenn Pool im Speicher verschoben wurde
+            if (poolStartAdress != &pool.front()) {
+                poolStartAdress = &pool.front();
+                for (CbVectorMapIter it = cbVectorMap.begin(); it != cbVectorMap.end(); ++it) {
+                    CbVector<value_type> &tmpVec = *it->second;
+                    CbVectorAllocatorPool<value_type> &tmpAllocator =
+                        dynamic_cast<CbVectorAllocatorPool<value_type> &>(*tmpVec.getAllocator());
+
+                    if (!tmpAllocator.ptrDataOf(tmpVec))
+                        continue; // Fall: CbVector hat noch keinen Datenbereich (data zeigt auf NULL)
+                    tmpAllocator.ptrDataOf(tmpVec) = &pool[tmpAllocator.startIndexInPool];
+                }
+                // std::cout<<"CbVectorPoolMpi::allocVectorData vector wurde im speicher verschoben - adressen
+                // angepasst!!!"<<std::endl;
+            }
+
+            // aktuellem element adresse zuweisen (wurde evtl schon inder schleife zuvor gemacht)
+            allocator.ptrDataOf(vec)   = &pool.at(nextCbVectorStartIndexInPool);
+            allocator.startIndexInPool = nextCbVectorStartIndexInPool;
+
+            // neuen StartIndex fuer naechstes Element berechnen
+            nextCbVectorStartIndexInPool += dataSize;
+            if (nextCbVectorStartIndexInPool != pool.size())
+                UB_THROW(UbException(UB_EXARGS, "index Problem... Annahme falsch?"));
+        }
+
+        // vector zu map hinzuf�gen (speicher wird dann anschliessend zugwiesen)
+        cbVectorMap.insert(
+            std::make_pair(allocator.key, &vec)); // ist angeblich performanter als  cbVectorMap[ allocator.key ] =
+                                                  // cbVector; //aus Effective STL von Scott Meyer
+        allocator.dataSizeOf(vec) = dataSize;
+
+        // dummDoof nextKey-Generung...
+        if (allocator.key >= this->nextCbVectorKey)
+            this->nextCbVectorKey = allocator.key + "1";
+
+        return true;
+    }
+    /*==========================================================*/
+    bool resizeData(CbVectorAllocatorPool<value_type> &allocator, CbVector<value_type> &vec, const size_type &dataSize,
+                    const value_type &value)
+    {
+        // datenvector verlaengern/-kuerzen
+        typename Pool::iterator startPos =
+            pool.begin() + allocator.startIndexInPool; // startPosition der cbVector-Daten im Pool
+        if (vec.size() > dataSize)
+            pool.erase(startPos + dataSize, startPos + vec.size());
+        else
+            pool.insert(startPos + vec.size(), dataSize - vec.size(), value);
+
+        //////////////////////////////////////////////////////////////////////////
+        // adressen und laengen der einzelnen vectoren anpassen
+        if (!pool.empty()) {
+            bool poolMoved  = (poolStartAdress != &pool.front());
             poolStartAdress = &pool.front();
-            for(CbVectorMapIter it=cbVectorMap.begin(); it!=cbVectorMap.end(); ++it)
-            {
-               CbVector< value_type >& tmpVec = *it->second;
-               CbVectorAllocatorPool< value_type >& tmpAllocator = dynamic_cast< CbVectorAllocatorPool< value_type >& >(*tmpVec.getAllocator());
 
-               if( !tmpAllocator.ptrDataOf(tmpVec) ) continue; //Fall: CbVector hat noch keinen Datenbereich (data zeigt auf NULL)
-               tmpAllocator.ptrDataOf(tmpVec) = &pool[ tmpAllocator.startIndexInPool];
+            for (CbVectorMapIter it = cbVectorMap.begin(); it != cbVectorMap.end(); ++it) {
+                CbVector<value_type> &tmpVec = *it->second;
+
+                if (tmpVec.size() > 0) {
+                    CbVectorAllocatorPool<value_type> &tmpAllocator =
+                        dynamic_cast<CbVectorAllocatorPool<value_type> &>(*tmpVec.getAllocator());
+                    // liegt CbVector VOR ver�ndertem CbVector?
+                    if (tmpAllocator.startIndexInPool <=
+                        allocator.startIndexInPool) // ja: anpassung NUR wenn pool verschoben wurde!
+                    {
+                        if (poolMoved && tmpVec.size() > 0)
+                            tmpAllocator.ptrDataOf(tmpVec) = &pool[tmpAllocator.startIndexInPool];
+                    } else // nein: -> Adresse + Index MUSS immer angepasst werden
+                    {
+                        tmpAllocator.startIndexInPool += dataSize - vec.size();
+                        tmpAllocator.ptrDataOf(tmpVec) = &pool[tmpAllocator.startIndexInPool];
+                    }
+                }
             }
-            //std::cout<<"CbVectorPoolMpi::allocVectorData vector wurde im speicher verschoben - adressen angepasst!!!"<<std::endl;
-         }
-
-         //aktuellem element adresse zuweisen (wurde evtl schon inder schleife zuvor gemacht)
-         allocator.ptrDataOf(vec) = &pool.at(nextCbVectorStartIndexInPool);
-         allocator.startIndexInPool = nextCbVectorStartIndexInPool;
-
-         //neuen StartIndex fuer naechstes Element berechnen
-         nextCbVectorStartIndexInPool += dataSize;
-         if(nextCbVectorStartIndexInPool!=pool.size())
-            UB_THROW( UbException(UB_EXARGS,"index Problem... Annahme falsch?") );
-      }
-
-      //vector zu map hinzuf�gen (speicher wird dann anschliessend zugwiesen)
-      cbVectorMap.insert( std::make_pair( allocator.key, &vec ) ); // ist angeblich performanter als  cbVectorMap[ allocator.key ] = cbVector; //aus Effective STL von Scott Meyer
-      allocator.dataSizeOf(vec) = dataSize;
-
-      //dummDoof nextKey-Generung...
-      if( allocator.key >= this->nextCbVectorKey ) this->nextCbVectorKey = allocator.key + "1";
-
-      return true;
-   }
-   /*==========================================================*/
-   bool resizeData(CbVectorAllocatorPool< value_type >& allocator, CbVector<value_type>& vec, const size_type& dataSize, const value_type& value )
-   {
-      //datenvector verlaengern/-kuerzen
-      typename Pool::iterator startPos = pool.begin()+allocator.startIndexInPool; //startPosition der cbVector-Daten im Pool
-      if( vec.size() > dataSize ) pool.erase( startPos+dataSize, startPos+vec.size());
-      else                        pool.insert( startPos+vec.size(), dataSize-vec.size(), value );
-
-      //////////////////////////////////////////////////////////////////////////
-      //adressen und laengen der einzelnen vectoren anpassen
-      if( !pool.empty() )
-      {
-         bool poolMoved   = ( poolStartAdress != &pool.front() );
-         poolStartAdress  = &pool.front();
-
-         for(CbVectorMapIter it=cbVectorMap.begin(); it!=cbVectorMap.end(); ++it)
-         {
-            CbVector< value_type >& tmpVec = *it->second;
-
-            if( tmpVec.size()>0 )
-            {
-               CbVectorAllocatorPool< value_type >& tmpAllocator = dynamic_cast< CbVectorAllocatorPool<value_type>& >(*tmpVec.getAllocator());
-               //liegt CbVector VOR ver�ndertem CbVector?
-               if( tmpAllocator.startIndexInPool <= allocator.startIndexInPool ) //ja: anpassung NUR wenn pool verschoben wurde!
-               {
-                  if(poolMoved && tmpVec.size()>0 ) tmpAllocator.ptrDataOf(tmpVec) = &pool[ tmpAllocator.startIndexInPool];
-               }
-               else //nein: -> Adresse + Index MUSS immer angepasst werden
-               {
-                  tmpAllocator.startIndexInPool += dataSize-vec.size();
-                  tmpAllocator.ptrDataOf(tmpVec) = &pool[ tmpAllocator.startIndexInPool ];
-               }
+        } else // Sonderfall: alle Elemente haben Laenge 0 -> kein pool -> alle Feld-Adressen auf NULL setzen!
+        {
+            poolStartAdress = NULL;
+            for (CbVectorMapIter it = cbVectorMap.begin(); it != cbVectorMap.end(); ++it) {
+                CbVector<value_type> &tmpVec = *it->second;
+                CbVectorAllocatorPool<value_type> &tmpAllocator =
+                    dynamic_cast<CbVectorAllocatorPool<value_type> &>(*tmpVec.getAllocator());
+                tmpAllocator.startIndexInPool = 0;
             }
-         }
-      }
-      else //Sonderfall: alle Elemente haben Laenge 0 -> kein pool -> alle Feld-Adressen auf NULL setzen!
-      {
-         poolStartAdress = NULL;
-         for(CbVectorMapIter it=cbVectorMap.begin(); it!=cbVectorMap.end(); ++it)
-         {
-            CbVector< value_type >& tmpVec = *it->second;
-            CbVectorAllocatorPool< value_type >& tmpAllocator = dynamic_cast< CbVectorAllocatorPool<value_type>& >(*tmpVec.getAllocator());
-            tmpAllocator.startIndexInPool = 0;
-         }
-
-      }
-
-      //restliche Daten von cbVector + allocator aktualisieren
-      allocator.dataSizeOf(vec) = dataSize;
-      if(dataSize==0)
-      {
-         allocator.ptrDataOf(vec)   = NULL;
-         allocator.startIndexInPool = 0;
-      }
-
-      nextCbVectorStartIndexInPool = pool.size();
-
-      return true;
-   }
+        }
+
+        // restliche Daten von cbVector + allocator aktualisieren
+        allocator.dataSizeOf(vec) = dataSize;
+        if (dataSize == 0) {
+            allocator.ptrDataOf(vec)   = NULL;
+            allocator.startIndexInPool = 0;
+        }
+
+        nextCbVectorStartIndexInPool = pool.size();
+
+        return true;
+    }
 
 protected:
-   /*==================================================================*/
-   void getCbVectorData(const CbVector< value_type >& vec, CbVectorKey& vectorKey, size_type& startIndexInPool, size_type& dataSize )
-   {
-      CbVectorAllocatorPool< value_type >& allocator = dynamic_cast< CbVectorAllocatorPool< value_type >& >(*vec.getAllocator() );
-
-      startIndexInPool  = allocator.startIndexInPool;
-      vectorKey         = allocator.key;
-      dataSize          = vec.size();
-   }
-   /*==================================================================*/
-   void setCbVectorData(CbVector< value_type >& vec, const CbVectorKey& vectorKey, const size_type& startIndexInPool, const size_type& dataSize )
-   {
-      CbVectorAllocatorPool< value_type >& allocator = dynamic_cast< CbVectorAllocatorPool< value_type >& >(*vec.getAllocator() );
-
-      allocator.startIndexInPool = startIndexInPool;
-      allocator.key              = vectorKey;
-      allocator.dataSizeOf(vec)  = dataSize;
-      allocator.ptrDataOf(vec)   = &this->pool[ startIndexInPool ];
-   }
-   /*==================================================================*/
-
-   CbVectorMap                cbVectorMap;                      //informationsmap fuer MPIData und zugewiesener vector
-
-   Pool                       pool;                             //globaler Datenvector
-   typename Pool::pointer     poolStartAdress;                  //StartAdresse des aktuellen Datenvektors
-   typename Pool::size_type   nextCbVectorStartIndexInPool;     //StartIndex fuer den naechsten CbVector
-
-   //key - erstmal dummdoof
-   CbVectorKey nextCbVectorKey;
+    /*==================================================================*/
+    void getCbVectorData(const CbVector<value_type> &vec, CbVectorKey &vectorKey, size_type &startIndexInPool,
+                         size_type &dataSize)
+    {
+        CbVectorAllocatorPool<value_type> &allocator =
+            dynamic_cast<CbVectorAllocatorPool<value_type> &>(*vec.getAllocator());
+
+        startIndexInPool = allocator.startIndexInPool;
+        vectorKey        = allocator.key;
+        dataSize         = vec.size();
+    }
+    /*==================================================================*/
+    void setCbVectorData(CbVector<value_type> &vec, const CbVectorKey &vectorKey, const size_type &startIndexInPool,
+                         const size_type &dataSize)
+    {
+        CbVectorAllocatorPool<value_type> &allocator =
+            dynamic_cast<CbVectorAllocatorPool<value_type> &>(*vec.getAllocator());
+
+        allocator.startIndexInPool = startIndexInPool;
+        allocator.key              = vectorKey;
+        allocator.dataSizeOf(vec)  = dataSize;
+        allocator.ptrDataOf(vec)   = &this->pool[startIndexInPool];
+    }
+    /*==================================================================*/
+
+    CbVectorMap cbVectorMap; // informationsmap fuer MPIData und zugewiesener vector
+
+    Pool pool;                                             // globaler Datenvector
+    typename Pool::pointer poolStartAdress;                // StartAdresse des aktuellen Datenvektors
+    typename Pool::size_type nextCbVectorStartIndexInPool; // StartIndex fuer den naechsten CbVector
+
+    // key - erstmal dummdoof
+    CbVectorKey nextCbVectorKey;
 };
 
-
 //////////////////////////////////////////////////////////////////////////
 //  CbVectorAllocatorPool
 //////////////////////////////////////////////////////////////////////////
-template< typename T >
+template <typename T>
 class CbVectorAllocatorPool : public CbVectorAllocator<T>
 {
 public:
-   //typedefs wiederholen, da Basisklasse = template -> "Dependent-Base"-Problem
-   using value_type = typename CbVector<T>::value_type;
-   using size_type = typename CbVector<value_type>::size_type;
+    // typedefs wiederholen, da Basisklasse = template -> "Dependent-Base"-Problem
+    using value_type = typename CbVector<T>::value_type;
+    using size_type  = typename CbVector<value_type>::size_type;
+
+    friend class CbVectorPool<value_type>;
 
-   friend class CbVectorPool< value_type >;
+    CbVectorAllocatorPool(const CbVectorAllocatorPool &) = delete;
+    const CbVectorAllocatorPool &operator=(const CbVectorAllocatorPool &) = delete;
 
-    CbVectorAllocatorPool( const CbVectorAllocatorPool& ) = delete;
-    const CbVectorAllocatorPool& operator=( const CbVectorAllocatorPool& ) = delete;
 public:
-   /*==========================================================*/
-   CbVectorAllocatorPool(const typename CbVectorPool< value_type >::CbVectorKey& key, CbVectorPool<value_type>* const& ptrVectorPool)
-      :  CbVectorAllocator<value_type>()
-       , key(key)
-       , startIndexInPool(0)
-       , ptrVectorPool(ptrVectorPool)
-   {
-      if(!ptrVectorPool) UB_THROW( UbException(UB_EXARGS,"ptrVectorPool==NULL") );
-   }
-   /*==========================================================*/
-   //hier wird der key automatisch erzeugt!
-   CbVectorAllocatorPool(CbVectorPool<value_type>* const& ptrVectorPool)
-      :  CbVectorAllocator<value_type>()
-       , startIndexInPool(0)
-       , ptrVectorPool(ptrVectorPool)
-   {
-      if(!ptrVectorPool) UB_THROW( UbException(UB_EXARGS,"ptrVectorPool==NULL") );
-      key = ptrVectorPool->getNextCbVectorKey();
-   }
-   /*==========================================================*/
-   bool alloc(CbVector< value_type >& vec, const size_type& dataSize, const value_type& value=value_type()) override
-   {
-      if(!ptrVectorPool) UB_THROW( UbException(UB_EXARGS,"vectorPool seems to be destroyed, ptrVectorPool==NULL") );
-      return ptrVectorPool->allocVectorData(vec, dataSize, value);
-   }
-   /*==========================================================*/
-   bool resize(CbVector< value_type >& vec, const size_type& dataSize, const value_type& value=value_type()) override
-   {
-      if(!ptrVectorPool) UB_THROW( UbException(UB_EXARGS,"vectorPool seems to be destroyed, ptrVectorPool==NULL") );
-      return ptrVectorPool->resizeVectorData(vec, dataSize, value);
-   }
-   /*==========================================================*/
-   bool dealloc(CbVector< value_type >& vec) override
-   {
-      if(ptrVectorPool) return this->ptrVectorPool->deallocVectorData(vec);
-      //wenn kein ptrVectorPool -> wurde bereits deallokiert
-      return true;
-   }
-   /*==========================================================*/
-   const CbVectorPool< value_type >& getCbVectorPool()
-   {
-      if(!ptrVectorPool) UB_THROW( UbException(UB_EXARGS,"vectorPool seems to be destroyed, ptrVectorPool==NULL") );
-      return *ptrVectorPool;
-   }
-   /*==========================================================*/
+    /*==========================================================*/
+    CbVectorAllocatorPool(const typename CbVectorPool<value_type>::CbVectorKey &key,
+                          CbVectorPool<value_type> *const &ptrVectorPool)
+        : CbVectorAllocator<value_type>(), key(key), startIndexInPool(0), ptrVectorPool(ptrVectorPool)
+    {
+        if (!ptrVectorPool)
+            UB_THROW(UbException(UB_EXARGS, "ptrVectorPool==NULL"));
+    }
+    /*==========================================================*/
+    // hier wird der key automatisch erzeugt!
+    CbVectorAllocatorPool(CbVectorPool<value_type> *const &ptrVectorPool)
+        : CbVectorAllocator<value_type>(), startIndexInPool(0), ptrVectorPool(ptrVectorPool)
+    {
+        if (!ptrVectorPool)
+            UB_THROW(UbException(UB_EXARGS, "ptrVectorPool==NULL"));
+        key = ptrVectorPool->getNextCbVectorKey();
+    }
+    /*==========================================================*/
+    bool alloc(CbVector<value_type> &vec, const size_type &dataSize, const value_type &value = value_type()) override
+    {
+        if (!ptrVectorPool)
+            UB_THROW(UbException(UB_EXARGS, "vectorPool seems to be destroyed, ptrVectorPool==NULL"));
+        return ptrVectorPool->allocVectorData(vec, dataSize, value);
+    }
+    /*==========================================================*/
+    bool resize(CbVector<value_type> &vec, const size_type &dataSize, const value_type &value = value_type()) override
+    {
+        if (!ptrVectorPool)
+            UB_THROW(UbException(UB_EXARGS, "vectorPool seems to be destroyed, ptrVectorPool==NULL"));
+        return ptrVectorPool->resizeVectorData(vec, dataSize, value);
+    }
+    /*==========================================================*/
+    bool dealloc(CbVector<value_type> &vec) override
+    {
+        if (ptrVectorPool)
+            return this->ptrVectorPool->deallocVectorData(vec);
+        // wenn kein ptrVectorPool -> wurde bereits deallokiert
+        return true;
+    }
+    /*==========================================================*/
+    const CbVectorPool<value_type> &getCbVectorPool()
+    {
+        if (!ptrVectorPool)
+            UB_THROW(UbException(UB_EXARGS, "vectorPool seems to be destroyed, ptrVectorPool==NULL"));
+        return *ptrVectorPool;
+    }
+    /*==========================================================*/
 
 private:
-   typename CbVectorPool< value_type >::CbVectorKey     key;
-   typename CbVectorPool< value_type >::Pool::size_type startIndexInPool;
+    typename CbVectorPool<value_type>::CbVectorKey key;
+    typename CbVectorPool<value_type>::Pool::size_type startIndexInPool;
 
-   CbVectorPool< value_type >* ptrVectorPool;
+    CbVectorPool<value_type> *ptrVectorPool;
 };
 
-
-#endif //CBVECTORPOOL_H
+#endif // CBVECTORPOOL_H
diff --git a/src/basics/basics/memory/MbSmartPtr.h b/src/basics/basics/memory/MbSmartPtr.h
index 54d154f148d99afb22d61e15d46304dff6099dbf..1ddced8c061708af5b04e005d7c7224900f64d3c 100644
--- a/src/basics/basics/memory/MbSmartPtr.h
+++ b/src/basics/basics/memory/MbSmartPtr.h
@@ -13,15 +13,14 @@
 #pragma clang system_header
 #endif
 
-
 //=====================================================
 // Globale Funktion, um das Loeschen des referenzierten
 // Objektes flexibler zu gestalten.
 //
-template<class ObjType>
-void deleteRefPtr(ObjType* ptr)
+template <class ObjType>
+void deleteRefPtr(ObjType *ptr)
 {
-   delete ptr;
+    delete ptr;
 }
 
 //======================================================
@@ -34,95 +33,76 @@ void deleteRefPtr(ObjType* ptr)
 // ueber die globale Template-Funktion deleteRefPtr(), die bei Bedarf ueberschrieben werden kann.
 // Der Reference-Pointer verfuegt also sozusagen ueber eine automatische Garbage Collection
 
-template<class ObjType>
-class MbSmartPtr  : public MbSmartPtrBase
+template <class ObjType>
+class MbSmartPtr : public MbSmartPtrBase
 {
 public:
-   // Konstruktoren //bei explicit geht der implizite cast nicht mehr, aber um keinen stress zu verursachen
-   /*explicit*/ MbSmartPtr<ObjType>(const ObjType* pPtr=NULL)
-      : MbSmartPtrBase(), mpPtr(NULL)
-	{
-		init(pPtr);
-	}
-	template<class ParamType>
-	MbSmartPtr<ObjType>(const MbSmartPtr<ParamType>& ptr)
-      : MbSmartPtrBase(), mpPtr(NULL)
-	{
-		init(ptr.get());
-	}
-	// Destruktor
-   ~MbSmartPtr<ObjType>() override
-	{
-      init(NULL);
-	}
-   //---------------------------------------------------
-   // Kopierkonstruktor
-   MbSmartPtr<ObjType>(const MbSmartPtr<ObjType>& ptr)
-     : MbSmartPtrBase(), mpPtr(NULL)
-	{
-		init(ptr.get());
-	}
-   //---------------------------------------------------
-   // Zuweisungsoperatoren
-	template<class ParamType>
-	const MbSmartPtr<ObjType>& operator =(const MbSmartPtr<ParamType>& ptr)
-	{
-   	    init(ptr.get());
-		return *this;
-	}
-	const MbSmartPtr<ObjType>& operator =(const MbSmartPtr<ObjType>& ptr)
-	{
-		init(ptr.get());
-		return *this;
-	}
+    // Konstruktoren //bei explicit geht der implizite cast nicht mehr, aber um keinen stress zu verursachen
+    /*explicit*/ MbSmartPtr<ObjType>(const ObjType *pPtr = NULL) : MbSmartPtrBase(), mpPtr(NULL) { init(pPtr); }
+    template <class ParamType>
+    MbSmartPtr<ObjType>(const MbSmartPtr<ParamType> &ptr) : MbSmartPtrBase(), mpPtr(NULL)
+    {
+        init(ptr.get());
+    }
+    // Destruktor
+    ~MbSmartPtr<ObjType>() override { init(NULL); }
+    //---------------------------------------------------
+    // Kopierkonstruktor
+    MbSmartPtr<ObjType>(const MbSmartPtr<ObjType> &ptr) : MbSmartPtrBase(), mpPtr(NULL) { init(ptr.get()); }
+    //---------------------------------------------------
+    // Zuweisungsoperatoren
+    template <class ParamType>
+    const MbSmartPtr<ObjType> &operator=(const MbSmartPtr<ParamType> &ptr)
+    {
+        init(ptr.get());
+        return *this;
+    }
+    const MbSmartPtr<ObjType> &operator=(const MbSmartPtr<ObjType> &ptr)
+    {
+        init(ptr.get());
+        return *this;
+    }
+
+    const MbSmartPtr<ObjType> &operator=(const ObjType *pPtr)
+    {
+        init(pPtr);
+        return *this;
+    }
+    //---------------------------------------------------
+    // Dereferenzierung-Operatoren
+    ObjType &operator*() const { return *mpPtr; }
+    ObjType *operator->() const { return mpPtr; }
+    bool operator!() const { return !mpPtr; }
+    operator ObjType *() const { return mpPtr; }
+    //---------------------------------------------------
+    // Methoden
+    ObjType *get() const { return mpPtr; }
+    //---------------------------------------------------
+    int ref_count() const { return MbSmartPtrBase::ref_count(mpPtr); }
+    //---------------------------------------------------
+    bool release() const { return MbSmartPtrBase::removeFromGC(mpPtr); }
 
-	const MbSmartPtr<ObjType>& operator =(const ObjType *pPtr)
-	{
-		init(pPtr);
-		return *this;
-	}
-   //---------------------------------------------------
-   // Dereferenzierung-Operatoren
-	ObjType& operator *() const  { return *mpPtr; }
-   ObjType* operator ->() const { return mpPtr;  }
-   bool operator !() const      { return !mpPtr; }
-   operator ObjType *() const   { return mpPtr;  }
-   //---------------------------------------------------
-	// Methoden
-	ObjType* get() const
-   {
-      return mpPtr;
-   }
-   //---------------------------------------------------
-   int ref_count() const
-   {
-      return MbSmartPtrBase::ref_count(mpPtr);
-   }
-   //---------------------------------------------------
-   bool release() const
-   {
-      return MbSmartPtrBase::removeFromGC(mpPtr);
-   }
 private:
-   void init(const ObjType* pPtr)
-	{
-      // Nur was tun, wenn wirklich noetig
-		if(pPtr==mpPtr) return;
+    void init(const ObjType *pPtr)
+    {
+        // Nur was tun, wenn wirklich noetig
+        if (pPtr == mpPtr)
+            return;
 
-      // Aktuell referenziertes Objekt freigeben, dabei ueberpruefen, ob letztes Release
-		if(mpPtr && releaseRef(mpPtr))
-		{
-         // referenziertes Objekt loeschen
-			deleteRefPtr(mpPtr);
-		}
+        // Aktuell referenziertes Objekt freigeben, dabei ueberpruefen, ob letztes Release
+        if (mpPtr && releaseRef(mpPtr)) {
+            // referenziertes Objekt loeschen
+            deleteRefPtr(mpPtr);
+        }
 
-      // Wenn pPtr ein neues Objekt ist, Zugriffszaehler auf neues Objekt erhoehen
-		mpPtr=const_cast<ObjType*>(pPtr);
-	   if(mpPtr) addRef(mpPtr);
-	}
+        // Wenn pPtr ein neues Objekt ist, Zugriffszaehler auf neues Objekt erhoehen
+        mpPtr = const_cast<ObjType *>(pPtr);
+        if (mpPtr)
+            addRef(mpPtr);
+    }
 
 private:
-   ObjType* mpPtr;
+    ObjType *mpPtr;
 };
 
-#endif //MBSMARTPTR_H
+#endif // MBSMARTPTR_H
diff --git a/src/basics/basics/memory/MbSmartPtrBase.cpp b/src/basics/basics/memory/MbSmartPtrBase.cpp
index d0e07fa9503fe01f94128543d84927804505b97a..a0651b0290f6628d50442658d26912e4337d0cd6 100644
--- a/src/basics/basics/memory/MbSmartPtrBase.cpp
+++ b/src/basics/basics/memory/MbSmartPtrBase.cpp
@@ -2,43 +2,42 @@
 
 using namespace std;
 
-bool MbSmartPtrBase::addRef(void* ptr)
+bool MbSmartPtrBase::addRef(void *ptr)
 {
-   MbSmartPtrBaseMap::getInstance()->getMap()[ptr]++;
-	return true;
+    MbSmartPtrBaseMap::getInstance()->getMap()[ptr]++;
+    return true;
 }
 //-------------------------------------------------
-bool MbSmartPtrBase::releaseRef(void* ptr)
+bool MbSmartPtrBase::releaseRef(void *ptr)
 {
-   map<void*,int>& ptrMap = MbSmartPtrBaseMap::getInstance()->getMap();
-   map<void*,int>::iterator pos=ptrMap.find(ptr);
-	
-   if( pos!=ptrMap.end() )
-	{
-		pos->second--;
-		
-      if(pos->second==0)
-		{
-			ptrMap.erase(pos);
-			return true;
-		}
-	}
-	return false;
+    map<void *, int> &ptrMap       = MbSmartPtrBaseMap::getInstance()->getMap();
+    map<void *, int>::iterator pos = ptrMap.find(ptr);
+
+    if (pos != ptrMap.end()) {
+        pos->second--;
+
+        if (pos->second == 0) {
+            ptrMap.erase(pos);
+            return true;
+        }
+    }
+    return false;
 }
 //-------------------------------------------------
-bool MbSmartPtrBase::removeFromGC(void* ptr) const 
+bool MbSmartPtrBase::removeFromGC(void *ptr) const
 {
-   if( MbSmartPtrBaseMap::getInstance()->getMap().erase(ptr) ) return true;
-   return false;
+    if (MbSmartPtrBaseMap::getInstance()->getMap().erase(ptr))
+        return true;
+    return false;
 }
 //-------------------------------------------------
-int MbSmartPtrBase::ref_count(void* ptr) const 
+int MbSmartPtrBase::ref_count(void *ptr) const
 {
-   map<void*,int>& ptrMap = MbSmartPtrBaseMap::getInstance()->getMap();
-   map<void*,int>::iterator pos=ptrMap.find(ptr);
+    map<void *, int> &ptrMap       = MbSmartPtrBaseMap::getInstance()->getMap();
+    map<void *, int>::iterator pos = ptrMap.find(ptr);
 
-   if( pos!=ptrMap.end() ) return pos->second;
-   else                    return 0;
+    if (pos != ptrMap.end())
+        return pos->second;
+    else
+        return 0;
 }
-
-
diff --git a/src/basics/basics/memory/MbSmartPtrBase.h b/src/basics/basics/memory/MbSmartPtrBase.h
index 7c531902b4279f842daa99b0126eee9984154d54..1abdcac81c1454694d846d5d4a396df2dca095da 100644
--- a/src/basics/basics/memory/MbSmartPtrBase.h
+++ b/src/basics/basics/memory/MbSmartPtrBase.h
@@ -18,34 +18,39 @@
 //
 class MbSmartPtrBase
 {
-   //Ursprung:
-   // mpCntrMap ist ein Pointer, weil sichergestellt sein muss, dass die
-   // Map existiert, wenn das erste mal darauf zugegriffen wird.
-   // Ein Zugriff zwischen zwei statischen Objekten kann zum Fehler fuehren, da
-   // die Reihenfolge der Konstruktorenaufrufe dann vom Linker bestimmt wird.
-
-   //Anpassung a la UbWriter mit SingletonMap
-   class MbSmartPtrBaseMap
-   {
-   private:
-      MbSmartPtrBaseMap() = default;
-
-      std::map<void*,int> mpCntrMap;
-   public:
-       MbSmartPtrBaseMap( const MbSmartPtrBaseMap& ) = delete;
-       const MbSmartPtrBaseMap& operator=( const MbSmartPtrBaseMap& ) = delete;
-
-      static MbSmartPtrBaseMap* getInstance() { static MbSmartPtrBaseMap instance; return &instance; }
-      std::map<void*,int>& getMap()           { return mpCntrMap;                                    }
-   };
+    // Ursprung:
+    // mpCntrMap ist ein Pointer, weil sichergestellt sein muss, dass die
+    // Map existiert, wenn das erste mal darauf zugegriffen wird.
+    // Ein Zugriff zwischen zwei statischen Objekten kann zum Fehler fuehren, da
+    // die Reihenfolge der Konstruktorenaufrufe dann vom Linker bestimmt wird.
+
+    // Anpassung a la UbWriter mit SingletonMap
+    class MbSmartPtrBaseMap
+    {
+    private:
+        MbSmartPtrBaseMap() = default;
+
+        std::map<void *, int> mpCntrMap;
+
+    public:
+        MbSmartPtrBaseMap(const MbSmartPtrBaseMap &) = delete;
+        const MbSmartPtrBaseMap &operator=(const MbSmartPtrBaseMap &) = delete;
+
+        static MbSmartPtrBaseMap *getInstance()
+        {
+            static MbSmartPtrBaseMap instance;
+            return &instance;
+        }
+        std::map<void *, int> &getMap() { return mpCntrMap; }
+    };
 
 protected:
-   MbSmartPtrBase() = default;
-   virtual ~MbSmartPtrBase() = default;
-   bool addRef(void* p);
-	bool releaseRef(void* p);
-   bool removeFromGC(void* ptr) const;
-   int  ref_count(void* ptr) const;
+    MbSmartPtrBase()          = default;
+    virtual ~MbSmartPtrBase() = default;
+    bool addRef(void *p);
+    bool releaseRef(void *p);
+    bool removeFromGC(void *ptr) const;
+    int ref_count(void *ptr) const;
 };
 
-#endif //MBSMARTPTRBASE_H
+#endif // MBSMARTPTRBASE_H
diff --git a/src/basics/basics/objects/ObObject.h b/src/basics/basics/objects/ObObject.h
index 0b543dc18c2a260a7146a168155f33966d619638..6d40d8af49979947e941dc9eb92b47d6f2b78b3d 100644
--- a/src/basics/basics/objects/ObObject.h
+++ b/src/basics/basics/objects/ObObject.h
@@ -1,28 +1,28 @@
 //=======================================================================================
-// ____          ____    __    ______     __________   __      __       __        __         
-// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |        
-//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |        
-//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |        
-//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____    
-//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|   
-//      \    \  |    |   ________________________________________________________________    
-//       \    \ |    |  |  ______________________________________________________________|   
-//        \    \|    |  |  |         __          __     __     __     ______      _______    
-//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)   
-//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______    
+// ____          ____    __    ______     __________   __      __       __        __
+// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |
+//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |
+//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |
+//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____
+//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|
+//      \    \  |    |   ________________________________________________________________
+//       \    \ |    |  |  ______________________________________________________________|
+//        \    \|    |  |  |         __          __     __     __     ______      _______
+//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)
+//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______
 //           \       |  |  |        |  |_____   |   \_/   |   |  |   |  |_/  /    _____  |
-//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/   
+//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/
 //
-//  This file is part of VirtualFluids. VirtualFluids is free software: you can 
+//  This file is part of VirtualFluids. VirtualFluids is free software: you can
 //  redistribute it and/or modify it under the terms of the GNU General Public
-//  License as published by the Free Software Foundation, either version 3 of 
+//  License as published by the Free Software Foundation, either version 3 of
 //  the License, or (at your option) any later version.
-//  
-//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT 
-//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
-//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License 
+//
+//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT
+//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 //  for more details.
-//  
+//
 //  You should have received a copy of the GNU General Public License along
 //  with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>.
 //
@@ -41,21 +41,19 @@ class ObObject : public UbObservable
 {
 public:
     ObObject() = default;
-   ObObject(const std::string& name) : name(name) { }
+    ObObject(const std::string &name) : name(name) {}
 
-   ~ObObject() override = default;
+    ~ObObject() override = default;
 
-   virtual ObObject* clone() = 0;
+    virtual ObObject *clone() = 0;
 
-   virtual std::string getName()  { return name; }
-   void setName(std::string name) { this->name = name; }
-
-   std::string toString() override = 0;
+    virtual std::string getName() { return name; }
+    void setName(std::string name) { this->name = name; }
 
+    std::string toString() override = 0;
 
 private:
-   std::string name;
+    std::string name;
 };
 
-
 #endif
diff --git a/src/basics/basics/parallel/PbMpi.h b/src/basics/basics/parallel/PbMpi.h
index d3954e363a77bc77d2c9fe97c48b1a352c571d57..63470c2d82d35ccc22599fc3623e6e1d93354a1a 100644
--- a/src/basics/basics/parallel/PbMpi.h
+++ b/src/basics/basics/parallel/PbMpi.h
@@ -7,11 +7,11 @@
 #ifndef PbMpi_H
 #define PbMpi_H
 
-#include <vector>
 #include <sstream>
+#include <vector>
 
 #ifndef VF_MPI
-#  error VF_MPI has to be defined
+#error VF_MPI has to be defined
 #endif
 
 // As we doing a lot of const-cast here we define PbMpi.h to system_header to mute clang-tidy
@@ -27,433 +27,451 @@
 #include <basics/utilities/UbException.h>
 
 #ifdef USE_MPI_CXX_SYNTAX
-   #define PbMpi_COMM_WORLD MPI::COMM_WORLD
-   #define PbMpi_INT        MPI::INT  
-   #define PbMpi_CHAR       MPI::CHAR 
-   #define PbMpi_SHORT      MPI::SHORT
-   #define PbMpi_FLOAT      MPI::FLOAT
-   #define PbMpi_DOUBLE     MPI::DOUBLE
-   #define PbMpi_COMM_NULL  MPI::COMM_NULL   
-
+#define PbMpi_COMM_WORLD MPI::COMM_WORLD
+#define PbMpi_INT MPI::INT
+#define PbMpi_CHAR MPI::CHAR
+#define PbMpi_SHORT MPI::SHORT
+#define PbMpi_FLOAT MPI::FLOAT
+#define PbMpi_DOUBLE MPI::DOUBLE
+#define PbMpi_COMM_NULL MPI::COMM_NULL
 
 namespace PbMpi
 {
-   typedef MPI::Intracomm Comm;
-   typedef MPI::Group     Group;
-   typedef MPI::Request   Request;
-   typedef MPI::Status    Status;
-
-   inline void Init( )  
-   {
-      MPI::Init(); 
-      MPI::COMM_WORLD.Set_errhandler(MPI::ERRORS_THROW_EXCEPTIONS); 
-   }
-   inline void Init(int& argc, char** argv )  
-   {
-      MPI::Init(argc, argv); 
-      MPI::COMM_WORLD.Set_errhandler(MPI::ERRORS_THROW_EXCEPTIONS); 
-   }
-   inline void Finalize()                      { MPI::Finalize();        }
-
-   inline int  GetCommSize( const Comm& comm ) { return comm.Get_size(); }
-   inline int  GetCommRank( const Comm& comm ) { return comm.Get_rank(); }
-   inline void Barrier( const Comm& comm  )    { comm.Barrier();         }
-
-   inline double Wtime()                       { return MPI::Wtime();    }
-   inline double Wtick()                       { return MPI::Wtick();    }
-
-   inline void Wait( Request& request, Status* outStatus=NULL) 
-   { 
-      if(outStatus) request.Wait(*outStatus); 
-      else request.Wait();   
-   }
-
-   inline Group GetCommGroup(Comm& comm)                               { return comm.Get_group();     }
-   inline Group GetGroupIncl( Group& group, const int& n, int* ranks ) { return group.Incl(n, ranks); }
-   inline Comm  CommCreateComm( Comm& comm, Group& group )             { return comm.Create(group);   }
-
-   inline void Alltoall( Comm& comm, void* sendBuffer, const int& sn, const MPI_Datatype& sdatatype, void* recvBuffer, const int& rn, const MPI_Datatype& rdatatype)
-   {
-      comm.Alltoall(sendBuffer, sn, sdatatype, recvBuffer, rn, rdatatype);
-   }
-   inline void Bcast(Comm& comm, void* data, const int& n, const MPI_Datatype& datatype , const int& srcRank )
-   {
-      comm.Bcast(data, n, datatype, srcRank);
-   }
-   inline void Send(Comm& comm,  const void* data, const int& length, const MPI_Datatype& dataType, const int& destRank, const int& tag)
-   {
-      try
-      { 
-         comm.Send(data, length, dataType, destRank, tag);
-      }
-      catch(MPI::Exception& e)
-      {
-         std::stringstream ss; 
-         ss<<"MPI::Exception error_string="<<e.Get_error_string()<<std::endl;
-         throw UbException(UB_EXARGS,"MPI:Exception catched\n"+ss.str());
-      }
-      catch(...)  
-      {
-         throw UbException(UB_EXARGS,"unknown exception"); 
-      }
-   }
-   inline void Recv(Comm& comm,  const void* data, const int& length, const MPI_Datatype& dataType, const int& srcRank, const int& tag)
-   {
-      try
-      { 
-         comm.Recv(const_cast<void*>(data), length, dataType, srcRank, tag);
-      }
-      catch(MPI::Exception& e)
-      {
-         std::stringstream ss; 
-         ss<<"MPI::Exception error_string="<<e.Get_error_string()<<std::endl;
-         throw UbException(UB_EXARGS,"MPI:Exception catched \n"+ss.str());
-      }
-      catch(...)  
-      {
-         throw UbException(UB_EXARGS,"unknown exception"); 
-      }
-   }
-
-   inline void Irecv(Comm comm,  const void* data, const int& length, const MPI_Datatype& dataType, const int& srcRank, const int& tag, Request& outRequest)
-   {
-      outRequest = comm.Irecv(const_cast<void*>(data), length, dataType, srcRank, tag);
-   }
-   inline void Ssend(Comm& comm,  const void* data, const int& length, const MPI_Datatype& dataType, const int& destRank, const int& tag)
-   {
-      try
-      { 
-         comm.Ssend(data, length, dataType, destRank, tag);
-      }
-      catch(MPI::Exception& e)
-      {
-         std::stringstream ss; 
-         ss<<"MPI::Exception error_string="<<e.Get_error_string()<<std::endl;
-         throw UbException(UB_EXARGS,"MPI:Exception catched\n"+ss.str());
-      }
-      catch(...)  
-      {
-         throw UbException(UB_EXARGS,"unknown exception"); 
-      }
-   }
+typedef MPI::Intracomm Comm;
+typedef MPI::Group Group;
+typedef MPI::Request Request;
+typedef MPI::Status Status;
+
+inline void Init()
+{
+    MPI::Init();
+    MPI::COMM_WORLD.Set_errhandler(MPI::ERRORS_THROW_EXCEPTIONS);
+}
+inline void Init(int &argc, char **argv)
+{
+    MPI::Init(argc, argv);
+    MPI::COMM_WORLD.Set_errhandler(MPI::ERRORS_THROW_EXCEPTIONS);
+}
+inline void Finalize() { MPI::Finalize(); }
+
+inline int GetCommSize(const Comm &comm) { return comm.Get_size(); }
+inline int GetCommRank(const Comm &comm) { return comm.Get_rank(); }
+inline void Barrier(const Comm &comm) { comm.Barrier(); }
+
+inline double Wtime() { return MPI::Wtime(); }
+inline double Wtick() { return MPI::Wtick(); }
+
+inline void Wait(Request &request, Status *outStatus = NULL)
+{
+    if (outStatus)
+        request.Wait(*outStatus);
+    else
+        request.Wait();
+}
+
+inline Group GetCommGroup(Comm &comm) { return comm.Get_group(); }
+inline Group GetGroupIncl(Group &group, const int &n, int *ranks) { return group.Incl(n, ranks); }
+inline Comm CommCreateComm(Comm &comm, Group &group) { return comm.Create(group); }
+
+inline void Alltoall(Comm &comm, void *sendBuffer, const int &sn, const MPI_Datatype &sdatatype, void *recvBuffer,
+                     const int &rn, const MPI_Datatype &rdatatype)
+{
+    comm.Alltoall(sendBuffer, sn, sdatatype, recvBuffer, rn, rdatatype);
+}
+inline void Bcast(Comm &comm, void *data, const int &n, const MPI_Datatype &datatype, const int &srcRank)
+{
+    comm.Bcast(data, n, datatype, srcRank);
+}
+inline void Send(Comm &comm, const void *data, const int &length, const MPI_Datatype &dataType, const int &destRank,
+                 const int &tag)
+{
+    try {
+        comm.Send(data, length, dataType, destRank, tag);
+    } catch (MPI::Exception &e) {
+        std::stringstream ss;
+        ss << "MPI::Exception error_string=" << e.Get_error_string() << std::endl;
+        throw UbException(UB_EXARGS, "MPI:Exception catched\n" + ss.str());
+    } catch (...) {
+        throw UbException(UB_EXARGS, "unknown exception");
+    }
+}
+inline void Recv(Comm &comm, const void *data, const int &length, const MPI_Datatype &dataType, const int &srcRank,
+                 const int &tag)
+{
+    try {
+        comm.Recv(const_cast<void *>(data), length, dataType, srcRank, tag);
+    } catch (MPI::Exception &e) {
+        std::stringstream ss;
+        ss << "MPI::Exception error_string=" << e.Get_error_string() << std::endl;
+        throw UbException(UB_EXARGS, "MPI:Exception catched \n" + ss.str());
+    } catch (...) {
+        throw UbException(UB_EXARGS, "unknown exception");
+    }
+}
 
+inline void Irecv(Comm comm, const void *data, const int &length, const MPI_Datatype &dataType, const int &srcRank,
+                  const int &tag, Request &outRequest)
+{
+    outRequest = comm.Irecv(const_cast<void *>(data), length, dataType, srcRank, tag);
+}
+inline void Ssend(Comm &comm, const void *data, const int &length, const MPI_Datatype &dataType, const int &destRank,
+                  const int &tag)
+{
+    try {
+        comm.Ssend(data, length, dataType, destRank, tag);
+    } catch (MPI::Exception &e) {
+        std::stringstream ss;
+        ss << "MPI::Exception error_string=" << e.Get_error_string() << std::endl;
+        throw UbException(UB_EXARGS, "MPI:Exception catched\n" + ss.str());
+    } catch (...) {
+        throw UbException(UB_EXARGS, "unknown exception");
+    }
 }
+
+} // namespace PbMpi
 #else //////////////////////////////////////////////////////////////////////////
-   //////////////////////////////////////////////////////////////////////////
-   // C-Syntax 
-   //////////////////////////////////////////////////////////////////////////
-   namespace PbMpi
-   {
-      using Comm = MPI_Comm;
-      using Group = MPI_Group;
-      using Request = MPI_Request;
-      using Status = MPI_Status;
-   }
-
-   #define PbMpi_COMM_WORLD ((PbMpi::Comm)MPI_COMM_WORLD)
-   #define PbMpi_INT        MPI_INT
-   #define PbMpi_CHAR       MPI_CHAR
-   #define PbMpi_SHORT      MPI_SHORT
-   #define PbMpi_FLOAT      MPI_FLOAT
-   #define PbMpi_DOUBLE     MPI_DOUBLE
-   #define PbMpi_COMM_NULL  MPI_COMM_NULL   
+//////////////////////////////////////////////////////////////////////////
+// C-Syntax
+//////////////////////////////////////////////////////////////////////////
+namespace PbMpi
+{
+using Comm    = MPI_Comm;
+using Group   = MPI_Group;
+using Request = MPI_Request;
+using Status  = MPI_Status;
+} // namespace PbMpi
+
+#define PbMpi_COMM_WORLD ((PbMpi::Comm)MPI_COMM_WORLD)
+#define PbMpi_INT MPI_INT
+#define PbMpi_CHAR MPI_CHAR
+#define PbMpi_SHORT MPI_SHORT
+#define PbMpi_FLOAT MPI_FLOAT
+#define PbMpi_DOUBLE MPI_DOUBLE
+#define PbMpi_COMM_NULL MPI_COMM_NULL
 
 namespace PbMpi
 {
-   inline void Init( )  
-   {
-      int    argc = 1;
-      char** argv = new char*[1];
-      argv[0]     = new char[1];
-      argv[0][0]  = 'n';
-      MPI_Init(&argc, &argv); 
-   }
-   inline void Init(int& argc, char** argv ) { MPI_Init(&argc, &argv);                         }
-   inline void Finalize( )                   { MPI_Finalize();                                 }
-   inline int  GetCommSize( Comm comm )      { int tmp; MPI_Comm_size(comm, &tmp); return tmp; }
-   inline int  GetCommRank( Comm comm )      { int tmp; MPI_Comm_rank(comm, &tmp); return tmp; }
-   inline void Barrier(  Comm comm )         { MPI_Barrier( comm );                            }
-   inline double Wtime()                     { return MPI_Wtime();                             }
-   inline double Wtick()                     { return MPI_Wtick();                             }
-   inline void   Wait( Request& request, Status* outStatus=NULL) { MPI_Wait( &request, outStatus);   }
-
-   inline Group GetCommGroup(Comm comm)                               { Group out; MPI_Comm_group(comm, &out);            return out; }
-   inline Group GetGroupIncl( Group group, const int& n, int* ranks ) { Group out; MPI_Group_incl(group, n, ranks, &out); return out; }
-   inline Comm  CommCreateComm( Comm comm, Group& group )             { Comm out;  MPI_Comm_create(comm, group, &out);    return out; }
-
-   inline void Alltoall( Comm comm, void* sendBuffer, const int& sn, const MPI_Datatype& sdatatype, void* recvBuffer, const int& rn, const MPI_Datatype& rdatatype)
-   {
-      MPI_Alltoall(sendBuffer, sn, sdatatype, recvBuffer, rn, rdatatype, comm);
-   }
-   inline void Bcast(Comm comm, void* data, const int& n, const MPI_Datatype& datatype , const int& srcRank )
-   {
-      MPI_Bcast(data, n, datatype, srcRank, comm);
-   }
-   inline void Send(Comm comm,  const void* data, const int& length, const MPI_Datatype& dataType, const int& destRank, const int& tag)
-   {
-      MPI_Send(const_cast<void*>(data), length, dataType, destRank, tag, comm);
-   }
-   inline void Recv(Comm comm,  const void* data, const int& length, const MPI_Datatype& dataType, const int& srcRank, const int& tag)
-   {
-      MPI_Recv(const_cast<void*>(data), length, dataType, srcRank, tag, comm, MPI_STATUS_IGNORE);
-   }
-   inline void Ssend(Comm comm,  const void* data, const int& length, const MPI_Datatype& dataType, const int& destRank, const int& tag)
-   {
-      MPI_Ssend(const_cast<void*>(data), length, dataType, destRank, tag, comm);
-   }
-   inline void Irecv(Comm comm,  const void* data, const int& length, const MPI_Datatype& dataType, const int& srcRank, const int& tag, Request& outRequest)
-   {
-      MPI_Irecv(const_cast<void*>(data), length, dataType, srcRank, tag, comm, &outRequest);
-   }
+inline void Init()
+{
+    int argc    = 1;
+    char **argv = new char *[1];
+    argv[0]     = new char[1];
+    argv[0][0]  = 'n';
+    MPI_Init(&argc, &argv);
+}
+inline void Init(int &argc, char **argv) { MPI_Init(&argc, &argv); }
+inline void Finalize() { MPI_Finalize(); }
+inline int GetCommSize(Comm comm)
+{
+    int tmp;
+    MPI_Comm_size(comm, &tmp);
+    return tmp;
+}
+inline int GetCommRank(Comm comm)
+{
+    int tmp;
+    MPI_Comm_rank(comm, &tmp);
+    return tmp;
+}
+inline void Barrier(Comm comm) { MPI_Barrier(comm); }
+inline double Wtime() { return MPI_Wtime(); }
+inline double Wtick() { return MPI_Wtick(); }
+inline void Wait(Request &request, Status *outStatus = NULL) { MPI_Wait(&request, outStatus); }
 
+inline Group GetCommGroup(Comm comm)
+{
+    Group out;
+    MPI_Comm_group(comm, &out);
+    return out;
+}
+inline Group GetGroupIncl(Group group, const int &n, int *ranks)
+{
+    Group out;
+    MPI_Group_incl(group, n, ranks, &out);
+    return out;
+}
+inline Comm CommCreateComm(Comm comm, Group &group)
+{
+    Comm out;
+    MPI_Comm_create(comm, group, &out);
+    return out;
+}
+
+inline void Alltoall(Comm comm, void *sendBuffer, const int &sn, const MPI_Datatype &sdatatype, void *recvBuffer,
+                     const int &rn, const MPI_Datatype &rdatatype)
+{
+    MPI_Alltoall(sendBuffer, sn, sdatatype, recvBuffer, rn, rdatatype, comm);
+}
+inline void Bcast(Comm comm, void *data, const int &n, const MPI_Datatype &datatype, const int &srcRank)
+{
+    MPI_Bcast(data, n, datatype, srcRank, comm);
+}
+inline void Send(Comm comm, const void *data, const int &length, const MPI_Datatype &dataType, const int &destRank,
+                 const int &tag)
+{
+    MPI_Send(const_cast<void *>(data), length, dataType, destRank, tag, comm);
+}
+inline void Recv(Comm comm, const void *data, const int &length, const MPI_Datatype &dataType, const int &srcRank,
+                 const int &tag)
+{
+    MPI_Recv(const_cast<void *>(data), length, dataType, srcRank, tag, comm, MPI_STATUS_IGNORE);
+}
+inline void Ssend(Comm comm, const void *data, const int &length, const MPI_Datatype &dataType, const int &destRank,
+                  const int &tag)
+{
+    MPI_Ssend(const_cast<void *>(data), length, dataType, destRank, tag, comm);
+}
+inline void Irecv(Comm comm, const void *data, const int &length, const MPI_Datatype &dataType, const int &srcRank,
+                  const int &tag, Request &outRequest)
+{
+    MPI_Irecv(const_cast<void *>(data), length, dataType, srcRank, tag, comm, &outRequest);
 }
+
+} // namespace PbMpi
 #endif
 
 namespace PbMpi
 {
-   /*======================================================================*/  
-   // send a single value "value" of MPI_Datatype
-   template <class T>
-   inline void sendSingleValue(const T& value, MPI_Datatype datatype, int dest, int tag, PbMpi::Comm comm);
-   
-   /*======================================================================*/  
-   // receives a single value "value" of MPI_Datatype
-   template <class T>
-   inline void receiveSingleValue(T& value, MPI_Datatype datatype, int source, int tag, PbMpi::Comm comm);
-   
-   /*======================================================================*/  
-   // receives and returns a single value of MPI_Datatype
-   // expample: int value = PbMpi::receiveSingleValue<int>(MPI::INT,0,10,comm);
-   template <class T>
-   inline T receiveSingleValue(MPI_Datatype datatype, int source, int tag, PbMpi::Comm comm);
-   
-   /*======================================================================*/  
-   // sends bool value (doesn't work with template, why ever... stupid MPI)
-   inline void sendBoolValue(const bool& value,int dest, int tag, PbMpi::Comm comm);
-
-   /*======================================================================*/  
-   // receives bool value (doesn't work with template, why ever... stupid MPI)
-   inline bool receiveBoolValue(int source, int tag, PbMpi::Comm comm);
-
-   /*======================================================================*/  
-   // sends bool value (doesn't work with template, why ever... stupid MPI)
-   inline void sendStringValue(const std::string& value,int dest, int tag, PbMpi::Comm comm);
-
-   /*======================================================================*/  
-   // receives bool value (doesn't work with template, why ever... stupid MPI)
-   inline std::string receiveStringValue(int source, int tag, PbMpi::Comm comm);
-
-   /*======================================================================*/  
-   // send a vector of MPI_Datatype
-   template <class T>
-	inline void sendVector(const std::vector<T>& v, MPI_Datatype datatype, int dest, int tag, PbMpi::Comm comm);
-	
-   /*======================================================================*/  
-   // receive a std::vector of MPI_Datatype
-   template <class T>
-   inline void receiveVector(std::vector<T>& v, MPI_Datatype datatype, int source, int tag, PbMpi::Comm comm);
-
-   /*======================================================================*/  
-   // receive a vector of MPI_Datatype and adds this vector to existing vector
-   // ans returns number of received elements
-   template <class T>
-   inline int receiveVectorAndAddToVector(std::vector<T>& v, MPI_Datatype datatype, int source, int tag, PbMpi::Comm comm);
-
-   /*======================================================================*/  
-   // send a std::vector of strings
-   inline void sendStringVector(const std::vector<std::string>& v, int dest, int tag, PbMpi::Comm comm);
-
-   /*======================================================================*/  
-   // send a vector of strings
-   inline void receiveStringVector(std::vector<std::string>& v, int dest, int tag, PbMpi::Comm comm);
-};
-
-/*======================================================================*/  
+/*======================================================================*/
+// send a single value "value" of MPI_Datatype
+template <class T>
+inline void sendSingleValue(const T &value, MPI_Datatype datatype, int dest, int tag, PbMpi::Comm comm);
+
+/*======================================================================*/
+// receives a single value "value" of MPI_Datatype
+template <class T>
+inline void receiveSingleValue(T &value, MPI_Datatype datatype, int source, int tag, PbMpi::Comm comm);
+
+/*======================================================================*/
+// receives and returns a single value of MPI_Datatype
+// expample: int value = PbMpi::receiveSingleValue<int>(MPI::INT,0,10,comm);
+template <class T>
+inline T receiveSingleValue(MPI_Datatype datatype, int source, int tag, PbMpi::Comm comm);
+
+/*======================================================================*/
+// sends bool value (doesn't work with template, why ever... stupid MPI)
+inline void sendBoolValue(const bool &value, int dest, int tag, PbMpi::Comm comm);
+
+/*======================================================================*/
+// receives bool value (doesn't work with template, why ever... stupid MPI)
+inline bool receiveBoolValue(int source, int tag, PbMpi::Comm comm);
+
+/*======================================================================*/
+// sends bool value (doesn't work with template, why ever... stupid MPI)
+inline void sendStringValue(const std::string &value, int dest, int tag, PbMpi::Comm comm);
+
+/*======================================================================*/
+// receives bool value (doesn't work with template, why ever... stupid MPI)
+inline std::string receiveStringValue(int source, int tag, PbMpi::Comm comm);
+
+/*======================================================================*/
+// send a vector of MPI_Datatype
+template <class T>
+inline void sendVector(const std::vector<T> &v, MPI_Datatype datatype, int dest, int tag, PbMpi::Comm comm);
+
+/*======================================================================*/
+// receive a std::vector of MPI_Datatype
+template <class T>
+inline void receiveVector(std::vector<T> &v, MPI_Datatype datatype, int source, int tag, PbMpi::Comm comm);
+
+/*======================================================================*/
+// receive a vector of MPI_Datatype and adds this vector to existing vector
+// ans returns number of received elements
+template <class T>
+inline int receiveVectorAndAddToVector(std::vector<T> &v, MPI_Datatype datatype, int source, int tag, PbMpi::Comm comm);
+
+/*======================================================================*/
+// send a std::vector of strings
+inline void sendStringVector(const std::vector<std::string> &v, int dest, int tag, PbMpi::Comm comm);
+
+/*======================================================================*/
+// send a vector of strings
+inline void receiveStringVector(std::vector<std::string> &v, int dest, int tag, PbMpi::Comm comm);
+}; // namespace PbMpi
+
+/*======================================================================*/
 // send a single value of MPI_Datatype
 template <class T>
-void PbMpi::sendSingleValue(const T& value, MPI_Datatype datatype, int dest, int tag, PbMpi::Comm comm)
+void PbMpi::sendSingleValue(const T &value, MPI_Datatype datatype, int dest, int tag, PbMpi::Comm comm)
 {
-   PbMpi::Send(comm, &value, 1, datatype, dest, tag); 
-   //comm.Send(&value, 1, datatype, dest, tag); 
+    PbMpi::Send(comm, &value, 1, datatype, dest, tag);
+    // comm.Send(&value, 1, datatype, dest, tag);
 }
-/*======================================================================*/  
+/*======================================================================*/
 template <class T>
-void PbMpi::receiveSingleValue(T& value, MPI_Datatype datatype, int source, int tag, PbMpi::Comm comm) 
+void PbMpi::receiveSingleValue(T &value, MPI_Datatype datatype, int source, int tag, PbMpi::Comm comm)
 {
-   PbMpi::Recv(comm, &value, 1, datatype, source, tag); 
-   //comm.Recv(&value, 1, datatype, source, tag); 
+    PbMpi::Recv(comm, &value, 1, datatype, source, tag);
+    // comm.Recv(&value, 1, datatype, source, tag);
 }
-/*======================================================================*/  
+/*======================================================================*/
 template <class T>
-T PbMpi::receiveSingleValue(MPI_Datatype datatype, int source, int tag, PbMpi::Comm comm) 
+T PbMpi::receiveSingleValue(MPI_Datatype datatype, int source, int tag, PbMpi::Comm comm)
 {
-   T value;
-   PbMpi::Recv(comm, &value, 1, datatype, source, tag); 
-   //comm.Recv(&value, 1, datatype, source, tag); 
+    T value;
+    PbMpi::Recv(comm, &value, 1, datatype, source, tag);
+    // comm.Recv(&value, 1, datatype, source, tag);
 
-   return value;
+    return value;
 }
-/*======================================================================*/  
+/*======================================================================*/
 // send a bool value (bool doesn't work with template, why ever)
-void PbMpi::sendBoolValue(const bool& value,int dest, int tag, PbMpi::Comm comm)
+void PbMpi::sendBoolValue(const bool &value, int dest, int tag, PbMpi::Comm comm)
 {
-   short dummy;
-   if(value) dummy=1;                  
-   else      dummy=0;
-
-   PbMpi::Send(comm, &dummy, 1, PbMpi_SHORT, dest, tag); 
-   //comm.Send(&dummy, 1, MPI::SHORT, dest, tag); 
+    short dummy;
+    if (value)
+        dummy = 1;
+    else
+        dummy = 0;
+
+    PbMpi::Send(comm, &dummy, 1, PbMpi_SHORT, dest, tag);
+    // comm.Send(&dummy, 1, MPI::SHORT, dest, tag);
 }
-/*======================================================================*/  
-bool PbMpi::receiveBoolValue(int source, int tag, PbMpi::Comm comm) 
+/*======================================================================*/
+bool PbMpi::receiveBoolValue(int source, int tag, PbMpi::Comm comm)
 {
-   short dummy {0};
-   PbMpi::Recv(comm, &dummy, 1, PbMpi_SHORT, source, tag); 
-   //comm.Recv(&dummy, 1, MPI::SHORT, source, tag);
- 
-   return (dummy==1);
+    short dummy{ 0 };
+    PbMpi::Recv(comm, &dummy, 1, PbMpi_SHORT, source, tag);
+    // comm.Recv(&dummy, 1, MPI::SHORT, source, tag);
+
+    return (dummy == 1);
 }
-/*======================================================================*/  
+/*======================================================================*/
 // sends bool value (doesn't work with template, why ever... stupid MPI)
-void PbMpi::sendStringValue(const std::string& value,int dest, int tag, PbMpi::Comm comm)
+void PbMpi::sendStringValue(const std::string &value, int dest, int tag, PbMpi::Comm comm)
 {
-   std::vector<char> vec;
-   for(char i : value)
-      vec.push_back(i);
- 
-   PbMpi::sendVector(vec,PbMpi_CHAR,dest,tag,comm);
+    std::vector<char> vec;
+    for (char i : value)
+        vec.push_back(i);
+
+    PbMpi::sendVector(vec, PbMpi_CHAR, dest, tag, comm);
 }
 
-/*======================================================================*/  
+/*======================================================================*/
 // receives bool value (doesn't work with template, why ever... stupid MPI)
 std::string PbMpi::receiveStringValue(int source, int tag, PbMpi::Comm comm)
 {
-   std::vector<char> vec;
-   PbMpi::receiveVector(vec,PbMpi_CHAR,source,tag,comm);
-   
-   std::string str;
-   for(char i : vec)
-      str+=i;
+    std::vector<char> vec;
+    PbMpi::receiveVector(vec, PbMpi_CHAR, source, tag, comm);
+
+    std::string str;
+    for (char i : vec)
+        str += i;
 
-   return str;
+    return str;
 }
-/*======================================================================*/  
+/*======================================================================*/
 // send a vector of MPI_Datatype
 template <class T>
-void PbMpi::sendVector(const std::vector<T>& v, MPI_Datatype datatype, int dest, int tag, PbMpi::Comm comm)
-{
-   // send size
-   int size = (int)v.size();
-   
-   PbMpi::Send(comm, &size, 1, PbMpi_INT, dest, tag);
-   //comm.Send(&size, 1, MPI::INT, dest, tag); 
-   
-   if(size>0)
-	{
-      PbMpi::Send(comm, &v[0], size, datatype, dest, tag);
-      //comm.Send(&v[0], size, datatype, dest, tag);
-   }
-}
-/*======================================================================*/  
+void PbMpi::sendVector(const std::vector<T> &v, MPI_Datatype datatype, int dest, int tag, PbMpi::Comm comm)
+{
+    // send size
+    int size = (int)v.size();
+
+    PbMpi::Send(comm, &size, 1, PbMpi_INT, dest, tag);
+    // comm.Send(&size, 1, MPI::INT, dest, tag);
+
+    if (size > 0) {
+        PbMpi::Send(comm, &v[0], size, datatype, dest, tag);
+        // comm.Send(&v[0], size, datatype, dest, tag);
+    }
+}
+/*======================================================================*/
 // receive a vector of MPI_Datatype
 template <class T>
-void PbMpi::receiveVector(std::vector<T>& v, MPI_Datatype datatype, int source, int tag, PbMpi::Comm comm) 
+void PbMpi::receiveVector(std::vector<T> &v, MPI_Datatype datatype, int source, int tag, PbMpi::Comm comm)
 {
-   int size {0};
+    int size{ 0 };
 
-   PbMpi::Recv(comm, &size, 1, PbMpi_INT, source, tag);
-   //comm.Recv(&size, 1, MPI::INT, source, tag); 
+    PbMpi::Recv(comm, &size, 1, PbMpi_INT, source, tag);
+    // comm.Recv(&size, 1, MPI::INT, source, tag);
 
-   v.resize(size);
+    v.resize(size);
 
-   if( size>0 )
-   {
-      PbMpi::Recv(comm, &v[0], size, datatype, source, tag);
-      //comm.Recv(&v[0], size, datatype, source, tag); 
-   }
+    if (size > 0) {
+        PbMpi::Recv(comm, &v[0], size, datatype, source, tag);
+        // comm.Recv(&v[0], size, datatype, source, tag);
+    }
 }
-/*======================================================================*/  
+/*======================================================================*/
 // receive a vector of MPI_Datatype and adds this vector to existing vector
 // return value is size of received elements
 template <class T>
-int PbMpi::receiveVectorAndAddToVector(std::vector<T>& v, MPI_Datatype datatype, int source, int tag, PbMpi::Comm comm) 
+int PbMpi::receiveVectorAndAddToVector(std::vector<T> &v, MPI_Datatype datatype, int source, int tag, PbMpi::Comm comm)
 {
-   int incommingSize;
+    int incommingSize;
 
-   PbMpi::Recv(comm, &incommingSize, 1, PbMpi_INT, source, tag);
-   //comm.Recv(&incommingSize, 1, MPI::INT, source, tag);
+    PbMpi::Recv(comm, &incommingSize, 1, PbMpi_INT, source, tag);
+    // comm.Recv(&incommingSize, 1, MPI::INT, source, tag);
 
-   int oldSize = (int)v.size();
-   v.resize(oldSize+incommingSize);
+    int oldSize = (int)v.size();
+    v.resize(oldSize + incommingSize);
 
-   if( incommingSize>0 )
-   {
-      PbMpi::Recv(comm, &v[oldSize], incommingSize, datatype, source, tag);
-      //comm.Recv(&v[oldSize], incommingSize, datatype, source, tag);
-   }
+    if (incommingSize > 0) {
+        PbMpi::Recv(comm, &v[oldSize], incommingSize, datatype, source, tag);
+        // comm.Recv(&v[oldSize], incommingSize, datatype, source, tag);
+    }
 
-   return incommingSize;
+    return incommingSize;
 }
-/*======================================================================*/  
+/*======================================================================*/
 // send a vector of strings
-void PbMpi::sendStringVector(const std::vector<std::string>& v, int dest, int tag, PbMpi::Comm comm)
+void PbMpi::sendStringVector(const std::vector<std::string> &v, int dest, int tag, PbMpi::Comm comm)
 {
-   // send size
-   int stringVectorSize = (int)v.size();
-
-   PbMpi::Send(comm, &stringVectorSize, 1, PbMpi_INT, dest, tag); 
-   //comm.Send(&stringVectorSize, 1, MPI::INT, dest, tag); 
-
-   if(stringVectorSize>0)
-   {
-      std::vector<int> singleStringSizes(stringVectorSize+1);
-      int nofChars = 0;
-      for(int i=0; i<stringVectorSize; i++)
-         nofChars += singleStringSizes[i] = (int)v[i].length();
-      singleStringSizes[stringVectorSize] = nofChars;
-
-      PbMpi::Send(comm, &singleStringSizes[0], stringVectorSize+1, PbMpi_INT, dest, tag); 
-
-      std::vector<char> charVector(nofChars);
-      int pos = 0;
-      for(int i=0; i<stringVectorSize; i++)
-         for(int j=0; j<singleStringSizes[i]; j++)
-            charVector[pos++] = v[i][j];      
-
-      PbMpi::Send(comm, &charVector[0], nofChars, PbMpi_CHAR, dest, tag); 
-      //comm.Send(&charVector[0], nofChars, MPI::CHAR, dest, tag); 
-   }
+    // send size
+    int stringVectorSize = (int)v.size();
+
+    PbMpi::Send(comm, &stringVectorSize, 1, PbMpi_INT, dest, tag);
+    // comm.Send(&stringVectorSize, 1, MPI::INT, dest, tag);
+
+    if (stringVectorSize > 0) {
+        std::vector<int> singleStringSizes(stringVectorSize + 1);
+        int nofChars = 0;
+        for (int i = 0; i < stringVectorSize; i++)
+            nofChars += singleStringSizes[i] = (int)v[i].length();
+        singleStringSizes[stringVectorSize] = nofChars;
+
+        PbMpi::Send(comm, &singleStringSizes[0], stringVectorSize + 1, PbMpi_INT, dest, tag);
+
+        std::vector<char> charVector(nofChars);
+        int pos = 0;
+        for (int i = 0; i < stringVectorSize; i++)
+            for (int j = 0; j < singleStringSizes[i]; j++)
+                charVector[pos++] = v[i][j];
+
+        PbMpi::Send(comm, &charVector[0], nofChars, PbMpi_CHAR, dest, tag);
+        // comm.Send(&charVector[0], nofChars, MPI::CHAR, dest, tag);
+    }
 }
-/*======================================================================*/  
+/*======================================================================*/
 // send a vector of strings
-void PbMpi::receiveStringVector(std::vector<std::string>& v, int source, int tag, PbMpi::Comm comm)
+void PbMpi::receiveStringVector(std::vector<std::string> &v, int source, int tag, PbMpi::Comm comm)
 {
-   // send size
-   int stringVectorSize {0};
-   PbMpi::Recv(comm, &stringVectorSize, 1, PbMpi_INT, source, tag);
-   //comm.Recv(&stringVectorSize, 1, MPI::INT, source, tag); 
+    // send size
+    int stringVectorSize{ 0 };
+    PbMpi::Recv(comm, &stringVectorSize, 1, PbMpi_INT, source, tag);
+    // comm.Recv(&stringVectorSize, 1, MPI::INT, source, tag);
 
-   v.clear();
-   v.resize(stringVectorSize);
+    v.clear();
+    v.resize(stringVectorSize);
 
-   if(stringVectorSize>0)
-   {
-      std::vector<int> singleStringSizes(stringVectorSize+1);
+    if (stringVectorSize > 0) {
+        std::vector<int> singleStringSizes(stringVectorSize + 1);
 
-      PbMpi::Recv(comm, &singleStringSizes[0], stringVectorSize+1, PbMpi_INT, source, tag); 
-      //comm.Recv(&singleStringSizes[0], stringVectorSize+1, MPI::INT, source, tag); 
+        PbMpi::Recv(comm, &singleStringSizes[0], stringVectorSize + 1, PbMpi_INT, source, tag);
+        // comm.Recv(&singleStringSizes[0], stringVectorSize+1, MPI::INT, source, tag);
 
-      int nofChars = singleStringSizes[stringVectorSize];
-      std::vector<char> charVector(nofChars);
+        int nofChars = singleStringSizes[stringVectorSize];
+        std::vector<char> charVector(nofChars);
 
-      PbMpi::Recv(comm, &charVector[0], nofChars, PbMpi_CHAR, source, tag); 
-      //comm.Recv(&charVector[0], nofChars, MPI::CHAR, source, tag); 
+        PbMpi::Recv(comm, &charVector[0], nofChars, PbMpi_CHAR, source, tag);
+        // comm.Recv(&charVector[0], nofChars, MPI::CHAR, source, tag);
 
-      int pos=0;
-      for(int i=0; i<stringVectorSize; i++)
-         for(int j=0; j<singleStringSizes[i]; j++)
-            v[i].push_back(charVector[pos++]);      
-   }
+        int pos = 0;
+        for (int i = 0; i < stringVectorSize; i++)
+            for (int j = 0; j < singleStringSizes[i]; j++)
+                v[i].push_back(charVector[pos++]);
+    }
 }
 
-#endif //PbMpi_H
+#endif // PbMpi_H
diff --git a/src/basics/basics/transmitter/TbTransmitter.h b/src/basics/basics/transmitter/TbTransmitter.h
index 61874360faa73689d435068baafdf9ece8f9ac44..4d5e5195d9840ea54b3a4f62b0063626e60e4c5b 100644
--- a/src/basics/basics/transmitter/TbTransmitter.h
+++ b/src/basics/basics/transmitter/TbTransmitter.h
@@ -17,52 +17,52 @@ This Class provides the base for sending and receiving of data.
 <BR><BR>
 @author <A HREF="mailto:muffmolch@gmx.de">S. Freudiger</A>
 @version 1.0 - 08.11.07
-*/ 
+*/
 
 /*
 usage: ...
 */
 
 //////////////////////////////////////////////////////////////////////////
-// Transmitter 
+// Transmitter
 // macht nichts ausser daten senden und empfangen
-template<typename T>
+template <typename T>
 class TbTransmitter
 {
 public:
-   using value_type = T;
+    using value_type = T;
 
 public:
-   TbTransmitter() = default;
-   virtual ~TbTransmitter() = default;
+    TbTransmitter()          = default;
+    virtual ~TbTransmitter() = default;
+
+    virtual bool isLocalTransmitter() const  = 0;
+    virtual bool isRemoteTransmitter() const = 0;
 
-   virtual bool isLocalTransmitter()  const = 0;
-   virtual bool isRemoteTransmitter() const = 0;
+    // preprocess (e.g. synchronizing send-/receive-buffer)
+    virtual void sendDataSize()    = 0;
+    virtual void receiveDataSize() = 0;
 
-   //preprocess (e.g. synchronizing send-/receive-buffer)
-   virtual void sendDataSize()   = 0;
-   virtual void receiveDataSize()= 0; 
-   
-   //calculation
-   virtual void        prepareForSend() {}
-   virtual void        sendData()=0;
-   virtual void        prepareForReceive() {}
-   virtual value_type& receiveData()=0;
+    // calculation
+    virtual void prepareForSend() {}
+    virtual void sendData() = 0;
+    virtual void prepareForReceive() {}
+    virtual value_type &receiveData() = 0;
 
-   //data-access
-   inline value_type&       getData()       { return this->data; }
-   inline const value_type& getData() const { return this->data; }
+    // data-access
+    inline value_type &getData() { return this->data; }
+    inline const value_type &getData() const { return this->data; }
 
-   //info-section (usable for remote transmitter)
-   virtual int  getSendToRank()   const { return  -1; }
-   virtual int  getSendToTag()    const { return  -1; }
-   virtual int  getRecvFromRank() const { return  -1; }
-   virtual int  getRecvFromTag()  const { return  -1; }
+    // info-section (usable for remote transmitter)
+    virtual int getSendToRank() const { return -1; }
+    virtual int getSendToTag() const { return -1; }
+    virtual int getRecvFromRank() const { return -1; }
+    virtual int getRecvFromTag() const { return -1; }
 
-   virtual std::string toString() const = 0;
+    virtual std::string toString() const = 0;
 
 protected:
-   value_type data;
+    value_type data;
 };
 
-#endif //TBTRANSMITTER_H 
+#endif // TBTRANSMITTER_H
diff --git a/src/basics/basics/transmitter/TbTransmitterLocal.h b/src/basics/basics/transmitter/TbTransmitterLocal.h
index abc127a0a9f01d8b7a83954b0351ede87b0813c3..f0a6c30df18a28dd61bfc25af48610d931ba270f 100644
--- a/src/basics/basics/transmitter/TbTransmitterLocal.h
+++ b/src/basics/basics/transmitter/TbTransmitterLocal.h
@@ -7,9 +7,9 @@
 #ifndef TOTRANSMITTERLOCAL_H
 #define TOTRANSMITTERLOCAL_H
 
-#include <basics/utilities/UbException.h>
-#include <basics/transmitter/TbTransmitter.h>
 #include <PointerDefinitions.h>
+#include <basics/transmitter/TbTransmitter.h>
+#include <basics/utilities/UbException.h>
 
 /*================================================================================*/
 /*   TbLocalTransmitter, TbVectorSenderLocal, TbVectorReceiverLocal               */
@@ -19,7 +19,7 @@ This Class provides the base for exception handling.
 <BR><BR>
 @author <A HREF="mailto:muffmolch@gmx.de">S. Freudiger</A>
 @version 1.0 - 08.11.07
-*/ 
+*/
 
 /*
 usage: ...
@@ -28,102 +28,95 @@ usage: ...
 //////////////////////////////////////////////////////////////////////////
 // LocalTransmitter lokalen Datenaustausch
 // data = send- und zugleich receive-buffer
-template<typename T>
+template <typename T>
 class TbLocalTransmitter : public TbTransmitter<T>
 {
 public:
-   using TbLocalTransmitterPtr = SPtr<TbLocalTransmitter<T> >;
+    using TbLocalTransmitterPtr = SPtr<TbLocalTransmitter<T>>;
 
-   using value_type = T;
+    using value_type = T;
 
 public:
-   TbLocalTransmitter() : TbTransmitter<T>() 
-   {
+    TbLocalTransmitter() : TbTransmitter<T>() {}
 
-   }
-   
-   bool isLocalTransmitter()  const override { return true;                         }
-   bool isRemoteTransmitter() const override { return !this->isLocalTransmitter();  }
+    bool isLocalTransmitter() const override { return true; }
+    bool isRemoteTransmitter() const override { return !this->isLocalTransmitter(); }
 
-   //send buffer wird autom resized
-   void sendDataSize() override    { }
-   //reiceive braucht nichts machen, da send==receive buffer ;-)
-   void receiveDataSize() override { } 
+    // send buffer wird autom resized
+    void sendDataSize() override {}
+    // reiceive braucht nichts machen, da send==receive buffer ;-)
+    void receiveDataSize() override {}
 
-   void        sendData() override    { }
-   value_type& receiveData() override { return this->data; }
+    void sendData() override {}
+    value_type &receiveData() override { return this->data; }
 
-   std::string toString()  const override { return "TbLocalTransmitter"+(std::string)typeid(T).name(); }
+    std::string toString() const override { return "TbLocalTransmitter" + (std::string) typeid(T).name(); }
 };
 
 //////////////////////////////////////////////////////////////////////////
 // TbVectorSender/ReceiverLocal lokalen Datenaustausch ueber ZWEI vektoren
-template<typename T>
+template <typename T>
 class TbVectorReceiverLocal : public TbTransmitter<T>
 {
 public:
-   using value_type = T;
+    using value_type = T;
 
 public:
-   TbVectorReceiverLocal() : TbTransmitter<value_type>() 
-   {
-
-   }
-   //virtual ~TbVectorReceiverLocal() { std::cout<<typeid(*this).name()<<" tot"<<std::endl;   }
+    TbVectorReceiverLocal() : TbTransmitter<value_type>() {}
+    // virtual ~TbVectorReceiverLocal() { std::cout<<typeid(*this).name()<<" tot"<<std::endl;   }
 
-   bool isLocalTransmitter()  const { return true;                         }
-   bool isRemoteTransmitter() const { return !this->isLocalTransmitter();  }
+    bool isLocalTransmitter() const { return true; }
+    bool isRemoteTransmitter() const { return !this->isLocalTransmitter(); }
 
-   //send buffer wird autom resized
-   void sendDataSize()    { UB_THROW( UbException(UB_EXARGS,"empfaengt nur") ); }
-   //reiceive braucht nichts machen, das macht der sender :-)
-   void receiveDataSize() { } 
+    // send buffer wird autom resized
+    void sendDataSize() { UB_THROW(UbException(UB_EXARGS, "empfaengt nur")); }
+    // reiceive braucht nichts machen, das macht der sender :-)
+    void receiveDataSize() {}
 
-   void         sendData()    { UB_THROW( UbException(UB_EXARGS,"empfaengt nur") ); }
-   value_type&  receiveData() { return this->data; }
+    void sendData() { UB_THROW(UbException(UB_EXARGS, "empfaengt nur")); }
+    value_type &receiveData() { return this->data; }
 
-   std::string toString() const { return "TbVectorReceiverLocal<"+(std::string)typeid(T).name()+">"; }
+    std::string toString() const { return "TbVectorReceiverLocal<" + (std::string) typeid(T).name() + ">"; }
 };
 
-template<typename T>
+template <typename T>
 class TbVectorSenderLocal : public TbTransmitter<T>
 {
 public:
-   using value_type = T;
+    using value_type = T;
 
 public:
-   TbVectorSenderLocal(SPtr< TbVectorReceiverLocal< value_type > > receiver) 
-      : TbTransmitter< value_type >(), receiver(receiver) 
-   {
-
-   }
-   //virtual ~TbVectorSenderLocal() { std::cout<<typeid(*this).name()<<" tot"<<std::endl;   }
-
-   bool isLocalTransmitter()  const { return true;                         }
-   bool isRemoteTransmitter() const { return !this->isLocalTransmitter();  }
-
-   //send buffer wird autom resized
-   void sendDataSize()  
-   { 
-      assert(receiver!=NULL); 
-      receiver->getData().resize( this->data.size() ); 
-   }
-   //reiceive braucht nichts machen, da send==receive buffer ;-)
-   void receiveDataSize()  { UB_THROW( UbException(UB_EXARGS,"sendet nur") ); } 
-   
-   void sendData()    
-   { 
-      assert( this->data.size() == receiver->getData().size() );
-      receiver->getData() = this->data;
-//       for(int i=(int)this->data.size()-1; i>=0; --i)
-//          receiver->getData()[i]= this->data[i];
-   }
-   value_type& receiveData() { UB_THROW( UbException(UB_EXARGS,"sendet nur") ); }
-
-   std::string toString() const { return "TbVectorSenderLocal<"+(std::string)typeid(T).name()+">"; }
+    TbVectorSenderLocal(SPtr<TbVectorReceiverLocal<value_type>> receiver)
+        : TbTransmitter<value_type>(), receiver(receiver)
+    {
+    }
+    // virtual ~TbVectorSenderLocal() { std::cout<<typeid(*this).name()<<" tot"<<std::endl;   }
+
+    bool isLocalTransmitter() const { return true; }
+    bool isRemoteTransmitter() const { return !this->isLocalTransmitter(); }
+
+    // send buffer wird autom resized
+    void sendDataSize()
+    {
+        assert(receiver != NULL);
+        receiver->getData().resize(this->data.size());
+    }
+    // reiceive braucht nichts machen, da send==receive buffer ;-)
+    void receiveDataSize() { UB_THROW(UbException(UB_EXARGS, "sendet nur")); }
+
+    void sendData()
+    {
+        assert(this->data.size() == receiver->getData().size());
+        receiver->getData() = this->data;
+        //       for(int i=(int)this->data.size()-1; i>=0; --i)
+        //          receiver->getData()[i]= this->data[i];
+    }
+    value_type &receiveData() { UB_THROW(UbException(UB_EXARGS, "sendet nur")); }
+
+    std::string toString() const { return "TbVectorSenderLocal<" + (std::string) typeid(T).name() + ">"; }
 
 protected:
-   SPtr< TbVectorReceiverLocal< value_type > > receiver; 
+    SPtr<TbVectorReceiverLocal<value_type>> receiver;
 };
-                                        
-#endif //TOTRANSMITTERLOCAL_H 
+
+#endif // TOTRANSMITTERLOCAL_H
diff --git a/src/basics/basics/transmitter/TbTransmitterMpiPool.h b/src/basics/basics/transmitter/TbTransmitterMpiPool.h
index aa5a9c16704e8491052abb63520a686bd8336a45..ff170e18e31f6f14beef00e245e724a259a9e753 100644
--- a/src/basics/basics/transmitter/TbTransmitterMpiPool.h
+++ b/src/basics/basics/transmitter/TbTransmitterMpiPool.h
@@ -9,528 +9,540 @@
 
 #ifdef VF_MPI
 
+#include <iomanip>
 #include <iostream>
+#include <map>
 #include <sstream>
-#include <iomanip>
 #include <vector>
-#include <map>
 
 #include <mpi.h>
 
-#include <basics/transmitter/TbTransmitter.h>
 #include <basics/container/CbVector.h>
 #include <basics/container/CbVectorPool.h>
+#include <basics/transmitter/TbTransmitter.h>
 
 #include <PointerDefinitions.h>
 //////////////////////////////////////////////////////////////////////////
 //////////////////////////////////////////////////////////////////////////
-//TbCbVectorMpiPoolSender/Receiver
-//diese verschicken immer einen VectorPool. Letztlich einen langen vector,
-//der eigentlich aus vielen kleinen besteht
-//jeder MpiPoolVector hat einen pointer auf die startadresse in diesem vector
-//die informationen werden im TbMpiVectorPool verwaltet
-//MpiPoolVector verhaelt sich nach aussen hin mit einschraenkungen wie ein std::vector
-//und kann somit bei den vector connector verwendet werden
-//man kann die klassen theoretisch verallgemeinern.
-
-template<typename T> class TbCbVectorSenderMpiPool;
-template<typename T> class TbCbVectorReceiverMpiPool;
+// TbCbVectorMpiPoolSender/Receiver
+// diese verschicken immer einen VectorPool. Letztlich einen langen vector,
+// der eigentlich aus vielen kleinen besteht
+// jeder MpiPoolVector hat einen pointer auf die startadresse in diesem vector
+// die informationen werden im TbMpiVectorPool verwaltet
+// MpiPoolVector verhaelt sich nach aussen hin mit einschraenkungen wie ein std::vector
+// und kann somit bei den vector connector verwendet werden
+// man kann die klassen theoretisch verallgemeinern.
+
+template <typename T>
+class TbCbVectorSenderMpiPool;
+template <typename T>
+class TbCbVectorReceiverMpiPool;
 
 /*==================================================================*/
-template<typename T>
+template <typename T>
 class TbCbVectorMpiPool : public CbVectorPool<T>
 {
 public:
-   using MpiPoolPtr = SPtr< TbCbVectorMpiPool< T > >;
+    using MpiPoolPtr = SPtr<TbCbVectorMpiPool<T>>;
 
-   //////////////////////////////////////////////////////////////////////////
-   using MpiPoolPtrMap = std::map<std::string, MpiPoolPtr>;
-   using MpiPoolPtrMapIter = typename MpiPoolPtrMap::iterator;
+    //////////////////////////////////////////////////////////////////////////
+    using MpiPoolPtrMap     = std::map<std::string, MpiPoolPtr>;
+    using MpiPoolPtrMapIter = typename MpiPoolPtrMap::iterator;
 
-   //da BasisKlasse templateKlasse ist MUSS man hier die typedefs nochmal wiederholen!
-   using value_type = typename CbVector<T>::value_type;
-   using size_type = typename CbVector<T>::size_type;
-   using Pool = std::vector<value_type>;
+    // da BasisKlasse templateKlasse ist MUSS man hier die typedefs nochmal wiederholen!
+    using value_type = typename CbVector<T>::value_type;
+    using size_type  = typename CbVector<T>::size_type;
+    using Pool       = std::vector<value_type>;
 
-   using CbVectorKey = std::string;
-   using CbVectorMap = std::map<CbVectorKey, CbVector<value_type> *>;
-   using CbVectorMapIter = typename CbVectorMap::iterator;
+    using CbVectorKey     = std::string;
+    using CbVectorMap     = std::map<CbVectorKey, CbVector<value_type> *>;
+    using CbVectorMapIter = typename CbVectorMap::iterator;
 
-   //////////////////////////////////////////////////////////////////////////
-   friend class TbCbVectorSenderMpiPool< T >; 
-   friend class TbCbVectorReceiverMpiPool< T >; 
+    //////////////////////////////////////////////////////////////////////////
+    friend class TbCbVectorSenderMpiPool<T>;
+    friend class TbCbVectorReceiverMpiPool<T>;
 
 protected:
-   //////////////////////////////////////////////////////////////////////////
-   static MpiPoolPtrMap poolMap;
+    //////////////////////////////////////////////////////////////////////////
+    static MpiPoolPtrMap poolMap;
+
 public:
-   //////////////////////////////////////////////////////////////////////////
-   //STATIC MEMBERS
-   //////////////////////////////////////////////////////////////////////////
-   //createTbCbVectorMpiPool:
-   // poolKey      : Schluessel fuer eindeutige Indizierung in Map
-   // mpiRemoteRank: mpi-rank des Empfaengers/Senders
-   // mpiTag       : mpi-tag mit dem empfangen/gesendet wird
-   static MpiPoolPtr createTbCbVectorMpiPool(CbVectorKey poolKey, int mpiRemoteRank, int mpiTag, MPI_Comm comm, size_type startPoolSize = 20000 ) //startPoolSize*sizeof(T)/1024/1024 [MB]
-
-   {
-      if( poolMap.find(poolKey)!=poolMap.end() )
-      {
-         throw UbException(UB_EXARGS,"es ist bereits ein Pool mit dem key vorhanden!!!");
-      }
-
-      //pool erstellen
-      MpiPoolPtr mpiPool(new TbCbVectorMpiPool<T>(poolKey, mpiRemoteRank, mpiTag, comm, startPoolSize) ); 
-
-      //pool "speichern"
-      TbCbVectorMpiPool< value_type >::poolMap[poolKey] = mpiPool;
-
-      return mpiPool; 
-   }
-   static void deleteTbCbVectorMpiPool(CbVectorKey poolKey)
-   {
-      MpiPoolPtrMapIter it = TbCbVectorMpiPool< value_type >::poolMap.find(poolKey);
-      if( it==poolMap.end() )
-      {
-         throw UbException(UB_EXARGS,"kein Pool mit dem key vorhanden");
-      }
-      TbCbVectorMpiPool< value_type >::poolMap.erase(it);
-   }
-   /*==================================================================*/
-   static MpiPoolPtr getTbCbVectorMpiPool(CbVectorKey poolKey)
-   {
-      MpiPoolPtrMapIter it;
-      if( (it=TbCbVectorMpiPool< T >::poolMap.find(poolKey))!=TbCbVectorMpiPool< T >::poolMap.end() ) 
-      {
-         return it->second;
-      }
-      return MpiPoolPtr();
-   }
-   /*==================================================================*/
-   static std::string getInfoString()
-   {
-      std::stringstream out;  
-      out<<"TbCbVectorMpiPool<"<< typeid( T ).name()  << ") - Info:"<<std::endl;
-      for(MpiPoolPtrMapIter it=poolMap.begin(); it!=poolMap.end(); ++it)
-         out<<"pool with key("            <<std::setw(15)<<it->first<<") "
-         <<"stores "                  <<std::setw(12)<<it->second->getNofStoredVectors() <<" vectors " 
-         <<", elements to transfer = "<<std::setw(15)<<it->second->getPoolSize() 
-         <<" ( "<< it->second->getPoolSize()*sizeof( T ) / ( 1024.0 * 1024.0 ) << " MB )" <<std::endl;
-      return out.str();
-   }
-   /*==================================================================*/
-   // checks if all vectors have one to one pool-entries
-   static bool consistencyCheck()
-   {
-      for(MpiPoolPtrMapIter it=poolMap.begin(); it!=poolMap.end(); ++it)
-      {
-         if( !it->second-> CbVectorPool<T>::consistencyCheck() ) 
-         {
-            return false;         
-         }
-      }
-
-      return true;
-   }
-   //////////////////////////////////////////////////////////////////////////
-   static void eraseMap()
-   {
-      poolMap.clear();
-   }
+    //////////////////////////////////////////////////////////////////////////
+    // STATIC MEMBERS
+    //////////////////////////////////////////////////////////////////////////
+    // createTbCbVectorMpiPool:
+    // poolKey      : Schluessel fuer eindeutige Indizierung in Map
+    // mpiRemoteRank: mpi-rank des Empfaengers/Senders
+    // mpiTag       : mpi-tag mit dem empfangen/gesendet wird
+    static MpiPoolPtr createTbCbVectorMpiPool(CbVectorKey poolKey, int mpiRemoteRank, int mpiTag, MPI_Comm comm,
+                                              size_type startPoolSize = 20000) // startPoolSize*sizeof(T)/1024/1024 [MB]
+
+    {
+        if (poolMap.find(poolKey) != poolMap.end()) {
+            throw UbException(UB_EXARGS, "es ist bereits ein Pool mit dem key vorhanden!!!");
+        }
+
+        // pool erstellen
+        MpiPoolPtr mpiPool(new TbCbVectorMpiPool<T>(poolKey, mpiRemoteRank, mpiTag, comm, startPoolSize));
+
+        // pool "speichern"
+        TbCbVectorMpiPool<value_type>::poolMap[poolKey] = mpiPool;
+
+        return mpiPool;
+    }
+    static void deleteTbCbVectorMpiPool(CbVectorKey poolKey)
+    {
+        MpiPoolPtrMapIter it = TbCbVectorMpiPool<value_type>::poolMap.find(poolKey);
+        if (it == poolMap.end()) {
+            throw UbException(UB_EXARGS, "kein Pool mit dem key vorhanden");
+        }
+        TbCbVectorMpiPool<value_type>::poolMap.erase(it);
+    }
+    /*==================================================================*/
+    static MpiPoolPtr getTbCbVectorMpiPool(CbVectorKey poolKey)
+    {
+        MpiPoolPtrMapIter it;
+        if ((it = TbCbVectorMpiPool<T>::poolMap.find(poolKey)) != TbCbVectorMpiPool<T>::poolMap.end()) {
+            return it->second;
+        }
+        return MpiPoolPtr();
+    }
+    /*==================================================================*/
+    static std::string getInfoString()
+    {
+        std::stringstream out;
+        out << "TbCbVectorMpiPool<" << typeid(T).name() << ") - Info:" << std::endl;
+        for (MpiPoolPtrMapIter it = poolMap.begin(); it != poolMap.end(); ++it)
+            out << "pool with key(" << std::setw(15) << it->first << ") "
+                << "stores " << std::setw(12) << it->second->getNofStoredVectors() << " vectors "
+                << ", elements to transfer = " << std::setw(15) << it->second->getPoolSize() << " ( "
+                << it->second->getPoolSize() * sizeof(T) / (1024.0 * 1024.0) << " MB )" << std::endl;
+        return out.str();
+    }
+    /*==================================================================*/
+    // checks if all vectors have one to one pool-entries
+    static bool consistencyCheck()
+    {
+        for (MpiPoolPtrMapIter it = poolMap.begin(); it != poolMap.end(); ++it) {
+            if (!it->second->CbVectorPool<T>::consistencyCheck()) {
+                return false;
+            }
+        }
+
+        return true;
+    }
+    //////////////////////////////////////////////////////////////////////////
+    static void eraseMap() { poolMap.clear(); }
+
 protected:
-   //////////////////////////////////////////////////////////////////////////
-   TbCbVectorMpiPool(CbVectorKey poolKey, int mpiRemoteRank, int mpiTag, MPI_Comm comm, size_type startPoolSize )
-      :    CbVectorPool< value_type >( startPoolSize ) 
-      , poolKey(poolKey)                           
-      , nofStoredVectors(0) //=Anzahl an Vectoren im Pool, wird bei send/receiveDataOrder gesetzt
-      , counterPrepareReceiveDataOrder(0)          
-      , counterSendDataOrder(0)                    
-      , counterReceiveDataOrder(0)                 
-      , counterPrepareForReceive(0)                
-      , counterReceive(0)                          
-      , counterPrepareForSend(0)                   
-      , counterSend(0)                             
-      , comm(comm)                                 
-      , receiveRequest(MPI_REQUEST_NULL)
-      //, sendRequest(MPI_REQUEST_NULL)
-      , mpiRemoteRank(mpiRemoteRank)               
-      , mpiTag(mpiTag)                              
-   {
-      if     ( (std::string)typeid(value_type).name()==(std::string)typeid(double).name() ) mpiDataType = MPI_DOUBLE;
-      else if( (std::string)typeid(value_type).name()==(std::string)typeid(float).name()  ) mpiDataType = MPI_FLOAT;
-      else if( (std::string)typeid(value_type).name()==(std::string)typeid(int).name()    ) mpiDataType = MPI_INT;
-      else throw UbException(UB_EXARGS,"no MpiDataType for T"+(std::string)typeid(T).name());
-
-      for (int i = 0; i < 3; i++)
-      {
-         sendRequest[i] = MPI_REQUEST_NULL;
-      }
-   }
+    //////////////////////////////////////////////////////////////////////////
+    TbCbVectorMpiPool(CbVectorKey poolKey, int mpiRemoteRank, int mpiTag, MPI_Comm comm, size_type startPoolSize)
+        : CbVectorPool<value_type>(startPoolSize), poolKey(poolKey),
+          nofStoredVectors(0) //=Anzahl an Vectoren im Pool, wird bei send/receiveDataOrder gesetzt
+          ,
+          counterPrepareReceiveDataOrder(0), counterSendDataOrder(0), counterReceiveDataOrder(0),
+          counterPrepareForReceive(0), counterReceive(0), counterPrepareForSend(0), counterSend(0), comm(comm),
+          receiveRequest(MPI_REQUEST_NULL)
+          //, sendRequest(MPI_REQUEST_NULL)
+          ,
+          mpiRemoteRank(mpiRemoteRank), mpiTag(mpiTag)
+    {
+        if ((std::string) typeid(value_type).name() == (std::string) typeid(double).name())
+            mpiDataType = MPI_DOUBLE;
+        else if ((std::string) typeid(value_type).name() == (std::string) typeid(float).name())
+            mpiDataType = MPI_FLOAT;
+        else if ((std::string) typeid(value_type).name() == (std::string) typeid(int).name())
+            mpiDataType = MPI_INT;
+        else
+            throw UbException(UB_EXARGS, "no MpiDataType for T" + (std::string) typeid(T).name());
+
+        for (int i = 0; i < 3; i++) {
+            sendRequest[i] = MPI_REQUEST_NULL;
+        }
+    }
 
 public:
-   /*==================================================================*/
-   //returns key of Pool in MpiPoolMap
-   CbVectorKey  getPoolKey()    const { return  this->poolKey;       }
-   /*==================================================================*/
-   //returns rank of process pool data will be send to/received from
-   int  getRemoteRank() const { return  this->mpiRemoteRank; }
-   /*==================================================================*/
-   //returns tag of process pool data will be send to/received from
-   int  getRemoteTag()  const { return  this->mpiTag;        }
+    /*==================================================================*/
+    // returns key of Pool in MpiPoolMap
+    CbVectorKey getPoolKey() const { return this->poolKey; }
+    /*==================================================================*/
+    // returns rank of process pool data will be send to/received from
+    int getRemoteRank() const { return this->mpiRemoteRank; }
+    /*==================================================================*/
+    // returns tag of process pool data will be send to/received from
+    int getRemoteTag() const { return this->mpiTag; }
 
 protected:
-   /*==================================================================*/
-   void sendDataOrder()
-   {
-      counterSendDataOrder++;
-      if(counterSendDataOrder==this->cbVectorMap.size())
-      {
-         //allg.: bei MPI muss man darauf achten, dass bei unblocked operationen die puffer (aus dem oder in den 
-         //geschrieben wird auch noch vorhanden sind!!! wuerde man hier z.B. einen lokalen vector mit Isend() los-
-         //schicken, dann wurde der scope verlassen werden und der vector evtl geloescht werden, bevor mpi den
-         //vorgang abgeschlossen hat!!! ->  tmpOrderVec ist class-member!!!
-         unsigned nofElements = (unsigned)this->cbVectorMap.size()*3+1;
-         tmpSendOrderVec.resize(nofElements);//std::vector< unsigned > vec(nofElements);
-         unsigned index = 0;
-         tmpSendOrderVec[index++] = (unsigned)this->pool.size(); //= laenge des vectors
-         if(this->nextCbVectorStartIndexInPool != this->pool.size())  throw UbException(UB_EXARGS,"an dieser Stelle sollten nextStartIndex und pool.size() identisch sein!!!");
-         for(CbVectorMapIter it = this->cbVectorMap.begin(); it!=this->cbVectorMap.end(); ++it)
-         {
-            CbVectorKey vectorKey;
-            size_type   dataSize=0, startIndexInPool=0;
-            this->getCbVectorData(*it->second/*vec*/, vectorKey, startIndexInPool, dataSize );
-            if(it->first != vectorKey) throw UbException(UB_EXARGS,"key mismatch!");
-
-            tmpSendOrderKeyVec += vectorKey;         //vectorKey == allocator.getAllocatorKey()
-            tmpSendOrderVec[index++] = (unsigned)vectorKey.length();
-            tmpSendOrderVec[index++] = (unsigned)startIndexInPool;  //startIndex in poolVector
-            tmpSendOrderVec[index++] = (unsigned)dataSize;          //dataSize
-         }
-         
-         MPI_Isend(&tmpSendOrderVec[0],(int)tmpSendOrderVec.size(), MPI_UNSIGNED, mpiRemoteRank, mpiTag, comm, &sendRequest[0]);
-         
-         tmpSendOrderKeyVecLength = (unsigned)tmpSendOrderKeyVec.length();
-         MPI_Isend(&tmpSendOrderKeyVecLength,1, MPI_UNSIGNED, mpiRemoteRank, mpiTag, comm, &sendRequest[1]);
-         MPI_Isend((char *)tmpSendOrderKeyVec.c_str(),tmpSendOrderKeyVecLength, MPI_CHAR, mpiRemoteRank, mpiTag, comm, &sendRequest[2]);
-
-
-         counterSendDataOrder=0;
-
-         nofStoredVectors = this->cbVectorMap.size();
-
-         UBLOG(logDEBUG5, "TbCbVectorMpiPool::sendDataOrder()"<<" mpiRemoteRank="<<mpiRemoteRank<<" mpiTag="<<mpiTag);
+    /*==================================================================*/
+    void sendDataOrder()
+    {
+        counterSendDataOrder++;
+        if (counterSendDataOrder == this->cbVectorMap.size()) {
+            // allg.: bei MPI muss man darauf achten, dass bei unblocked operationen die puffer (aus dem oder in den
+            // geschrieben wird auch noch vorhanden sind!!! wuerde man hier z.B. einen lokalen vector mit Isend() los-
+            // schicken, dann wurde der scope verlassen werden und der vector evtl geloescht werden, bevor mpi den
+            // vorgang abgeschlossen hat!!! ->  tmpOrderVec ist class-member!!!
+            unsigned nofElements = (unsigned)this->cbVectorMap.size() * 3 + 1;
+            tmpSendOrderVec.resize(nofElements); // std::vector< unsigned > vec(nofElements);
+            unsigned index           = 0;
+            tmpSendOrderVec[index++] = (unsigned)this->pool.size(); //= laenge des vectors
+            if (this->nextCbVectorStartIndexInPool != this->pool.size())
+                throw UbException(UB_EXARGS,
+                                  "an dieser Stelle sollten nextStartIndex und pool.size() identisch sein!!!");
+            for (CbVectorMapIter it = this->cbVectorMap.begin(); it != this->cbVectorMap.end(); ++it) {
+                CbVectorKey vectorKey;
+                size_type dataSize = 0, startIndexInPool = 0;
+                this->getCbVectorData(*it->second /*vec*/, vectorKey, startIndexInPool, dataSize);
+                if (it->first != vectorKey)
+                    throw UbException(UB_EXARGS, "key mismatch!");
+
+                tmpSendOrderKeyVec += vectorKey; // vectorKey == allocator.getAllocatorKey()
+                tmpSendOrderVec[index++] = (unsigned)vectorKey.length();
+                tmpSendOrderVec[index++] = (unsigned)startIndexInPool; // startIndex in poolVector
+                tmpSendOrderVec[index++] = (unsigned)dataSize;         // dataSize
+            }
+
+            MPI_Isend(&tmpSendOrderVec[0], (int)tmpSendOrderVec.size(), MPI_UNSIGNED, mpiRemoteRank, mpiTag, comm,
+                      &sendRequest[0]);
+
+            tmpSendOrderKeyVecLength = (unsigned)tmpSendOrderKeyVec.length();
+            MPI_Isend(&tmpSendOrderKeyVecLength, 1, MPI_UNSIGNED, mpiRemoteRank, mpiTag, comm, &sendRequest[1]);
+            MPI_Isend((char *)tmpSendOrderKeyVec.c_str(), tmpSendOrderKeyVecLength, MPI_CHAR, mpiRemoteRank, mpiTag,
+                      comm, &sendRequest[2]);
+
+            counterSendDataOrder = 0;
+
+            nofStoredVectors = this->cbVectorMap.size();
+
+            UBLOG(logDEBUG5, "TbCbVectorMpiPool::sendDataOrder()"
+                                 << " mpiRemoteRank=" << mpiRemoteRank << " mpiTag=" << mpiTag);
 
 #ifdef _DEBUG
-         orgPoolVectorStartPointer = &this->pool[0];
+            orgPoolVectorStartPointer = &this->pool[0];
 #endif
-      }
-   }
-   /*==================================================================*/
-   void receiveDataOrder()
-   {
-      counterReceiveDataOrder++;
-      if(counterReceiveDataOrder==this->cbVectorMap.size())
-      {
-         //receiveRequest.Wait();
-         unsigned nofElements = (unsigned)this->cbVectorMap.size()*3+1; //map MUSS auf beiden seiten gleich gross sein, sonst hat man ein grundsaetzliches problem ;-)
-
-         UBLOG(logDEBUG5, "TbCbVectorMpiPool::receiveDataOrder()"<<" mpiRemoteRank="<<mpiRemoteRank<<" mpiTag="<<mpiTag);
-
-         std::vector< unsigned > tmpRecvOrderVec;
-         tmpRecvOrderVec.resize(nofElements);
-
-         std::vector<char> tmpRecvOrderKeyVec;
-        
-         //MPI_Status status;
-         MPI_Recv(&tmpRecvOrderVec[0], nofElements, MPI_UNSIGNED, mpiRemoteRank, mpiTag, comm, MPI_STATUS_IGNORE);
-
-         unsigned rcount;
-         MPI_Recv(&rcount, 1, MPI_UNSIGNED, mpiRemoteRank, mpiTag, comm, MPI_STATUS_IGNORE);
-         tmpRecvOrderKeyVec.resize(rcount);
-         MPI_Recv(&tmpRecvOrderKeyVec[0], rcount, MPI_CHAR, mpiRemoteRank, mpiTag, comm, MPI_STATUS_IGNORE);
-
-         if(nofElements!=(unsigned)tmpRecvOrderVec.size())
-            throw UbException(UB_EXARGS,"error... vec size stimmt nicht");
-
-         unsigned index = 0;
-         size_type index2 = 0;
-         this->nextCbVectorStartIndexInPool = tmpRecvOrderVec[index++]; //= laenge des vectors
-         this->pool.resize(this->nextCbVectorStartIndexInPool);
-         CbVectorMapIter it = this->cbVectorMap.begin();
-         for(/*index*/; index<nofElements; index+=3, ++it)
-         {
-            size_type   vectorKeyLength  = (size_type)tmpRecvOrderVec.at(index  );
-            size_type   startIndexInPool = (size_type)tmpRecvOrderVec.at(index+1);
-            size_type   dataSize         = (size_type)tmpRecvOrderVec.at(index+2);
-            CbVectorKey vectorKey = CbVectorKey(&tmpRecvOrderKeyVec[index2], vectorKeyLength);
-            index2 += vectorKeyLength;
-
-            //if(it==this->cbVectorMap.end() || it->first != vectorKey ) 
-               //throw UbException(UB_EXARGS, "entweder hat map nicht die gleiche reihenfolge oder vectorKey = "+UbSystem::toString(vectorKey)+" nicht vorhanden");
-            if (it==this->cbVectorMap.end())
-               throw UbException(UB_EXARGS,"map ist leer");
-            else if (it->first != vectorKey)
-               throw UbException(UB_EXARGS, "vectorKey = "+UbSystem::toString(vectorKey)+" nicht vorhanden it->first =" + UbSystem::toString(it->first));
-
-            this->setCbVectorData(*it->second/*vec*/, vectorKey, startIndexInPool, dataSize );
-            
-         }
-         if(it!=this->cbVectorMap.end())
-            throw UbException(UB_EXARGS,"error... in der map sind scheinbar noch weiter elemente vorhanden, die es auf der send seite nicht gibt...");
-
-         counterReceiveDataOrder = 0;
-         nofStoredVectors = this->cbVectorMap.size();
+        }
+    }
+    /*==================================================================*/
+    void receiveDataOrder()
+    {
+        counterReceiveDataOrder++;
+        if (counterReceiveDataOrder == this->cbVectorMap.size()) {
+            // receiveRequest.Wait();
+            unsigned nofElements =
+                (unsigned)this->cbVectorMap.size() * 3 +
+                1; // map MUSS auf beiden seiten gleich gross sein, sonst hat man ein grundsaetzliches problem ;-)
+
+            UBLOG(logDEBUG5, "TbCbVectorMpiPool::receiveDataOrder()"
+                                 << " mpiRemoteRank=" << mpiRemoteRank << " mpiTag=" << mpiTag);
+
+            std::vector<unsigned> tmpRecvOrderVec;
+            tmpRecvOrderVec.resize(nofElements);
+
+            std::vector<char> tmpRecvOrderKeyVec;
+
+            // MPI_Status status;
+            MPI_Recv(&tmpRecvOrderVec[0], nofElements, MPI_UNSIGNED, mpiRemoteRank, mpiTag, comm, MPI_STATUS_IGNORE);
+
+            unsigned rcount;
+            MPI_Recv(&rcount, 1, MPI_UNSIGNED, mpiRemoteRank, mpiTag, comm, MPI_STATUS_IGNORE);
+            tmpRecvOrderKeyVec.resize(rcount);
+            MPI_Recv(&tmpRecvOrderKeyVec[0], rcount, MPI_CHAR, mpiRemoteRank, mpiTag, comm, MPI_STATUS_IGNORE);
+
+            if (nofElements != (unsigned)tmpRecvOrderVec.size())
+                throw UbException(UB_EXARGS, "error... vec size stimmt nicht");
+
+            unsigned index                     = 0;
+            size_type index2                   = 0;
+            this->nextCbVectorStartIndexInPool = tmpRecvOrderVec[index++]; //= laenge des vectors
+            this->pool.resize(this->nextCbVectorStartIndexInPool);
+            CbVectorMapIter it = this->cbVectorMap.begin();
+            for (/*index*/; index < nofElements; index += 3, ++it) {
+                size_type vectorKeyLength  = (size_type)tmpRecvOrderVec.at(index);
+                size_type startIndexInPool = (size_type)tmpRecvOrderVec.at(index + 1);
+                size_type dataSize         = (size_type)tmpRecvOrderVec.at(index + 2);
+                CbVectorKey vectorKey      = CbVectorKey(&tmpRecvOrderKeyVec[index2], vectorKeyLength);
+                index2 += vectorKeyLength;
+
+                // if(it==this->cbVectorMap.end() || it->first != vectorKey )
+                // throw UbException(UB_EXARGS, "entweder hat map nicht die gleiche reihenfolge oder vectorKey =
+                // "+UbSystem::toString(vectorKey)+" nicht vorhanden");
+                if (it == this->cbVectorMap.end())
+                    throw UbException(UB_EXARGS, "map ist leer");
+                else if (it->first != vectorKey)
+                    throw UbException(UB_EXARGS, "vectorKey = " + UbSystem::toString(vectorKey) +
+                                                     " nicht vorhanden it->first =" + UbSystem::toString(it->first));
+
+                this->setCbVectorData(*it->second /*vec*/, vectorKey, startIndexInPool, dataSize);
+            }
+            if (it != this->cbVectorMap.end())
+                throw UbException(UB_EXARGS, "error... in der map sind scheinbar noch weiter elemente vorhanden, die "
+                                             "es auf der send seite nicht gibt...");
+
+            counterReceiveDataOrder = 0;
+            nofStoredVectors        = this->cbVectorMap.size();
 
 #ifdef _DEBUG
-         orgPoolVectorStartPointer = &this->pool[0];
+            orgPoolVectorStartPointer = &this->pool[0];
 #endif
-      }
-   }
-   /*==================================================================*/
-   void prepareForSendData()
-   {
-      //da sendDataOrder einen request verwendet muss man hier immer abfragen
-      if(counterPrepareForSend==0)
-      {
-         UBLOG(logDEBUG5, "TbCbVectorMpiPool::prepareForSendData():start"<<" mpiRemoteRank="<<mpiRemoteRank<<" mpiTag="<<mpiTag);
-         //if(sendRequest != MPI_REQUEST_NULL) MPI_Wait(&sendRequest, MPI_STATUS_IGNORE);
-         if(sendRequest[2] != MPI_REQUEST_NULL) MPI_Waitall(3, sendRequest, MPI_STATUS_IGNORE);
-         UBLOG(logDEBUG5, "TbCbVectorMpiPool::prepareForSendData():end"<<" mpiRemoteRank="<<mpiRemoteRank<<" mpiTag="<<mpiTag);
-      }
-
-      counterPrepareForSend++;
-
-      if(counterPrepareForSend==nofStoredVectors)
-      {
-         counterPrepareForSend=0;  
-      }
-
-
-      //A - non blocking
-      ////der ERSTE is entscheidend 
-      ////Grund: wenn man 
-      //// for(all trans) { trans->prepare(); trans->fillBuffer(); }
-      //// aufruft, dann wuerde u.U. der Buffer neu beschrieben werden obwohl noch nicht versendet wurde!!!
-      //counterPrepareForSend++;
-      //if(counterPrepareForSend==1)
-      //{
-      //   if(sendRequest != MPI::REQUEST_NULL) sendRequest.Wait();
-      //}
-      //
-      //if(counterPrepareForSend==nofStoredVectors)
-      //   counterPrepareForSend=0;  
-   }
-   /*==================================================================*/
-   void sendData()
-   {
-      //A - non blocking
-      //der LETZTE is entscheidend 
-      //counterSend++;
-      //if(counterSend==nofStoredVectors)
-      //{
-      //   //std::cout<<"Isend von "<<(int)nextStartIndex<<"elementen von "<<mpiRemoteRank<<" mit tag="<<mpiTag<<std::endl;
-      //   sendRequest = comm.Isend(&pool[0],(int)nextCbVectorStartIndexInPool, mpiDataType, mpiRemoteRank, mpiTag);
-      //   counterSend=0;
-      //}
-      //B - blocking
-      //der LETZTE is entscheidend 
-      counterSend++;
-      if(counterSend==nofStoredVectors)
-      {
-         //std::cout<<"Isend von "<<(int)nextStartIndex<<"elementen von "<<mpiRemoteRank<<" mit tag="<<mpiTag<<std::endl;
-         UBLOG(logDEBUG5, "TbCbVectorMpiPool::sendData():start"<<" mpiRemoteRank="<<mpiRemoteRank<<" mpiTag="<<mpiTag);
-
-         //synchronous send 
-         //comm.Ssend(&this->pool[0],(int)this->nextCbVectorStartIndexInPool, mpiDataType, mpiRemoteRank, mpiTag);
+        }
+    }
+    /*==================================================================*/
+    void prepareForSendData()
+    {
+        // da sendDataOrder einen request verwendet muss man hier immer abfragen
+        if (counterPrepareForSend == 0) {
+            UBLOG(logDEBUG5, "TbCbVectorMpiPool::prepareForSendData():start"
+                                 << " mpiRemoteRank=" << mpiRemoteRank << " mpiTag=" << mpiTag);
+            // if(sendRequest != MPI_REQUEST_NULL) MPI_Wait(&sendRequest, MPI_STATUS_IGNORE);
+            if (sendRequest[2] != MPI_REQUEST_NULL)
+                MPI_Waitall(3, sendRequest, MPI_STATUS_IGNORE);
+            UBLOG(logDEBUG5, "TbCbVectorMpiPool::prepareForSendData():end"
+                                 << " mpiRemoteRank=" << mpiRemoteRank << " mpiTag=" << mpiTag);
+        }
+
+        counterPrepareForSend++;
+
+        if (counterPrepareForSend == nofStoredVectors) {
+            counterPrepareForSend = 0;
+        }
+
+        // A - non blocking
+        ////der ERSTE is entscheidend
+        ////Grund: wenn man
+        //// for(all trans) { trans->prepare(); trans->fillBuffer(); }
+        //// aufruft, dann wuerde u.U. der Buffer neu beschrieben werden obwohl noch nicht versendet wurde!!!
+        // counterPrepareForSend++;
+        // if(counterPrepareForSend==1)
+        //{
+        //   if(sendRequest != MPI::REQUEST_NULL) sendRequest.Wait();
+        //}
+        //
+        // if(counterPrepareForSend==nofStoredVectors)
+        //   counterPrepareForSend=0;
+    }
+    /*==================================================================*/
+    void sendData()
+    {
+        // A - non blocking
+        // der LETZTE is entscheidend
+        // counterSend++;
+        // if(counterSend==nofStoredVectors)
+        //{
+        //   //std::cout<<"Isend von "<<(int)nextStartIndex<<"elementen von "<<mpiRemoteRank<<" mit
+        //   tag="<<mpiTag<<std::endl; sendRequest = comm.Isend(&pool[0],(int)nextCbVectorStartIndexInPool, mpiDataType,
+        //   mpiRemoteRank, mpiTag); counterSend=0;
+        //}
+        // B - blocking
+        // der LETZTE is entscheidend
+        counterSend++;
+        if (counterSend == nofStoredVectors) {
+            // std::cout<<"Isend von "<<(int)nextStartIndex<<"elementen von "<<mpiRemoteRank<<" mit
+            // tag="<<mpiTag<<std::endl;
+            UBLOG(logDEBUG5, "TbCbVectorMpiPool::sendData():start"
+                                 << " mpiRemoteRank=" << mpiRemoteRank << " mpiTag=" << mpiTag);
+
+            // synchronous send
+            // comm.Ssend(&this->pool[0],(int)this->nextCbVectorStartIndexInPool, mpiDataType, mpiRemoteRank, mpiTag);
 #ifdef _DEBUG
-         if(this->orgPoolVectorStartPointer != &this->pool[0] ) throw UbException(UB_EXARGS, "ups, pool array adress changed - unknown behavoir");
+            if (this->orgPoolVectorStartPointer != &this->pool[0])
+                throw UbException(UB_EXARGS, "ups, pool array adress changed - unknown behavoir");
 #endif
 
-         //standard send
-         MPI_Send(&this->pool[0],(int)this->nextCbVectorStartIndexInPool, mpiDataType, mpiRemoteRank, mpiTag, comm);
-         UBLOG(logDEBUG5, "TbCbVectorMpiPool::sendData():end"<<" mpiRemoteRank="<<mpiRemoteRank<<" mpiTag="<<mpiTag);
-////////////////////////////////////////////////////////////////////////////////////////////
-//DEBUG///////////////////////////////////////
-         //int irank;
-         //MPI_Comm_rank(MPI_COMM_WORLD, &irank);
-         //std::cout << "MPI_Send: " << irank <<  " "  << mpiRemoteRank << " "  <<mpiTag<<std::endl;
-///////////////////////////////////////////////////
-         counterSend=0;
-      }                           
-   }
-   /*==================================================================*/
-   void prepareForReceiveData()
-   {
-      //A - non blocking
-      //sobald der Letzte kann man den den request holen.
-      //andernfalls kann nicht gewaehrleistet werden, dass evtl noch mit dem buffer gearbeitet wird!!!
-      counterPrepareForReceive++;
-      if(counterPrepareForReceive==this->nofStoredVectors)
-      {
-         UBLOG(logDEBUG5, "TbCbVectorMpiPool::prepareForReceiveData():start"<<" mpiRemoteRank="<<mpiRemoteRank<<" mpiTag="<<mpiTag);
+            // standard send
+            MPI_Send(&this->pool[0], (int)this->nextCbVectorStartIndexInPool, mpiDataType, mpiRemoteRank, mpiTag, comm);
+            UBLOG(logDEBUG5, "TbCbVectorMpiPool::sendData():end"
+                                 << " mpiRemoteRank=" << mpiRemoteRank << " mpiTag=" << mpiTag);
+            ////////////////////////////////////////////////////////////////////////////////////////////
+            // DEBUG///////////////////////////////////////
+            // int irank;
+            // MPI_Comm_rank(MPI_COMM_WORLD, &irank);
+            // std::cout << "MPI_Send: " << irank <<  " "  << mpiRemoteRank << " "  <<mpiTag<<std::endl;
+            ///////////////////////////////////////////////////
+            counterSend = 0;
+        }
+    }
+    /*==================================================================*/
+    void prepareForReceiveData()
+    {
+        // A - non blocking
+        // sobald der Letzte kann man den den request holen.
+        // andernfalls kann nicht gewaehrleistet werden, dass evtl noch mit dem buffer gearbeitet wird!!!
+        counterPrepareForReceive++;
+        if (counterPrepareForReceive == this->nofStoredVectors) {
+            UBLOG(logDEBUG5, "TbCbVectorMpiPool::prepareForReceiveData():start"
+                                 << " mpiRemoteRank=" << mpiRemoteRank << " mpiTag=" << mpiTag);
 #ifdef _DEBUG
-         if(this->orgPoolVectorStartPointer != &this->pool[0] ) throw UbException(UB_EXARGS, "ups, pool array adress changed - unknown behavoir");
+            if (this->orgPoolVectorStartPointer != &this->pool[0])
+                throw UbException(UB_EXARGS, "ups, pool array adress changed - unknown behavoir");
 #endif
-         MPI_Irecv(&this->pool[0],(int)this->nextCbVectorStartIndexInPool, mpiDataType, mpiRemoteRank, mpiTag, comm, &receiveRequest);
-         UBLOG(logDEBUG5, "TbCbVectorMpiPool::prepareForReceiveData():end"<<" mpiRemoteRank="<<mpiRemoteRank<<" mpiTag="<<mpiTag);
-         counterPrepareForReceive=0;
-      }
-   }
-   /*==================================================================*/
-   void receiveData()
-   {
-      //A - non blocking
-      //sobald der ERSTE reinkommt muss man warten, bis received wurde!!!
-      //denn erst anschliessend stehen die empfangenen daten zur verfuegung
-      if(counterReceive==0)
-      {
-         UBLOG(logDEBUG5, "TbCbVectorMpiPool::receiveData():start"<<" mpiRemoteRank="<<mpiRemoteRank<<" mpiTag="<<mpiTag);
-         MPI_Wait(&receiveRequest, MPI_STATUS_IGNORE);
-         UBLOG(logDEBUG5, "TbCbVectorMpiPool::receiveData():end"<<" mpiRemoteRank="<<mpiRemoteRank<<" mpiTag="<<mpiTag);
-      }
-      counterReceive++;
-      if(counterReceive==this->nofStoredVectors) //alle receiver waren hier
-      {
-         counterReceive=0;
-      }
-
-      ////B - blocking
-      ////sobald der ERSTE reinkommt muss man warten, bis received wurde!!!
-      ////denn erst anschliessend stehen die empfangenen daten zur verfuegung
-      //if(counterReceive==0)
-      //{
-      //   comm.Recv(&this->pool[0],(int)this->nextCbVectorStartIndexInPool, mpiDataType, mpiRemoteRank, mpiTag);
-      //}
-      //counterReceive++;
-      //if(counterReceive==this->nofStoredVectors) //alle receiver waren hier
-      //   counterReceive=0;
-   }
+            MPI_Irecv(&this->pool[0], (int)this->nextCbVectorStartIndexInPool, mpiDataType, mpiRemoteRank, mpiTag, comm,
+                      &receiveRequest);
+            UBLOG(logDEBUG5, "TbCbVectorMpiPool::prepareForReceiveData():end"
+                                 << " mpiRemoteRank=" << mpiRemoteRank << " mpiTag=" << mpiTag);
+            counterPrepareForReceive = 0;
+        }
+    }
+    /*==================================================================*/
+    void receiveData()
+    {
+        // A - non blocking
+        // sobald der ERSTE reinkommt muss man warten, bis received wurde!!!
+        // denn erst anschliessend stehen die empfangenen daten zur verfuegung
+        if (counterReceive == 0) {
+            UBLOG(logDEBUG5, "TbCbVectorMpiPool::receiveData():start"
+                                 << " mpiRemoteRank=" << mpiRemoteRank << " mpiTag=" << mpiTag);
+            MPI_Wait(&receiveRequest, MPI_STATUS_IGNORE);
+            UBLOG(logDEBUG5, "TbCbVectorMpiPool::receiveData():end"
+                                 << " mpiRemoteRank=" << mpiRemoteRank << " mpiTag=" << mpiTag);
+        }
+        counterReceive++;
+        if (counterReceive == this->nofStoredVectors) // alle receiver waren hier
+        {
+            counterReceive = 0;
+        }
+
+        ////B - blocking
+        ////sobald der ERSTE reinkommt muss man warten, bis received wurde!!!
+        ////denn erst anschliessend stehen die empfangenen daten zur verfuegung
+        // if(counterReceive==0)
+        //{
+        //   comm.Recv(&this->pool[0],(int)this->nextCbVectorStartIndexInPool, mpiDataType, mpiRemoteRank, mpiTag);
+        //}
+        // counterReceive++;
+        // if(counterReceive==this->nofStoredVectors) //alle receiver waren hier
+        //   counterReceive=0;
+    }
 
 protected:
-   CbVectorKey poolKey; //eindeutiger schluessel fuer pool
-   size_type nofStoredVectors;
-
-   size_type counterPrepareReceiveDataOrder;
-   size_type counterSendDataOrder;
-   size_type counterReceiveDataOrder;
-   size_type counterPrepareForReceive;
-   size_type counterReceive;
-   size_type counterPrepareForSend;
-   size_type counterSend;
-
-   std::vector< unsigned > tmpSendOrderVec; //wird zur temp speicherung der anordnung benoetigt
-   std::string tmpSendOrderKeyVec;
-   unsigned tmpSendOrderKeyVecLength;
-
-   MPI_Comm     comm;
-   MPI_Request  receiveRequest;
-   //MPI_Request  sendRequest;
-   MPI_Request  sendRequest[3];
-   //MPI_Status   sendStatus;
-   //MPI_Status   receiveStatus;
-   MPI_Datatype mpiDataType;
-
-   int mpiRemoteRank, mpiTag;
+    CbVectorKey poolKey; // eindeutiger schluessel fuer pool
+    size_type nofStoredVectors;
+
+    size_type counterPrepareReceiveDataOrder;
+    size_type counterSendDataOrder;
+    size_type counterReceiveDataOrder;
+    size_type counterPrepareForReceive;
+    size_type counterReceive;
+    size_type counterPrepareForSend;
+    size_type counterSend;
+
+    std::vector<unsigned> tmpSendOrderVec; // wird zur temp speicherung der anordnung benoetigt
+    std::string tmpSendOrderKeyVec;
+    unsigned tmpSendOrderKeyVecLength;
+
+    MPI_Comm comm;
+    MPI_Request receiveRequest;
+    // MPI_Request  sendRequest;
+    MPI_Request sendRequest[3];
+    // MPI_Status   sendStatus;
+    // MPI_Status   receiveStatus;
+    MPI_Datatype mpiDataType;
+
+    int mpiRemoteRank, mpiTag;
 
 #ifdef _DEBUG
-   T* orgPoolVectorStartPointer;
+    T *orgPoolVectorStartPointer;
 #endif
 };
 
-template<typename T>
+template <typename T>
 typename TbCbVectorMpiPool<T>::MpiPoolPtrMap TbCbVectorMpiPool<T>::poolMap;
 
 //////////////////////////////////////////////////////////////////////////
 //  TbSenderMpiPool
 //////////////////////////////////////////////////////////////////////////
-template<typename T>
-class TbCbVectorSenderMpiPool : public TbTransmitter< CbVector< T >  >
+template <typename T>
+class TbCbVectorSenderMpiPool : public TbTransmitter<CbVector<T>>
 {
 public:
-   using value_type = CbVector<T>;
+    using value_type = CbVector<T>;
 
 public:
-   TbCbVectorSenderMpiPool(std::string cbVectorKey, TbCbVectorMpiPool< T >* mpiVectorPool)
-      : mpiVectorPool(mpiVectorPool)
-   { 
-      this->getData().setAllocator( new CbVectorAllocatorPool<T>(cbVectorKey,this->mpiVectorPool) );
-   }
-   ~TbCbVectorSenderMpiPool() override
-   {
-      if( this->mpiVectorPool->getNofStoredVectors()==1 ) //last entry!
-      {
-         TbCbVectorMpiPool< T >::deleteTbCbVectorMpiPool(this->mpiVectorPool->getPoolKey());  
-      }
-   }
-
-   bool isLocalTransmitter()  const override { return false;                        }
-   bool isRemoteTransmitter() const override { return !this->isLocalTransmitter();  }
-
-   void sendDataSize() override          { this->mpiVectorPool->sendDataOrder(); }
-   void receiveDataSize() override       { throw UbException(UB_EXARGS,"TbMpiPoolSender sends only");  }   
-   CbVector< T >& receiveData() override { throw UbException(UB_EXARGS,"TbMpiPoolSender sends only");  }
-   void prepareForSend() override        { this->mpiVectorPool->prepareForSendData(); }
-   void sendData() override              { this->mpiVectorPool->sendData(); }
-
-   //info-section (usable for remote transmitter)
-   int  getSendTbRank()   const { return  this->mpiVectorPool->getRemoteRank(); }
-   int  getSendTbTag()    const { return  this->mpiVectorPool->getRemoteTag();  }
-   int  getRecvFromRank() const override { throw UbException(UB_EXARGS,"TbCbVectorSenderMpiPool sends only"); }
-   int  getRecvFromTag()  const override { throw UbException(UB_EXARGS,"TbCbVectorSenderMpiPool sends only"); }
-
-   std::string toString() const override { return "TbCbVectorSenderMpiPool<"+(std::string)typeid(T).name()+" to rank (tag)"+UbSystem::toString(getSendTbRank())+"("+UbSystem::toString(getSendTbTag())+")"; }
+    TbCbVectorSenderMpiPool(std::string cbVectorKey, TbCbVectorMpiPool<T> *mpiVectorPool) : mpiVectorPool(mpiVectorPool)
+    {
+        this->getData().setAllocator(new CbVectorAllocatorPool<T>(cbVectorKey, this->mpiVectorPool));
+    }
+    ~TbCbVectorSenderMpiPool() override
+    {
+        if (this->mpiVectorPool->getNofStoredVectors() == 1) // last entry!
+        {
+            TbCbVectorMpiPool<T>::deleteTbCbVectorMpiPool(this->mpiVectorPool->getPoolKey());
+        }
+    }
+
+    bool isLocalTransmitter() const override { return false; }
+    bool isRemoteTransmitter() const override { return !this->isLocalTransmitter(); }
+
+    void sendDataSize() override { this->mpiVectorPool->sendDataOrder(); }
+    void receiveDataSize() override { throw UbException(UB_EXARGS, "TbMpiPoolSender sends only"); }
+    CbVector<T> &receiveData() override { throw UbException(UB_EXARGS, "TbMpiPoolSender sends only"); }
+    void prepareForSend() override { this->mpiVectorPool->prepareForSendData(); }
+    void sendData() override { this->mpiVectorPool->sendData(); }
+
+    // info-section (usable for remote transmitter)
+    int getSendTbRank() const { return this->mpiVectorPool->getRemoteRank(); }
+    int getSendTbTag() const { return this->mpiVectorPool->getRemoteTag(); }
+    int getRecvFromRank() const override { throw UbException(UB_EXARGS, "TbCbVectorSenderMpiPool sends only"); }
+    int getRecvFromTag() const override { throw UbException(UB_EXARGS, "TbCbVectorSenderMpiPool sends only"); }
+
+    std::string toString() const override
+    {
+        return "TbCbVectorSenderMpiPool<" + (std::string) typeid(T).name() + " to rank (tag)" +
+               UbSystem::toString(getSendTbRank()) + "(" + UbSystem::toString(getSendTbTag()) + ")";
+    }
 
 protected:
-   TbCbVectorMpiPool<T>* mpiVectorPool;
+    TbCbVectorMpiPool<T> *mpiVectorPool;
 };
 
-
 /*==================================================================*/
-template<typename T>
-class TbCbVectorReceiverMpiPool : public TbTransmitter< CbVector< T >  >
+template <typename T>
+class TbCbVectorReceiverMpiPool : public TbTransmitter<CbVector<T>>
 {
 public:
-   using value_type = CbVector<T>;   
+    using value_type = CbVector<T>;
 
 public:
-   TbCbVectorReceiverMpiPool(std::string cbVectorKey, TbCbVectorMpiPool< T >* mpiVectorPool)
-      : mpiVectorPool(mpiVectorPool)
-   { 
-      this->getData().setAllocator( new CbVectorAllocatorPool<T>(cbVectorKey, this->mpiVectorPool) );
-   }
-   ~TbCbVectorReceiverMpiPool() override
-   {
-      if( this->mpiVectorPool->getNofStoredVectors()==1 ) //last entry!
-      {
-         TbCbVectorMpiPool< T >::deleteTbCbVectorMpiPool(this->mpiVectorPool->getPoolKey());  
-      }
-   }
-   bool isLocalTransmitter()  const override { return false;                        }
-   bool isRemoteTransmitter() const override { return !this->isLocalTransmitter();  }
-
-   void sendDataSize() override      { throw UbException(UB_EXARGS,"TbCbVectorReceiverMpiPool receives only");  }   
-   void receiveDataSize() override   { this->mpiVectorPool->receiveDataOrder(); }  
-   void sendData() override          { throw UbException(UB_EXARGS,"TbCbVectorReceiverMpiPool receives only"); }
-   void prepareForReceive() override { this->mpiVectorPool->prepareForReceiveData(); }
-   CbVector< T >& receiveData() override
-   { 
-      this->mpiVectorPool->receiveData();
-      return this->getData();
-   }
-
-   //info-section (usable for remote transmitter)
-   int  getSendTbRank()   const { throw UbException(UB_EXARGS,"TbCbVectorReceiverMpiPool receives only"); }
-   int  getSendTbTag()    const { throw UbException(UB_EXARGS,"TbCbVectorReceiverMpiPool receives only"); }
-   int  getRecvFromRank() const override { return  this->mpiVectorPool->getRemoteRank();  }
-   int  getRecvFromTag()  const override { return  this->mpiVectorPool->getRemoteTag();  }
-
-   std::string toString() const override { return "TbCbVectorReceiverMpiPool<"+(std::string)typeid(T).name()+" to rank (tag)"+UbSystem::toString(getRecvFromRank())+"("+UbSystem::toString(getRecvFromTag())+")"; }
+    TbCbVectorReceiverMpiPool(std::string cbVectorKey, TbCbVectorMpiPool<T> *mpiVectorPool)
+        : mpiVectorPool(mpiVectorPool)
+    {
+        this->getData().setAllocator(new CbVectorAllocatorPool<T>(cbVectorKey, this->mpiVectorPool));
+    }
+    ~TbCbVectorReceiverMpiPool() override
+    {
+        if (this->mpiVectorPool->getNofStoredVectors() == 1) // last entry!
+        {
+            TbCbVectorMpiPool<T>::deleteTbCbVectorMpiPool(this->mpiVectorPool->getPoolKey());
+        }
+    }
+    bool isLocalTransmitter() const override { return false; }
+    bool isRemoteTransmitter() const override { return !this->isLocalTransmitter(); }
+
+    void sendDataSize() override { throw UbException(UB_EXARGS, "TbCbVectorReceiverMpiPool receives only"); }
+    void receiveDataSize() override { this->mpiVectorPool->receiveDataOrder(); }
+    void sendData() override { throw UbException(UB_EXARGS, "TbCbVectorReceiverMpiPool receives only"); }
+    void prepareForReceive() override { this->mpiVectorPool->prepareForReceiveData(); }
+    CbVector<T> &receiveData() override
+    {
+        this->mpiVectorPool->receiveData();
+        return this->getData();
+    }
+
+    // info-section (usable for remote transmitter)
+    int getSendTbRank() const { throw UbException(UB_EXARGS, "TbCbVectorReceiverMpiPool receives only"); }
+    int getSendTbTag() const { throw UbException(UB_EXARGS, "TbCbVectorReceiverMpiPool receives only"); }
+    int getRecvFromRank() const override { return this->mpiVectorPool->getRemoteRank(); }
+    int getRecvFromTag() const override { return this->mpiVectorPool->getRemoteTag(); }
+
+    std::string toString() const override
+    {
+        return "TbCbVectorReceiverMpiPool<" + (std::string) typeid(T).name() + " to rank (tag)" +
+               UbSystem::toString(getRecvFromRank()) + "(" + UbSystem::toString(getRecvFromTag()) + ")";
+    }
 
 protected:
-   TbCbVectorMpiPool<T>* mpiVectorPool;
+    TbCbVectorMpiPool<T> *mpiVectorPool;
 };
 
-#endif //VF_MPI
+#endif // VF_MPI
 
-#endif //TBTRANSMITTERMPIPOOL_H
- 
+#endif // TBTRANSMITTERMPIPOOL_H
diff --git a/src/basics/basics/utilities/UbComparators.h b/src/basics/basics/utilities/UbComparators.h
index 0e7d2cbeda4334e34630611f9bafa90d4e5ab7c0..bc507e456b9603d85d42f8597fe4748a135e51d2 100644
--- a/src/basics/basics/utilities/UbComparators.h
+++ b/src/basics/basics/utilities/UbComparators.h
@@ -1,28 +1,28 @@
 //=======================================================================================
-// ____          ____    __    ______     __________   __      __       __        __         
-// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |        
-//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |        
-//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |        
-//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____    
-//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|   
-//      \    \  |    |   ________________________________________________________________    
-//       \    \ |    |  |  ______________________________________________________________|   
-//        \    \|    |  |  |         __          __     __     __     ______      _______    
-//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)   
-//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______    
+// ____          ____    __    ______     __________   __      __       __        __
+// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |
+//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |
+//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |
+//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____
+//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|
+//      \    \  |    |   ________________________________________________________________
+//       \    \ |    |  |  ______________________________________________________________|
+//        \    \|    |  |  |         __          __     __     __     ______      _______
+//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)
+//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______
 //           \       |  |  |        |  |_____   |   \_/   |   |  |   |  |_/  /    _____  |
-//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/   
+//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/
 //
-//  This file is part of VirtualFluids. VirtualFluids is free software: you can 
+//  This file is part of VirtualFluids. VirtualFluids is free software: you can
 //  redistribute it and/or modify it under the terms of the GNU General Public
-//  License as published by the Free Software Foundation, either version 3 of 
+//  License as published by the Free Software Foundation, either version 3 of
 //  the License, or (at your option) any later version.
-//  
-//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT 
-//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
-//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License 
+//
+//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT
+//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 //  for more details.
-//  
+//
 //  You should have received a copy of the GNU General Public License along
 //  with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>.
 //
@@ -30,202 +30,200 @@
 //! \ingroup utilities
 //! \author Soeren Freudiger, Sebastian Geller
 //=======================================================================================
-#ifndef UBCOMPARATORS_H 
+#ifndef UBCOMPARATORS_H
 #define UBCOMPARATORS_H
 
-#include <functional> 
+#include <functional>
 
 namespace UbComparators
 {
-   //type_traits 
-   template <typename T> struct MemberInfo; //not defined for correct compiler errors!
-
-   // specialization for MemberFunctionsPtr
-   // C - class with return T method
-   template <typename T, typename C> 
-   struct MemberInfo<T C::*> 
-   { 
-      using type = T; 
-      using class_type = C; 
-
-      static       T& apply(       C& c, T C::* ptr ) { return c.*ptr; } 
-      static const T& apply( const C& c, T C::* ptr ) { return c.*ptr; } 
-   }; 
-   //specialization for MemberFunctionsPtr
-   //C - class with return T method
-   template <typename T, typename C> 
-   struct MemberInfo<T (C::*)()> 
-   { 
-      using type = T; 
-      using class_type = C; 
-
-      static T apply( C& c, T (C::*ptr)() ) { return (c.*ptr)(); } 
-   }; 
-   //specialization for const MemberFunctionsPtr
-   //C - class with return T method
-   template <typename T, typename C> 
-   struct MemberInfo<T (C::*)() const> 
-   { 
-      using type = T; 
-      using class_type = C; 
-
-      static T apply( const C& c, T (C::*ptr)() const ) { return (c.*ptr)(); } 
-   }; 
-
-   //MemberComparative-Class
-   template <typename Ptr, typename Comp = std::less<typename MemberInfo<Ptr>::type> > 
-   class MemComp 
-      : private Comp  // -> usage of Empty Base Class Optimization (EBCO) 
-   { 
-      using C = typename MemberInfo<Ptr>::class_type; 
-
-   public: 
-      MemComp( Ptr ptr, Comp c = Comp() ) 
-         : Comp(c), mp_(ptr) 
-      {} 
-
-      bool operator()(C& lhs, C& rhs) 
-      { 
-         return Comp::operator()( MemberInfo<Ptr>::apply(lhs, mp_), MemberInfo<Ptr>::apply(rhs, mp_) ); 
-      } 
-      bool operator()(C& lhs, C& rhs) const 
-      { 
-         return Comp::operator()( MemberInfo<Ptr>::apply(lhs, mp_), MemberInfo<Ptr>::apply(rhs, mp_) ); 
-      } 
-      bool operator()(const C& lhs, const C& rhs) 
-      { 
-         return Comp::operator()( MemberInfo<Ptr>::apply(lhs, mp_), MemberInfo<Ptr>::apply(rhs, mp_) ); 
-      } 
-      bool operator()(const C& lhs, const C& rhs) const 
-      { 
-         return Comp::operator()( MemberInfo<Ptr>::apply(lhs, mp_), MemberInfo<Ptr>::apply(rhs, mp_) ); 
-      } 
-
-   private: 
-      Ptr mp_; 
-   }; 
-
-   // Factoryfunktionen 
-   template <typename Ptr> 
-   MemComp<Ptr> membercomp(Ptr p) 
-   { 
-      return MemComp<Ptr>(p); 
-   } 
-
-   template<typename Comp, typename Ptr> 
-   MemComp<Ptr, Comp> membercomp(Ptr p, Comp c = Comp()) 
-   { 
-      return MemComp<Ptr, Comp>(p, c); 
-   } 
-
-   template<template<typename> class Comp, typename Ptr> 
-   MemComp<Ptr, Comp<typename MemberInfo<Ptr>::type> > 
-      membercomp(Ptr p, Comp<typename MemberInfo<Ptr>::type> c = Comp<typename MemberInfo<Ptr>::type>()) 
-   {
-      return MemComp<Ptr, Comp<typename MemberInfo<Ptr>::type> >(p, c); 
-   } 
-
-    
-   //////////////////////////////////////////////////////////////////////////
-   //////////////////////////////////////////////////////////////////////////
-   //////////////////////////////////////////////////////////////////////////
-   //andere Variante (alerdings ist hier keine Deduction moeglich!!!)
-   //////////////////////////////////////////////////////////////////////////
-   //Vergleichs-Templates:
-   //Funktor zum "non-const" Methodenvergleich: liste.sort( compareMethods<Klasse, int, &Klasse::getVal1  );
-   template<typename K/*Klasse*/, typename M /*MethodenRueckgabeTyp*/, M (K::*fct)() /*MethodenPointer*/> // Allgemeiner Fall
-   struct compareMethods
-   {
-      bool operator()(K& r, K& l) const // da fct nicht const ist, kann auch K nicht const sein. das const hinter der deklaration besagt dass compareMethods const sein kann
-      { return (r.*fct)() < (l.*fct)();  }
-   };
-   //////////////////////////////////////////////////////////////////////////
-   //Funktor zum "const" Methodenvergleich: liste.sort( compareMethods<Klasse, int, &Klasse::getVal1  );
-   template<typename K/*Klasse*/, typename M /*MethodenRueckgabeTyp*/, M (K::*fct)() const /*MethodenPointer*/> // <- hier const 
-   struct compareConstMethods
-   {
-      bool operator()(const K& r, const K& l) const //hier koennen die K's auch const sein, muessen sie aber nicht (const hinzufuegen geht ja problemlos)
-      { return (r.*fct)() < (l.*fct)();  }
-   };
-   //////////////////////////////////////////////////////////////////////////
-   //Funktor zum Membervergleich: lise.sort( compareMember<Klasse, int, &Klasse::member>() );
-   template<typename K/*Klasse*/, typename M /*MemberTyp*/, M (K::*Member) /*MemberPointer*/> // <- hier const 
-   struct compareMember
-   { 
-      bool operator()(const K& r,const K& l) const
-      { return r.*Member < l.*Member; } 
-   };
-   //Bsp:
-   //class Klasse{ 
-   //public: 
-   //   Klasse(double val1, double val2 ) : val1(val1),val2(val2) {} 
-   //   double getVal1()       { return val1; } 
-   //   double getVal2() const { return val2; } // <- hier const
-   //   double val1, val2; 
-   //}; 
-   //int main(int argc, char** argv){ 
-   //   std::list<Klasse> l; 
-   //   l.push_back( Klasse(10,10) ); 
-   //   l.push_back( Klasse(1,5)   ); 
-   //   l.sort( compareMember<Klasse, double,  &Klasse::val1 >() ); 
-   //   l.sort( compareMethods<Klasse, double,  &Klasse::getVal1 >() ); 
-   //   l.sort( compareConstMethods<Klasse, double,  &Klasse::getVal1 >() ); 
-   //} 
+// type_traits
+template <typename T>
+struct MemberInfo; // not defined for correct compiler errors!
+
+// specialization for MemberFunctionsPtr
+// C - class with return T method
+template <typename T, typename C>
+struct MemberInfo<T C::*> {
+    using type       = T;
+    using class_type = C;
+
+    static T &apply(C &c, T C::*ptr) { return c.*ptr; }
+    static const T &apply(const C &c, T C::*ptr) { return c.*ptr; }
+};
+// specialization for MemberFunctionsPtr
+// C - class with return T method
+template <typename T, typename C>
+struct MemberInfo<T (C::*)()> {
+    using type       = T;
+    using class_type = C;
+
+    static T apply(C &c, T (C::*ptr)()) { return (c.*ptr)(); }
+};
+// specialization for const MemberFunctionsPtr
+// C - class with return T method
+template <typename T, typename C>
+struct MemberInfo<T (C::*)() const> {
+    using type       = T;
+    using class_type = C;
+
+    static T apply(const C &c, T (C::*ptr)() const) { return (c.*ptr)(); }
+};
 
+// MemberComparative-Class
+template <typename Ptr, typename Comp = std::less<typename MemberInfo<Ptr>::type>>
+class MemComp : private Comp // -> usage of Empty Base Class Optimization (EBCO)
+{
+    using C = typename MemberInfo<Ptr>::class_type;
+
+public:
+    MemComp(Ptr ptr, Comp c = Comp()) : Comp(c), mp_(ptr) {}
+
+    bool operator()(C &lhs, C &rhs)
+    {
+        return Comp::operator()(MemberInfo<Ptr>::apply(lhs, mp_), MemberInfo<Ptr>::apply(rhs, mp_));
+    }
+    bool operator()(C &lhs, C &rhs) const
+    {
+        return Comp::operator()(MemberInfo<Ptr>::apply(lhs, mp_), MemberInfo<Ptr>::apply(rhs, mp_));
+    }
+    bool operator()(const C &lhs, const C &rhs)
+    {
+        return Comp::operator()(MemberInfo<Ptr>::apply(lhs, mp_), MemberInfo<Ptr>::apply(rhs, mp_));
+    }
+    bool operator()(const C &lhs, const C &rhs) const
+    {
+        return Comp::operator()(MemberInfo<Ptr>::apply(lhs, mp_), MemberInfo<Ptr>::apply(rhs, mp_));
+    }
+
+private:
+    Ptr mp_;
 };
 
-#endif //UBCOMPARATOR_H
-
-//example
-// #include <basics/utilities/UbComparators.h" 
-// #include <list> 
-// using namespace std; 
-// using namespace UbComparators; 
-// 
-// struct S { 
-//    S(int i) :x(i) {} 
-//    int x; 
-//    float f() {return x;}; 
-//    double g() const {return x;} 
-// }; 
-// 
-// struct intComp { 
-//    bool operator()(int l, int r) const 
-//    { return l > r; } 
-// }; 
-// 
-// struct dblComp { 
-//    bool operator()(double l,  double r) const 
-//    { return l > r; } 
-// }; 
-// 
-// template <typename T> 
-// struct genComp { 
+// Factoryfunktionen
+template <typename Ptr>
+MemComp<Ptr> membercomp(Ptr p)
+{
+    return MemComp<Ptr>(p);
+}
+
+template <typename Comp, typename Ptr>
+MemComp<Ptr, Comp> membercomp(Ptr p, Comp c = Comp())
+{
+    return MemComp<Ptr, Comp>(p, c);
+}
+
+template <template <typename> class Comp, typename Ptr>
+MemComp<Ptr, Comp<typename MemberInfo<Ptr>::type>>
+membercomp(Ptr p, Comp<typename MemberInfo<Ptr>::type> c = Comp<typename MemberInfo<Ptr>::type>())
+{
+    return MemComp<Ptr, Comp<typename MemberInfo<Ptr>::type>>(p, c);
+}
+
+//////////////////////////////////////////////////////////////////////////
+//////////////////////////////////////////////////////////////////////////
+//////////////////////////////////////////////////////////////////////////
+// andere Variante (alerdings ist hier keine Deduction moeglich!!!)
+//////////////////////////////////////////////////////////////////////////
+// Vergleichs-Templates:
+// Funktor zum "non-const" Methodenvergleich: liste.sort( compareMethods<Klasse, int, &Klasse::getVal1  );
+template <typename K /*Klasse*/, typename M /*MethodenRueckgabeTyp*/,
+          M (K::*fct)() /*MethodenPointer*/> // Allgemeiner Fall
+struct compareMethods {
+    bool operator()(K &r, K &l) const // da fct nicht const ist, kann auch K nicht const sein. das const hinter der
+                                      // deklaration besagt dass compareMethods const sein kann
+    {
+        return (r.*fct)() < (l.*fct)();
+    }
+};
+//////////////////////////////////////////////////////////////////////////
+// Funktor zum "const" Methodenvergleich: liste.sort( compareMethods<Klasse, int, &Klasse::getVal1  );
+template <typename K /*Klasse*/, typename M /*MethodenRueckgabeTyp*/,
+          M (K::*fct)() const /*MethodenPointer*/> // <- hier const
+struct compareConstMethods {
+    bool operator()(const K &r, const K &l)
+        const // hier koennen die K's auch const sein, muessen sie aber nicht (const hinzufuegen geht ja problemlos)
+    {
+        return (r.*fct)() < (l.*fct)();
+    }
+};
+//////////////////////////////////////////////////////////////////////////
+// Funktor zum Membervergleich: lise.sort( compareMember<Klasse, int, &Klasse::member>() );
+template <typename K /*Klasse*/, typename M /*MemberTyp*/, M(K::*Member) /*MemberPointer*/> // <- hier const
+struct compareMember {
+    bool operator()(const K &r, const K &l) const { return r.*Member < l.*Member; }
+};
+// Bsp:
+// class Klasse{
+// public:
+//   Klasse(double val1, double val2 ) : val1(val1),val2(val2) {}
+//   double getVal1()       { return val1; }
+//   double getVal2() const { return val2; } // <- hier const
+//   double val1, val2;
+//};
+// int main(int argc, char** argv){
+//   std::list<Klasse> l;
+//   l.push_back( Klasse(10,10) );
+//   l.push_back( Klasse(1,5)   );
+//   l.sort( compareMember<Klasse, double,  &Klasse::val1 >() );
+//   l.sort( compareMethods<Klasse, double,  &Klasse::getVal1 >() );
+//   l.sort( compareConstMethods<Klasse, double,  &Klasse::getVal1 >() );
+//}
+
+}; // namespace UbComparators
+
+#endif // UBCOMPARATOR_H
+
+// example
+// #include <basics/utilities/UbComparators.h"
+// #include <list>
+// using namespace std;
+// using namespace UbComparators;
+//
+// struct S {
+//    S(int i) :x(i) {}
+//    int x;
+//    float f() {return x;};
+//    double g() const {return x;}
+// };
+//
+// struct intComp {
+//    bool operator()(int l, int r) const
+//    { return l > r; }
+// };
+//
+// struct dblComp {
+//    bool operator()(double l,  double r) const
+//    { return l > r; }
+// };
+//
+// template <typename T>
+// struct genComp {
 //    bool operator()(const T& l, const T& r) const
-//    { return l > r; } 
-// }; 
-// 
-// 
-// int main() 
-// { 
-//    S a(1); 
-//    S b(2); 
-//    list<S> sList; 
-//    sList.push_back(a); 
-//    sList.push_back(b); 
-//    sList.sort(UbComparators::membercomp(&S::x,intComp()));  //calls overload (1) 
-//    sList.sort(UbComparators::membercomp<intComp>(&S::x));   //same 
-//    sList.sort(UbComparators::membercomp(&S::x));            //calls overload (5) 
-//    sList.sort(UbComparators::membercomp<genComp>(&S::x));   //calls overload(3) 
-//    sList.sort(UbComparators::membercomp(&S::x, genComp<int>())); //calls overload(1) 
-//    //same for nonconst function 
-//    sList.sort(UbComparators::membercomp(&S::f, dblComp())); //overload(2) 
-//    sList.sort(UbComparators::membercomp<dblComp>(&S::f));   //same      
-//    sList.sort(UbComparators::membercomp(&S::f));            //overload(6) 
-//    sList.sort(UbComparators::membercomp<genComp>(&S::f));   //overload(4) 
-//    //same for const function 
-//    sList.sort(UbComparators::membercomp(&S::g, dblComp())); //overload(2) 
-//    sList.sort(UbComparators::membercomp<dblComp>(&S::g));   //same      
-//    sList.sort(UbComparators::membercomp(&S::g));            //overload(6) 
-//    sList.sort(UbComparators::membercomp<genComp>(&S::g));   //overload(4) 
-// } 
+//    { return l > r; }
+// };
+//
+//
+// int main()
+// {
+//    S a(1);
+//    S b(2);
+//    list<S> sList;
+//    sList.push_back(a);
+//    sList.push_back(b);
+//    sList.sort(UbComparators::membercomp(&S::x,intComp()));  //calls overload (1)
+//    sList.sort(UbComparators::membercomp<intComp>(&S::x));   //same
+//    sList.sort(UbComparators::membercomp(&S::x));            //calls overload (5)
+//    sList.sort(UbComparators::membercomp<genComp>(&S::x));   //calls overload(3)
+//    sList.sort(UbComparators::membercomp(&S::x, genComp<int>())); //calls overload(1)
+//    //same for nonconst function
+//    sList.sort(UbComparators::membercomp(&S::f, dblComp())); //overload(2)
+//    sList.sort(UbComparators::membercomp<dblComp>(&S::f));   //same
+//    sList.sort(UbComparators::membercomp(&S::f));            //overload(6)
+//    sList.sort(UbComparators::membercomp<genComp>(&S::f));   //overload(4)
+//    //same for const function
+//    sList.sort(UbComparators::membercomp(&S::g, dblComp())); //overload(2)
+//    sList.sort(UbComparators::membercomp<dblComp>(&S::g));   //same
+//    sList.sort(UbComparators::membercomp(&S::g));            //overload(6)
+//    sList.sort(UbComparators::membercomp<genComp>(&S::g));   //overload(4)
+// }
diff --git a/src/basics/basics/utilities/UbEqual.h b/src/basics/basics/utilities/UbEqual.h
index c605c36efd8b793ba4585aad27fc9eb083185e26..b3ca9102d585faeac0b2a4e413434d4d0d759282 100644
--- a/src/basics/basics/utilities/UbEqual.h
+++ b/src/basics/basics/utilities/UbEqual.h
@@ -1,28 +1,28 @@
 //=======================================================================================
-// ____          ____    __    ______     __________   __      __       __        __         
-// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |        
-//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |        
-//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |        
-//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____    
-//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|   
-//      \    \  |    |   ________________________________________________________________    
-//       \    \ |    |  |  ______________________________________________________________|   
-//        \    \|    |  |  |         __          __     __     __     ______      _______    
-//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)   
-//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______    
+// ____          ____    __    ______     __________   __      __       __        __
+// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |
+//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |
+//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |
+//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____
+//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|
+//      \    \  |    |   ________________________________________________________________
+//       \    \ |    |  |  ______________________________________________________________|
+//        \    \|    |  |  |         __          __     __     __     ______      _______
+//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)
+//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______
 //           \       |  |  |        |  |_____   |   \_/   |   |  |   |  |_/  /    _____  |
-//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/   
+//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/
 //
-//  This file is part of VirtualFluids. VirtualFluids is free software: you can 
+//  This file is part of VirtualFluids. VirtualFluids is free software: you can
 //  redistribute it and/or modify it under the terms of the GNU General Public
-//  License as published by the Free Software Foundation, either version 3 of 
+//  License as published by the Free Software Foundation, either version 3 of
 //  the License, or (at your option) any later version.
-//  
-//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT 
-//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
-//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License 
+//
+//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT
+//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 //  for more details.
-//  
+//
 //  You should have received a copy of the GNU General Public License along
 //  with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>.
 //
@@ -33,7 +33,7 @@
 #ifndef UBEQUAL_H
 #define UBEQUAL_H
 
-#include<cmath>
+#include <cmath>
 
 //////////////////////////////////////////////////////////////////////////
 //
@@ -52,94 +52,220 @@
 //
 //////////////////////////////////////////////////////////////////////////
 
-//std-trait, fuer alle nicht spezifischen typen:
-template < typename T1, typename T2 >
-struct UbEqualTrait
-{
-   using High = T1;
-   using Low = T1;
+// std-trait, fuer alle nicht spezifischen typen:
+template <typename T1, typename T2>
+struct UbEqualTrait {
+    using High = T1;
+    using Low  = T1;
 };
 
-//std-trait, fuer gleiche T
-template < typename T >
-struct UbEqualTrait< T, T >
-{
-   using High = T;
-   using Low = T;
-};
-
-//spezialisierung fuer diverse Typen-Tuples
-template<> struct UbEqualTrait< short, int >          { using High = int; using Low = short; };
-template<> struct UbEqualTrait< short, long >         { using High = long; using Low = short; };
-template<> struct UbEqualTrait< short, float >        { using High = float; using Low = short; };
-template<> struct UbEqualTrait< short, double >       { using High = double; using Low = short; };
-template<> struct UbEqualTrait< short, long double >  { using High = long double; using Low = short; };
-
-template<> struct UbEqualTrait< int, short >          { using High = int; using Low = short; };
-template<> struct UbEqualTrait< int, long >           { using High = long; using Low = int; };
-template<> struct UbEqualTrait< int, float >          { using High = float; using Low = int; };
-template<> struct UbEqualTrait< int, double >         { using High = double; using Low = int; };
-template<> struct UbEqualTrait< int, long double >    { using High = long double; using Low = int; };
-
-template<> struct UbEqualTrait< long, short >         { using High = long; using Low = short; };
-template<> struct UbEqualTrait< long, int >           { using High = long; using Low = int; };
-template<> struct UbEqualTrait< long, float >         { using High = float; using Low = long; };
-template<> struct UbEqualTrait< long, double >        { using High = double; using Low = long; };
-template<> struct UbEqualTrait< long, long double >   { using High = long double; using Low = long; };
-
-template<> struct UbEqualTrait< float, short >        { using High = float; using Low = short; };
-template<> struct UbEqualTrait< float, int >          { using High = float; using Low = int; };
-template<> struct UbEqualTrait< float, long >         { using High = float; using Low = long; };
-template<> struct UbEqualTrait< float, double >       { using High = double; using Low = float; };
-template<> struct UbEqualTrait< float, long double >  { using High = long double; using Low = float; };
-
-template<> struct UbEqualTrait< double, short >       { using High = double; using Low = short; };
-template<> struct UbEqualTrait< double, int >         { using High = double; using Low = int; };
-template<> struct UbEqualTrait< double, long >        { using High = double; using Low = long; };
-template<> struct UbEqualTrait< double, float >       { using High = double; using Low = float; };
-template<> struct UbEqualTrait< double, long double > { using High = long double; using Low = double; };
-
-template<> struct UbEqualTrait< long double, short >  { using High = long double; using Low = short; };
-template<> struct UbEqualTrait< long double, int >    { using High = long double; using Low = int; };
-template<> struct UbEqualTrait< long double, long >   { using High = long double; using Low = long; };
-template<> struct UbEqualTrait< long double, float >  { using High = long double; using Low = float; };
-template<> struct UbEqualTrait< long double, double > { using High = long double; using Low = double; };
+// std-trait, fuer gleiche T
+template <typename T>
+struct UbEqualTrait<T, T> {
+    using High = T;
+    using Low  = T;
+};
+
+// spezialisierung fuer diverse Typen-Tuples
+template <>
+struct UbEqualTrait<short, int> {
+    using High = int;
+    using Low  = short;
+};
+template <>
+struct UbEqualTrait<short, long> {
+    using High = long;
+    using Low  = short;
+};
+template <>
+struct UbEqualTrait<short, float> {
+    using High = float;
+    using Low  = short;
+};
+template <>
+struct UbEqualTrait<short, double> {
+    using High = double;
+    using Low  = short;
+};
+template <>
+struct UbEqualTrait<short, long double> {
+    using High = long double;
+    using Low  = short;
+};
+
+template <>
+struct UbEqualTrait<int, short> {
+    using High = int;
+    using Low  = short;
+};
+template <>
+struct UbEqualTrait<int, long> {
+    using High = long;
+    using Low  = int;
+};
+template <>
+struct UbEqualTrait<int, float> {
+    using High = float;
+    using Low  = int;
+};
+template <>
+struct UbEqualTrait<int, double> {
+    using High = double;
+    using Low  = int;
+};
+template <>
+struct UbEqualTrait<int, long double> {
+    using High = long double;
+    using Low  = int;
+};
+
+template <>
+struct UbEqualTrait<long, short> {
+    using High = long;
+    using Low  = short;
+};
+template <>
+struct UbEqualTrait<long, int> {
+    using High = long;
+    using Low  = int;
+};
+template <>
+struct UbEqualTrait<long, float> {
+    using High = float;
+    using Low  = long;
+};
+template <>
+struct UbEqualTrait<long, double> {
+    using High = double;
+    using Low  = long;
+};
+template <>
+struct UbEqualTrait<long, long double> {
+    using High = long double;
+    using Low  = long;
+};
+
+template <>
+struct UbEqualTrait<float, short> {
+    using High = float;
+    using Low  = short;
+};
+template <>
+struct UbEqualTrait<float, int> {
+    using High = float;
+    using Low  = int;
+};
+template <>
+struct UbEqualTrait<float, long> {
+    using High = float;
+    using Low  = long;
+};
+template <>
+struct UbEqualTrait<float, double> {
+    using High = double;
+    using Low  = float;
+};
+template <>
+struct UbEqualTrait<float, long double> {
+    using High = long double;
+    using Low  = float;
+};
+
+template <>
+struct UbEqualTrait<double, short> {
+    using High = double;
+    using Low  = short;
+};
+template <>
+struct UbEqualTrait<double, int> {
+    using High = double;
+    using Low  = int;
+};
+template <>
+struct UbEqualTrait<double, long> {
+    using High = double;
+    using Low  = long;
+};
+template <>
+struct UbEqualTrait<double, float> {
+    using High = double;
+    using Low  = float;
+};
+template <>
+struct UbEqualTrait<double, long double> {
+    using High = long double;
+    using Low  = double;
+};
+
+template <>
+struct UbEqualTrait<long double, short> {
+    using High = long double;
+    using Low  = short;
+};
+template <>
+struct UbEqualTrait<long double, int> {
+    using High = long double;
+    using Low  = int;
+};
+template <>
+struct UbEqualTrait<long double, long> {
+    using High = long double;
+    using Low  = long;
+};
+template <>
+struct UbEqualTrait<long double, float> {
+    using High = long double;
+    using Low  = float;
+};
+template <>
+struct UbEqualTrait<long double, double> {
+    using High = long double;
+    using Low  = double;
+};
 
 //////////////////////////////////////////////////////////////////////////
-//fuer Allgmeine-Typen ( operator== ):
-template< typename T1, typename T2 >
-inline bool specific_equal(const T1& a, const T2& b) { return a==b; }
+// fuer Allgmeine-Typen ( operator== ):
+template <typename T1, typename T2>
+inline bool specific_equal(const T1 &a, const T2 &b)
+{
+    return a == b;
+}
 
 //////////////////////////////////////////////////////////////////////////
-//fuer floating point build-in-type
-//float.float
-template< /*float,float*/>
-inline bool specific_equal< float, float >(const float& a, const float& b) {  return std::fabs( a - b ) < 1E-8; }
+// fuer floating point build-in-type
+// float.float
+template </*float,float*/>
+inline bool specific_equal<float, float>(const float &a, const float &b)
+{
+    return std::fabs(a - b) < 1E-8;
+}
 
-template</*double,double*/>
-inline bool specific_equal< double, double >(const double& a, const double& b) { return std::fabs( a - b ) < 1E-13; }
+template </*double,double*/>
+inline bool specific_equal<double, double>(const double &a, const double &b)
+{
+    return std::fabs(a - b) < 1E-13;
+}
 
-template</*long double,long double*/>
-inline bool specific_equal< long double, long double >(const long double& a, const long double& b) { return std::fabs( a - b ) < 1E-16; }
+template </*long double,long double*/>
+inline bool specific_equal<long double, long double>(const long double &a, const long double &b)
+{
+    return std::fabs(a - b) < 1E-16;
+}
 
 //////////////////////////////////////////////////////////////////////////
-//globale isUbEqual - Funktion
-template< typename T1, typename T2 >
-inline bool isUbEqual(const T1& a, const T2& b)
+// globale isUbEqual - Funktion
+template <typename T1, typename T2>
+inline bool isUbEqual(const T1 &a, const T2 &b)
 {
-   using Low = typename UbEqualTrait<T1, T2>::Low;
-   return specific_equal< Low, Low >(static_cast< Low >( a ),static_cast< Low >( b ));
+    using Low = typename UbEqualTrait<T1, T2>::Low;
+    return specific_equal<Low, Low>(static_cast<Low>(a), static_cast<Low>(b));
 };
 
 //////////////////////////////////////////////////////////////////////////
-//UbEqual-Functor
-template< typename T1, typename T2 >
-struct UbEqual
-{
-   bool operator()(const T1& a, const T2& b)
-   {
-      return isUbEqual(a,b);
-   }
+// UbEqual-Functor
+template <typename T1, typename T2>
+struct UbEqual {
+    bool operator()(const T1 &a, const T2 &b) { return isUbEqual(a, b); }
 };
 
-#endif //UBEQUAL_H
+#endif // UBEQUAL_H
diff --git a/src/basics/basics/utilities/UbException.h b/src/basics/basics/utilities/UbException.h
index 7c625c33f73fb92ae4d3aa1a7a20c822276f16a0..9a458980688145c199bf7193000131aeb5fb5e30 100644
--- a/src/basics/basics/utilities/UbException.h
+++ b/src/basics/basics/utilities/UbException.h
@@ -1,28 +1,28 @@
 //=======================================================================================
-// ____          ____    __    ______     __________   __      __       __        __         
-// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |        
-//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |        
-//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |        
-//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____    
-//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|   
-//      \    \  |    |   ________________________________________________________________    
-//       \    \ |    |  |  ______________________________________________________________|   
-//        \    \|    |  |  |         __          __     __     __     ______      _______    
-//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)   
-//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______    
+// ____          ____    __    ______     __________   __      __       __        __
+// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |
+//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |
+//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |
+//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____
+//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|
+//      \    \  |    |   ________________________________________________________________
+//       \    \ |    |  |  ______________________________________________________________|
+//        \    \|    |  |  |         __          __     __     __     ______      _______
+//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)
+//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______
 //           \       |  |  |        |  |_____   |   \_/   |   |  |   |  |_/  /    _____  |
-//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/   
+//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/
 //
-//  This file is part of VirtualFluids. VirtualFluids is free software: you can 
+//  This file is part of VirtualFluids. VirtualFluids is free software: you can
 //  redistribute it and/or modify it under the terms of the GNU General Public
-//  License as published by the Free Software Foundation, either version 3 of 
+//  License as published by the Free Software Foundation, either version 3 of
 //  the License, or (at your option) any later version.
-//  
-//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT 
-//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
-//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License 
+//
+//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT
+//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 //  for more details.
-//  
+//
 //  You should have received a copy of the GNU General Public License along
 //  with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>.
 //
@@ -33,11 +33,11 @@
 #ifndef UBEXCEPTION_H
 #define UBEXCEPTION_H
 
-#include <vector>
 #include <iostream>
-#include <string>
 #include <sstream>
 #include <stdexcept>
+#include <string>
+#include <vector>
 
 #include "./UbTuple.h"
 
@@ -51,127 +51,115 @@
 //
 //=========================================================================
 
-//Macro UB_FUNCTION: figures out the method/function name (platform dependant)
+// Macro UB_FUNCTION: figures out the method/function name (platform dependant)
 #if defined(__GNUC__) || (defined(__MWERKS__) && (__MWERKS__ >= 0x3000)) || (defined(__ICC) && (__ICC >= 600))
- # define UB_FUNCTION __PRETTY_FUNCTION__
+#define UB_FUNCTION __PRETTY_FUNCTION__
 #elif defined(__DMC__) && (__DMC__ >= 0x810)
- # define UB_FUNCTION __PRETTY_FUNCTION__
+#define UB_FUNCTION __PRETTY_FUNCTION__
 #elif defined(__FUNCSIG__)
- # define UB_FUNCTION __FUNCSIG__
+#define UB_FUNCTION __FUNCSIG__
 #elif (defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 600)) || (defined(__IBMCPP__) && (__IBMCPP__ >= 500))
- # define UB_FUNCTION __FUNCTION__
+#define UB_FUNCTION __FUNCTION__
 #elif defined(__BORLANDC__) && (__BORLANDC__ >= 0x550)
- # define UB_FUNCTION __FUNC__
+#define UB_FUNCTION __FUNC__
 #elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901)
- # define UB_FUNCTION __func__
+#define UB_FUNCTION __func__
 #else
- # define UB_FUNCTION "(unknown)"
+#define UB_FUNCTION "(unknown)"
 #endif
 
-//Helper Marco
-#define UB_EXARGS __FILE__,__LINE__,UB_FUNCTION
+// Helper Marco
+#define UB_EXARGS __FILE__, __LINE__, UB_FUNCTION
 
 #ifdef CAB_BOOST
-   #define UB_THROW(e) throw boost::enable_current_exception(e)
+#define UB_THROW(e) throw boost::enable_current_exception(e)
 #else
-   #define UB_THROW(e) throw e
+#define UB_THROW(e) throw e
 #endif
 
 class UbException : public std::runtime_error
 {
 public:
-   using ExceptionData = UbTuple<std::string, int, std::string, std::string>;
+    using ExceptionData = UbTuple<std::string, int, std::string, std::string>;
+
 public:
-   //////////////////////////////////////////////////////////////////////////
-   //constructors
-   UbException()
-      : std::runtime_error("")
-   { 
-   }
-   /*==========================================================*/
-   UbException(const std::string& str)
-      : std::runtime_error("")
-   {
-      this->addInfo(str);		
-   }
-   /*==========================================================*/
-   UbException(const std::string& file, const int& line, const std::string& err_str)
-      : std::runtime_error("")
-   {
-      this->addInfo(file,line,"unknown",err_str);		
-   }
-   /*==========================================================*/
-   //UbException(const char* file, const int& line, const char* function, const std::string& err_str)
-   UbException(const std::string& file, const int& line, const std::string& function, const std::string& err_str)
-      : std::runtime_error("")
-   {
-      this->addInfo(file,line,function,err_str);		
-   }
-   //////////////////////////////////////////////////////////////////////////
-   //destructor
-   ~UbException() noexcept override = default;
-   //////////////////////////////////////////////////////////////////////////
-   //virtual public methods
-   //returns  exception-string
-   const char* what() const noexcept override
-   {
-      exceptionString = this->toString();
-      return exceptionString.c_str();  //ansonsten ist das Verhalten anschliessend undefiniert!
-   }
-   /*==========================================================*/
-   virtual void addInfo(const std::string& err_str)	 
-   { 
-      exceptionData.push_back( makeUbTuple( (std::string)"-", 0, (std::string)"unknown", err_str) ); 
-   }
-   /*==========================================================*/
-   //add exception
-   virtual void addInfo(const std::string& file, const int& line, const std::string& function, const std::string& err_str)	 
-   { 
-      exceptionData.push_back( makeUbTuple( file, line, function, err_str ) ); 
-   }
-   /*==========================================================*/
-   //returns exception-string with all calles exceptions
-   virtual const std::vector<std::string> getInfo() const
-   { 
-      std::vector<std::string> tmp;
-      for(std::size_t i=0; i<exceptionData.size(); i++)
-      {
-         std::stringstream str;
-         str << val<1>( exceptionData[i] ) << ", " 
-             << val<2>( exceptionData[i] ) << ", " 
-             << val<3>( exceptionData[i] ) << ", " 
-             << val<4>( exceptionData[i] );
-         tmp.push_back( str.str());
-      }
-      return tmp; 
-   }
-   /*==========================================================*/
-   //returns exception-string with all calles exceptions and detailes informations
-   virtual std::string toString() const
-   { 
-      std::stringstream str("UbExeption");
-      
-      for(std::size_t i=0; i<exceptionData.size(); i++)
-         str<<(std::string)"caller[" << i << "]\n"
-            <<"  - file:     "<< val<1>( exceptionData[i] )<<"\n"
-            <<"  - line:     "<< val<2>( exceptionData[i] )<<"\n"
-            <<"  - function: "<< val<3>( exceptionData[i] )<<"\n"
-            <<"  - what:     "<< val<4>( exceptionData[i] )<< std::endl; 
+    //////////////////////////////////////////////////////////////////////////
+    // constructors
+    UbException() : std::runtime_error("") {}
+    /*==========================================================*/
+    UbException(const std::string &str) : std::runtime_error("") { this->addInfo(str); }
+    /*==========================================================*/
+    UbException(const std::string &file, const int &line, const std::string &err_str) : std::runtime_error("")
+    {
+        this->addInfo(file, line, "unknown", err_str);
+    }
+    /*==========================================================*/
+    // UbException(const char* file, const int& line, const char* function, const std::string& err_str)
+    UbException(const std::string &file, const int &line, const std::string &function, const std::string &err_str)
+        : std::runtime_error("")
+    {
+        this->addInfo(file, line, function, err_str);
+    }
+    //////////////////////////////////////////////////////////////////////////
+    // destructor
+    ~UbException() noexcept override = default;
+    //////////////////////////////////////////////////////////////////////////
+    // virtual public methods
+    // returns  exception-string
+    const char *what() const noexcept override
+    {
+        exceptionString = this->toString();
+        return exceptionString.c_str(); // ansonsten ist das Verhalten anschliessend undefiniert!
+    }
+    /*==========================================================*/
+    virtual void addInfo(const std::string &err_str)
+    {
+        exceptionData.push_back(makeUbTuple((std::string) "-", 0, (std::string) "unknown", err_str));
+    }
+    /*==========================================================*/
+    // add exception
+    virtual void addInfo(const std::string &file, const int &line, const std::string &function,
+                         const std::string &err_str)
+    {
+        exceptionData.push_back(makeUbTuple(file, line, function, err_str));
+    }
+    /*==========================================================*/
+    // returns exception-string with all calles exceptions
+    virtual const std::vector<std::string> getInfo() const
+    {
+        std::vector<std::string> tmp;
+        for (std::size_t i = 0; i < exceptionData.size(); i++) {
+            std::stringstream str;
+            str << val<1>(exceptionData[i]) << ", " << val<2>(exceptionData[i]) << ", " << val<3>(exceptionData[i])
+                << ", " << val<4>(exceptionData[i]);
+            tmp.push_back(str.str());
+        }
+        return tmp;
+    }
+    /*==========================================================*/
+    // returns exception-string with all calles exceptions and detailes informations
+    virtual std::string toString() const
+    {
+        std::stringstream str("UbExeption");
 
-      return str.str();
-   }
+        for (std::size_t i = 0; i < exceptionData.size(); i++)
+            str << (std::string) "caller[" << i << "]\n"
+                << "  - file:     " << val<1>(exceptionData[i]) << "\n"
+                << "  - line:     " << val<2>(exceptionData[i]) << "\n"
+                << "  - function: " << val<3>(exceptionData[i]) << "\n"
+                << "  - what:     " << val<4>(exceptionData[i]) << std::endl;
+
+        return str.str();
+    }
 
 protected:
-   //////////////////////////////////////////////////////////////////////////
-   //protected member
-   std::vector< ExceptionData > exceptionData;
-   mutable std::string exceptionString;
+    //////////////////////////////////////////////////////////////////////////
+    // protected member
+    std::vector<ExceptionData> exceptionData;
+    mutable std::string exceptionString;
 };
 
-//overlading operator <<
-inline std::ostream& operator<<(std::ostream& os, const UbException& e)
-{
-   return os<<e.toString();
-}
+// overlading operator <<
+inline std::ostream &operator<<(std::ostream &os, const UbException &e) { return os << e.toString(); }
 
-#endif //UBEXCEPTION_H
+#endif // UBEXCEPTION_H
diff --git a/src/basics/basics/utilities/UbFileInput.h b/src/basics/basics/utilities/UbFileInput.h
index 006c0b98781f3fa0d738bc2f41ee242a9d7daa33..d3128830be296c1250617d82b4190c618a49335e 100644
--- a/src/basics/basics/utilities/UbFileInput.h
+++ b/src/basics/basics/utilities/UbFileInput.h
@@ -33,65 +33,64 @@ usage: ...
 class UbFileInput
 {
 public:
-   enum FILETYPE {ASCII, BINARY};      
+    enum FILETYPE { ASCII, BINARY };
 
 public:
-   UbFileInput() : filename("") { }
-   virtual ~UbFileInput() = default;
-
-   virtual bool        operator!() { return !(infile); }
-   virtual bool        isOpen()    { return !(!(infile)); }
-
-   virtual bool        open(std::string filename)=0;
-   virtual void        close() { infile.close(); }
-   virtual int         eof()   { return infile.eof(); }
-
-   virtual void        skipLine()=0;					// Springt zur naechsten Zeile
-	virtual void        readLine()=0;
-   virtual std::string readStringLine()=0;
-	virtual int		     readInteger()=0;				// Liest einen Int-Wert ein
-   virtual std::size_t readSize_t()=0;
-   virtual double	     readDouble()=0;				   // Liest einen double-Wert ein
-	virtual float	     readFloat()=0;				   // Liest einen float-Wert ein
-	virtual bool  	     readBool()=0;				   // Liest einen bool-Wert ein
-   virtual char  	     readChar()=0;				   // Liest einen char-Wert ein
-   virtual std::string readString()=0;			      // Liest ein Wort ein
-	virtual std::string readLineTill(char stop)=0;	// Liest gesamte Zeile ein bis zu einem bestimmten Zeichen
-	virtual std::string parseString()=0;	         // Liest
-
-   virtual void        setCommentIndicator(char commentindicator) {this->commentindicator = commentindicator;}
-
-   virtual bool        containsString( const std::string& var)=0;
-   virtual void        setPosAfterLineWithString( const std::string& var)=0;
-   virtual int		     readIntegerAfterString( const std::string& var)=0;
-   virtual double	     readDoubleAfterString( const std::string& var)=0;
-   virtual bool        readBoolAfterString( const std::string& var)=0;
-   virtual std::string readStringAfterString( const std::string& var)=0;
-
-   virtual std::string getFileName() {return this->filename;}
-
-   //returns file extension:
-   //e.g. "./../test/ich.inp" -> "inp", "./../test/ich" -> ""
-   virtual std::string getFileExtension()
-   {
-      std::size_t pos1 = filename.rfind("/");
-      if(pos1==std::string::npos) pos1 = 0;
-      std::size_t pos2 = filename.rfind(".");
-      if(pos2!=std::string::npos && pos2>pos1)
-         return filename.substr(pos2+1);
-
-      return "";
-   }
-
-   //returns "ASCII", "BINARY"
-   virtual FILETYPE getFileType()=0;
+    UbFileInput() : filename("") {}
+    virtual ~UbFileInput() = default;
+
+    virtual bool operator!() { return !(infile); }
+    virtual bool isOpen() { return !(!(infile)); }
+
+    virtual bool open(std::string filename) = 0;
+    virtual void close() { infile.close(); }
+    virtual int eof() { return infile.eof(); }
+
+    virtual void skipLine()                     = 0; // Springt zur naechsten Zeile
+    virtual void readLine()                     = 0;
+    virtual std::string readStringLine()        = 0;
+    virtual int readInteger()                   = 0; // Liest einen Int-Wert ein
+    virtual std::size_t readSize_t()            = 0;
+    virtual double readDouble()                 = 0; // Liest einen double-Wert ein
+    virtual float readFloat()                   = 0; // Liest einen float-Wert ein
+    virtual bool readBool()                     = 0; // Liest einen bool-Wert ein
+    virtual char readChar()                     = 0; // Liest einen char-Wert ein
+    virtual std::string readString()            = 0; // Liest ein Wort ein
+    virtual std::string readLineTill(char stop) = 0; // Liest gesamte Zeile ein bis zu einem bestimmten Zeichen
+    virtual std::string parseString()           = 0; // Liest
+
+    virtual void setCommentIndicator(char commentindicator) { this->commentindicator = commentindicator; }
+
+    virtual bool containsString(const std::string &var)               = 0;
+    virtual void setPosAfterLineWithString(const std::string &var)    = 0;
+    virtual int readIntegerAfterString(const std::string &var)        = 0;
+    virtual double readDoubleAfterString(const std::string &var)      = 0;
+    virtual bool readBoolAfterString(const std::string &var)          = 0;
+    virtual std::string readStringAfterString(const std::string &var) = 0;
+
+    virtual std::string getFileName() { return this->filename; }
+
+    // returns file extension:
+    // e.g. "./../test/ich.inp" -> "inp", "./../test/ich" -> ""
+    virtual std::string getFileExtension()
+    {
+        std::size_t pos1 = filename.rfind("/");
+        if (pos1 == std::string::npos)
+            pos1 = 0;
+        std::size_t pos2 = filename.rfind(".");
+        if (pos2 != std::string::npos && pos2 > pos1)
+            return filename.substr(pos2 + 1);
+
+        return "";
+    }
+
+    // returns "ASCII", "BINARY"
+    virtual FILETYPE getFileType() = 0;
 
 protected:
-   std::ifstream infile;
-   std::string   filename;
-   char          commentindicator{'C'};
+    std::ifstream infile;
+    std::string filename;
+    char commentindicator{ 'C' };
 };
 
-#endif //UBFILEINPUT_H
-
-
+#endif // UBFILEINPUT_H
diff --git a/src/basics/basics/utilities/UbFileInputASCII.cpp b/src/basics/basics/utilities/UbFileInputASCII.cpp
index 84a6ff49053c6460147296155951d4c98427a28d..12ce32ab032579976d3b3f97d53e5ae4a2584f78 100644
--- a/src/basics/basics/utilities/UbFileInputASCII.cpp
+++ b/src/basics/basics/utilities/UbFileInputASCII.cpp
@@ -5,30 +5,31 @@ using namespace std;
 
 UbFileInputASCII::UbFileInputASCII(string filename)
 {
-	this->filename         = filename;
-   this->commentindicator = 'C';
+    this->filename         = filename;
+    this->commentindicator = 'C';
 
-   infile.open(filename.c_str());
+    infile.open(filename.c_str());
 
-   //if(!infile) UB_THROW( UbException((string)("UbFileInputASCII::UbFileInputASCII(string filename, int how) couldn't open file:\n "+filename)) );
+    // if(!infile) UB_THROW( UbException((string)("UbFileInputASCII::UbFileInputASCII(string filename, int how) couldn't
+    // open file:\n "+filename)) );
 }
 /*==========================================================*/
 bool UbFileInputASCII::open(string filename)
 {
-   infile.close();
-   infile.clear(); //setzt flags zurueck
+    infile.close();
+    infile.clear(); // setzt flags zurueck
 
-   this->filename = filename;
-   infile.open(this->filename.c_str());
+    this->filename = filename;
+    infile.open(this->filename.c_str());
 
-   return infile.is_open();
+    return infile.is_open();
 }
 /*==========================================================*/
 int UbFileInputASCII::readInteger()
 {
-	int dummy;
-	infile>>dummy;
-	return dummy;
+    int dummy;
+    infile >> dummy;
+    return dummy;
 }
 /*==========================================================*/
 long long UbFileInputASCII::readLongLong()
@@ -38,197 +39,210 @@ long long UbFileInputASCII::readLongLong()
     return dummy;
 }
 /*==========================================================*/
-string UbFileInputASCII::getFileName()
-{
-	return this->filename;
-}
+string UbFileInputASCII::getFileName() { return this->filename; }
 
 /*==========================================================*/
 void UbFileInputASCII::skipLine()
 {
-	string dummy;
-	getline(infile, dummy);
+    string dummy;
+    getline(infile, dummy);
 }
 /*==========================================================*/
 void UbFileInputASCII::readLine()
 {
-	string dummy;
-	getline(infile, dummy);
+    string dummy;
+    getline(infile, dummy);
 }
 /*==========================================================*/
 string UbFileInputASCII::readStringLine()
 {
-   string dummy;
-   getline(infile, dummy);
-   return dummy;
+    string dummy;
+    getline(infile, dummy);
+    return dummy;
 }
 /*==========================================================*/
 string UbFileInputASCII::readLineTill(char stop)
 {
-	string dummy;
-	getline(infile, dummy, stop);
-	return dummy;
+    string dummy;
+    getline(infile, dummy, stop);
+    return dummy;
 }
 /*==========================================================*/
 string UbFileInputASCII::parseString()
 {
-	string dummy;
-	getline(infile, dummy, ' ');
-	return dummy;
+    string dummy;
+    getline(infile, dummy, ' ');
+    return dummy;
 }
 /*==========================================================*/
 double UbFileInputASCII::readDouble()
 {
-   double dummy;
-   infile>>dummy;
-   return dummy;
+    double dummy;
+    infile >> dummy;
+    return dummy;
 }
 /*==========================================================*/
 float UbFileInputASCII::readFloat()
 {
-   float dummy;
-   infile>>dummy;
-   return dummy;
+    float dummy;
+    infile >> dummy;
+    return dummy;
 }
 /*==========================================================*/
 string UbFileInputASCII::readString()
 {
-	string dummy;
-	infile>>dummy;
-	return dummy;
+    string dummy;
+    infile >> dummy;
+    return dummy;
 }
 /*==========================================================*/
 char UbFileInputASCII::readChar()
 {
-   int dummy;
-   infile>>dummy;
-   return (char)dummy;
+    int dummy;
+    infile >> dummy;
+    return (char)dummy;
 }
 /*==========================================================*/
 std::size_t UbFileInputASCII::readSize_t()
 {
-   std::size_t dummy;
-   infile>>dummy;
-   return dummy;
+    std::size_t dummy;
+    infile >> dummy;
+    return dummy;
 }
 /*==========================================================*/
-void UbFileInputASCII::setPosAfterLineWithString(const string& var)
+void UbFileInputASCII::setPosAfterLineWithString(const string &var)
 {
-   infile.seekg(0L, ios::beg); //Positionszeiger der Datei auf den Anfang setzen
-   char line[512];
-   do
-   {
-      infile.getline(line,512);
-      if(infile.eof()) UB_THROW( UbException(UB_EXARGS,"error at reading in file \""+filename+"\" -> string "+var+" wasn't found in "+this->filename) );
-   }while (strstr(line,var.c_str()) != line);		// Ende Schleife, wenn varname ganz in zeile vorkommt
+    infile.seekg(0L, ios::beg); // Positionszeiger der Datei auf den Anfang setzen
+    char line[512];
+    do {
+        infile.getline(line, 512);
+        if (infile.eof())
+            UB_THROW(UbException(UB_EXARGS, "error at reading in file \"" + filename + "\" -> string " + var +
+                                                " wasn't found in " + this->filename));
+    } while (strstr(line, var.c_str()) != line); // Ende Schleife, wenn varname ganz in zeile vorkommt
 }
 /*==========================================================*/
-bool UbFileInputASCII::containsString(const string& var)
+bool UbFileInputASCII::containsString(const string &var)
 {
-   infile.clear(); // setzt den EOF-Status zurueck (wird durch infile.seekg() NICHT getan!!!)
+    infile.clear(); // setzt den EOF-Status zurueck (wird durch infile.seekg() NICHT getan!!!)
 
-   infile.seekg(0L, ios::beg); //Positionszeiger der Datei auf den Anfang setzen
-   char line[512];
-   do
-   {
-      infile.getline(line,512);
-      if(infile.eof()) return false;
-   }while (strstr(line,var.c_str()) != line);		// Ende Schleife, wenn varname ganz in zeile vorkommt
+    infile.seekg(0L, ios::beg); // Positionszeiger der Datei auf den Anfang setzen
+    char line[512];
+    do {
+        infile.getline(line, 512);
+        if (infile.eof())
+            return false;
+    } while (strstr(line, var.c_str()) != line); // Ende Schleife, wenn varname ganz in zeile vorkommt
 
-   return true;
+    return true;
 }
 /*==========================================================*/
-int UbFileInputASCII::readIntegerAfterString(const string& var)
+int UbFileInputASCII::readIntegerAfterString(const string &var)
 // last change [10.3.2004] at [9:46]
-//suchts in einer Datei nach varname und gibt den dahinter stehenden int-Wert zurueck
-//z.B. timesteps 9
+// suchts in einer Datei nach varname und gibt den dahinter stehenden int-Wert zurueck
+// z.B. timesteps 9
 {
-   infile.clear(); // setzt den EOF-Status zurueck (wird durch infile.seekg() NICHT getan!!!)
-   
-   infile.seekg(0L, ios::beg); //Positionszeiger der Datei auf den Anfang setzen
+    infile.clear(); // setzt den EOF-Status zurueck (wird durch infile.seekg() NICHT getan!!!)
 
-   char line[512];
+    infile.seekg(0L, ios::beg); // Positionszeiger der Datei auf den Anfang setzen
 
-   do
-   {
-      infile.getline(line,512);
-      if(infile.eof()) UB_THROW( UbException(UB_EXARGS,"error at reading in file \""+filename+"\" -> "+var+" wasn't found in "+this->filename) );
-   }while (strstr(line,var.c_str()) != line);		// Ende Schleife, wenn varname ganz in zeile vorkommt
+    char line[512];
 
-   strcpy (line, (line+strlen(var.c_str())));	    // zeile um "varname" kuerzen
-   while ((line[0] == ' ') || (line[0] == '\t')) strcpy (line, (line+1));	// Whitespaces entfernen
+    do {
+        infile.getline(line, 512);
+        if (infile.eof())
+            UB_THROW(UbException(UB_EXARGS, "error at reading in file \"" + filename + "\" -> " + var +
+                                                " wasn't found in " + this->filename));
+    } while (strstr(line, var.c_str()) != line); // Ende Schleife, wenn varname ganz in zeile vorkommt
 
-   return(atoi(line));						// Umwandlung in int
+    strcpy(line, (line + strlen(var.c_str()))); // zeile um "varname" kuerzen
+    while ((line[0] == ' ') || (line[0] == '\t'))
+        strcpy(line, (line + 1)); // Whitespaces entfernen
+
+    return (atoi(line)); // Umwandlung in int
 }
 /*==========================================================*/
 // last change [10.3.2004] at [9:46]
-//sucht in einer Datei nach varname und gibt den dahinter stehenden int-Wert zurueck
-//z.B. nue 9.5
-double UbFileInputASCII::readDoubleAfterString(const string& var)
+// sucht in einer Datei nach varname und gibt den dahinter stehenden int-Wert zurueck
+// z.B. nue 9.5
+double UbFileInputASCII::readDoubleAfterString(const string &var)
 {
-   infile.clear(); // setzt den EOF-Status zurueck (wird durch infile.seekg() NICHT getan!!!)
-   
-   infile.seekg(0L, ios::beg); //Positionszeiger der Datei auf den Anfang setzen
+    infile.clear(); // setzt den EOF-Status zurueck (wird durch infile.seekg() NICHT getan!!!)
 
-   char line[512];
+    infile.seekg(0L, ios::beg); // Positionszeiger der Datei auf den Anfang setzen
 
-   do
-   {
-      infile.getline(line,512);
-      if(infile.eof()) UB_THROW( UbException(UB_EXARGS,"error at reading in file \""+filename+"\" -> "+var+" wasn't found in "+this->filename) );
-   }while (/*!strncmp(varname,line,sizeof(varname))==0*/strstr(line,var.c_str()) != line);		// Ende Schleife, wenn varname ganz in zeile vorkommt
+    char line[512];
 
+    do {
+        infile.getline(line, 512);
+        if (infile.eof())
+            UB_THROW(UbException(UB_EXARGS, "error at reading in file \"" + filename + "\" -> " + var +
+                                                " wasn't found in " + this->filename));
+    } while (/*!strncmp(varname,line,sizeof(varname))==0*/ strstr(line, var.c_str()) !=
+             line); // Ende Schleife, wenn varname ganz in zeile vorkommt
 
-   strcpy (line, (line+strlen(var.c_str())));	    // zeile um "varname" kuerzen
-   while ((line[0] == ' ') || (line[0] == '\t')) strcpy (line, (line+1));	// Whitespaces entfernen
+    strcpy(line, (line + strlen(var.c_str()))); // zeile um "varname" kuerzen
+    while ((line[0] == ' ') || (line[0] == '\t'))
+        strcpy(line, (line + 1)); // Whitespaces entfernen
 
-   return (atof(line));			// Umwandlung in double
+    return (atof(line)); // Umwandlung in double
 }
 /*==========================================================*/
 //  [9.9.2002]
 // liefert string-Wert der hinter dem uebergebenen char feld in der datei infile steht
 // zudem wird der wert in die uebergebene variable value uebertragen (falls man das ergebniss als char benoetig)
-string UbFileInputASCII::readStringAfterString(const string& var)//,char *value)
+string UbFileInputASCII::readStringAfterString(const string &var) //,char *value)
 {
-   infile.clear(); // setzt den EOF-Status zurueck (wird durch infile.seekg() NICHT getan!!!)
-   
-   infile.seekg(0L, ios::beg); //Positionszeiger der Datei auf den Anfang setzen
+    infile.clear(); // setzt den EOF-Status zurueck (wird durch infile.seekg() NICHT getan!!!)
+
+    infile.seekg(0L, ios::beg); // Positionszeiger der Datei auf den Anfang setzen
 
-   char line[512];
-   //string line_copy[512];
+    char line[512];
+    // string line_copy[512];
 
-   do{
-      infile.getline(line,512);
-      if(infile.eof()) UB_THROW( UbException(UB_EXARGS,"error at reading in file \""+filename+"\" -> "+var+" wasn't found in "+this->filename) );
-   }while (strstr(line,var.c_str()) != line);		// Ende Schleife, wenn varname ganz in zeile vorkommt
+    do {
+        infile.getline(line, 512);
+        if (infile.eof())
+            UB_THROW(UbException(UB_EXARGS, "error at reading in file \"" + filename + "\" -> " + var +
+                                                " wasn't found in " + this->filename));
+    } while (strstr(line, var.c_str()) != line); // Ende Schleife, wenn varname ganz in zeile vorkommt
 
-   strcpy (line, (line+strlen(var.c_str())));										// zeile um "varname" kuerzen
-   while ((line[0] == ' ') || (line[0] == '\t')) strcpy (line, (line+1));	// Whitespaces entfernen
+    strcpy(line, (line + strlen(var.c_str()))); // zeile um "varname" kuerzen
+    while ((line[0] == ' ') || (line[0] == '\t'))
+        strcpy(line, (line + 1)); // Whitespaces entfernen
 
-   char *p;
-   p=strtok(line," "); //schneidet alles "ab und inklusive space " nach namen ab
-   p=strtok(line,"\t");//schneidet alles "ab und inklusive tab   " nach namen ab
+    char *p;
+    p = strtok(line, " ");  // schneidet alles "ab und inklusive space " nach namen ab
+    p = strtok(line, "\t"); // schneidet alles "ab und inklusive tab   " nach namen ab
 
-   return static_cast<string>(p);			// Umwandlung in string
+    return static_cast<string>(p); // Umwandlung in string
 }
 /*==========================================================*/
 // last change [10.3.2004] at [9:46]
-//sucht in einer Datei nach varname und gibt den dahinter stehenden int-Wert zurueck
-//z.B. nue 9.5
-bool UbFileInputASCII::readBoolAfterString(const string& var)
+// sucht in einer Datei nach varname und gibt den dahinter stehenden int-Wert zurueck
+// z.B. nue 9.5
+bool UbFileInputASCII::readBoolAfterString(const string &var)
 {
-   if(this->readStringAfterString(var)      == "true" ) return true;
-   else if(this->readStringAfterString(var) == "false") return false;
-   else UB_THROW( UbException(UB_EXARGS,"error at reading in file \""+filename+"\" -> expression after "+var+" is not equal to 'true' or 'false' in "+this->filename) );
+    if (this->readStringAfterString(var) == "true")
+        return true;
+    else if (this->readStringAfterString(var) == "false")
+        return false;
+    else
+        UB_THROW(UbException(UB_EXARGS, "error at reading in file \"" + filename + "\" -> expression after " + var +
+                                            " is not equal to 'true' or 'false' in " + this->filename));
 }
 /*==========================================================*/
 // last change [10.3.2004] at [9:46]
-//sucht in einer Datei nach varname und gibt den dahinter stehenden int-Wert zurueck
-//z.B. nue 9.5
+// sucht in einer Datei nach varname und gibt den dahinter stehenden int-Wert zurueck
+// z.B. nue 9.5
 bool UbFileInputASCII::readBool()
 {
-   string tmp = this->readString();
-   if(     tmp == "true" ) return true;
-   else if(tmp == "false") return false;
-   else UB_THROW( UbException(UB_EXARGS,"error at reading in file \""+filename+"\" -> expression=\""+tmp+"\" is not equal to 'true' or 'false' in "+this->filename) );
+    string tmp = this->readString();
+    if (tmp == "true")
+        return true;
+    else if (tmp == "false")
+        return false;
+    else
+        UB_THROW(UbException(UB_EXARGS, "error at reading in file \"" + filename + "\" -> expression=\"" + tmp +
+                                            "\" is not equal to 'true' or 'false' in " + this->filename));
 }
diff --git a/src/basics/basics/utilities/UbFileInputASCII.h b/src/basics/basics/utilities/UbFileInputASCII.h
index 40d5528c8b2aaefc427a7998c948d827c446f222..65cd28921ce99e04ad483cc397fd0aff076ec54c 100644
--- a/src/basics/basics/utilities/UbFileInputASCII.h
+++ b/src/basics/basics/utilities/UbFileInputASCII.h
@@ -24,55 +24,52 @@
 <BR><BR>
 @author <A HREF="mailto:muffmolch@gmx.de">S. Freudiger</A>
 @version 1.0 - 23.11.04
-*/ 
+*/
 
 /*
 usage: ...
 */
 
 class BASICS_EXPORT UbFileInputASCII : public UbFileInput
-{                               
+{
 public:
-   UbFileInputASCII() : UbFileInput() { }
-   UbFileInputASCII(std::string filename);
-	
-   bool open(std::string filename) override;
-
-   std::string getFileName() override;				
-	void	      skipLine() override;					   // Springt zur naechsten Zeile
-
-   void        readLine() override;		 
-   std::string readStringLine() override;				
-	int		   readInteger() override;				   // Liest einen Int-Wert ein
-    long long   readLongLong();                       // Liest einen long-Wert ein
-
-   std::size_t readSize_t() override;
-   double	   readDouble() override;				   // Liest einen double-Wert ein
-	float 	   readFloat() override;				   // Liest einen float-Wert ein
-	bool  	   readBool() override;				      // Liest einen bool-Wert ein
-   char        readChar() override;                // Liest einen char-Wert ein
-   std::string	readString() override;				   // Liest ein Wort ein
-	std::string	readLineTill(char stop) override;	// Liest gesamte Zeile ein bis zu einem bestimmten Zeichen
-	std::string	parseString() override;	
-
-
-   bool        containsString(const std::string& var) override;
-   void        setPosAfterLineWithString(const std::string& var) override;
-   int		   readIntegerAfterString(const std::string& var) override;
-   double	   readDoubleAfterString(const std::string& var) override;
-   bool        readBoolAfterString(const std::string& var) override;
-   std::string readStringAfterString(const std::string& var) override;
-
-   FILETYPE getFileType() override { return ASCII; }
-
-   template< typename T >
-   friend inline UbFileInputASCII& operator>>(UbFileInputASCII& file, T& data) 
-   {
-      file.infile>>data;
-      return file;
-   }
+    UbFileInputASCII() : UbFileInput() {}
+    UbFileInputASCII(std::string filename);
+
+    bool open(std::string filename) override;
+
+    std::string getFileName() override;
+    void skipLine() override; // Springt zur naechsten Zeile
+
+    void readLine() override;
+    std::string readStringLine() override;
+    int readInteger() override; // Liest einen Int-Wert ein
+    long long readLongLong();   // Liest einen long-Wert ein
+
+    std::size_t readSize_t() override;
+    double readDouble() override;                 // Liest einen double-Wert ein
+    float readFloat() override;                   // Liest einen float-Wert ein
+    bool readBool() override;                     // Liest einen bool-Wert ein
+    char readChar() override;                     // Liest einen char-Wert ein
+    std::string readString() override;            // Liest ein Wort ein
+    std::string readLineTill(char stop) override; // Liest gesamte Zeile ein bis zu einem bestimmten Zeichen
+    std::string parseString() override;
+
+    bool containsString(const std::string &var) override;
+    void setPosAfterLineWithString(const std::string &var) override;
+    int readIntegerAfterString(const std::string &var) override;
+    double readDoubleAfterString(const std::string &var) override;
+    bool readBoolAfterString(const std::string &var) override;
+    std::string readStringAfterString(const std::string &var) override;
+
+    FILETYPE getFileType() override { return ASCII; }
+
+    template <typename T>
+    friend inline UbFileInputASCII &operator>>(UbFileInputASCII &file, T &data)
+    {
+        file.infile >> data;
+        return file;
+    }
 };
 
-#endif //UBFILEINPUTASCII_H
-
-
+#endif // UBFILEINPUTASCII_H
diff --git a/src/basics/basics/utilities/UbFileInputBinary.cpp b/src/basics/basics/utilities/UbFileInputBinary.cpp
index 0cf6a5a85deab826f7a4ca6089fe2aedca39f3cb..120b4ab860d45dac3094b46c4bbad3f03fa65b6e 100644
--- a/src/basics/basics/utilities/UbFileInputBinary.cpp
+++ b/src/basics/basics/utilities/UbFileInputBinary.cpp
@@ -6,145 +6,145 @@ using namespace std;
 /*==========================================================*/
 UbFileInputBinary::UbFileInputBinary(string filename)
 {
-	this->filename = filename;
-   infile.open(filename.c_str(), ios::in | ios::binary);
+    this->filename = filename;
+    infile.open(filename.c_str(), ios::in | ios::binary);
 }
 /*==========================================================*/
 bool UbFileInputBinary::open(string filename)
 {
-   infile.close();
-   infile.clear(); //setzt flags zurueck
-   
-   this->filename = filename;
-   infile.open(this->filename.c_str(), ios::in | ios::binary);
+    infile.close();
+    infile.clear(); // setzt flags zurueck
 
-   return infile.is_open();
+    this->filename = filename;
+    infile.open(this->filename.c_str(), ios::in | ios::binary);
+
+    return infile.is_open();
 }
 /*==========================================================*/
-int UbFileInputBinary::readInteger()				
+int UbFileInputBinary::readInteger()
 {
-   int dummy;
-   infile.read((char*)&dummy,sizeof(int));
-   return dummy; 
+    int dummy;
+    infile.read((char *)&dummy, sizeof(int));
+    return dummy;
 }
 /*==========================================================*/
-std::size_t UbFileInputBinary::readSize_t()				
+std::size_t UbFileInputBinary::readSize_t()
 {
-   std::size_t dummy;
-   infile.read((char*)&dummy,sizeof(std::size_t));
-   return dummy;
+    std::size_t dummy;
+    infile.read((char *)&dummy, sizeof(std::size_t));
+    return dummy;
 }
 /*==========================================================*/
-double UbFileInputBinary::readDouble()	
+double UbFileInputBinary::readDouble()
 {
-   double dummy;
-   infile.read((char*)&dummy,sizeof(double));
-   return dummy; 
+    double dummy;
+    infile.read((char *)&dummy, sizeof(double));
+    return dummy;
 }
 /*==========================================================*/
-float UbFileInputBinary::readFloat()	
+float UbFileInputBinary::readFloat()
 {
-	float dummy;
-	infile.read((char*)&dummy,sizeof(float));
-	return dummy; 
+    float dummy;
+    infile.read((char *)&dummy, sizeof(float));
+    return dummy;
 }
 /*==========================================================*/
-char UbFileInputBinary::readChar()	
+char UbFileInputBinary::readChar()
 {
-   char dummy;
-   infile.read((char*)&dummy,sizeof(char));
-   return dummy; 
+    char dummy;
+    infile.read((char *)&dummy, sizeof(char));
+    return dummy;
 }
 /*==========================================================*/
-string UbFileInputBinary::readString()	
+string UbFileInputBinary::readString()
 {
-   char c;
-   infile.read(&c,sizeof(char));
-   while(c==' ' || c=='\t') infile.read(&c,sizeof(char));  
-   
-   string dummy;
-   dummy+=c;
+    char c;
+    infile.read(&c, sizeof(char));
+    while (c == ' ' || c == '\t')
+        infile.read(&c, sizeof(char));
+
+    string dummy;
+    dummy += c;
 
-   infile.read(&c,sizeof(char));
-   while(c!='\0' && c!=' ' && c!='\t' && c!='\n')
-   {
-      dummy+=c;
-      infile.read(&c,sizeof(char));
-   }
-   return dummy;
+    infile.read(&c, sizeof(char));
+    while (c != '\0' && c != ' ' && c != '\t' && c != '\n') {
+        dummy += c;
+        infile.read(&c, sizeof(char));
+    }
+    return dummy;
 }
 /*==========================================================*/
-bool UbFileInputBinary::readBool()	
+bool UbFileInputBinary::readBool()
 {
-   bool dummy;
-   infile.read((char*)&dummy,sizeof(bool));
-   return dummy; 
+    bool dummy;
+    infile.read((char *)&dummy, sizeof(bool));
+    return dummy;
 }
 /*==========================================================*/
-void UbFileInputBinary::skipLine()				
+void UbFileInputBinary::skipLine()
 {
-   char c;
-   do{
-      infile.read(&c,sizeof(char));
-   }while(c!='\n');
+    char c;
+    do {
+        infile.read(&c, sizeof(char));
+    } while (c != '\n');
 }
 /*==========================================================*/
-void UbFileInputBinary::readLine()				
+void UbFileInputBinary::readLine()
 {
-   char c;
-   infile.read(&c,sizeof(char));
-   while(c!='\n') infile.read(&c,sizeof(char));
+    char c;
+    infile.read(&c, sizeof(char));
+    while (c != '\n')
+        infile.read(&c, sizeof(char));
 }
 /*==========================================================*/
-string UbFileInputBinary::readStringLine()				
+string UbFileInputBinary::readStringLine()
 {
-   char c;
-   string dummy;
-   infile.read(&c,sizeof(char));
-   while(c!='\n')
-   {
-      dummy+=c;
-      infile.read(&c,sizeof(char));
-   }
-   return dummy;
+    char c;
+    string dummy;
+    infile.read(&c, sizeof(char));
+    while (c != '\n') {
+        dummy += c;
+        infile.read(&c, sizeof(char));
+    }
+    return dummy;
 }
 /*==========================================================*/
-string UbFileInputBinary::readLineTill(char  /*stop*/)				
+string UbFileInputBinary::readLineTill(char /*stop*/)
 {
-   UB_THROW( UbException(UB_EXARGS,"method makes no sense for binary streams") );
+    UB_THROW(UbException(UB_EXARGS, "method makes no sense for binary streams"));
 }
 /*==========================================================*/
-string UbFileInputBinary::parseString()				
+string UbFileInputBinary::parseString()
 {
-   UB_THROW( UbException(UB_EXARGS,"method makes no sense for binary streams") );
+    UB_THROW(UbException(UB_EXARGS, "method makes no sense for binary streams"));
 }
 /*==========================================================*/
-bool UbFileInputBinary::containsString(const string&  /*var*/)
+bool UbFileInputBinary::containsString(const string & /*var*/)
 {
-   UB_THROW( UbException(UB_EXARGS,"method makes no sense for binary streams") );
+    UB_THROW(UbException(UB_EXARGS, "method makes no sense for binary streams"));
 }
 /*==========================================================*/
-void UbFileInputBinary::setPosAfterLineWithString(const string&  /*var*/)
+void UbFileInputBinary::setPosAfterLineWithString(const string & /*var*/)
 {
-   UB_THROW( UbException(UB_EXARGS,"method makes no sense for binary streams") );
+    UB_THROW(UbException(UB_EXARGS, "method makes no sense for binary streams"));
 }
 /*==========================================================*/
-int UbFileInputBinary::readIntegerAfterString(const string&  /*var*/)
+int UbFileInputBinary::readIntegerAfterString(const string & /*var*/)
 {
-   UB_THROW( UbException(UB_EXARGS,"method makes no sense for binary streams") );
+    UB_THROW(UbException(UB_EXARGS, "method makes no sense for binary streams"));
 }
 /*==========================================================*/
-double UbFileInputBinary::readDoubleAfterString(const string&  /*var*/)	
+double UbFileInputBinary::readDoubleAfterString(const string & /*var*/)
 {
-   UB_THROW( UbException(UB_EXARGS,"method makes no sense for binary streams") );
+    UB_THROW(UbException(UB_EXARGS, "method makes no sense for binary streams"));
 }
 /*==========================================================*/
-string UbFileInputBinary::readStringAfterString(const string&  /*var*/)	
+string UbFileInputBinary::readStringAfterString(const string & /*var*/)
 {
-   UB_THROW( UbException(UB_EXARGS,"method makes no sense for binary streams") );
+    UB_THROW(UbException(UB_EXARGS, "method makes no sense for binary streams"));
 }
 /*==========================================================*/
-bool UbFileInputBinary::readBoolAfterString(const string&  /*var*/)	
+bool UbFileInputBinary::readBoolAfterString(const string & /*var*/)
 {
-   UB_THROW( UbException(UB_EXARGS,"method makes no sense for binary streams") );
+    UB_THROW(UbException(UB_EXARGS, "method makes no sense for binary streams"));
 }
diff --git a/src/basics/basics/utilities/UbFileInputBinary.h b/src/basics/basics/utilities/UbFileInputBinary.h
index 06086639323cffc8714e8bac64585127c422cfcc..b1e40d396c6948ef474dd23eab5e04767b6d8d2d 100644
--- a/src/basics/basics/utilities/UbFileInputBinary.h
+++ b/src/basics/basics/utilities/UbFileInputBinary.h
@@ -22,61 +22,57 @@
 <BR><BR>
 @author <A HREF="mailto:muffmolch@gmx.de">S. Freudiger</A>
 @version 1.0 - 23.11.04
-*/ 
+*/
 
 /*
 usage: ...
 */
 
 class UbFileInputBinary : public UbFileInput
-{                               
+{
 public:
-   UbFileInputBinary() : UbFileInput() {  }
-   UbFileInputBinary(std::string filename);
-	
-	bool        open(std::string filename) override;
+    UbFileInputBinary() : UbFileInput() {}
+    UbFileInputBinary(std::string filename);
 
-   void	      skipLine() override;					   // Springt zur naechsten Zeile
-	void        readLine() override;		 
-   std::string readStringLine() override;				
-   std::size_t readSize_t() override;				
-   int		   readInteger() override;				   // Liest einen Int-Wert ein
-	double	   readDouble() override;				   // Liest einen double-Wert ein
-	float 	   readFloat() override;				   // Liest einen float-Wert ein
-	bool  	   readBool() override;				      // Liest einen bool-Wert ein
-   char        readChar() override;                // Liest einen char-Wert ein
-   std::string	readString() override;				   // Liest ein Wort ein
-	std::string	readLineTill(char stop) override;	// Liest gesamte Zeile ein bis zu einem bestimmten Zeichen
-	std::string	parseString() override;	// Liest 
+    bool open(std::string filename) override;
 
-   bool        containsString(const std::string& var) override;
-   void        setPosAfterLineWithString(const std::string& var) override;
-   int		   readIntegerAfterString(const std::string& var) override;
-   double	   readDoubleAfterString(const std::string& var) override;
-   bool        readBoolAfterString(const std::string& var) override;
-   std::string readStringAfterString(const std::string& var) override;
+    void skipLine() override; // Springt zur naechsten Zeile
+    void readLine() override;
+    std::string readStringLine() override;
+    std::size_t readSize_t() override;
+    int readInteger() override;                   // Liest einen Int-Wert ein
+    double readDouble() override;                 // Liest einen double-Wert ein
+    float readFloat() override;                   // Liest einen float-Wert ein
+    bool readBool() override;                     // Liest einen bool-Wert ein
+    char readChar() override;                     // Liest einen char-Wert ein
+    std::string readString() override;            // Liest ein Wort ein
+    std::string readLineTill(char stop) override; // Liest gesamte Zeile ein bis zu einem bestimmten Zeichen
+    std::string parseString() override;           // Liest
 
-   FILETYPE getFileType() override { return BINARY; }
+    bool containsString(const std::string &var) override;
+    void setPosAfterLineWithString(const std::string &var) override;
+    int readIntegerAfterString(const std::string &var) override;
+    double readDoubleAfterString(const std::string &var) override;
+    bool readBoolAfterString(const std::string &var) override;
+    std::string readStringAfterString(const std::string &var) override;
 
-   template< typename T >
-   friend inline UbFileInputBinary& operator>>(UbFileInputBinary& file, T& data) 
-   {
-      file.infile.read((char*)&data,sizeof(T));
-      return file;
-   }
+    FILETYPE getFileType() override { return BINARY; }
 
-   template< typename T>
-   void readVector(std::vector<T>& v)
-   {
-      size_t size = v.size();
-      if (size > 0)
-      {
-         infile.read((char*)&v[0], sizeof(T)*size);
-      }
-   }
+    template <typename T>
+    friend inline UbFileInputBinary &operator>>(UbFileInputBinary &file, T &data)
+    {
+        file.infile.read((char *)&data, sizeof(T));
+        return file;
+    }
 
+    template <typename T>
+    void readVector(std::vector<T> &v)
+    {
+        size_t size = v.size();
+        if (size > 0) {
+            infile.read((char *)&v[0], sizeof(T) * size);
+        }
+    }
 };
 
 #endif
-
-
diff --git a/src/basics/basics/utilities/UbFileOutput.h b/src/basics/basics/utilities/UbFileOutput.h
index 38c0928088d4598f0416fabaea7ebab3385607b8..7e3e12d4ce2725073ed153d4cad9985664664cd1 100644
--- a/src/basics/basics/utilities/UbFileOutput.h
+++ b/src/basics/basics/utilities/UbFileOutput.h
@@ -5,10 +5,10 @@
 // |___/_/_/   \__/\__,_/\__,_/_/_/   /_/\__,_/_/\__,_/____/
 //
 #ifndef UBFILEOUTPUT_H
-#define UBFILEOUTPUT_H            
+#define UBFILEOUTPUT_H
 
-#include <iomanip>
 #include <fstream>
+#include <iomanip>
 #include <iostream>
 #include <string>
 
@@ -22,7 +22,7 @@
 <BR><BR>
 @author <A HREF="mailto:muffmolch@gmx.de">S. Freudiger</A>
 @version 1.0 - 23.11.04
-*/ 
+*/
 
 /*
 usage: ...
@@ -31,63 +31,65 @@ usage: ...
 class UbFileOutput
 {
 public:
-   enum CREATEOPTION {OUTFILE=0, INANDOUTFILE=1, APPENDFILE=2};      
-   enum FILETYPE {ASCII, BINARY};      
+    enum CREATEOPTION { OUTFILE = 0, INANDOUTFILE = 1, APPENDFILE = 2 };
+    enum FILETYPE { ASCII, BINARY };
 
 public:
-   UbFileOutput() : filename("") {  }
-   UbFileOutput(const std::string& filename)  : filename(filename) { }
-   virtual ~UbFileOutput() { outfile.flush(); }
-
-   virtual bool open(const std::string& filename, CREATEOPTION opt=OUTFILE) = 0;
-
-   virtual bool operator!() { return !(outfile); }
-   virtual bool isOpen()    { return !(!(outfile)); }
-   
-   virtual void flush() { outfile.flush(); }
-   virtual void close() { outfile.close(); }
-   
-   virtual void writeInteger(const int& value, const int& width=0)=0;
-	virtual void writeDouble(const double& value, const int& width=0)=0;
-	virtual void writeFloat(const float& value, const int& width=0)=0;
-   virtual void writeBool(const bool& value, const int& width=0)=0;
-   virtual void writeSize_t(const std::size_t& value, const int& width=0)=0;
-   virtual void writeChar(const char& value, const int& width=0)=0;
-   virtual void writeString(const std::string& value, const int& width=0)=0;
-   virtual void writeStringOnly(const std::string& value)=0;
-	virtual void writeLine(const std::string& value, const int& width=0)=0;
-	virtual void writeLine()=0;
-
-	virtual void writeCommentLine(const std::string& line)=0;
-	virtual void writeCommentLine(char indicator, const std::string& line)=0;
-   virtual void writeCopyOfFile(const std::string& filename)=0;
-	
-   virtual void setCommentIndicator(char commentindicator) {this->commentindicator = commentindicator;} 
-   
-   virtual void setPrecision(const int& precision)=0;
-   virtual int  getPrecision()=0;
-
-   //returns "ASCII", "BINARY"
-   virtual FILETYPE getFileType()=0;
-
-   //returns file extension:
-   //e.g. "./../test/ich.inp" -> "inp", "./../test/ich" -> ""
-   virtual std::string getFileExtension()  
-   {
-	   std::size_t pos1 = filename.rfind("/");
-      if(pos1==std::string::npos) pos1 = 0;
-      std::size_t pos2 = filename.rfind(".");
-      if(pos2!=std::string::npos && pos2>pos1)
-         return filename.substr(pos2+1);
-
-      return "";
-   }				
-
-   virtual std::string  getFileName() {return this->filename;}
+    UbFileOutput() : filename("") {}
+    UbFileOutput(const std::string &filename) : filename(filename) {}
+    virtual ~UbFileOutput() { outfile.flush(); }
+
+    virtual bool open(const std::string &filename, CREATEOPTION opt = OUTFILE) = 0;
+
+    virtual bool operator!() { return !(outfile); }
+    virtual bool isOpen() { return !(!(outfile)); }
+
+    virtual void flush() { outfile.flush(); }
+    virtual void close() { outfile.close(); }
+
+    virtual void writeInteger(const int &value, const int &width = 0)        = 0;
+    virtual void writeDouble(const double &value, const int &width = 0)      = 0;
+    virtual void writeFloat(const float &value, const int &width = 0)        = 0;
+    virtual void writeBool(const bool &value, const int &width = 0)          = 0;
+    virtual void writeSize_t(const std::size_t &value, const int &width = 0) = 0;
+    virtual void writeChar(const char &value, const int &width = 0)          = 0;
+    virtual void writeString(const std::string &value, const int &width = 0) = 0;
+    virtual void writeStringOnly(const std::string &value)                   = 0;
+    virtual void writeLine(const std::string &value, const int &width = 0)   = 0;
+    virtual void writeLine()                                                 = 0;
+
+    virtual void writeCommentLine(const std::string &line)                 = 0;
+    virtual void writeCommentLine(char indicator, const std::string &line) = 0;
+    virtual void writeCopyOfFile(const std::string &filename)              = 0;
+
+    virtual void setCommentIndicator(char commentindicator) { this->commentindicator = commentindicator; }
+
+    virtual void setPrecision(const int &precision) = 0;
+    virtual int getPrecision()                      = 0;
+
+    // returns "ASCII", "BINARY"
+    virtual FILETYPE getFileType() = 0;
+
+    // returns file extension:
+    // e.g. "./../test/ich.inp" -> "inp", "./../test/ich" -> ""
+    virtual std::string getFileExtension()
+    {
+        std::size_t pos1 = filename.rfind("/");
+        if (pos1 == std::string::npos)
+            pos1 = 0;
+        std::size_t pos2 = filename.rfind(".");
+        if (pos2 != std::string::npos && pos2 > pos1)
+            return filename.substr(pos2 + 1);
+
+        return "";
+    }
+
+    virtual std::string getFileName() { return this->filename; }
+
 protected:
-   std::ofstream outfile;
-   std::string   filename; 
-   char          commentindicator{'C'}; 
+    std::ofstream outfile;
+    std::string filename;
+    char commentindicator{ 'C' };
 };
 
-#endif //UBFILEOUTPUT_H
+#endif // UBFILEOUTPUT_H
diff --git a/src/basics/basics/utilities/UbFileOutputASCII.cpp b/src/basics/basics/utilities/UbFileOutputASCII.cpp
index 3a0930105e936982e664d48a6cbb0abf150f12d2..68bfc8b64ad2e10c5b8a76b0bcdc98bdd7fa019d 100644
--- a/src/basics/basics/utilities/UbFileOutputASCII.cpp
+++ b/src/basics/basics/utilities/UbFileOutputASCII.cpp
@@ -1,177 +1,171 @@
 #include <basics/utilities/UbFileOutputASCII.h>
-#include <basics/utilities/UbSystem.h>
 #include <basics/utilities/UbInfinity.h>
 #include <basics/utilities/UbMath.h>
+#include <basics/utilities/UbSystem.h>
 #include <cstring>
 
 using namespace std;
 
-UbFileOutputASCII::UbFileOutputASCII(const string& filename, const bool& createPath, const int&  /*precision*/)
-   : UbFileOutput(filename)
+UbFileOutputASCII::UbFileOutputASCII(const string &filename, const bool &createPath, const int & /*precision*/)
+    : UbFileOutput(filename)
 {
-	this->commentindicator = 'C'; 
-	this->setPrecision(20);
+    this->commentindicator = 'C';
+    this->setPrecision(20);
+
+    outfile.open(filename.c_str(), ios::out);
 
-   outfile.open(filename.c_str(),ios::out);
-   
-   if(!outfile && createPath) 
-   {
-      outfile.clear(); //flags ruecksetzen (ansonsten liefert utern if(!outfile) weiterhin true!!!
-      string path = UbSystem::getPathFromString(filename);
-      if(path.size()>0) 
-      {
-         UbSystem::makeDirectory(path);
-         outfile.open(filename.c_str(),ios::out);
-      }
-   }
+    if (!outfile && createPath) {
+        outfile.clear(); // flags ruecksetzen (ansonsten liefert utern if(!outfile) weiterhin true!!!
+        string path = UbSystem::getPathFromString(filename);
+        if (path.size() > 0) {
+            UbSystem::makeDirectory(path);
+            outfile.open(filename.c_str(), ios::out);
+        }
+    }
 
-      if(!outfile) UB_THROW( UbException(UB_EXARGS,"couldn't open file:\n "+filename) );
+    if (!outfile)
+        UB_THROW(UbException(UB_EXARGS, "couldn't open file:\n " + filename));
 }
 /*==========================================================*/
-UbFileOutputASCII::UbFileOutputASCII(const std::string& filename, CREATEOPTION opt, const bool& createPath, const int& precision)
-   : UbFileOutput(filename)
+UbFileOutputASCII::UbFileOutputASCII(const std::string &filename, CREATEOPTION opt, const bool &createPath,
+                                     const int &precision)
+    : UbFileOutput(filename)
 {
-	this->commentindicator = 'C'; 
-   this->setPrecision(precision);
-	
-   if(!this->open(filename,opt) && createPath) 
-   {
-      outfile.clear(); //flags ruecksetzen (ansonsten liefert utern if(!outfile) weiterhin true!!!
-      string path = UbSystem::getPathFromString(filename);
-      if(path.size()>0) UbSystem::makeDirectory(path);
+    this->commentindicator = 'C';
+    this->setPrecision(precision);
 
-      this->open(filename,opt);
-   }
+    if (!this->open(filename, opt) && createPath) {
+        outfile.clear(); // flags ruecksetzen (ansonsten liefert utern if(!outfile) weiterhin true!!!
+        string path = UbSystem::getPathFromString(filename);
+        if (path.size() > 0)
+            UbSystem::makeDirectory(path);
 
-   if(!outfile) UB_THROW( UbException(UB_EXARGS,"couldn't open file:\n "+filename) );
+        this->open(filename, opt);
+    }
+
+    if (!outfile)
+        UB_THROW(UbException(UB_EXARGS, "couldn't open file:\n " + filename));
 }
 /*==========================================================*/
-bool UbFileOutputASCII::open(const std::string& filename, CREATEOPTION opt)
+bool UbFileOutputASCII::open(const std::string &filename, CREATEOPTION opt)
 {
-   outfile.close();
-   outfile.clear(); //setzt flags zurueck
-   this->filename = filename;
+    outfile.close();
+    outfile.clear(); // setzt flags zurueck
+    this->filename = filename;
 
-   if     (opt==UbFileOutput::OUTFILE      ) outfile.open(this->filename.c_str(),ios::out); 
-   else if(opt==UbFileOutput::INANDOUTFILE ) outfile.open(this->filename.c_str(),ios::out | ios::in);
-   else if(opt==UbFileOutput::APPENDFILE   ) outfile.open(this->filename.c_str(),ios::app);
-   else UB_THROW( UbException(UB_EXARGS,"undefined CREATEOPTION") );
+    if (opt == UbFileOutput::OUTFILE)
+        outfile.open(this->filename.c_str(), ios::out);
+    else if (opt == UbFileOutput::INANDOUTFILE)
+        outfile.open(this->filename.c_str(), ios::out | ios::in);
+    else if (opt == UbFileOutput::APPENDFILE)
+        outfile.open(this->filename.c_str(), ios::app);
+    else
+        UB_THROW(UbException(UB_EXARGS, "undefined CREATEOPTION"));
 
-   return outfile.is_open();
+    return outfile.is_open();
 }
 /*==========================================================*/
-void UbFileOutputASCII::writeBool(const bool& value, const int& width)				
+void UbFileOutputASCII::writeBool(const bool &value, const int &width)
 {
-   outfile.width(width);
-   if(value) outfile<<"true ";
-   else      outfile<<"false ";
+    outfile.width(width);
+    if (value)
+        outfile << "true ";
+    else
+        outfile << "false ";
 }
 /*==========================================================*/
-void UbFileOutputASCII::writeDouble(const double& value, const int& width)				
+void UbFileOutputASCII::writeDouble(const double &value, const int &width)
 {
-   outfile.width(width);
-   //Problem: Ub::inf wird gerundet 
-   //         -> beim Einlesen ist der Wert evtl zu gross und es kommt murks raus 
-   //         -> max Laenge darstellen und gut ist
-   if(UbMath::equal(value, (double)Ub::inf) )
-   {
-      ios_base::fmtflags flags = outfile.flags();
-      outfile<<setprecision(std::numeric_limits<double>::digits10+2);
-      outfile<<value<<" ";
-      outfile.flags(flags);
-      return;
-   }
-   outfile<<value<<" ";
+    outfile.width(width);
+    // Problem: Ub::inf wird gerundet
+    //         -> beim Einlesen ist der Wert evtl zu gross und es kommt murks raus
+    //         -> max Laenge darstellen und gut ist
+    if (UbMath::equal(value, (double)Ub::inf)) {
+        ios_base::fmtflags flags = outfile.flags();
+        outfile << setprecision(std::numeric_limits<double>::digits10 + 2);
+        outfile << value << " ";
+        outfile.flags(flags);
+        return;
+    }
+    outfile << value << " ";
 }
 /*==========================================================*/
-void UbFileOutputASCII::writeFloat(const float& value, const int& width)				
+void UbFileOutputASCII::writeFloat(const float &value, const int &width)
 {
-   outfile.width(width);
-   //Problem: Ub::inf wird gerundet 
-   //         -> beim Einlesen ist der Wert evtl zu gross und es kommt murks raus 
-   //         -> max Laenge darstellen und gut ist
-   if(UbMath::equal(value, (float)Ub::inf) )
-   {
-      ios_base::fmtflags flags = outfile.flags();
-      outfile<<setprecision(std::numeric_limits<float>::digits10+2);
-      outfile<<value<<" ";
-      outfile.flags(flags);
-      return;
-   }
-   outfile<<value<<" ";
+    outfile.width(width);
+    // Problem: Ub::inf wird gerundet
+    //         -> beim Einlesen ist der Wert evtl zu gross und es kommt murks raus
+    //         -> max Laenge darstellen und gut ist
+    if (UbMath::equal(value, (float)Ub::inf)) {
+        ios_base::fmtflags flags = outfile.flags();
+        outfile << setprecision(std::numeric_limits<float>::digits10 + 2);
+        outfile << value << " ";
+        outfile.flags(flags);
+        return;
+    }
+    outfile << value << " ";
 }
 /*==========================================================*/
-void UbFileOutputASCII::setPrecision(const int& precision)				
-{
-   outfile<<setprecision(precision);
-}
+void UbFileOutputASCII::setPrecision(const int &precision) { outfile << setprecision(precision); }
 /*==========================================================*/
-void UbFileOutputASCII::writeInteger(const int& value, const int& width)				
+void UbFileOutputASCII::writeInteger(const int &value, const int &width)
 {
-   outfile.width(width);
-   outfile<<value<<" ";
+    outfile.width(width);
+    outfile << value << " ";
 }
 /*==========================================================*/
-void UbFileOutputASCII::writeSize_t(const std::size_t& value, const int& width)
+void UbFileOutputASCII::writeSize_t(const std::size_t &value, const int &width)
 {
-   outfile.width(width);
-   outfile<<value<<" ";
+    outfile.width(width);
+    outfile << value << " ";
 }
 /*==========================================================*/
-void UbFileOutputASCII::writeChar(const char& value, const int& width)
+void UbFileOutputASCII::writeChar(const char &value, const int &width)
 {
-   outfile.width(width);
-   outfile<<(int)value<<" ";	
+    outfile.width(width);
+    outfile << (int)value << " ";
 }
 /*==========================================================*/
-void UbFileOutputASCII::writeString(const string& value, const int& width)				
+void UbFileOutputASCII::writeString(const string &value, const int &width)
 {
-   outfile.width(width);
-   outfile<<value.c_str()<<" ";	
+    outfile.width(width);
+    outfile << value.c_str() << " ";
 }
 /*==========================================================*/
-void UbFileOutputASCII::writeStringOnly(const string& value)				
-{
-	outfile<<value.c_str();	
-}
+void UbFileOutputASCII::writeStringOnly(const string &value) { outfile << value.c_str(); }
 
 /*==========================================================*/
-void UbFileOutputASCII::writeLine(const string& value, const int& width)				
+void UbFileOutputASCII::writeLine(const string &value, const int &width)
 {
-   outfile.width(width);
-   outfile<<value.c_str()<<endl;	
+    outfile.width(width);
+    outfile << value.c_str() << endl;
 }
 /*==========================================================*/
-void UbFileOutputASCII::writeLine()				
-{
-	outfile<<endl;	
-}
+void UbFileOutputASCII::writeLine() { outfile << endl; }
 /*==========================================================*/
-void UbFileOutputASCII::writeCommentLine(const string& line) 
-{
-   this->writeCommentLine(this->commentindicator, line); 
-}
+void UbFileOutputASCII::writeCommentLine(const string &line) { this->writeCommentLine(this->commentindicator, line); }
 /*==========================================================*/
-void UbFileOutputASCII::writeCommentLine(char indicator, const string& line) 
+void UbFileOutputASCII::writeCommentLine(char indicator, const string &line)
 {
-	this->outfile<<indicator<<line<<endl;
+    this->outfile << indicator << line << endl;
 }
 /*==========================================================*/
-void UbFileOutputASCII::writeCopyOfFile(const string& filename)
+void UbFileOutputASCII::writeCopyOfFile(const string &filename)
 {
-   ifstream infile(filename.c_str());
-   if(!infile) UB_THROW( UbException(UB_EXARGS,"couldn't open file:\n "+filename) );
+    ifstream infile(filename.c_str());
+    if (!infile)
+        UB_THROW(UbException(UB_EXARGS, "couldn't open file:\n " + filename));
 
-   try
-   {
-      char c;
-      while(infile.get(c)) 
-      {
-         outfile.put(c);  //=out<<c;
-      }
-      outfile.flush();
-      infile.close();
-   }
-   catch(std::exception& e) { UB_THROW( UbException(UB_EXARGS,"catched std::exception, error: "+(std::string)e.what()) ); }
-   catch(...)               { UB_THROW( UbException(UB_EXARGS,"unknown error") ); }
+    try {
+        char c;
+        while (infile.get(c)) {
+            outfile.put(c); //=out<<c;
+        }
+        outfile.flush();
+        infile.close();
+    } catch (std::exception &e) {
+        UB_THROW(UbException(UB_EXARGS, "catched std::exception, error: " + (std::string)e.what()));
+    } catch (...) {
+        UB_THROW(UbException(UB_EXARGS, "unknown error"));
+    }
 }
diff --git a/src/basics/basics/utilities/UbFileOutputASCII.h b/src/basics/basics/utilities/UbFileOutputASCII.h
index 25041513f8989990b6cb99a80186b2049771bedc..e6d763561ba6e36dbceae844e4d0423692fa6a94 100644
--- a/src/basics/basics/utilities/UbFileOutputASCII.h
+++ b/src/basics/basics/utilities/UbFileOutputASCII.h
@@ -7,8 +7,8 @@
 #ifndef UBFILEOUTPUTASCII_H
 #define UBFILEOUTPUTASCII_H
 
-#include <iomanip>
 #include <fstream>
+#include <iomanip>
 #include <iostream>
 
 #include "basics_export.h"
@@ -24,7 +24,7 @@
 <BR><BR>
 @author <A HREF="mailto:muffmolch@gmx.de">S. Freudiger</A>
 @version 1.0 - 23.11.04
-*/ 
+*/
 
 /*
 usage: ...
@@ -33,42 +33,41 @@ usage: ...
 class BASICS_EXPORT UbFileOutputASCII : public UbFileOutput
 {
 public:
-   UbFileOutputASCII() : UbFileOutput() {}
-   UbFileOutputASCII(const std::string& filename, const bool& createPath=true,  const int& precision=15);             
-   UbFileOutputASCII(const std::string& filename, CREATEOPTION opt, const bool& createPath=true, const int& precision=15);
-   
-   bool open(const std::string& filename, CREATEOPTION opt=OUTFILE) override;
-   
-   void writeBool(const bool& value, const int& width=0) override;
-   void writeDouble(const double& value, const int& width=0) override;
-	void writeFloat(const float& value, const int& width=0) override;
-	void writeInteger(const int& value, const int& width=0) override;
-   void writeSize_t(const std::size_t& value, const int& width=0) override;
-   void writeChar(const char& value, const int& width=0) override;
-   void writeString(const std::string& value, const int& width=0) override;
-   void writeStringOnly(const std::string& value) override;
-   void writeLine(const std::string& value, const int& width=0) override;
-   void writeLine() override;
-  
-   void setPrecision(const int& precision) override;
-   int  getPrecision() override { return (int)outfile.precision(); }
+    UbFileOutputASCII() : UbFileOutput() {}
+    UbFileOutputASCII(const std::string &filename, const bool &createPath = true, const int &precision = 15);
+    UbFileOutputASCII(const std::string &filename, CREATEOPTION opt, const bool &createPath = true,
+                      const int &precision = 15);
 
-   void setCommentIndicator(char commentindicator) override {this->commentindicator = commentindicator;} 
-   
-   void writeCommentLine(const std::string& line) override;
-   void writeCommentLine(char indicator, const std::string& line) override;
-   void writeCopyOfFile(const std::string& filename) override;
+    bool open(const std::string &filename, CREATEOPTION opt = OUTFILE) override;
 
-   FILETYPE getFileType() override { return ASCII; }
+    void writeBool(const bool &value, const int &width = 0) override;
+    void writeDouble(const double &value, const int &width = 0) override;
+    void writeFloat(const float &value, const int &width = 0) override;
+    void writeInteger(const int &value, const int &width = 0) override;
+    void writeSize_t(const std::size_t &value, const int &width = 0) override;
+    void writeChar(const char &value, const int &width = 0) override;
+    void writeString(const std::string &value, const int &width = 0) override;
+    void writeStringOnly(const std::string &value) override;
+    void writeLine(const std::string &value, const int &width = 0) override;
+    void writeLine() override;
 
-   template< typename T >
-   friend inline UbFileOutputASCII& operator<<(UbFileOutputASCII& file, const T& data) 
-   {
-      file.outfile<<data;
-      return file;
-   }
-};
+    void setPrecision(const int &precision) override;
+    int getPrecision() override { return (int)outfile.precision(); }
 
-#endif
+    void setCommentIndicator(char commentindicator) override { this->commentindicator = commentindicator; }
 
+    void writeCommentLine(const std::string &line) override;
+    void writeCommentLine(char indicator, const std::string &line) override;
+    void writeCopyOfFile(const std::string &filename) override;
 
+    FILETYPE getFileType() override { return ASCII; }
+
+    template <typename T>
+    friend inline UbFileOutputASCII &operator<<(UbFileOutputASCII &file, const T &data)
+    {
+        file.outfile << data;
+        return file;
+    }
+};
+
+#endif
diff --git a/src/basics/basics/utilities/UbFileOutputBinary.cpp b/src/basics/basics/utilities/UbFileOutputBinary.cpp
index a34d11441f6ac6176ab987bb52734af7e3dd2cdc..fa9ab7480f360e4d9a14098ffca8020f159cc76c 100644
--- a/src/basics/basics/utilities/UbFileOutputBinary.cpp
+++ b/src/basics/basics/utilities/UbFileOutputBinary.cpp
@@ -5,176 +5,172 @@
 using namespace std;
 
 /*==========================================================*/
-UbFileOutputBinary::UbFileOutputBinary(const string& filename, const bool& createPath)
+UbFileOutputBinary::UbFileOutputBinary(const string &filename, const bool &createPath)
 {
-   this->filename         = filename;
-   this->commentindicator = 'C'; 
+    this->filename         = filename;
+    this->commentindicator = 'C';
 
-   outfile.open(filename.c_str(),ios::out | ios::binary);
+    outfile.open(filename.c_str(), ios::out | ios::binary);
 
-   if(!outfile && createPath) 
-   {
-      string path = UbSystem::getPathFromString(filename);
-      if(path.size()>0)
-      {
-         outfile.clear(); //flags ruecksetzen (ansonsten liefert utern if(!outfile) weiterhin true!!!
-         UbSystem::makeDirectory(path);
-         outfile.open(filename.c_str(),ios::out | ios::binary);
-      }
-   }
-
-   if(!outfile) UB_THROW( UbException(UB_EXARGS,"couldn't open file:\n "+filename) );
+    if (!outfile && createPath) {
+        string path = UbSystem::getPathFromString(filename);
+        if (path.size() > 0) {
+            outfile.clear(); // flags ruecksetzen (ansonsten liefert utern if(!outfile) weiterhin true!!!
+            UbSystem::makeDirectory(path);
+            outfile.open(filename.c_str(), ios::out | ios::binary);
+        }
+    }
 
+    if (!outfile)
+        UB_THROW(UbException(UB_EXARGS, "couldn't open file:\n " + filename));
 }
 /*==========================================================*/
-UbFileOutputBinary::UbFileOutputBinary(const string& filename,UbFileOutput::CREATEOPTION opt, const bool& createPath)
+UbFileOutputBinary::UbFileOutputBinary(const string &filename, UbFileOutput::CREATEOPTION opt, const bool &createPath)
 {
-   this->filename         = filename;
-   this->commentindicator = 'C'; 
+    this->filename         = filename;
+    this->commentindicator = 'C';
 
-   this->open(filename,opt);
+    this->open(filename, opt);
 
-   if(!this->open(filename,opt) && createPath) 
-   {
-      string path = UbSystem::getPathFromString(filename);
-      if(path.size()>0)
-      {
-         outfile.clear(); //flags ruecksetzen (ansonsten liefert utern if(!outfile) weiterhin true!!!
-         UbSystem::makeDirectory(path,20);
+    if (!this->open(filename, opt) && createPath) {
+        string path = UbSystem::getPathFromString(filename);
+        if (path.size() > 0) {
+            outfile.clear(); // flags ruecksetzen (ansonsten liefert utern if(!outfile) weiterhin true!!!
+            UbSystem::makeDirectory(path, 20);
 
-         this->open(filename,opt);     
-      }      
-   }
+            this->open(filename, opt);
+        }
+    }
 
-   if(!outfile) UB_THROW( UbException(UB_EXARGS,"couldn't open file:\n "+filename) );
+    if (!outfile)
+        UB_THROW(UbException(UB_EXARGS, "couldn't open file:\n " + filename));
 }
 /*==========================================================*/
-bool UbFileOutputBinary::open(const string& filename, UbFileOutput::CREATEOPTION opt)
+bool UbFileOutputBinary::open(const string &filename, UbFileOutput::CREATEOPTION opt)
 {
-   outfile.close();
-   outfile.clear(); //setzt flags zurueck
+    outfile.close();
+    outfile.clear(); // setzt flags zurueck
 
-   this->filename         = filename;
+    this->filename = filename;
 
-   if     (opt==UbFileOutput::OUTFILE    )  outfile.open(this->filename.c_str(),ios::out | ios::binary);
-   else if(opt==UbFileOutput::APPENDFILE )  outfile.open(this->filename.c_str(),ios::app | ios::binary);
-   else if(opt==UbFileOutput::INANDOUTFILE) UB_THROW( UbException(UB_EXARGS,"undefined CREATEOPTION - INANDOUTFILE not possible for BINARY files") );
-   else UB_THROW( UbException(UB_EXARGS,"undefined CREATEOPTION") );
+    if (opt == UbFileOutput::OUTFILE)
+        outfile.open(this->filename.c_str(), ios::out | ios::binary);
+    else if (opt == UbFileOutput::APPENDFILE)
+        outfile.open(this->filename.c_str(), ios::app | ios::binary);
+    else if (opt == UbFileOutput::INANDOUTFILE)
+        UB_THROW(UbException(UB_EXARGS, "undefined CREATEOPTION - INANDOUTFILE not possible for BINARY files"));
+    else
+        UB_THROW(UbException(UB_EXARGS, "undefined CREATEOPTION"));
 
-   return outfile.is_open();
+    return outfile.is_open();
 }
 /*==========================================================*/
-void UbFileOutputBinary::writeBool(const bool& value, const int&  /*width*/)				
+void UbFileOutputBinary::writeBool(const bool &value, const int & /*width*/)
 {
-   outfile.write((char*)&value,sizeof(bool));
+    outfile.write((char *)&value, sizeof(bool));
 }
 /*==========================================================*/
-void UbFileOutputBinary::writeDouble(const double& value, const int&  /*width*/)				
+void UbFileOutputBinary::writeDouble(const double &value, const int & /*width*/)
 {
-   outfile.write((char*)&value,sizeof(double));
+    outfile.write((char *)&value, sizeof(double));
 }
 /*==========================================================*/
-void UbFileOutputBinary::writeFloat(const float& value, const int&  /*width*/)				
+void UbFileOutputBinary::writeFloat(const float &value, const int & /*width*/)
 {
-	outfile.write((char*)&value,sizeof(float));
+    outfile.write((char *)&value, sizeof(float));
 }
 /*==========================================================*/
-void UbFileOutputBinary::setPrecision(const int&  /*precision*/)				
-{
-   UB_THROW( UbException(UB_EXARGS,"no way") );
-}
+void UbFileOutputBinary::setPrecision(const int & /*precision*/) { UB_THROW(UbException(UB_EXARGS, "no way")); }
 /*==========================================================*/
-int UbFileOutputBinary::getPrecision()				
-{
-   UB_THROW( UbException(UB_EXARGS,"no way") );
-}
+int UbFileOutputBinary::getPrecision() { UB_THROW(UbException(UB_EXARGS, "no way")); }
 /*==========================================================*/
-void UbFileOutputBinary::writeInteger(const int& value, const int&  /*width*/)				
+void UbFileOutputBinary::writeInteger(const int &value, const int & /*width*/)
 {
-   outfile.write((char*)&value,sizeof(value));
+    outfile.write((char *)&value, sizeof(value));
 }
 /*==========================================================*/
-void UbFileOutputBinary::writeSize_t(const std::size_t& value, const int&  /*width*/)
+void UbFileOutputBinary::writeSize_t(const std::size_t &value, const int & /*width*/)
 {
-   outfile.write((char*)&value,sizeof(value));
+    outfile.write((char *)&value, sizeof(value));
 }
 /*==========================================================*/
-void UbFileOutputBinary::writeChar(const char& value, const int&  /*width*/)				
+void UbFileOutputBinary::writeChar(const char &value, const int & /*width*/)
 {
-   outfile.write((char*)&value,sizeof(value));
+    outfile.write((char *)&value, sizeof(value));
 }
 /*==========================================================*/
-void UbFileOutputBinary::writeString(const string& value, const int&  /*width*/)				
+void UbFileOutputBinary::writeString(const string &value, const int & /*width*/)
 {
-   char c='\0';
-   unsigned int length = (unsigned)value.length();
-   
-   unsigned pos;
-   //whitespaces und tabs am stringanfang uebergehen
-   for(pos=0; pos<length; pos++)
-      if( value[pos]!=' ' && value[pos]!='\t' ) break;
+    char c              = '\0';
+    unsigned int length = (unsigned)value.length();
+
+    unsigned pos;
+    // whitespaces und tabs am stringanfang uebergehen
+    for (pos = 0; pos < length; pos++)
+        if (value[pos] != ' ' && value[pos] != '\t')
+            break;
 
-   while(pos<length)
-   {
-      while(pos<length && value[pos]!=' ' && value[pos]!='\t' && value[pos]!='\0')
-      {
-         outfile.write((char*)&(value[pos++]),sizeof(char));
-      }
+    while (pos < length) {
+        while (pos < length && value[pos] != ' ' && value[pos] != '\t' && value[pos] != '\0') {
+            outfile.write((char *)&(value[pos++]), sizeof(char));
+        }
 
-      outfile.write(&c,sizeof(char));
-      pos++;
+        outfile.write(&c, sizeof(char));
+        pos++;
 
-      while(pos<length && (value[pos]==' ' || value[pos]=='\t' || value[pos]=='\0') )
-      {
-         pos++;
-      }
-   }
+        while (pos < length && (value[pos] == ' ' || value[pos] == '\t' || value[pos] == '\0')) {
+            pos++;
+        }
+    }
 }
 /*==========================================================*/
-void UbFileOutputBinary::writeStringOnly(const string&  /*value*/)				
+void UbFileOutputBinary::writeStringOnly(const string & /*value*/)
 {
-   throw UbException(UB_EXARGS,"no way... causes to many errors"); // TODO: WTF?
+    throw UbException(UB_EXARGS, "no way... causes to many errors"); // TODO: WTF?
 }
 /*==========================================================*/
-void UbFileOutputBinary::writeLine(const std::string& value, const int&  /*width*/)				
+void UbFileOutputBinary::writeLine(const std::string &value, const int & /*width*/)
 {
-   this->writeString(value);
-   char c='\n';
-   outfile.write(&c,sizeof(char));
+    this->writeString(value);
+    char c = '\n';
+    outfile.write(&c, sizeof(char));
 }
 /*==========================================================*/
-void UbFileOutputBinary::writeLine()				
+void UbFileOutputBinary::writeLine()
 {
-   char c='\n';
-   outfile.write(&c,sizeof(char));   
+    char c = '\n';
+    outfile.write(&c, sizeof(char));
 }
 /*==========================================================*/
-void UbFileOutputBinary::writeCommentLine(const string& line) 
+void UbFileOutputBinary::writeCommentLine(const string &line)
 {
-   try        { this->writeCommentLine(this->commentindicator, line); }
-   catch(...) { UB_THROW( UbException(UB_EXARGS,"unknown error") ); }
+    try {
+        this->writeCommentLine(this->commentindicator, line);
+    } catch (...) {
+        UB_THROW(UbException(UB_EXARGS, "unknown error"));
+    }
 }
 /*==========================================================*/
-void UbFileOutputBinary::writeCommentLine(char indicator, const string& line) 
+void UbFileOutputBinary::writeCommentLine(char indicator, const string &line)
 {
-   string dummy = indicator + line;
-   this->writeLine(dummy);
+    string dummy = indicator + line;
+    this->writeLine(dummy);
 }
 /*==========================================================*/
-void UbFileOutputBinary::writeCopyOfFile(const string& filename)
+void UbFileOutputBinary::writeCopyOfFile(const string &filename)
 {
-   ifstream infile(filename.c_str(),ios::in | ios::binary);
-   if(!infile) UB_THROW( UbException(UB_EXARGS,"couldn't open file:\n "+filename) );
+    ifstream infile(filename.c_str(), ios::in | ios::binary);
+    if (!infile)
+        UB_THROW(UbException(UB_EXARGS, "couldn't open file:\n " + filename));
 
-   try
-   {
-      char c;
-      while(infile.get(c)) 
-      {
-         outfile.put(c);  //=out<<c;
-      }
-      outfile.flush();
-      infile.close();
-   }
-   catch(...) {UB_THROW( UbException(UB_EXARGS,"unknown error") );}
+    try {
+        char c;
+        while (infile.get(c)) {
+            outfile.put(c); //=out<<c;
+        }
+        outfile.flush();
+        infile.close();
+    } catch (...) {
+        UB_THROW(UbException(UB_EXARGS, "unknown error"));
+    }
 }
diff --git a/src/basics/basics/utilities/UbFileOutputBinary.h b/src/basics/basics/utilities/UbFileOutputBinary.h
index 11b62b791523e202cbc5ea0a8a1264ecfd24025b..fb4799d1761fbc7056e5b0c6050c385e95692073 100644
--- a/src/basics/basics/utilities/UbFileOutputBinary.h
+++ b/src/basics/basics/utilities/UbFileOutputBinary.h
@@ -7,11 +7,10 @@
 #ifndef UBFILEOUTPUTBINARY_H
 #define UBFILEOUTPUTBINARY_H
 
-#include <iomanip>
 #include <fstream>
+#include <iomanip>
 #include <iostream>
 
-
 #include <basics/utilities/UbException.h>
 #include <basics/utilities/UbFileOutput.h>
 
@@ -23,7 +22,7 @@
 <BR><BR>
 @author <A HREF="mailto:muffmolch@gmx.de">S. Freudiger</A>
 @version 1.0 - 23.11.04
-*/ 
+*/
 
 /*
 usage: ...
@@ -32,49 +31,46 @@ usage: ...
 class UbFileOutputBinary : public UbFileOutput
 {
 public:
-   UbFileOutputBinary() : UbFileOutput() {}
-   UbFileOutputBinary(const std::string& filename, const bool& createPath=true);
-   UbFileOutputBinary(const std::string& filename, UbFileOutput::CREATEOPTION opt, const bool& createPath);
-   
-   bool open(const std::string& filename, UbFileOutput::CREATEOPTION opt=OUTFILE) override;
+    UbFileOutputBinary() : UbFileOutput() {}
+    UbFileOutputBinary(const std::string &filename, const bool &createPath = true);
+    UbFileOutputBinary(const std::string &filename, UbFileOutput::CREATEOPTION opt, const bool &createPath);
 
-   void writeInteger(const int& value, const int& width=0) override;
-   void writeDouble(const double& value, const int& width=0) override;
-	void writeFloat(const float& value, const int& width=0) override;
-	void writeBool(const bool& value, const int& width=0) override;
-   void writeChar(const char& value, const int& width=0) override;
-   void writeSize_t(const std::size_t& value, const int& width=0) override;
-   void writeString(const std::string& value, const int& width=0) override;
-   void writeStringOnly(const std::string& value) override;
-   void writeLine(const std::string& value, const int& width=0) override;
-   void writeLine() override;
-   void writeCommentLine(const std::string& line) override;
-   void writeCommentLine(char indicator, const std::string& line) override;
-   void writeCopyOfFile(const std::string& filename) override;
+    bool open(const std::string &filename, UbFileOutput::CREATEOPTION opt = OUTFILE) override;
 
-   void setPrecision(const int& precision) override;
-   int  getPrecision() override;
+    void writeInteger(const int &value, const int &width = 0) override;
+    void writeDouble(const double &value, const int &width = 0) override;
+    void writeFloat(const float &value, const int &width = 0) override;
+    void writeBool(const bool &value, const int &width = 0) override;
+    void writeChar(const char &value, const int &width = 0) override;
+    void writeSize_t(const std::size_t &value, const int &width = 0) override;
+    void writeString(const std::string &value, const int &width = 0) override;
+    void writeStringOnly(const std::string &value) override;
+    void writeLine(const std::string &value, const int &width = 0) override;
+    void writeLine() override;
+    void writeCommentLine(const std::string &line) override;
+    void writeCommentLine(char indicator, const std::string &line) override;
+    void writeCopyOfFile(const std::string &filename) override;
 
-   FILETYPE getFileType() override { return BINARY; }
+    void setPrecision(const int &precision) override;
+    int getPrecision() override;
 
-   template< typename T >
-   friend inline UbFileOutputBinary& operator<<(UbFileOutputBinary& file, const T& data) 
-   {
-      file.outfile.write((char*)&data,sizeof(T));
-      return file;
-   }
+    FILETYPE getFileType() override { return BINARY; }
 
-   template< typename T>
-   void writeVector(std::vector<T>& v)
-   {
-      size_t size = v.size();
-      if (size > 0)
-      {
-         outfile.write((char*)&v[0],sizeof(T)*size);
-      }
-   }
+    template <typename T>
+    friend inline UbFileOutputBinary &operator<<(UbFileOutputBinary &file, const T &data)
+    {
+        file.outfile.write((char *)&data, sizeof(T));
+        return file;
+    }
+
+    template <typename T>
+    void writeVector(std::vector<T> &v)
+    {
+        size_t size = v.size();
+        if (size > 0) {
+            outfile.write((char *)&v[0], sizeof(T) * size);
+        }
+    }
 };
 
 #endif
-
-
diff --git a/src/basics/basics/utilities/UbInfinity.h b/src/basics/basics/utilities/UbInfinity.h
index 460c439ecd3141ab8bc1973934007acf58a42b50..d42b21a4285f5e62cc9f04483937dfd0740df780 100644
--- a/src/basics/basics/utilities/UbInfinity.h
+++ b/src/basics/basics/utilities/UbInfinity.h
@@ -1,28 +1,28 @@
 //=======================================================================================
-// ____          ____    __    ______     __________   __      __       __        __         
-// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |        
-//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |        
-//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |        
-//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____    
-//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|   
-//      \    \  |    |   ________________________________________________________________    
-//       \    \ |    |  |  ______________________________________________________________|   
-//        \    \|    |  |  |         __          __     __     __     ______      _______    
-//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)   
-//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______    
+// ____          ____    __    ______     __________   __      __       __        __
+// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |
+//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |
+//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |
+//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____
+//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|
+//      \    \  |    |   ________________________________________________________________
+//       \    \ |    |  |  ______________________________________________________________|
+//        \    \|    |  |  |         __          __     __     __     ______      _______
+//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)
+//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______
 //           \       |  |  |        |  |_____   |   \_/   |   |  |   |  |_/  /    _____  |
-//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/   
+//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/
 //
-//  This file is part of VirtualFluids. VirtualFluids is free software: you can 
+//  This file is part of VirtualFluids. VirtualFluids is free software: you can
 //  redistribute it and/or modify it under the terms of the GNU General Public
-//  License as published by the Free Software Foundation, either version 3 of 
+//  License as published by the Free Software Foundation, either version 3 of
 //  the License, or (at your option) any later version.
-//  
-//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT 
-//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
-//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License 
+//
+//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT
+//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 //  for more details.
-//  
+//
 //  You should have received a copy of the GNU General Public License along
 //  with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>.
 //
@@ -40,41 +40,42 @@
 //////////////////////////////////////////////////////////////////////////
 //!
 //!  \brief UbNegInfinity
-//!  \details Note: The UbNegInfinity class cannot be instantiated on its own, but works 
+//!  \details Note: The UbNegInfinity class cannot be instantiated on its own, but works
 //!        as a base class for the Infinity class.
 //!
 //////////////////////////////////////////////////////////////////////////
 
 class UbNegInfinity
 {
- public:
-   //name Conversion operators 
-   inline operator signed char() const { return UbLimits<signed char>::ninf(); }
-   inline operator char()        const { return UbLimits<char>::ninf();        }
-   inline operator wchar_t()     const { return UbLimits<wchar_t>::ninf();     }
-   inline operator short()       const { return UbLimits<short>::ninf();       }
-   inline operator int()         const { return UbLimits<int>::ninf();         }
-   inline operator long()        const { return UbLimits<long>::ninf();        }
-   inline operator float()       const { return UbLimits<float>::ninf();       }
-   inline operator double()      const { return UbLimits<double>::ninf();      }
-   inline operator long double() const { return UbLimits<long double>::ninf(); }
-
-   //! This function compares built-in data types with their largest possible value. The function
-   //! only works for built-in data types. The attempt to compare user-defined class types will
-   //! result in a compile time error.
-   template< typename T >
-   inline bool equal( const T& rhs ) const
-   {
-      UB_STATIC_ASSERT( std::numeric_limits<T>::is_specialized );
-      return UbLimits<T>::ninf() == rhs;
-   }
- protected:
+public:
+    // name Conversion operators
+    inline operator signed char() const { return UbLimits<signed char>::ninf(); }
+    inline operator char() const { return UbLimits<char>::ninf(); }
+    inline operator wchar_t() const { return UbLimits<wchar_t>::ninf(); }
+    inline operator short() const { return UbLimits<short>::ninf(); }
+    inline operator int() const { return UbLimits<int>::ninf(); }
+    inline operator long() const { return UbLimits<long>::ninf(); }
+    inline operator float() const { return UbLimits<float>::ninf(); }
+    inline operator double() const { return UbLimits<double>::ninf(); }
+    inline operator long double() const { return UbLimits<long double>::ninf(); }
+
+    //! This function compares built-in data types with their largest possible value. The function
+    //! only works for built-in data types. The attempt to compare user-defined class types will
+    //! result in a compile time error.
+    template <typename T>
+    inline bool equal(const T &rhs) const
+    {
+        UB_STATIC_ASSERT(std::numeric_limits<T>::is_specialized);
+        return UbLimits<T>::ninf() == rhs;
+    }
+
+protected:
     inline UbNegInfinity() = default;
 
- private:
-   UbNegInfinity( const UbNegInfinity& ninf );             //copy constructor (private & undefined)
-   UbNegInfinity& operator=( const UbNegInfinity& ninf );  //copy assignment operator (private & undefined)
-   void* operator&() const;                                //address operator (private & undefined)
+private:
+    UbNegInfinity(const UbNegInfinity &ninf);            // copy constructor (private & undefined)
+    UbNegInfinity &operator=(const UbNegInfinity &ninf); // copy assignment operator (private & undefined)
+    void *operator&() const;                             // address operator (private & undefined)
 };
 
 //=================================================================================================
@@ -82,28 +83,28 @@ class UbNegInfinity
 //  GLOBAL OPERATORS
 //
 //=================================================================================================
-template< typename T >
-inline bool operator==( const UbNegInfinity& lhs, const T& rhs )
+template <typename T>
+inline bool operator==(const UbNegInfinity &lhs, const T &rhs)
 {
-   return lhs.equal( rhs );
+    return lhs.equal(rhs);
 }
 //*************************************************************************************************
-template< typename T >
-inline bool operator==( const T& lhs, const UbNegInfinity& rhs )
+template <typename T>
+inline bool operator==(const T &lhs, const UbNegInfinity &rhs)
 {
-   return rhs.equal( lhs );
+    return rhs.equal(lhs);
 }
 //*************************************************************************************************
-template< typename T >
-inline bool operator!=( const UbNegInfinity& lhs, const T& rhs )
+template <typename T>
+inline bool operator!=(const UbNegInfinity &lhs, const T &rhs)
 {
-   return !lhs.equal( rhs );
+    return !lhs.equal(rhs);
 }
 //*************************************************************************************************
-template< typename T >
-inline bool operator!=( const T& lhs, const UbNegInfinity& rhs )
+template <typename T>
+inline bool operator!=(const T &lhs, const UbNegInfinity &rhs)
 {
-   return !rhs.equal( lhs );
+    return !rhs.equal(lhs);
 }
 
 //////////////////////////////////////////////////////////////////////////
@@ -111,61 +112,58 @@ inline bool operator!=( const T& lhs, const UbNegInfinity& rhs )
 //  UbInfinity
 //
 //////////////////////////////////////////////////////////////////////////
-class UbInfinity : public UbNegInfinity //um spaeter -UbInfinity leichter zu implementieren!!!
+class UbInfinity : public UbNegInfinity // um spaeter -UbInfinity leichter zu implementieren!!!
 {
- public:
-   inline UbInfinity() 
-      : UbNegInfinity()
-    {}
-   
-   inline operator unsigned char()  const  { return UbLimits<unsigned char>::inf();  }
-   inline operator signed char()    const  { return UbLimits<signed char>::inf();    }
-   inline operator char()           const  { return UbLimits<char>::inf();           }
-   inline operator wchar_t()        const  { return UbLimits<wchar_t>::inf();        }
-   inline operator unsigned short() const  { return UbLimits<unsigned short>::inf(); }
-   inline operator short()          const  { return UbLimits<short>::inf();          }
-   inline operator unsigned int()   const  { return UbLimits<unsigned int>::inf();   }
-   inline operator int()            const  { return UbLimits<int>::inf();            }
-   inline operator unsigned long()  const  { return UbLimits<unsigned long>::inf();  }
-   inline operator long()           const  { return UbLimits<long>::inf();           }
-   inline operator float()          const  { return UbLimits<float>::inf();          }
-   inline operator double()         const  { return UbLimits<double>::inf();         }
-   inline operator long double()    const  { return UbLimits<long double>::inf();    }
-
-   inline const UbNegInfinity& operator-() const { return static_cast<const UbNegInfinity&>( *this ); }
-
-   /*==========================================================*/
-   template< typename T >
-   inline bool equal( const T& rhs ) const
-   {
-      UB_STATIC_ASSERT( std::numeric_limits<T>::is_specialized );
-      return UbLimits<T>::inf() == rhs;
-   }
-
- private:
-   UbInfinity( const UbInfinity& inf );             //Copy constructor (private & undefined)
-   UbInfinity& operator=( const UbInfinity& inf );  //Copy assignment operator (private & undefined)
-   void* operator&() const;                         //Address operator (private & undefined)
+public:
+    inline UbInfinity() : UbNegInfinity() {}
+
+    inline operator unsigned char() const { return UbLimits<unsigned char>::inf(); }
+    inline operator signed char() const { return UbLimits<signed char>::inf(); }
+    inline operator char() const { return UbLimits<char>::inf(); }
+    inline operator wchar_t() const { return UbLimits<wchar_t>::inf(); }
+    inline operator unsigned short() const { return UbLimits<unsigned short>::inf(); }
+    inline operator short() const { return UbLimits<short>::inf(); }
+    inline operator unsigned int() const { return UbLimits<unsigned int>::inf(); }
+    inline operator int() const { return UbLimits<int>::inf(); }
+    inline operator unsigned long() const { return UbLimits<unsigned long>::inf(); }
+    inline operator long() const { return UbLimits<long>::inf(); }
+    inline operator float() const { return UbLimits<float>::inf(); }
+    inline operator double() const { return UbLimits<double>::inf(); }
+    inline operator long double() const { return UbLimits<long double>::inf(); }
+
+    inline const UbNegInfinity &operator-() const { return static_cast<const UbNegInfinity &>(*this); }
+
+    /*==========================================================*/
+    template <typename T>
+    inline bool equal(const T &rhs) const
+    {
+        UB_STATIC_ASSERT(std::numeric_limits<T>::is_specialized);
+        return UbLimits<T>::inf() == rhs;
+    }
+
+private:
+    UbInfinity(const UbInfinity &inf);            // Copy constructor (private & undefined)
+    UbInfinity &operator=(const UbInfinity &inf); // Copy assignment operator (private & undefined)
+    void *operator&() const;                      // Address operator (private & undefined)
 };
 
 //////////////////////////////////////////////////////////////////////////
 //  GLOBAL OPERATORS
 //////////////////////////////////////////////////////////////////////////
-template< typename T >
-inline bool operator==( const UbInfinity& lhs, const T& rhs );
+template <typename T>
+inline bool operator==(const UbInfinity &lhs, const T &rhs);
 
-template< typename T >
-inline bool operator==( const T& lhs, const UbInfinity& rhs );
+template <typename T>
+inline bool operator==(const T &lhs, const UbInfinity &rhs);
 
-template< typename T >
-inline bool operator!=( const UbInfinity& lhs, const T& rhs );
+template <typename T>
+inline bool operator!=(const UbInfinity &lhs, const T &rhs);
 
-template< typename T >
-inline bool operator!=( const T& lhs, const UbInfinity& rhs );
+template <typename T>
+inline bool operator!=(const T &lhs, const UbInfinity &rhs);
 //@}
 //*************************************************************************************************
 
-
 //*************************************************************************************************
 /*!\brief Equality comparison between an Infinity object and a built-in data type.
 // \ingroup util
@@ -173,28 +171,28 @@ inline bool operator!=( const T& lhs, const UbInfinity& rhs );
 // This operator works only for built-in data types. The attempt to compare user-defined class
 // types will result in a compile time error.
 */
-template< typename T >
-inline bool operator==( const UbInfinity& lhs, const T& rhs )
+template <typename T>
+inline bool operator==(const UbInfinity &lhs, const T &rhs)
 {
-   return lhs.equal( rhs );
+    return lhs.equal(rhs);
 }
 //*************************************************************************************************
-template< typename T >
-inline bool operator==( const T& lhs, const UbInfinity& rhs )
+template <typename T>
+inline bool operator==(const T &lhs, const UbInfinity &rhs)
 {
-   return rhs.equal( lhs );
+    return rhs.equal(lhs);
 }
 //*************************************************************************************************
-template< typename T >
-inline bool operator!=( const UbInfinity& lhs, const T& rhs )
+template <typename T>
+inline bool operator!=(const UbInfinity &lhs, const T &rhs)
 {
-   return !lhs.equal( rhs );
+    return !lhs.equal(rhs);
 }
 //*************************************************************************************************
-template< typename T >
-inline bool operator!=( const T& lhs, const UbInfinity& rhs )
+template <typename T>
+inline bool operator!=(const T &lhs, const UbInfinity &rhs)
 {
-   return !rhs.equal( lhs );
+    return !rhs.equal(lhs);
 }
 //*************************************************************************************************
 
@@ -203,8 +201,8 @@ inline bool operator!=( const T& lhs, const UbInfinity& rhs )
 //////////////////////////////////////////////////////////////////////////
 namespace Ub
 {
-   //e.g. double x = UbSystem::inf;  float x = -Ub::inf; 
-   const UbInfinity inf; 
-} 
+// e.g. double x = UbSystem::inf;  float x = -Ub::inf;
+const UbInfinity inf;
+} // namespace Ub
 
-#endif //UB_INFINITY_H
+#endif // UB_INFINITY_H
diff --git a/src/basics/basics/utilities/UbKeys.h b/src/basics/basics/utilities/UbKeys.h
index 29713e75626aab7c8207f8d2dc73b788ea32a9e7..60dfbf56bffcf0569a85ded55a276e489deba322 100644
--- a/src/basics/basics/utilities/UbKeys.h
+++ b/src/basics/basics/utilities/UbKeys.h
@@ -1,28 +1,28 @@
 //=======================================================================================
-// ____          ____    __    ______     __________   __      __       __        __         
-// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |        
-//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |        
-//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |        
-//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____    
-//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|   
-//      \    \  |    |   ________________________________________________________________    
-//       \    \ |    |  |  ______________________________________________________________|   
-//        \    \|    |  |  |         __          __     __     __     ______      _______    
-//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)   
-//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______    
+// ____          ____    __    ______     __________   __      __       __        __
+// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |
+//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |
+//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |
+//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____
+//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|
+//      \    \  |    |   ________________________________________________________________
+//       \    \ |    |  |  ______________________________________________________________|
+//        \    \|    |  |  |         __          __     __     __     ______      _______
+//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)
+//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______
 //           \       |  |  |        |  |_____   |   \_/   |   |  |   |  |_/  /    _____  |
-//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/   
+//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/
 //
-//  This file is part of VirtualFluids. VirtualFluids is free software: you can 
+//  This file is part of VirtualFluids. VirtualFluids is free software: you can
 //  redistribute it and/or modify it under the terms of the GNU General Public
-//  License as published by the Free Software Foundation, either version 3 of 
+//  License as published by the Free Software Foundation, either version 3 of
 //  the License, or (at your option) any later version.
-//  
-//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT 
-//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
-//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License 
+//
+//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT
+//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 //  for more details.
-//  
+//
 //  You should have received a copy of the GNU General Public License along
 //  with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>.
 //
@@ -35,270 +35,274 @@
 
 #include <iostream>
 
-
 #ifdef CAB_RCF
-   #include <3rdParty/rcf/RcfSerializationIncludes.h>
-#endif //CAB_RCF
+#include <3rdParty/rcf/RcfSerializationIncludes.h>
+#endif // CAB_RCF
 
 //////////////////////////////////////////////////////////////////////////
 //!
-//!  \brief 
+//!  \brief
 //!  namespace for global Keys (e.g. for STL-maps)
 //!
 //////////////////////////////////////////////////////////////////////////
 
 namespace UbKeys
 {
-   //nested class
-   template< typename T1, typename T2 = T1 >
-   class Key2 
-   {
-   public:
-      //////////////////////////////////////////////////////////////////////////
-      //Konstruktoren
-      Key2(const T1& t1, const T2& t2) 
-         : t1(t1), t2(t2)
-      { 
-      }
-      /*==========================================================*/
-      Key2& operator=(const Key2& srcKey) 
-      {
-         if(this == &srcKey ) return *this;
-
-         t1    = srcKey.t1;
-         t2    = srcKey.t2;
-
-         return *this;
-      }
-      /*==========================================================*/
-      T1 getT1() const { return t1; }
-      T2 getT2() const { return t2; }
-
-      //////////////////////////////////////////////////////////////////////////
-      //global ueberladene Operatoren
-      friend inline bool operator<(const Key2& lhsKey,const Key2& rhsKey)  
-      {
-         if( lhsKey.t1 < rhsKey.t1 ) return true;
-         if( lhsKey.t1 > rhsKey.t1 ) return false;
-         if( lhsKey.t2 < rhsKey.t2 ) return true;
+// nested class
+template <typename T1, typename T2 = T1>
+class Key2
+{
+public:
+    //////////////////////////////////////////////////////////////////////////
+    // Konstruktoren
+    Key2(const T1 &t1, const T2 &t2) : t1(t1), t2(t2) {}
+    /*==========================================================*/
+    Key2 &operator=(const Key2 &srcKey)
+    {
+        if (this == &srcKey)
+            return *this;
 
-         return false;
-      }
-      /*==========================================================*/
-      friend inline bool operator==(const Key2& lhsKey, const Key2& rhsKey)  
-      {
-         if(lhsKey.t1 != rhsKey.t1 ) return false;
-         if(lhsKey.t2 != rhsKey.t2 ) return false;
+        t1 = srcKey.t1;
+        t2 = srcKey.t2;
 
-         return true;
-      }
-      //ueberladene Operatoren
-      friend inline bool operator!=(const Key2& lhsKey, const Key2& rhsKey)  
-      {
-         return !(lhsKey == rhsKey); 
-      }
-      //ueberladene Operatoren
-      /*==========================================================*/
-      friend inline std::ostream& operator << (std::ostream& os, const Key2& key) 
-      {
-         os<<"Key2<"<<typeid(T1).name()<<","<<typeid(T2).name()<<">,("<<key.t1<<","<<key.t2<<")";
-         return os;
-      }
-      /*==========================================================*/
-      #ifdef CAB_RCF
-	      template<class Archive>
-	      void serialize(Archive & ar, const unsigned int version)
-	      {
-		      ar & t1;
-		      ar & t2;
-	      }
-      #endif //CAB_RCF
+        return *this;
+    }
+    /*==========================================================*/
+    T1 getT1() const { return t1; }
+    T2 getT2() const { return t2; }
 
-   private:
-      //////////////////////////////////////////////////////////////////////////
-      //private Member
-      T1 t1;
-      T2 t2;
+    //////////////////////////////////////////////////////////////////////////
+    // global ueberladene Operatoren
+    friend inline bool operator<(const Key2 &lhsKey, const Key2 &rhsKey)
+    {
+        if (lhsKey.t1 < rhsKey.t1)
+            return true;
+        if (lhsKey.t1 > rhsKey.t1)
+            return false;
+        if (lhsKey.t2 < rhsKey.t2)
+            return true;
 
-   };
+        return false;
+    }
+    /*==========================================================*/
+    friend inline bool operator==(const Key2 &lhsKey, const Key2 &rhsKey)
+    {
+        if (lhsKey.t1 != rhsKey.t1)
+            return false;
+        if (lhsKey.t2 != rhsKey.t2)
+            return false;
 
-   //////////////////////////////////////////////////////////////////////////
-   //
-   //////////////////////////////////////////////////////////////////////////
-   template< typename T1, typename T2 = T1, typename T3 = T1 >
-   class Key3 
-   {
-   public:
-      //////////////////////////////////////////////////////////////////////////
-      //Konstruktoren
-      Key3() : t1(0), t2(0), t3(0)
-      {
+        return true;
+    }
+    // ueberladene Operatoren
+    friend inline bool operator!=(const Key2 &lhsKey, const Key2 &rhsKey) { return !(lhsKey == rhsKey); }
+    // ueberladene Operatoren
+    /*==========================================================*/
+    friend inline std::ostream &operator<<(std::ostream &os, const Key2 &key)
+    {
+        os << "Key2<" << typeid(T1).name() << "," << typeid(T2).name() << ">,(" << key.t1 << "," << key.t2 << ")";
+        return os;
+    }
+/*==========================================================*/
+#ifdef CAB_RCF
+    template <class Archive>
+    void serialize(Archive &ar, const unsigned int version)
+    {
+        ar &t1;
+        ar &t2;
+    }
+#endif // CAB_RCF
 
-      }
-      Key3(const T1& t1, const T2& t2, const T3& t3) 
-         : t1(t1), t2(t2), t3(t3)
-      { 
-      }
-      /*==========================================================*/
-      T1 getT1() const { return t1; }
-      T2 getT2() const { return t2; }
-      T3 getT3() const { return t3; }
-      /*==========================================================*/
-      Key3& operator=(const Key3& srcKey) 
-      {
-         if(this == &srcKey ) return *this;
+private:
+    //////////////////////////////////////////////////////////////////////////
+    // private Member
+    T1 t1;
+    T2 t2;
+};
 
-         t1    = srcKey.t1;
-         t2    = srcKey.t2;
-         t3    = srcKey.t3;
+//////////////////////////////////////////////////////////////////////////
+//
+//////////////////////////////////////////////////////////////////////////
+template <typename T1, typename T2 = T1, typename T3 = T1>
+class Key3
+{
+public:
+    //////////////////////////////////////////////////////////////////////////
+    // Konstruktoren
+    Key3() : t1(0), t2(0), t3(0) {}
+    Key3(const T1 &t1, const T2 &t2, const T3 &t3) : t1(t1), t2(t2), t3(t3) {}
+    /*==========================================================*/
+    T1 getT1() const { return t1; }
+    T2 getT2() const { return t2; }
+    T3 getT3() const { return t3; }
+    /*==========================================================*/
+    Key3 &operator=(const Key3 &srcKey)
+    {
+        if (this == &srcKey)
+            return *this;
 
-         return *this;
-      }
+        t1 = srcKey.t1;
+        t2 = srcKey.t2;
+        t3 = srcKey.t3;
 
-      //////////////////////////////////////////////////////////////////////////
-      //global ueberladene Operatoren
-      friend inline bool operator<(const Key3& lhsKey,const Key3& rhsKey)  
-      {
-         if( lhsKey.t1 < rhsKey.t1 ) return true;
-         if( lhsKey.t1 > rhsKey.t1 ) return false;
-         if( lhsKey.t2 < rhsKey.t2 ) return true;
-         if( lhsKey.t2 > rhsKey.t2 ) return false;
-         if( lhsKey.t3 < rhsKey.t3 ) return true;
+        return *this;
+    }
 
-         return false;
-      }
-      /*==========================================================*/
-      friend inline bool operator==(const Key3& lhsKey,const Key3& rhsKey)  
-      {
-         if(lhsKey.t1 != rhsKey.t1 ) return false;
-         if(lhsKey.t2 != rhsKey.t2 ) return false;
-         if(lhsKey.t3 != rhsKey.t3 ) return false;
+    //////////////////////////////////////////////////////////////////////////
+    // global ueberladene Operatoren
+    friend inline bool operator<(const Key3 &lhsKey, const Key3 &rhsKey)
+    {
+        if (lhsKey.t1 < rhsKey.t1)
+            return true;
+        if (lhsKey.t1 > rhsKey.t1)
+            return false;
+        if (lhsKey.t2 < rhsKey.t2)
+            return true;
+        if (lhsKey.t2 > rhsKey.t2)
+            return false;
+        if (lhsKey.t3 < rhsKey.t3)
+            return true;
 
-         return true;
-      }
-      /*==========================================================*/
-      //ueberladene Operatoren
-      friend inline bool operator!=(const Key3& lhsKey, const Key3& rhsKey) 
-      {
-         return !(lhsKey == rhsKey); 
-      }
+        return false;
+    }
+    /*==========================================================*/
+    friend inline bool operator==(const Key3 &lhsKey, const Key3 &rhsKey)
+    {
+        if (lhsKey.t1 != rhsKey.t1)
+            return false;
+        if (lhsKey.t2 != rhsKey.t2)
+            return false;
+        if (lhsKey.t3 != rhsKey.t3)
+            return false;
 
-      //ueberladene Operatoren
-      /*==========================================================*/
-      friend inline std::ostream& operator << (std::ostream& os, const Key3& key) 
-      {
-         os<<"Key3<"<<typeid(T1).name()<<","<<typeid(T2).name()<<","<<typeid(T3).name();
-         os<<">,("<<key.t1<<","<<key.t2<<","<<key.t3<<")";
-         return os;
-      }
-      /*==========================================================*/
-      #ifdef CAB_RCF
-	      template<class Archive>
-	      void serialize(Archive & ar, const unsigned int version)
-	      {
-		      ar & t1;
-		      ar & t2;
-            ar & t3;
-         }
-      #endif //CAB_RCF
+        return true;
+    }
+    /*==========================================================*/
+    // ueberladene Operatoren
+    friend inline bool operator!=(const Key3 &lhsKey, const Key3 &rhsKey) { return !(lhsKey == rhsKey); }
 
-   private:
-      //////////////////////////////////////////////////////////////////////////
-      //private Member
-      T1 t1;
-      T2 t2;
-      T3 t3;
-   };
+    // ueberladene Operatoren
+    /*==========================================================*/
+    friend inline std::ostream &operator<<(std::ostream &os, const Key3 &key)
+    {
+        os << "Key3<" << typeid(T1).name() << "," << typeid(T2).name() << "," << typeid(T3).name();
+        os << ">,(" << key.t1 << "," << key.t2 << "," << key.t3 << ")";
+        return os;
+    }
+/*==========================================================*/
+#ifdef CAB_RCF
+    template <class Archive>
+    void serialize(Archive &ar, const unsigned int version)
+    {
+        ar &t1;
+        ar &t2;
+        ar &t3;
+    }
+#endif // CAB_RCF
 
-   //////////////////////////////////////////////////////////////////////////
-   //
-   //////////////////////////////////////////////////////////////////////////
-   template< typename T1, typename T2 = T1, typename T3 = T1, typename T4 = T1 >
-   class Key4 
-   {
-   public:
-      //////////////////////////////////////////////////////////////////////////
-      //Konstruktoren
-      Key4(const T1& t1, const T2& t2, const T3& t3, const T4& t4) 
-         : t1(t1), t2(t2), t3(t3), t4(t4)
-      { 
-      }
-      /*==========================================================*/
-      T1 getT1() const { return t1; }
-      T2 getT2() const { return t2; }
-      T3 getT3() const { return t3; }
-      T4 getT4() const { return t4; }
-      /*==========================================================*/
-      Key4& operator=(const Key4& srcKey) 
-      {
-         if(this == &srcKey ) return *this;
+private:
+    //////////////////////////////////////////////////////////////////////////
+    // private Member
+    T1 t1;
+    T2 t2;
+    T3 t3;
+};
 
-         t1    = srcKey.t1;
-         t2    = srcKey.t2;
-         t3    = srcKey.t3;
-         t4    = srcKey.t4;
+//////////////////////////////////////////////////////////////////////////
+//
+//////////////////////////////////////////////////////////////////////////
+template <typename T1, typename T2 = T1, typename T3 = T1, typename T4 = T1>
+class Key4
+{
+public:
+    //////////////////////////////////////////////////////////////////////////
+    // Konstruktoren
+    Key4(const T1 &t1, const T2 &t2, const T3 &t3, const T4 &t4) : t1(t1), t2(t2), t3(t3), t4(t4) {}
+    /*==========================================================*/
+    T1 getT1() const { return t1; }
+    T2 getT2() const { return t2; }
+    T3 getT3() const { return t3; }
+    T4 getT4() const { return t4; }
+    /*==========================================================*/
+    Key4 &operator=(const Key4 &srcKey)
+    {
+        if (this == &srcKey)
+            return *this;
 
-         return *this;
-      }
-      //////////////////////////////////////////////////////////////////////////
-      //global ueberladene Operatoren
-      friend inline bool operator<(const Key4& lhsKey,const Key4& rhsKey)  
-      {
-         if( lhsKey.t1 < rhsKey.t1 ) return true;
-         if( lhsKey.t1 > rhsKey.t1 ) return false;
-         if( lhsKey.t2 < rhsKey.t2 ) return true;
-         if( lhsKey.t2 > rhsKey.t2 ) return false;
-         if( lhsKey.t3 < rhsKey.t3 ) return true;
-         if( lhsKey.t3 > rhsKey.t3 ) return false;
-         if( lhsKey.t4 < rhsKey.t4 ) return true;
+        t1 = srcKey.t1;
+        t2 = srcKey.t2;
+        t3 = srcKey.t3;
+        t4 = srcKey.t4;
 
-         return false;
-      }
-      /*==========================================================*/
-      friend inline bool operator==(const Key4& lhsKey,const Key4& rhsKey)  
-      {
-         if(lhsKey.t1 != rhsKey.t1 ) return false;
-         if(lhsKey.t2 != rhsKey.t2 ) return false;
-         if(lhsKey.t3 != rhsKey.t3 ) return false;
-         if(lhsKey.t4 != rhsKey.t4 ) return false;
+        return *this;
+    }
+    //////////////////////////////////////////////////////////////////////////
+    // global ueberladene Operatoren
+    friend inline bool operator<(const Key4 &lhsKey, const Key4 &rhsKey)
+    {
+        if (lhsKey.t1 < rhsKey.t1)
+            return true;
+        if (lhsKey.t1 > rhsKey.t1)
+            return false;
+        if (lhsKey.t2 < rhsKey.t2)
+            return true;
+        if (lhsKey.t2 > rhsKey.t2)
+            return false;
+        if (lhsKey.t3 < rhsKey.t3)
+            return true;
+        if (lhsKey.t3 > rhsKey.t3)
+            return false;
+        if (lhsKey.t4 < rhsKey.t4)
+            return true;
 
-         return true;
-      }
+        return false;
+    }
+    /*==========================================================*/
+    friend inline bool operator==(const Key4 &lhsKey, const Key4 &rhsKey)
+    {
+        if (lhsKey.t1 != rhsKey.t1)
+            return false;
+        if (lhsKey.t2 != rhsKey.t2)
+            return false;
+        if (lhsKey.t3 != rhsKey.t3)
+            return false;
+        if (lhsKey.t4 != rhsKey.t4)
+            return false;
 
-      //ueberladene Operatoren
-      friend inline bool operator!=(const Key4& lhsKey, const Key4& rhsKey) 
-      {
-         return !(lhsKey == rhsKey); 
-      }
-      //ueberladene Operatoren
-      /*==========================================================*/
-      friend inline std::ostream& operator << (std::ostream& os, const Key4& key) 
-      {
-         os<<"Key4<"<<typeid(T1).name()<<","<<typeid(T2).name()<<","<<typeid(T3).name()<<","<<typeid(T4).name();
-         os<<">,("<<key.t1<<","<<key.t2<<","<<key.t3<<","<<key.t4<<")";
-         return os;
-      }
-      /*==========================================================*/
-      #ifdef CAB_RCF
-	      template<class Archive>
-	      void serialize(Archive & ar, const unsigned int version)
-	      {
-		      ar & t1;
-		      ar & t2;
-            ar & t3;
-            ar & t4;
-         }
-      #endif //CAB_RCF
+        return true;
+    }
 
-   private:
-      //////////////////////////////////////////////////////////////////////////
-      //private Member
-      T1 t1;
-      T2 t2;
-      T3 t3;
-      T4 t4;
+    // ueberladene Operatoren
+    friend inline bool operator!=(const Key4 &lhsKey, const Key4 &rhsKey) { return !(lhsKey == rhsKey); }
+    // ueberladene Operatoren
+    /*==========================================================*/
+    friend inline std::ostream &operator<<(std::ostream &os, const Key4 &key)
+    {
+        os << "Key4<" << typeid(T1).name() << "," << typeid(T2).name() << "," << typeid(T3).name() << ","
+           << typeid(T4).name();
+        os << ">,(" << key.t1 << "," << key.t2 << "," << key.t3 << "," << key.t4 << ")";
+        return os;
+    }
+/*==========================================================*/
+#ifdef CAB_RCF
+    template <class Archive>
+    void serialize(Archive &ar, const unsigned int version)
+    {
+        ar &t1;
+        ar &t2;
+        ar &t3;
+        ar &t4;
+    }
+#endif // CAB_RCF
 
-   };
-}
+private:
+    //////////////////////////////////////////////////////////////////////////
+    // private Member
+    T1 t1;
+    T2 t2;
+    T3 t3;
+    T4 t4;
+};
+} // namespace UbKeys
 
-#endif //UBKEYS_H
+#endif // UBKEYS_H
diff --git a/src/basics/basics/utilities/UbLimits.h b/src/basics/basics/utilities/UbLimits.h
index 282ea2c74a151265957018dc805e4f1c369a86b6..385f1f7e9d1f0cde2f05c2fac6c25f9333ea6293 100644
--- a/src/basics/basics/utilities/UbLimits.h
+++ b/src/basics/basics/utilities/UbLimits.h
@@ -1,28 +1,28 @@
 //=======================================================================================
-// ____          ____    __    ______     __________   __      __       __        __         
-// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |        
-//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |        
-//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |        
-//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____    
-//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|   
-//      \    \  |    |   ________________________________________________________________    
-//       \    \ |    |  |  ______________________________________________________________|   
-//        \    \|    |  |  |         __          __     __     __     ______      _______    
-//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)   
-//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______    
+// ____          ____    __    ______     __________   __      __       __        __
+// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |
+//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |
+//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |
+//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____
+//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|
+//      \    \  |    |   ________________________________________________________________
+//       \    \ |    |  |  ______________________________________________________________|
+//        \    \|    |  |  |         __          __     __     __     ______      _______
+//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)
+//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______
 //           \       |  |  |        |  |_____   |   \_/   |   |  |   |  |_/  /    _____  |
-//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/   
+//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/
 //
-//  This file is part of VirtualFluids. VirtualFluids is free software: you can 
+//  This file is part of VirtualFluids. VirtualFluids is free software: you can
 //  redistribute it and/or modify it under the terms of the GNU General Public
-//  License as published by the Free Software Foundation, either version 3 of 
+//  License as published by the Free Software Foundation, either version 3 of
 //  the License, or (at your option) any later version.
-//  
-//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT 
-//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
-//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License 
+//
+//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT
+//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 //  for more details.
-//  
+//
 //  You should have received a copy of the GNU General Public License along
 //  with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>.
 //
@@ -33,7 +33,6 @@
 #ifndef UB_LIMITS_H
 #define UB_LIMITS_H
 
-
 //*************************************************************************************************
 // Includes
 //*************************************************************************************************
@@ -43,123 +42,111 @@
 //////////////////////////////////////////////////////////////////////////
 //  CLASS DEFINITION
 //////////////////////////////////////////////////////////////////////////
-template< typename T >
-struct UbLimits  {};
+template <typename T>
+struct UbLimits {
+};
 
 //////////////////////////////////////////////////////////////////////////
 //  SPECIALIZATIONS
 //////////////////////////////////////////////////////////////////////////
-template<>
-struct UbLimits<unsigned char>
-{
-   //return the largest possible positive unsigned char value
-   static inline unsigned char inf() { return std::numeric_limits<unsigned char>::max(); }
+template <>
+struct UbLimits<unsigned char> {
+    // return the largest possible positive unsigned char value
+    static inline unsigned char inf() { return std::numeric_limits<unsigned char>::max(); }
 };
 //*************************************************************************************************
-template<>
-struct UbLimits<char>
-{
-   //return the largest possible positive char value. */
-   static inline char inf () { return std::numeric_limits<char>::max(); }
-   //return the largest possible negative char value
-   static inline char ninf() { return std::numeric_limits<char>::min(); }
+template <>
+struct UbLimits<char> {
+    // return the largest possible positive char value. */
+    static inline char inf() { return std::numeric_limits<char>::max(); }
+    // return the largest possible negative char value
+    static inline char ninf() { return std::numeric_limits<char>::min(); }
 };
 //*************************************************************************************************
-template<>
-struct UbLimits<signed char>
-{
-   //return the largest possible positive signed char value
-   static inline signed char inf () { return std::numeric_limits<signed char>::max(); }
+template <>
+struct UbLimits<signed char> {
+    // return the largest possible positive signed char value
+    static inline signed char inf() { return std::numeric_limits<signed char>::max(); }
 
-   //return The largest possible negative signed char value
-   static inline signed char ninf() { return std::numeric_limits<signed char>::min(); }
+    // return The largest possible negative signed char value
+    static inline signed char ninf() { return std::numeric_limits<signed char>::min(); }
 };
 //*************************************************************************************************
-template<>
-struct UbLimits<wchar_t>
-{
-   //return The largest possible positive wchar_t value
-   static inline wchar_t inf () { return std::numeric_limits<wchar_t>::max(); }
-   //return The largest possible negative wchar_t value
-   static inline wchar_t ninf() { return std::numeric_limits<wchar_t>::min(); }
+template <>
+struct UbLimits<wchar_t> {
+    // return The largest possible positive wchar_t value
+    static inline wchar_t inf() { return std::numeric_limits<wchar_t>::max(); }
+    // return The largest possible negative wchar_t value
+    static inline wchar_t ninf() { return std::numeric_limits<wchar_t>::min(); }
 };
 //*************************************************************************************************
-template<>
-struct UbLimits<unsigned short>
-{
-   //return The largest possible positive unsigned short value
-   static inline unsigned short inf() { return std::numeric_limits<unsigned short>::max(); }
+template <>
+struct UbLimits<unsigned short> {
+    // return The largest possible positive unsigned short value
+    static inline unsigned short inf() { return std::numeric_limits<unsigned short>::max(); }
 };
 //*************************************************************************************************
-template<>
-struct UbLimits<short>
-{
-   //return The largest possible positive short value
-   static inline short inf () { return std::numeric_limits<short>::max(); }
-   //return The largest possible negative short value
-   static inline short ninf() { return std::numeric_limits<short>::min(); }
+template <>
+struct UbLimits<short> {
+    // return The largest possible positive short value
+    static inline short inf() { return std::numeric_limits<short>::max(); }
+    // return The largest possible negative short value
+    static inline short ninf() { return std::numeric_limits<short>::min(); }
 };
 //*************************************************************************************************
-template<>
-struct UbLimits<unsigned int>
-{
-   //return The largest possible positive unsigned int value
-   static inline unsigned int inf() { return std::numeric_limits<unsigned int>::max(); }
+template <>
+struct UbLimits<unsigned int> {
+    // return The largest possible positive unsigned int value
+    static inline unsigned int inf() { return std::numeric_limits<unsigned int>::max(); }
 };
 //*************************************************************************************************
-template<>
-struct UbLimits<int>
-{
-   //return The largest possible positive int value
-   static inline int inf () { return std::numeric_limits<int>::max(); }
+template <>
+struct UbLimits<int> {
+    // return The largest possible positive int value
+    static inline int inf() { return std::numeric_limits<int>::max(); }
 
-   //return The largest possible negative int value
-   static inline int ninf() { return std::numeric_limits<int>::min(); }
+    // return The largest possible negative int value
+    static inline int ninf() { return std::numeric_limits<int>::min(); }
 };
 //*************************************************************************************************
-template<>
-struct UbLimits<unsigned long>
-{
-   //return The largest possible positive unsigned long value
-   static inline unsigned long inf() { return std::numeric_limits<unsigned long>::max(); }
+template <>
+struct UbLimits<unsigned long> {
+    // return The largest possible positive unsigned long value
+    static inline unsigned long inf() { return std::numeric_limits<unsigned long>::max(); }
 };
 //*************************************************************************************************
-template<>
-struct UbLimits<long>
-{
-   //return The largest possible positive long value
-   static inline long inf () { return std::numeric_limits<long>::max(); }
+template <>
+struct UbLimits<long> {
+    // return The largest possible positive long value
+    static inline long inf() { return std::numeric_limits<long>::max(); }
 
-   //return The largest possible negative long value
-   static inline long ninf() { return std::numeric_limits<long>::min(); }
+    // return The largest possible negative long value
+    static inline long ninf() { return std::numeric_limits<long>::min(); }
 };
 //*************************************************************************************************
-template<>
-struct UbLimits<float>
-{
-   //return The largest possible positive float value
-   static inline float inf () { return  std::numeric_limits<float>::max(); }
+template <>
+struct UbLimits<float> {
+    // return The largest possible positive float value
+    static inline float inf() { return std::numeric_limits<float>::max(); }
 
-   //return The largest possible negative float value
-   static inline float ninf() { return -std::numeric_limits<float>::max(); }
+    // return The largest possible negative float value
+    static inline float ninf() { return -std::numeric_limits<float>::max(); }
 };
 //*************************************************************************************************
-template<>
-struct UbLimits<double>
-{
-   //return The largest possible positive double value
-   static inline double inf () { return  std::numeric_limits<double>::max(); }
-   //return The largest possible negative double value
-   static inline double ninf() { return -std::numeric_limits<double>::max(); }
+template <>
+struct UbLimits<double> {
+    // return The largest possible positive double value
+    static inline double inf() { return std::numeric_limits<double>::max(); }
+    // return The largest possible negative double value
+    static inline double ninf() { return -std::numeric_limits<double>::max(); }
 };
 //*************************************************************************************************
-template<>
-struct UbLimits<long double>
-{
-   //return The largest possible positive long double value
-   static inline long double inf () { return  std::numeric_limits<long double>::max(); }
-   //return The largest possible negative long double value
-   static inline long double ninf() { return -std::numeric_limits<long double>::max(); }
+template <>
+struct UbLimits<long double> {
+    // return The largest possible positive long double value
+    static inline long double inf() { return std::numeric_limits<long double>::max(); }
+    // return The largest possible negative long double value
+    static inline long double ninf() { return -std::numeric_limits<long double>::max(); }
 };
 
-#endif //UB_LIMITS_H
+#endif // UB_LIMITS_H
diff --git a/src/basics/basics/utilities/UbLogger.cpp b/src/basics/basics/utilities/UbLogger.cpp
index 29834020f0fdd85ffc4603a0202e4748582a3e1e..b8c28cd0d4ebeadb436965a7f12f39d6393202e4 100644
--- a/src/basics/basics/utilities/UbLogger.cpp
+++ b/src/basics/basics/utilities/UbLogger.cpp
@@ -1,28 +1,28 @@
 //=======================================================================================
-// ____          ____    __    ______     __________   __      __       __        __         
-// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |        
-//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |        
-//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |        
-//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____    
-//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|   
-//      \    \  |    |   ________________________________________________________________    
-//       \    \ |    |  |  ______________________________________________________________|   
-//        \    \|    |  |  |         __          __     __     __     ______      _______    
-//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)   
-//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______    
+// ____          ____    __    ______     __________   __      __       __        __
+// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |
+//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |
+//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |
+//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____
+//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|
+//      \    \  |    |   ________________________________________________________________
+//       \    \ |    |  |  ______________________________________________________________|
+//        \    \|    |  |  |         __          __     __     __     ______      _______
+//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)
+//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______
 //           \       |  |  |        |  |_____   |   \_/   |   |  |   |  |_/  /    _____  |
-//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/   
+//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/
 //
-//  This file is part of VirtualFluids. VirtualFluids is free software: you can 
+//  This file is part of VirtualFluids. VirtualFluids is free software: you can
 //  redistribute it and/or modify it under the terms of the GNU General Public
-//  License as published by the Free Software Foundation, either version 3 of 
+//  License as published by the Free Software Foundation, either version 3 of
 //  the License, or (at your option) any later version.
-//  
-//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT 
-//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
-//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License 
+//
+//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT
+//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 //  for more details.
-//  
+//
 //  You should have received a copy of the GNU General Public License along
 //  with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>.
 //
@@ -37,4 +37,3 @@
 boost::mutex Output2Stream::mtx;
 
 #endif // CAB_BOOST
-
diff --git a/src/basics/basics/utilities/UbLogger.h b/src/basics/basics/utilities/UbLogger.h
index e30157cb56c8979f2b3fffb27129008626c66fba..d350a763721b4b5fc1c2736fa56e2fff66a3eee0 100644
--- a/src/basics/basics/utilities/UbLogger.h
+++ b/src/basics/basics/utilities/UbLogger.h
@@ -1,28 +1,28 @@
 //=======================================================================================
-// ____          ____    __    ______     __________   __      __       __        __         
-// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |        
-//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |        
-//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |        
-//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____    
-//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|   
-//      \    \  |    |   ________________________________________________________________    
-//       \    \ |    |  |  ______________________________________________________________|   
-//        \    \|    |  |  |         __          __     __     __     ______      _______    
-//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)   
-//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______    
+// ____          ____    __    ______     __________   __      __       __        __
+// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |
+//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |
+//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |
+//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____
+//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|
+//      \    \  |    |   ________________________________________________________________
+//       \    \ |    |  |  ______________________________________________________________|
+//        \    \|    |  |  |         __          __     __     __     ______      _______
+//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)
+//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______
 //           \       |  |  |        |  |_____   |   \_/   |   |  |   |  |_/  /    _____  |
-//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/   
+//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/
 //
-//  This file is part of VirtualFluids. VirtualFluids is free software: you can 
+//  This file is part of VirtualFluids. VirtualFluids is free software: you can
 //  redistribute it and/or modify it under the terms of the GNU General Public
-//  License as published by the Free Software Foundation, either version 3 of 
+//  License as published by the Free Software Foundation, either version 3 of
 //  the License, or (at your option) any later version.
-//  
-//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT 
-//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
-//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License 
+//
+//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT
+//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 //  for more details.
-//  
+//
 //  You should have received a copy of the GNU General Public License along
 //  with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>.
 //
@@ -33,53 +33,52 @@
 #ifndef UBLOGGER_H
 #define UBLOGGER_H
 
-#include <sstream>
-#include <string>
-#include <iostream>
 #include <fstream>
 #include <iomanip>
+#include <iostream>
+#include <sstream>
+#include <string>
 
-#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__)  || defined(_WIN64)  || defined(__WIN64__)
-   #include <windows.h>
+#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(_WIN64) || defined(__WIN64__)
+#include <windows.h>
 #else
-   #include <sys/time.h>
+#include <sys/time.h>
 #endif
 
 #if defined(CAB_BOOST) && !defined(NO_THREADSAFE_LOGGING)
-   #include <boost/thread.hpp>
+#include <boost/thread.hpp>
 #endif // CAB_BOOST
 
-
-
-enum LogLevel {logERROR, logWARNING, logINFO, logDEBUG, logDEBUG1, logDEBUG2, logDEBUG3, logDEBUG4, logDEBUG5};
+enum LogLevel { logERROR, logWARNING, logINFO, logDEBUG, logDEBUG1, logDEBUG2, logDEBUG3, logDEBUG4, logDEBUG5 };
 
 //////////////////////////////////////////////////////////////////////////
 // template <typename OutputPolicy> class Log  - declaration
 //////////////////////////////////////////////////////////////////////////
 //////////////////////////////////////////////////////////////////////////
 //!
-//! \brief 
+//! \brief
 //! C++ Logger
 //! \details Functionality:
 //! Per logentry an object of type UbLogger is generated, the log string is passed to this object and
-//! upon destruction of the object the string is written to a file or the screen depending on 
+//! upon destruction of the object the string is written to a file or the screen depending on
 //! the policy (=template paramter). Multiple log level are supported.
 //!
 //! helpermakro:  UBLOG
 //!
-//! Example 1: 
+//! Example 1:
 //! \code
-//! UBLOG(logINFO) << "Klasse::foo entered"; //endl is not required 
+//! UBLOG(logINFO) << "Klasse::foo entered"; //endl is not required
 //! \endcode
 //!
-//! Example 2: 
+//! Example 2:
 //! \code
 //! try
 //! {
 //!    UbLog::reportingLevel() = UbLog::logLevelFromString("DEBUG3");
 //!    //UbLog::output_policy::setStream(&std::cerr); //<- clog is stdandard
-//!    UbLog::output_policy::setStream("c:/temp/out.txt");  //you can not open these -> error message -> log is output in cerr
-//! 
+//!    UbLog::output_policy::setStream("c:/temp/out.txt");  //you can not open these -> error message -> log is output
+//!    in cerr
+//!
 //!    int count = 3;
 //!    UBLOG(logINFO, "A loop with " << count << " iterations");
 //!    for (int i = 0; i != count; ++i)
@@ -100,7 +99,7 @@ enum LogLevel {logERROR, logWARNING, logINFO, logDEBUG, logDEBUG1, logDEBUG2, lo
 //!    UBLOG(logERROR) << e.what();
 //! }
 //! \endcode
-//! Idee based on: 
+//! Idee based on:
 //! Paper by Dr. Dobbs Portal,
 //! September 05, 2007,
 //! Logging In C++
@@ -108,20 +107,22 @@ enum LogLevel {logERROR, logWARNING, logINFO, logDEBUG, logDEBUG1, logDEBUG2, lo
 //////////////////////////////////////////////////////////////////////////
 template <typename OutputPolicy>
 class UbLogger
-{   
+{
 public:
-   using output_policy = OutputPolicy;
+    using output_policy = OutputPolicy;
+
 public:
     UbLogger();
     virtual ~UbLogger();
-    std::ostringstream& get(const LogLevel& level = logINFO);
+    std::ostringstream &get(const LogLevel &level = logINFO);
+
 public:
-   //static, weil man so spaeter die ObjErstellunge ersparen kann,
-   //falls level kleiner als Level
-   static LogLevel&   reportingLevel();
-    
-    static std::string logLevelToString(const LogLevel& level);
-    static LogLevel    logLevelFromString(const std::string& level);
+    // static, weil man so spaeter die ObjErstellunge ersparen kann,
+    // falls level kleiner als Level
+    static LogLevel &reportingLevel();
+
+    static std::string logLevelToString(const LogLevel &level);
+    static LogLevel logLevelFromString(const std::string &level);
 
     static std::string logTimeString();
 
@@ -129,27 +130,26 @@ protected:
     std::ostringstream os;
 
 private:
-    UbLogger(const UbLogger&);
-    UbLogger& operator =(const UbLogger&);
+    UbLogger(const UbLogger &);
+    UbLogger &operator=(const UbLogger &);
 };
 
 //////////////////////////////////////////////////////////////////////////
 // template <typename OutputPolicy> class Log  - implementation
 //////////////////////////////////////////////////////////////////////////
 template <typename OutputPolicy>
-UbLogger<OutputPolicy>::UbLogger()
-= default;
+UbLogger<OutputPolicy>::UbLogger() = default;
 /*==========================================================*/
 template <typename OutputPolicy>
-std::ostringstream& UbLogger<OutputPolicy>::get(const LogLevel& level) 
+std::ostringstream &UbLogger<OutputPolicy>::get(const LogLevel &level)
 {
-   os << logTimeString() << " " << std::setw(6) 
+    os << logTimeString() << " " << std::setw(6)
 #if defined(CAB_BOOST) && !defined(NO_MT_LOGGING)
-      <<boost::this_thread::get_id() << " "
+       << boost::this_thread::get_id() << " "
 #endif
-      << std::setw(8) << std::left << UbLogger<OutputPolicy>::logLevelToString(level) << ": "
-      << std::string(level > logDEBUG ? 3*(level - logDEBUG) : 0, ' '); //<baumartiger output :D
-   
+       << std::setw(8) << std::left << UbLogger<OutputPolicy>::logLevelToString(level) << ": "
+       << std::string(level > logDEBUG ? 3 * (level - logDEBUG) : 0, ' '); //<baumartiger output :D
+
     return os;
 }
 /*==========================================================*/
@@ -161,72 +161,82 @@ UbLogger<OutputPolicy>::~UbLogger()
 }
 /*==========================================================*/
 template <typename OutputPolicy>
-LogLevel& UbLogger<OutputPolicy>::reportingLevel()
+LogLevel &UbLogger<OutputPolicy>::reportingLevel()
 {
     static LogLevel reportLevel = logINFO;
     return reportLevel;
 }
 /*==========================================================*/
 template <typename OutputPolicy>
-std::string UbLogger<OutputPolicy>::logLevelToString(const LogLevel& level)
+std::string UbLogger<OutputPolicy>::logLevelToString(const LogLevel &level)
 {
-   static std::string const buffer[] = {"ERROR", "WARNING", "INFO", "DEBUG", "DEBUG1", "DEBUG2", "DEBUG3", "DEBUG4", "DEBUG5"};
-   return buffer[level];
+    static std::string const buffer[] = { "ERROR",  "WARNING", "INFO",   "DEBUG", "DEBUG1",
+                                          "DEBUG2", "DEBUG3",  "DEBUG4", "DEBUG5" };
+    return buffer[level];
 }
 /*==========================================================*/
 template <typename OutputPolicy>
-LogLevel UbLogger<OutputPolicy>::logLevelFromString(const std::string& level)
+LogLevel UbLogger<OutputPolicy>::logLevelFromString(const std::string &level)
 {
-   if (level == "DEBUG5" ) return logDEBUG5;
-   if (level == "DEBUG4" ) return logDEBUG4;
-   if (level == "DEBUG3" ) return logDEBUG3;
-   if (level == "DEBUG2" ) return logDEBUG2;
-   if (level == "DEBUG1" ) return logDEBUG1;
-   if (level == "DEBUG"  ) return logDEBUG;
-   if (level == "INFO"   ) return logINFO;
-   if (level == "WARNING") return logWARNING;
-   if (level == "ERROR"  ) return logERROR;
-       
-   UbLogger<OutputPolicy>().get(logWARNING) << "UbLogger<OutputPolicy>::logLevelFromString(level) - unknown logging level '" << level << "'. Using INFO level as default.";
-   return logINFO;
+    if (level == "DEBUG5")
+        return logDEBUG5;
+    if (level == "DEBUG4")
+        return logDEBUG4;
+    if (level == "DEBUG3")
+        return logDEBUG3;
+    if (level == "DEBUG2")
+        return logDEBUG2;
+    if (level == "DEBUG1")
+        return logDEBUG1;
+    if (level == "DEBUG")
+        return logDEBUG;
+    if (level == "INFO")
+        return logINFO;
+    if (level == "WARNING")
+        return logWARNING;
+    if (level == "ERROR")
+        return logERROR;
+
+    UbLogger<OutputPolicy>().get(logWARNING)
+        << "UbLogger<OutputPolicy>::logLevelFromString(level) - unknown logging level '" << level
+        << "'. Using INFO level as default.";
+    return logINFO;
 }
 
 //////////////////////////////////////////////////////////////////////////
 // logTimeString
 //////////////////////////////////////////////////////////////////////////
-#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__)  || defined(_WIN64)  || defined(__WIN64__)
+#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(_WIN64) || defined(__WIN64__)
 template <typename OutputPolicy>
 inline std::string UbLogger<OutputPolicy>::logTimeString()
 {
-   const int MAX_LEN = 200;
-   char buffer[MAX_LEN];
-   if (GetTimeFormatA(LOCALE_USER_DEFAULT, 0, 0, "HH':'mm':'ss", buffer, MAX_LEN) == 0 )
-   {
-      return "Error in std::string UbLogger<OutputPolicy>::logTimeString()";
-   }
+    const int MAX_LEN = 200;
+    char buffer[MAX_LEN];
+    if (GetTimeFormatA(LOCALE_USER_DEFAULT, 0, 0, "HH':'mm':'ss", buffer, MAX_LEN) == 0) {
+        return "Error in std::string UbLogger<OutputPolicy>::logTimeString()";
+    }
 
-   char result[100] = {0};
-   static DWORD first = GetTickCount();
-   std::sprintf(result, "%s.%03ld", buffer, (long)(GetTickCount() - first) % 1000); 
-   return result;
+    char result[100]   = { 0 };
+    static DWORD first = GetTickCount();
+    std::sprintf(result, "%s.%03ld", buffer, (long)(GetTickCount() - first) % 1000);
+    return result;
 }
 #else
 template <typename OutputPolicy>
 inline std::string UbLogger<OutputPolicy>::logTimeString()
 {
-   char buffer[11];
-   time_t t;
-   time(&t);
-   tm r = {0};
-   strftime(buffer, sizeof(buffer), "%X", localtime_r(&t, &r));
-   struct timeval tv;
-   gettimeofday(&tv, 0);
-   char result[100] = {0};
-   std::sprintf(result, "%s.%03ld", buffer, (long)tv.tv_usec / 1000); 
-   return result;
+    char buffer[11];
+    time_t t;
+    time(&t);
+    tm r = { 0 };
+    strftime(buffer, sizeof(buffer), "%X", localtime_r(&t, &r));
+    struct timeval tv;
+    gettimeofday(&tv, 0);
+    char result[100] = { 0 };
+    std::sprintf(result, "%s.%03ld", buffer, (long)tv.tv_usec / 1000);
+    return result;
 }
-#endif 
-
+#endif
 
 //////////////////////////////////////////////////////////////////////////
 //! Implementation of OutputPolicy)
@@ -234,140 +244,140 @@ inline std::string UbLogger<OutputPolicy>::logTimeString()
 class Output2Stream // implementation of OutputPolicy
 {
 public:
-   static std::ostream*& getStream();
-   static void output(const std::string& msg);
-   
-   //!creates output-file-stream (of file opening fails -> stream is set to std::cerr)
-   static void setStream(const std::string& filename);
-   
-   //!direct set outputstream, gcControl = true -> object will be deleted by Output2Stream 
-   static void setStream(std::ostream* pStream, const bool& gcControl = false);
+    static std::ostream *&getStream();
+    static void output(const std::string &msg);
+
+    //! creates output-file-stream (of file opening fails -> stream is set to std::cerr)
+    static void setStream(const std::string &filename);
+
+    //! direct set outputstream, gcControl = true -> object will be deleted by Output2Stream
+    static void setStream(std::ostream *pStream, const bool &gcControl = false);
 
 protected:
 #if defined(CAB_BOOST) && !defined(NO_MT_LOGGING)
-   static boost::mutex mtx;
+    static boost::mutex mtx;
 #endif
 };
 /*==========================================================*/
-inline std::ostream*& Output2Stream::getStream()
+inline std::ostream *&Output2Stream::getStream()
 {
-   static std::ostream* pStream = &std::clog;
-   return pStream;
+    static std::ostream *pStream = &std::clog;
+    return pStream;
 }
 /*==========================================================*/
-inline void Output2Stream::setStream(std::ostream* pFile, const bool& gcControl)
+inline void Output2Stream::setStream(std::ostream *pFile, const bool &gcControl)
 {
 #if defined(CAB_BOOST) && !defined(NO_MT_LOGGING)
-   boost::mutex::scoped_lock lock(mtx);
+    boost::mutex::scoped_lock lock(mtx);
 #endif
-   static bool s_gcControl = false;
-   
-   if( s_gcControl && Output2Stream::getStream() ) 
-   {
-      delete Output2Stream::getStream();
-   }
-   
-   s_gcControl = gcControl;
-   
-   Output2Stream::getStream() = pFile;
+    static bool s_gcControl = false;
+
+    if (s_gcControl && Output2Stream::getStream()) {
+        delete Output2Stream::getStream();
+    }
+
+    s_gcControl = gcControl;
+
+    Output2Stream::getStream() = pFile;
 }
 /*==========================================================*/
-inline void Output2Stream::setStream(const std::string& filename)
+inline void Output2Stream::setStream(const std::string &filename)
 {
-   std::ofstream* file = new std::ofstream( filename.c_str() );
-   if( !(*file) ) 
-   {
-      delete file;
-      Output2Stream::setStream(&std::cerr, false);
-      UbLogger<Output2Stream>().get(logERROR) << " Output2Stream::setStream(const std::string& filename) could not open file "
-                                               << filename << " -> std::cerr is used instead " << std::endl;
-      return;
-   }
-   std::cout<<"UbLog writes to "<<filename<<std::endl;
-   Output2Stream::setStream(file,true);
+    std::ofstream *file = new std::ofstream(filename.c_str());
+    if (!(*file)) {
+        delete file;
+        Output2Stream::setStream(&std::cerr, false);
+        UbLogger<Output2Stream>().get(logERROR)
+            << " Output2Stream::setStream(const std::string& filename) could not open file " << filename
+            << " -> std::cerr is used instead " << std::endl;
+        return;
+    }
+    std::cout << "UbLog writes to " << filename << std::endl;
+    Output2Stream::setStream(file, true);
 }
 /*==========================================================*/
-inline void Output2Stream::output(const std::string& msg)
+inline void Output2Stream::output(const std::string &msg)
 {
 #if defined(CAB_BOOST) && !defined(NO_MT_LOGGING)
-   boost::mutex::scoped_lock lock(mtx);
+    boost::mutex::scoped_lock lock(mtx);
 #endif
-   std::ostream* pStream = getStream();
-   if (!pStream) return;
-   (*pStream) << msg << std::flush;
+    std::ostream *pStream = getStream();
+    if (!pStream)
+        return;
+    (*pStream) << msg << std::flush;
 }
 
 //////////////////////////////////////////////////////////////////////////
 // UbLog
 //////////////////////////////////////////////////////////////////////////
-class UbLog : public UbLogger< Output2Stream > 
+class UbLog : public UbLogger<Output2Stream>
 {
-
 };
 
-//Macro to limit compiler-side maxLevel
+// Macro to limit compiler-side maxLevel
 #ifndef UBLOG_MAX_LEVEL
-   #define UBLOG_MAX_LEVEL logDEBUG5
+#define UBLOG_MAX_LEVEL logDEBUG5
 #endif
 
 //////////////////////////////////////////////////////////////////////////
 // example UBLOG(logINFO) << "das ist ein log eintrag";
 //////////////////////////////////////////////////////////////////////////
-#define UBLOG(level, logtext) \
-   if(level <= UBLOG_MAX_LEVEL && level <= UbLog::reportingLevel() && Output2Stream::getStream()) \
-   {                                    \
-       UbLog().get(level) << logtext;   \
-   }
-   
+#define UBLOG(level, logtext)                                                                                          \
+    if (level <= UBLOG_MAX_LEVEL && level <= UbLog::reportingLevel() && Output2Stream::getStream()) {                  \
+        UbLog().get(level) << logtext;                                                                                 \
+    }
+
 //////////////////////////////////////////////////////////////////////////
-//makro 2 fuer korrekten MultiLineOutput (teuer!!)
+// makro 2 fuer korrekten MultiLineOutput (teuer!!)
 // example1: UBLOGML(logINFO, "line1"<<endl<<"line2"<<endl<<"line3" )
 // example2: UBLOGML(logINFO, "line1\nline2\nendl\nline3" )
 //////////////////////////////////////////////////////////////////////////
-#define UBLOGML(level, multiline) \
-   if(level > UBLOG_MAX_LEVEL || level > UbLog::reportingLevel() || !Output2Stream::getStream()) ; \
-   else                                                                                            \
-   {                                                                                               \
-      std::ostringstream output;                                                                   \
-      output << multiline;                                                                         \
-      std::istringstream input( output.str() );                                                    \
-      while(!input.eof())                                                                          \
-      {                                                                                            \
-         std::string dummy;                                                                        \
-         getline(input,dummy,'\n');                                                                \
-         UbLog().get(level) << dummy;                                                              \
-      }                                                                                            \
-   }                                                                                          
+#define UBLOGML(level, multiline)                                                                                      \
+    if (level > UBLOG_MAX_LEVEL || level > UbLog::reportingLevel() || !Output2Stream::getStream())                     \
+        ;                                                                                                              \
+    else {                                                                                                             \
+        std::ostringstream output;                                                                                     \
+        output << multiline;                                                                                           \
+        std::istringstream input(output.str());                                                                        \
+        while (!input.eof()) {                                                                                         \
+            std::string dummy;                                                                                         \
+            getline(input, dummy, '\n');                                                                               \
+            UbLog().get(level) << dummy;                                                                               \
+        }                                                                                                              \
+    }
 //////////////////////////////////////////////////////////////////////////
-//makro3, falls auch bildschirmausgabe erwuenscht
+// makro3, falls auch bildschirmausgabe erwuenscht
 //   -> es wird sowohl ins logfile als auch auf den "stream" geschrieben
 //      wenn reporting level und level passen :D
-//example1: UBLOG2ML(logINFO, std::cout,  "line1"<<endl<<"line2"<<endl<<"line3" ) 
-//example2: UBLOG2ML(logINFO, std::cout,  "line1\nline2\nendl\nline3" ) 
+// example1: UBLOG2ML(logINFO, std::cout,  "line1"<<endl<<"line2"<<endl<<"line3" )
+// example2: UBLOG2ML(logINFO, std::cout,  "line1\nline2\nendl\nline3" )
 //////////////////////////////////////////////////////////////////////////
-#define UBLOG2(level, stream,  text ) \
-   if(level > UBLOG_MAX_LEVEL || level > UbLog::reportingLevel() || !Output2Stream::getStream()) ; \
-   else { stream << text <<std::endl; UbLog().get(level) << text;   }                             
+#define UBLOG2(level, stream, text)                                                                                    \
+    if (level > UBLOG_MAX_LEVEL || level > UbLog::reportingLevel() || !Output2Stream::getStream())                     \
+        ;                                                                                                              \
+    else {                                                                                                             \
+        stream << text << std::endl;                                                                                   \
+        UbLog().get(level) << text;                                                                                    \
+    }
 
 //////////////////////////////////////////////////////////////////////////
-//makro4, wie 3 nur mit multiline
-//example: UBLOG2(logINFO, std::cout,  "test" ) 
+// makro4, wie 3 nur mit multiline
+// example: UBLOG2(logINFO, std::cout,  "test" )
 //////////////////////////////////////////////////////////////////////////
-#define UBLOG2ML(level, stream,  multiline ) \
-   if(level > UBLOG_MAX_LEVEL || level > UbLog::reportingLevel() || !Output2Stream::getStream()) ; \
-   else                                                                                            \
-   {                                                                                               \
-      stream << multiline << std::endl;                                                            \
-      std::ostringstream output;                                                                   \
-      output << multiline;                                                                         \
-      std::istringstream input( output.str() );                                                    \
-      while(!input.eof())                                                                          \
-      {                                                                                            \
-         std::string dummy;                                                                        \
-         getline(input,dummy,'\n');                                                                \
-         UbLog().get(level) << dummy;                                                              \
-      }                                                                                            \
-   }                                                                                               
+#define UBLOG2ML(level, stream, multiline)                                                                             \
+    if (level > UBLOG_MAX_LEVEL || level > UbLog::reportingLevel() || !Output2Stream::getStream())                     \
+        ;                                                                                                              \
+    else {                                                                                                             \
+        stream << multiline << std::endl;                                                                              \
+        std::ostringstream output;                                                                                     \
+        output << multiline;                                                                                           \
+        std::istringstream input(output.str());                                                                        \
+        while (!input.eof()) {                                                                                         \
+            std::string dummy;                                                                                         \
+            getline(input, dummy, '\n');                                                                               \
+            UbLog().get(level) << dummy;                                                                               \
+        }                                                                                                              \
+    }
 
 //////////////////////////////////////////////////////////////////////////
 // example 2
@@ -376,8 +386,9 @@ class UbLog : public UbLogger< Output2Stream >
 // {
 //    UbLog::reportingLevel() = UbLog::logLevelFromString("DEBUG3");
 //    //UbLog::output_policy::setStream(&std::cerr); //<- clog ist stdandard
-//    UbLog::output_policy::setStream("c:/temp/out.txt");  //kann man diese nicht oeffnen -> fehlermeldung -> Log wird in cerr ausgegben
-// 
+//    UbLog::output_policy::setStream("c:/temp/out.txt");  //kann man diese nicht oeffnen -> fehlermeldung -> Log wird
+//    in cerr ausgegben
+//
 //    int count = 3;
 //    UBLOG(logINFO, "A loop with " << count << " iterations");
 //    for (int i = 0; i != count; ++i)
@@ -398,5 +409,4 @@ class UbLog : public UbLogger< Output2Stream >
 //    UBLOG(logERROR) << e.what();
 // }
 
-
-#endif //UBLOGGER_H
+#endif // UBLOGGER_H
diff --git a/src/basics/basics/utilities/UbMath.cpp b/src/basics/basics/utilities/UbMath.cpp
index ffed193fbfc2b269740e213ede6146462f4512b6..d929f55c64b8929ac87ad3e94d06d87e0ab6ce62 100644
--- a/src/basics/basics/utilities/UbMath.cpp
+++ b/src/basics/basics/utilities/UbMath.cpp
@@ -1,28 +1,28 @@
 //=======================================================================================
-// ____          ____    __    ______     __________   __      __       __        __         
-// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |        
-//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |        
-//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |        
-//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____    
-//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|   
-//      \    \  |    |   ________________________________________________________________    
-//       \    \ |    |  |  ______________________________________________________________|   
-//        \    \|    |  |  |         __          __     __     __     ______      _______    
-//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)   
-//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______    
+// ____          ____    __    ______     __________   __      __       __        __
+// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |
+//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |
+//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |
+//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____
+//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|
+//      \    \  |    |   ________________________________________________________________
+//       \    \ |    |  |  ______________________________________________________________|
+//        \    \|    |  |  |         __          __     __     __     ______      _______
+//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)
+//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______
 //           \       |  |  |        |  |_____   |   \_/   |   |  |   |  |_/  /    _____  |
-//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/   
+//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/
 //
-//  This file is part of VirtualFluids. VirtualFluids is free software: you can 
+//  This file is part of VirtualFluids. VirtualFluids is free software: you can
 //  redistribute it and/or modify it under the terms of the GNU General Public
-//  License as published by the Free Software Foundation, either version 3 of 
+//  License as published by the Free Software Foundation, either version 3 of
 //  the License, or (at your option) any later version.
-//  
-//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT 
-//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
-//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License 
+//
+//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT
+//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 //  for more details.
-//  
+//
 //  You should have received a copy of the GNU General Public License along
 //  with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>.
 //
@@ -30,9 +30,8 @@
 //! \ingroup utilities
 //! \author Soeren Freudiger, Sebastian Geller
 //=======================================================================================
-#include <basics/utilities/UbMath.h>
 #include <basics/utilities/UbInfinity.h>
+#include <basics/utilities/UbMath.h>
 #include <cstring> //for memcmp
 
-       
-const double UbMath::PI = 4.0* std::atan(1.0);   //3.1415926535897932384626433832795
+const double UbMath::PI = 4.0 * std::atan(1.0); // 3.1415926535897932384626433832795
diff --git a/src/basics/basics/utilities/UbMath.h b/src/basics/basics/utilities/UbMath.h
index 195dda3998120d85f506b8faf09409858a6a0a52..fe6b01140a4f1675335e3e4f8c9a542055881727 100644
--- a/src/basics/basics/utilities/UbMath.h
+++ b/src/basics/basics/utilities/UbMath.h
@@ -1,28 +1,28 @@
 //=======================================================================================
-// ____          ____    __    ______     __________   __      __       __        __         
-// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |        
-//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |        
-//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |        
-//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____    
-//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|   
-//      \    \  |    |   ________________________________________________________________    
-//       \    \ |    |  |  ______________________________________________________________|   
-//        \    \|    |  |  |         __          __     __     __     ______      _______    
-//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)   
-//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______    
+// ____          ____    __    ______     __________   __      __       __        __
+// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |
+//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |
+//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |
+//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____
+//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|
+//      \    \  |    |   ________________________________________________________________
+//       \    \ |    |  |  ______________________________________________________________|
+//        \    \|    |  |  |         __          __     __     __     ______      _______
+//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)
+//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______
 //           \       |  |  |        |  |_____   |   \_/   |   |  |   |  |_/  /    _____  |
-//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/   
+//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/
 //
-//  This file is part of VirtualFluids. VirtualFluids is free software: you can 
+//  This file is part of VirtualFluids. VirtualFluids is free software: you can
 //  redistribute it and/or modify it under the terms of the GNU General Public
-//  License as published by the Free Software Foundation, either version 3 of 
+//  License as published by the Free Software Foundation, either version 3 of
 //  the License, or (at your option) any later version.
-//  
-//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT 
-//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
-//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License 
+//
+//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT
+//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 //  for more details.
-//  
+//
 //  You should have received a copy of the GNU General Public License along
 //  with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>.
 //
@@ -33,468 +33,474 @@
 #ifndef UBMATH_H
 #define UBMATH_H
 
+#include <basics/utilities/UbEqual.h>
+#include <basics/utilities/UbSystem.h>
+#include <cassert>
 #include <cmath>
-#include <limits>
 #include <iostream>
-#include <cassert>
-#include <basics/utilities/UbSystem.h>
-#include <basics/utilities/UbEqual.h>
+#include <limits>
+
+namespace UbMath
+{
+extern const double PI;
 
-namespace UbMath 
-{
-   extern const double PI;
-   
-   
-   //////////////////////////////////////////////////////////////////////////
-   //Hilfsfunktion fuer Genauigkeit
-   template< typename T >
-   struct Epsilon {  };
+//////////////////////////////////////////////////////////////////////////
+// Hilfsfunktion fuer Genauigkeit
+template <typename T>
+struct Epsilon {
+};
 
-   //////////////////////////////////////////////////////////////////////////
-   //  SPECIALIZATIONS von Epsilon
-   //////////////////////////////////////////////////////////////////////////
-   template<>
-   struct Epsilon<double>        { static inline double      val() { return 1.0E-11; } };
-   template<>
-   struct Epsilon<float>         { static inline float       val() { return 1.0E-7f; } };
-   template<>
-   struct Epsilon<long double>   { static inline long double val() { return 1.0E-15; } };
-   template<>
-   struct Epsilon<int>           { static inline int         val() { return 0;       } };
+//////////////////////////////////////////////////////////////////////////
+//  SPECIALIZATIONS von Epsilon
+//////////////////////////////////////////////////////////////////////////
+template <>
+struct Epsilon<double> {
+    static inline double val() { return 1.0E-11; }
+};
+template <>
+struct Epsilon<float> {
+    static inline float val() { return 1.0E-7f; }
+};
+template <>
+struct Epsilon<long double> {
+    static inline long double val() { return 1.0E-15; }
+};
+template <>
+struct Epsilon<int> {
+    static inline int val() { return 0; }
+};
+
+/*=======================================================*/
+// -------------------------------------------------------------------------------------------------
+// Funktion berechnet den Logarithmus einer Zahl z bzgl. der Basis b
+// -------------------------------------------------------------------------------------------------
+template <typename T>
+inline T log(const T &z, const T &base)
+{
+    if (::log(base) == 0)
+        return 1.0f;
+    return ::log(z) / ::log(base);
+}
+/*=======================================================*/
+// double x = UbMath::getNegativeInfinity<double>();
+template <typename T>
+inline T getNegativeInfinity()
+{
+    // assert(std::numeric_limits<T>::has_infinity);
+    UB_STATIC_ASSERT(std::numeric_limits<T>::has_infinity);
+    return -std::numeric_limits<T>::infinity();
+}
+/*=======================================================*/
+// double x = UbMath::getPositiveInfinity<double>();
+template <typename T>
+inline T getPositiveInfinity()
+{
+    // assert(std::numeric_limits<T>::has_infinity);
+    UB_STATIC_ASSERT(std::numeric_limits<T>::has_infinity);
+    return std::numeric_limits<T>::infinity();
+}
+/*=======================================================*/
+// double x; bool b = UbMath::isInfinity(x);
+template <typename T>
+inline bool isInfinity(const T &value)
+{
+    if (value == getNegativeInfinity<T>())
+        return true;
+    if (value == getPositiveInfinity<T>())
+        return true;
+    return false;
+}
+/*=======================================================*/
+// double x = UbMath::getNaN<double>(x);
+template <typename T>
+inline T getNaN()
+{
+    UB_STATIC_ASSERT(std::numeric_limits<T>::has_quiet_NaN);
+    return std::numeric_limits<T>::quiet_NaN();
+}
+/*=======================================================*/
+// double x; bool b = UbMath::isNaN(x);
+// x!=x liefert bei #QNAN "true"!
+template <typename T>
+inline bool isNaN(const T &x)
+{
+    UB_STATIC_ASSERT(std::numeric_limits<T>::has_quiet_NaN);
+    return (x != x);
+}
+/*=======================================================*/
+template <typename T>
+inline T getEqualityEpsilon()
+{
+    return Epsilon<T>::val();
+}
+/*=======================================================*/
+template <typename T>
+inline bool zero(const T &value)
+{
+    return std::fabs(value) < Epsilon<T>::val();
+    // return value >= -UbMath::EPSILON && value <= UbMath::EPSILON;
+}
+/*=======================================================*/
+// spezialisierung fuer ints
+template <>
+inline bool zero(const int &value)
+{
+    return value == 0;
+}
+/*=======================================================*/
+template <typename T1, typename T2>
+inline bool zero(const T1 &value1, const T2 &value2)
+{
+    return !(!UbMath::zero(value1) || !UbMath::zero(value2));
+}
+/*=======================================================*/
+template <typename T1, typename T2, typename T3>
+inline bool zero(const T1 &value1, const T2 &value2, const T3 &value3)
+{
+    return !(!UbMath::zero(value1) || !UbMath::zero(value2, value3));
+}
+/*=======================================================*/
+template <typename T>
+inline bool negative(const T &value)
+{
+    return value < -Epsilon<T>::val();
+}
+/*=======================================================*/
+template <typename T>
+inline bool nonPositive(const T &value)
+{
+    return value <= Epsilon<T>::val();
+}
+/*=======================================================*/
+template <typename T>
+inline bool positive(const T &value)
+{
+    return value > +Epsilon<T>::val();
+}
+/*=======================================================*/
+template <typename T>
+inline bool nonNegative(const T &value)
+{
+    return value >= -Epsilon<T>::val();
+}
+/*=======================================================*/
+template <typename T1, typename T2>
+inline bool equal(const T1 &value, const T2 &reference)
+{
+    using High = typename UbEqualTrait<T1, T2>::High;
+    return std::fabs(value - reference) < Epsilon<High>::val();
+}
+/*=======================================================*/
+template <typename T1, typename T2, typename T3>
+inline bool equal(const T1 &val1, const T2 &val2, const T3 &val3)
+{
+    return (UbMath::equal(val1, val2) && UbMath::equal(val1, val3));
+}
+/*=======================================================*/
+template <typename T1, typename T2>
+inline bool less(const T1 &value, const T2 &reference)
+{
+    using High = typename UbEqualTrait<T1, T2>::High;
+    return value < reference - Epsilon<High>::val();
+}
+/*=======================================================*/
+template <typename T1, typename T2>
+inline bool lessEqual(const T1 &value, const T2 &reference)
+{
+    using High = typename UbEqualTrait<T1, T2>::High;
+    return value <= reference + Epsilon<High>::val();
+}
+/*=======================================================*/
+template <typename T1, typename T2>
+inline bool greater(const T1 &value, const T2 &reference)
+{
+    using High = typename UbEqualTrait<T1, T2>::High;
+    return value > reference + Epsilon<High>::val();
+}
+/*=======================================================*/
+template <typename T1, typename T2>
+inline bool greaterEqual(const T1 &value, const T2 &reference)
+{
+    using High = typename UbEqualTrait<T1, T2>::High;
+    return value >= reference - Epsilon<High>::val();
+}
+/*=======================================================*/
+template <typename T>
+inline T round(const T &value, const int &decimalPlaces)
+{
+    return static_cast<T>(floor(value * pow(10.0, decimalPlaces) + 0.5) * pow(10.0, -decimalPlaces));
+}
+/*=======================================================*/
+template <typename T>
+inline int integerRounding(const T &value)
+{
+    return static_cast<int>(UbMath::zero(value) ? 0 : ((value < 0.0) ? (value - 0.5) : (value + 0.5)));
+}
+/*=======================================================*/
+template <typename T>
+inline T getRad(const T &degrees)
+{
+    return degrees * static_cast<T>(UbMath::PI / 180.0);
+}
+/*=======================================================*/
+template <typename T>
+inline T getDegrees(const T &rad)
+{
+    return rad * static_cast<T>(UbMath::PI / 180.0);
+}
+/*=======================================================*/
+// aus wildmagic
+template <typename T>
+inline T ACos(const T &fValue)
+{
+    if (-1.0 < fValue) {
+        if (fValue < 1.0)
+            return static_cast<T>(acos(fValue));
+        else
+            return static_cast<T>(0.0);
+    } else
+        return static_cast<T>(PI);
+}
+/*=======================================================*/
+template <typename T>
+inline T ASin(const T &fValue)
+{
+    double HALF_PI = 0.5 * UbMath::PI;
+    if (-1.0 < fValue) {
+        if (fValue < 1.0)
+            return static_cast<T>(asin(fValue));
+        else
+            return static_cast<T>(HALF_PI);
+    } else
+        return -static_cast<T>(HALF_PI);
+}
+/*=======================================================*/
+template <typename T>
+inline T invSqrt(const T &fValue)
+{
+    return static_cast<T>(1.0 / sqrt(fValue));
+}
 
-   /*=======================================================*/
-   // -------------------------------------------------------------------------------------------------
-   // Funktion berechnet den Logarithmus einer Zahl z bzgl. der Basis b
-   // -------------------------------------------------------------------------------------------------
-   template<typename T>
-   inline T log(const T& z, const T& base)
-   {
-      if( ::log(base)==0 ) return 1.0f;
-      return ::log(z) / ::log(base);
-   }
-   /*=======================================================*/
-   //double x = UbMath::getNegativeInfinity<double>();
-   template<typename T>
-   inline T getNegativeInfinity()
-   {
-      //assert(std::numeric_limits<T>::has_infinity);
-      UB_STATIC_ASSERT(std::numeric_limits<T>::has_infinity);
-      return -std::numeric_limits<T>::infinity();
-   }
-   /*=======================================================*/
-   //double x = UbMath::getPositiveInfinity<double>();
-   template<typename T>
-   inline T getPositiveInfinity()
-   {
-      //assert(std::numeric_limits<T>::has_infinity);
-      UB_STATIC_ASSERT(std::numeric_limits<T>::has_infinity);
-      return std::numeric_limits<T>::infinity();
-   }
-   /*=======================================================*/
-   //double x; bool b = UbMath::isInfinity(x);
-   template<typename T>
-   inline bool isInfinity(const T& value)
-   {
-      if(value==getNegativeInfinity<T>()) return true;
-      if(value==getPositiveInfinity<T>()) return true;
-      return false;
-   }
-   /*=======================================================*/
-   //double x = UbMath::getNaN<double>(x);
-   template<typename T>
-   inline T getNaN()
-   {
-      UB_STATIC_ASSERT(std::numeric_limits<T>::has_quiet_NaN);
-      return std::numeric_limits<T>::quiet_NaN();
-   }
-   /*=======================================================*/
-   //double x; bool b = UbMath::isNaN(x);
-   // x!=x liefert bei #QNAN "true"!
-   template<typename T>
-   inline bool isNaN(const T& x)
-   {
-      UB_STATIC_ASSERT(std::numeric_limits<T>::has_quiet_NaN);
-      return (x != x); 
-   }
-   /*=======================================================*/
-   template<typename T>
-   inline T getEqualityEpsilon()		  
-   { 
-      return  Epsilon<T>::val();  
-   }
-   /*=======================================================*/
-   template<typename T>
-   inline bool zero(const T& value)		  
-   { 
-      return std::fabs( value ) < Epsilon<T>::val();
-      //return value >= -UbMath::EPSILON && value <= UbMath::EPSILON;	
-   }
-   /*=======================================================*/
-   //spezialisierung fuer ints
-   template<>
-   inline bool zero(const int& value)		  
-   { 
-      return value == 0;
-   }
-   /*=======================================================*/
-   template<typename T1, typename T2>
-   inline bool zero(const T1& value1, const T2& value2)		  
-   { 
-      return !(!UbMath::zero(value1) || !UbMath::zero(value2));	
-   }
-   /*=======================================================*/
-   template<typename T1, typename T2, typename T3>
-   inline bool zero(const T1& value1, const T2& value2, const T3& value3)		  
-   { 
-      return !(!UbMath::zero(value1) || !UbMath::zero(value2,value3));	
-   }
-   /*=======================================================*/
-   template<typename T>
-   inline bool negative(const T& value)    
-   { 
-      return value < -Epsilon<T>::val();  
-   }
-   /*=======================================================*/
-   template<typename T>
-   inline bool nonPositive(const T& value) 
-   { 
-      return value <= Epsilon<T>::val(); 
-   }
-   /*=======================================================*/
-   template<typename T>
-   inline bool positive(const T& value)    
-   { 
-      return value > +Epsilon<T>::val();   
-   }
-   /*=======================================================*/
-   template<typename T>
-   inline bool nonNegative(const T& value) 
-   { 
-      return value >= -Epsilon<T>::val(); 
-   }
-   /*=======================================================*/
-   template<typename T1, typename T2>
-   inline bool equal(const T1& value, const T2& reference) 
-   { 
-      using High = typename UbEqualTrait<T1, T2>::High;
-      return std::fabs(value-reference) < Epsilon<High>::val(); 
-   }
-   /*=======================================================*/
-   template<typename T1, typename T2, typename T3>
-   inline bool equal(const T1& val1, const T2& val2, const T3& val3) 
-   { 
-      return ( UbMath::equal(val1,val2) && UbMath::equal(val1,val3) ); 
-   }
-   /*=======================================================*/
-   template<typename T1, typename T2>
-   inline bool less(const T1& value, const T2& reference)   
-   { 
-      using High = typename UbEqualTrait<T1, T2>::High;
-      return value < reference - Epsilon<High>::val(); 
-   }
-   /*=======================================================*/
-   template<typename T1, typename T2>
-   inline bool lessEqual(const T1& value, const T2& reference) 
-   { 
-      using High = typename UbEqualTrait<T1, T2>::High;
-      return value <= reference + Epsilon<High>::val();
-   }
-   /*=======================================================*/
-   template<typename T1, typename T2>
-   inline bool greater(const T1& value, const T2& reference)      
-   { 
-      using High = typename UbEqualTrait<T1, T2>::High;
-      return value > reference + Epsilon<High>::val();  
-   }
-   /*=======================================================*/
-   template<typename T1, typename T2>
-   inline bool greaterEqual(const T1& value, const T2& reference) 
-   { 
-      using High = typename UbEqualTrait<T1, T2>::High;
-      return value >= reference - Epsilon<High>::val(); 
-   }
-   /*=======================================================*/
-   template<typename T>
-   inline T round(const T& value, const int& decimalPlaces) 
-   { 
-      return static_cast<T>(floor(value * pow( 10.0, decimalPlaces) + 0.5 ) * pow(10.0, -decimalPlaces)); 
-   } 
-   /*=======================================================*/
-   template<typename T>
-   inline int integerRounding(const T& value) 
-   { 
-      return static_cast<int>( UbMath::zero(value) ?  0 : ( (value<0.0) ? (value-0.5) : (value+0.5) ) );
-   } 
-   /*=======================================================*/
-   template<typename T>
-   inline T getRad(const T& degrees) 
-   {
-      return degrees*static_cast<T>(UbMath::PI/180.0);
-   }
-   /*=======================================================*/
-   template<typename T>
-   inline T getDegrees(const T& rad) 
-   {
-      return rad*static_cast<T>(UbMath::PI/180.0);
-   }
-   /*=======================================================*/
-   //aus wildmagic
-   template<typename T>
-   inline T ACos (const T& fValue)
-   {
-      if ( -1.0 < fValue )
-      {
-         if ( fValue < 1.0 ) return static_cast<T>( acos(fValue) );
-         else                return static_cast<T>( 0.0          );
-      }
-      else return static_cast<T>( PI );
-   }
-   /*=======================================================*/
-   template<typename T>
-   inline T ASin(const T& fValue)
-   {
-      double HALF_PI = 0.5*UbMath::PI;
-      if ( -1.0 < fValue )
-      {
-         if ( fValue < 1.0 ) return static_cast<T>( asin(fValue) );
-         else                return static_cast<T>( HALF_PI      );
-      }
-      else return -static_cast<T>( HALF_PI );         
-   }
-   /*=======================================================*/
-   template<typename T>
-   inline T invSqrt(const T& fValue)   
-   { 
-      return static_cast<T>(1.0/sqrt(fValue));
-   }
+/*=======================================================*/
+/**
+ * Returns true, if specified values a and b are less both values c and d.
+ * @param a the first value to check
+ * @param b the second value to check
+ * @param c the first value to check against
+ * @param d the second value to check against
+ * @return true, if specified values a and b are less both values c and d
+ **/
+template <typename T1, typename T2, typename T3, typename T4>
+inline bool less2(const T1 &value1, const T2 &value2, T3 toBeLessAs1, T4 toBeLessAs2)
+{
+    return (less(value1, toBeLessAs1) && less(value1, toBeLessAs2) && less(value2, toBeLessAs1) &&
+            less(value2, toBeLessAs2));
+}
+/*=======================================================*/
+template <typename T1, typename T2, typename T3, typename T4>
+inline bool greater2(const T1 &value1, const T2 &value2, T3 toBeGreaterAs1, T4 toBeGreaterAs2)
+{
+    return (greater(value1, toBeGreaterAs1) && greater(value1, toBeGreaterAs2) && greater(value2, toBeGreaterAs1) &&
+            greater(value2, toBeGreaterAs2));
+}
+/*=======================================================*/
+template <typename T1, typename T2, typename T3>
+inline bool inClosedInterval(const T1 &value, const T2 &threshold1, const T3 &threshold2)
+{
+    if (threshold1 < threshold2) {
+        return (greaterEqual(value, threshold1) && lessEqual(value, threshold2));
+    }
 
-   /*=======================================================*/
-   /**
-   * Returns true, if specified values a and b are less both values c and d.
-   * @param a the first value to check
-   * @param b the second value to check
-   * @param c the first value to check against
-   * @param d the second value to check against
-   * @return true, if specified values a and b are less both values c and d
-   **/
-   template<typename T1, typename T2, typename T3, typename T4>
-   inline bool less2(const T1& value1, const T2& value2, T3 toBeLessAs1, T4 toBeLessAs2) 
-   {	
-      return (   less(value1,toBeLessAs1)
-              && less(value1,toBeLessAs2)
-              && less(value2,toBeLessAs1)
-              && less(value2,toBeLessAs2) );
-   }
-   /*=======================================================*/
-   template<typename T1, typename T2, typename T3, typename T4>
-   inline bool greater2(const T1& value1, const T2& value2, T3 toBeGreaterAs1, T4 toBeGreaterAs2)
-   { 
-      return (   greater(value1,toBeGreaterAs1)
-              && greater(value1,toBeGreaterAs2)
-              && greater(value2,toBeGreaterAs1)
-              && greater(value2,toBeGreaterAs2) );
-   }
-   /*=======================================================*/
-   template<typename T1, typename T2, typename T3>
-   inline bool inClosedInterval(const T1& value, const T2& threshold1, const T3& threshold2)
-   { 
-      if(threshold1 < threshold2)
-      {
-         return ( greaterEqual( value, threshold1) && lessEqual( value, threshold2) );
-      }
+    return (greaterEqual(value, threshold2) && lessEqual(value, threshold1));
+}
+/*=======================================================*/
+template <typename T1, typename T2, typename T3>
+inline bool inOpenInterval(const T1 &value, const T2 &threshold1, const T3 &threshold2)
+{
+    if (threshold1 < threshold2) {
+        return (greater(value, threshold1) && less(value, threshold2));
+    }
 
-      return ( greaterEqual( value, threshold2) && lessEqual( value, threshold1) );
-   }
-   /*=======================================================*/
-   template<typename T1, typename T2, typename T3>
-   inline bool inOpenInterval(const T1& value, const T2& threshold1, const T3& threshold2)
-   {	
-      if(threshold1 < threshold2) 
-      {
-         return (greater( value, threshold1) && less( value, threshold2));
-      }
+    return (greater(value, threshold2) && less(value, threshold1));
+}
+/*=======================================================*/
+template <typename T1, typename T2, typename T3>
+inline double adaptToClosedInterval(const T1 &value, const T2 &threshold1, const T3 &threshold2)
+{
+    if (threshold1 < threshold2) {
+        if (less(value, threshold1))
+            return threshold1;
+        else if (greater(value, threshold2))
+            return threshold2;
+    } else {
+        if (less(value, threshold2))
+            return threshold2;
+        else if (greater(value, threshold1))
+            return threshold1;
+    }
+    return value;
+}
+/*=======================================================*/
+// -------------------------------------------------------------------------------------------------
+// Funktion berechnet den groessten gemeinsamen Teiler zweier Zahlen (MK)
+// -------------------------------------------------------------------------------------------------
+/*=======================================================*/
+inline int calcGgt(int val1, int val2)
+{
+    if (val1 < val2)
+        std::swap(val1, val2);
+    int ggt = val2;
+    while (ggt > 1) {
+        if ((val1 % ggt) == 0 && (val2 % ggt) == 0)
+            break;
 
-      return (greater( value, threshold2) && less( value, threshold1));
-   }
-   /*=======================================================*/
-   template<typename T1, typename T2, typename T3>
-   inline double adaptToClosedInterval(const T1& value, const T2& threshold1, const T3& threshold2)
-   { 
-      if(threshold1 < threshold2)
-      {
-         if     ( less(   value, threshold1) ) return threshold1;
-         else if( greater(value, threshold2) ) return threshold2;
-      }
-      else
-      {
-         if     ( less(   value, threshold2) ) return threshold2;
-         else if( greater(value, threshold1) ) return threshold1;
-      }
-      return value;
-   }
-   /*=======================================================*/
-   // -------------------------------------------------------------------------------------------------
-   // Funktion berechnet den groessten gemeinsamen Teiler zweier Zahlen (MK)
-   // -------------------------------------------------------------------------------------------------
-   /*=======================================================*/
-   inline int calcGgt(int val1, int val2)
-   {
-      if( val1 < val2 ) std::swap(val1,val2);
-      int ggt=val2;
-      while(ggt > 1)
-      {
-         if( (val1%ggt)==0 && (val2%ggt)==0 ) break;
+        ggt -= 1;
+    }
+    return ggt;
+}
+/*=======================================================*/
+// -------------------------------------------------------------------------------------------------
+// Funktion berechnet den groessten gemeinsamen Teiler von drei Zahlen (MK)
+// -------------------------------------------------------------------------------------------------
+inline int calcGgt(int val1, const int &val2, int val3) { return UbMath::calcGgt(UbMath::calcGgt(val1, val2), val3); }
+/*=======================================================*/
+// returns the max of c2 values
+// to avoid errors at mixed argument-types use: double myMax = max<double>(2,2.3);
+template <typename T>
+inline const T &max(const T &a1, const T &a2)
+{
+    return (a1 < a2) ? a2 : a1;
+}
+/*=======================================================*/
+template <typename T>
+inline const T &max(const T &a1, const T &a2, const T &a3)
+{
+    return max(max(a1, a2), a3);
+}
+/*=======================================================*/
+template <typename T>
+inline const T &max(const T &a1, const T &a2, const T &a3, const T &a4)
+{
+    return max(max(max(a1, a2), a3), a4);
+}
+/*=======================================================*/
+template <typename T>
+inline const T &min(const T &a1, const T &a2)
+{
+    return (a1 < a2) ? a1 : a2;
+}
+/*=======================================================*/
+template <typename T>
+inline const T &min(const T &a1, const T &a2, const T &a3)
+{
+    return min(min(a1, a2), a3);
+}
+/*=======================================================*/
+template <typename T>
+inline const T &min(const T &a1, const T &a2, const T &a3, const T &a4)
+{
+    return min(min(min(a1, a2), a3), a4);
 
-         ggt -=1;
-      }
-      return ggt;
-   }
-   /*=======================================================*/
-   // -------------------------------------------------------------------------------------------------
-   // Funktion berechnet den groessten gemeinsamen Teiler von drei Zahlen (MK)
-   // -------------------------------------------------------------------------------------------------
-   inline int calcGgt(int val1, const int& val2, int val3)
-   {
-      return UbMath::calcGgt( UbMath::calcGgt(val1, val2), val3 );
-   }
-   /*=======================================================*/
-   //returns the max of c2 values
-   //to avoid errors at mixed argument-types use: double myMax = max<double>(2,2.3);
-   template< typename T >
-   inline const T& max(const T& a1, const T& a2) 
-   { 
-     return (a1<a2) ? a2 : a1;
-   }
-   /*=======================================================*/
-   template< typename T >
-   inline const T& max(const T& a1, const T& a2, const T& a3) 
-   { 
-      return max(max(a1,a2),a3);
-   }
-   /*=======================================================*/
-   template< typename T >
-   inline const T& max(const T& a1, const T& a2, const T& a3, const T& a4)
-   {
-      return max(max(max(a1,a2),a3),a4);
-   }
-   /*=======================================================*/
-   template< typename T >
-   inline const T& min(const T& a1,const T& a2) 
-   { 
-      return (a1<a2) ? a1 : a2;
-   }
-   /*=======================================================*/
-   template< typename T >
-   inline const T& min(const T& a1, const T& a2, const T& a3) 
-   { 
-      return min(min(a1,a2),a3);
-   }
-   /*=======================================================*/
-   template< typename T >
-   inline const T& min(const T& a1, const T& a2, const T& a3, const T& a4)
-   {
-      return min(min(min(a1,a2),a3),a4);
-      
-//       double tmp = a1;
-//       if(tmp>a2) tmp=a2;
-//       if(tmp>a3) tmp=a3;
-//       if(tmp>a4) tmp=a4;
-//       return tmp;
-   }
+    //       double tmp = a1;
+    //       if(tmp>a2) tmp=a2;
+    //       if(tmp>a3) tmp=a3;
+    //       if(tmp>a4) tmp=a4;
+    //       return tmp;
+}
 
-   //////////////////////////////////////////////////////////////////////////
-   //
-   //constants
-   //
-   //////////////////////////////////////////////////////////////////////////
-   static const double c8o27 = 8. / 27.;
-   static const double c2o27 = 2. / 27.;
-   static const double c1o54 = 1. / 54.;
-   static const double c1o216 = 1. / 216.;
-   static const double c9o2 = 9. / 2.; //4.5
-   static const double c9o4 = 9. / 4.; //2.25
-   static const double c3o9 = 3. / 9.;
-   static const double c3o54 = 3. / 54.;
-   static const double c3o216 = 3. / 216.;
+//////////////////////////////////////////////////////////////////////////
+//
+// constants
+//
+//////////////////////////////////////////////////////////////////////////
+static const double c8o27  = 8. / 27.;
+static const double c2o27  = 2. / 27.;
+static const double c1o54  = 1. / 54.;
+static const double c1o216 = 1. / 216.;
+static const double c9o2   = 9. / 2.; // 4.5
+static const double c9o4   = 9. / 4.; // 2.25
+static const double c3o9   = 3. / 9.;
+static const double c3o54  = 3. / 54.;
+static const double c3o216 = 3. / 216.;
 
-   static const double c1o27 = 1. / 27.;
+static const double c1o27 = 1. / 27.;
 
-   static const double c1o72 = 1. / 72.;          //0.01388888
-   static const double c1o36 = 1. / 36.;          //0.02777777
-   static const double c1o48 = 1. / 48.;          //0.02083333
-   static const double c1o32 = 1. / 32.;          //0.03125
-   static const double c1o24 = 1. / 24.;          //0.04166666
-   static const double c1o20 = 1. / 20.;          //0.05
-   static const double c1o18 = 1. / 18.;          //0.05555555
-   static const double c1o16 = 1. / 16.;          //0.0625
-   static const double c1o12 = 1. / 12.;          //0.08333333
-   static const double c1o9 = 1. / 9.;           //0.11111111
-   static const double c1o8 = 1. / 8.;           //0.125
-   static const double c1o6 = 1. / 6.;           //0.16666666
-   static const double c1o5 = 1. / 5.;           //0.2
-   static const double c1o4 = 1. / 4.;           //0.25
-   static const double c1o100 = 1. / 100.;
-   static const double c5o16 = 5. / 16.;          //0.3125
-   static const double c1o3 = 1. / 3.;           //0.33333333
-   static const double c3o8 = 3. / 8.;           //0.375
-   static const double c4o9 = 4. / 9.;           //0.44444444
-   static const double c1o2 = 1. / 2.;           //0.5
-   static const double c9o16 = 9. / 16.;          //0.5625
-   static const double c2o3 = 2. / 3.;           //0.66666666
-   static const double c3o4 = 3. / 4.;           //0.75
-   static const double c3o2 = 3. / 2.;           //1.5
-   static const double c4o3 = 4. / 3.;           //1.33333333
-   static const double c5o3 = 5. / 3.;           //1.66666666
-   static const double c9o5 = 9. / 5.;           //1.8
-   static const double c2o9 = 2. / 9.;           //0.22222222
-   static const double one_over_sqrt2 = 1.0 / sqrt(2.0); //0.707106781
-   static const double one_over_sqrt3 = 1.0 / sqrt(3.0); //0.577350269
-   static const double sqrt2 = sqrt(2.0); //1.4142135
-   static const double sqrt3 = sqrt(3.0); //1.7320508
-   static const double zeroReal = 0.0;
-   static const double c1 = 1.0;
-   static const double c2 = 2.0;
-   static const double c3 = 3.0;
-   static const double c4 = 4.0;
-   static const double c5 = 5.0;
-   static const double c6 = 6.0;
-   static const double c7 = 7.0;
-   static const double c8 = 8.0;
-   static const double c9 = 9.0;
-   static const double c14 = 14.0;
-   static const double c15 = 15.0;
-   static const double c16 = 16.0;
-   static const double c18 = 18.0;
-   static const double c21 = 21.0;
-   static const double c24 = 24.0;
-   static const double c28 = 28.0;
-   static const double c29 = 29.0;
-   static const double c36 = 36.0;
-   static const double c48 = 48.0;
-   static const double c50 = 50.0;
-   static const double c56 = 56.0;
-   static const double c152 = 152.0;
-   static const double c130 = 130.0;
-   static const double one = 1.0;
-   static const double two = 2.0;
-   static const double three = 3.0;
-   static const double four = 4.0;
-   static const double five = 5.0;
-   static const double six = 6.0;
-   static const double seven = 7.0;
-   static const double eight = 8.0;
-   static const double nine = 9.0;
-   static const double fourteen = 14.0;
-   static const double fiveteen = 15.0;
-   static const double sixteen = 16.0;
-   static const double twentyone = 21.0;
-   static const double twentyfour = 24.0;
-   static const double twentyeight = 28.0;
-   static const double twentynine = 29.0;
-   static const double fourtyeight = 48.0;
-   static const double fifty = 50.0;
-   static const double fiftysix = 56.0;
+static const double c1o72          = 1. / 72.; // 0.01388888
+static const double c1o36          = 1. / 36.; // 0.02777777
+static const double c1o48          = 1. / 48.; // 0.02083333
+static const double c1o32          = 1. / 32.; // 0.03125
+static const double c1o24          = 1. / 24.; // 0.04166666
+static const double c1o20          = 1. / 20.; // 0.05
+static const double c1o18          = 1. / 18.; // 0.05555555
+static const double c1o16          = 1. / 16.; // 0.0625
+static const double c1o12          = 1. / 12.; // 0.08333333
+static const double c1o9           = 1. / 9.;  // 0.11111111
+static const double c1o8           = 1. / 8.;  // 0.125
+static const double c1o6           = 1. / 6.;  // 0.16666666
+static const double c1o5           = 1. / 5.;  // 0.2
+static const double c1o4           = 1. / 4.;  // 0.25
+static const double c1o100         = 1. / 100.;
+static const double c5o16          = 5. / 16.;        // 0.3125
+static const double c1o3           = 1. / 3.;         // 0.33333333
+static const double c3o8           = 3. / 8.;         // 0.375
+static const double c4o9           = 4. / 9.;         // 0.44444444
+static const double c1o2           = 1. / 2.;         // 0.5
+static const double c9o16          = 9. / 16.;        // 0.5625
+static const double c2o3           = 2. / 3.;         // 0.66666666
+static const double c3o4           = 3. / 4.;         // 0.75
+static const double c3o2           = 3. / 2.;         // 1.5
+static const double c4o3           = 4. / 3.;         // 1.33333333
+static const double c5o3           = 5. / 3.;         // 1.66666666
+static const double c9o5           = 9. / 5.;         // 1.8
+static const double c2o9           = 2. / 9.;         // 0.22222222
+static const double one_over_sqrt2 = 1.0 / sqrt(2.0); // 0.707106781
+static const double one_over_sqrt3 = 1.0 / sqrt(3.0); // 0.577350269
+static const double sqrt2          = sqrt(2.0);       // 1.4142135
+static const double sqrt3          = sqrt(3.0);       // 1.7320508
+static const double zeroReal       = 0.0;
+static const double c1             = 1.0;
+static const double c2             = 2.0;
+static const double c3             = 3.0;
+static const double c4             = 4.0;
+static const double c5             = 5.0;
+static const double c6             = 6.0;
+static const double c7             = 7.0;
+static const double c8             = 8.0;
+static const double c9             = 9.0;
+static const double c14            = 14.0;
+static const double c15            = 15.0;
+static const double c16            = 16.0;
+static const double c18            = 18.0;
+static const double c21            = 21.0;
+static const double c24            = 24.0;
+static const double c28            = 28.0;
+static const double c29            = 29.0;
+static const double c36            = 36.0;
+static const double c48            = 48.0;
+static const double c50            = 50.0;
+static const double c56            = 56.0;
+static const double c152           = 152.0;
+static const double c130           = 130.0;
+static const double one            = 1.0;
+static const double two            = 2.0;
+static const double three          = 3.0;
+static const double four           = 4.0;
+static const double five           = 5.0;
+static const double six            = 6.0;
+static const double seven          = 7.0;
+static const double eight          = 8.0;
+static const double nine           = 9.0;
+static const double fourteen       = 14.0;
+static const double fiveteen       = 15.0;
+static const double sixteen        = 16.0;
+static const double twentyone      = 21.0;
+static const double twentyfour     = 24.0;
+static const double twentyeight    = 28.0;
+static const double twentynine     = 29.0;
+static const double fourtyeight    = 48.0;
+static const double fifty          = 50.0;
+static const double fiftysix       = 56.0;
 
-}
+} // namespace UbMath
 
 #endif
diff --git a/src/basics/basics/utilities/UbNupsTimer.h b/src/basics/basics/utilities/UbNupsTimer.h
index b4668ba91be3997922502956fd618da0521907c1..ca576fa6ce53c4bfaa48aed26463e12108745c94 100644
--- a/src/basics/basics/utilities/UbNupsTimer.h
+++ b/src/basics/basics/utilities/UbNupsTimer.h
@@ -5,7 +5,6 @@
 #include <sstream>
 #include <vector>
 
-
 /*=========================================================================*/
 /*  UbNupsTimer                                                             */
 /*                                                                         */
@@ -14,80 +13,81 @@ This Class provides the base for ...
 <BR><BR>
 @author <A HREF="mailto:muffmolch@gmx.de">S. Freudiger</A>
 @version 1.0 - 01.11.04
-*/ 
+*/
 class UbNupsTimer : public UbTiming
 {
 public:
-   UbNupsTimer() : UbTiming()
-   {
-      mTempNodes = 0.0;
-      mNofNodes.resize(0);
-      mDurations.resize(0);
-   }
-   /*==========================================================*/
-   UbNupsTimer(std::string name) : UbTiming(name)
-   {
-      mNofNodes.resize(0);
-      mDurations.resize(0);
-      mTempNodes = 0.0;
-   }
-   /*==========================================================*/
-   void initTiming() override
-   {
-      UbTiming::initTiming();
-      mNofNodes.resize(0);
-      mDurations.resize(0);
-      mTempNodes   = 0.0;
-   }
-   /*==========================================================*/
-   void startNUPSTiming(double nofNodes)
-   {
-      mTempNodes=nofNodes;
-      UbTiming::startTiming();
-   }
-   /*==========================================================*/
-   void endTiming() override
-   {
-      UbTiming::endTiming();
-      //save #node and time informations
-      mNofNodes.push_back(mTempNodes);
-      mDurations.push_back(UbTiming::getDuration());
-      //reset internal timecounter
-      UbTiming::initTiming();
-   }
-   /*==========================================================*/
-   double getAverageNups()
-   { 
-      double averageNups = 0.0;
-      for(int i=0;i<(int)mNofNodes.size();i++)
-         averageNups+=mNofNodes.at(i)/mDurations.at(i);
-      
-      return averageNups/(double)mNofNodes.size(); 
-   }
-   /*==========================================================*/
-   double getSumOfDuration()
-   {
-      double duration = 0.0;
-      for(int i=0;i<(int)mDurations.size();i++) duration+=mDurations.at(i);
-      return duration;
-   }
-   /*==========================================================*/
-   std::string getNupsString()
-   {
-      std::stringstream ss;
-      ss<<"saved nups informations"<<std::endl;
-      for(int i=0;i<(int)mNofNodes.size();i++)
-         ss<<mNofNodes.at(i)<<"nodes/"<<mDurations.at(i)<<"sec="<<mNofNodes.at(i)/mDurations.at(i)<<"nups\n";
-      return ss.str();
-   }
+    UbNupsTimer() : UbTiming()
+    {
+        mTempNodes = 0.0;
+        mNofNodes.resize(0);
+        mDurations.resize(0);
+    }
+    /*==========================================================*/
+    UbNupsTimer(std::string name) : UbTiming(name)
+    {
+        mNofNodes.resize(0);
+        mDurations.resize(0);
+        mTempNodes = 0.0;
+    }
+    /*==========================================================*/
+    void initTiming() override
+    {
+        UbTiming::initTiming();
+        mNofNodes.resize(0);
+        mDurations.resize(0);
+        mTempNodes = 0.0;
+    }
+    /*==========================================================*/
+    void startNUPSTiming(double nofNodes)
+    {
+        mTempNodes = nofNodes;
+        UbTiming::startTiming();
+    }
+    /*==========================================================*/
+    void endTiming() override
+    {
+        UbTiming::endTiming();
+        // save #node and time informations
+        mNofNodes.push_back(mTempNodes);
+        mDurations.push_back(UbTiming::getDuration());
+        // reset internal timecounter
+        UbTiming::initTiming();
+    }
+    /*==========================================================*/
+    double getAverageNups()
+    {
+        double averageNups = 0.0;
+        for (int i = 0; i < (int)mNofNodes.size(); i++)
+            averageNups += mNofNodes.at(i) / mDurations.at(i);
 
-protected:
+        return averageNups / (double)mNofNodes.size();
+    }
+    /*==========================================================*/
+    double getSumOfDuration()
+    {
+        double duration = 0.0;
+        for (int i = 0; i < (int)mDurations.size(); i++)
+            duration += mDurations.at(i);
+        return duration;
+    }
+    /*==========================================================*/
+    std::string getNupsString()
+    {
+        std::stringstream ss;
+        ss << "saved nups informations" << std::endl;
+        for (int i = 0; i < (int)mNofNodes.size(); i++)
+            ss << mNofNodes.at(i) << "nodes/" << mDurations.at(i) << "sec=" << mNofNodes.at(i) / mDurations.at(i)
+               << "nups\n";
+        return ss.str();
+    }
 
+protected:
 private:
-   std::vector<double> mNofNodes;
-   std::vector<double> mDurations;
-   
-   double mTempNodes;
+    std::vector<double> mNofNodes;
+    std::vector<double> mDurations;
+
+    double mTempNodes;
 };
 
 #endif
diff --git a/src/basics/basics/utilities/UbObservable.h b/src/basics/basics/utilities/UbObservable.h
index f877718f185615bd0645d8b54fd74b35eba4f476..0cbbe5655a47a9f238d038358d1b9855e4e52f80 100644
--- a/src/basics/basics/utilities/UbObservable.h
+++ b/src/basics/basics/utilities/UbObservable.h
@@ -1,28 +1,28 @@
 //=======================================================================================
-// ____          ____    __    ______     __________   __      __       __        __         
-// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |        
-//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |        
-//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |        
-//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____    
-//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|   
-//      \    \  |    |   ________________________________________________________________    
-//       \    \ |    |  |  ______________________________________________________________|   
-//        \    \|    |  |  |         __          __     __     __     ______      _______    
-//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)   
-//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______    
+// ____          ____    __    ______     __________   __      __       __        __
+// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |
+//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |
+//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |
+//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____
+//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|
+//      \    \  |    |   ________________________________________________________________
+//       \    \ |    |  |  ______________________________________________________________|
+//        \    \|    |  |  |         __          __     __     __     ______      _______
+//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)
+//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______
 //           \       |  |  |        |  |_____   |   \_/   |   |  |   |  |_/  /    _____  |
-//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/   
+//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/
 //
-//  This file is part of VirtualFluids. VirtualFluids is free software: you can 
+//  This file is part of VirtualFluids. VirtualFluids is free software: you can
 //  redistribute it and/or modify it under the terms of the GNU General Public
-//  License as published by the Free Software Foundation, either version 3 of 
+//  License as published by the Free Software Foundation, either version 3 of
 //  the License, or (at your option) any later version.
-//  
-//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT 
-//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
-//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License 
+//
+//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT
+//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 //  for more details.
-//  
+//
 //  You should have received a copy of the GNU General Public License along
 //  with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>.
 //
@@ -33,8 +33,8 @@
 #ifndef UBOBSERVABLE_H
 #define UBOBSERVABLE_H
 
-#include <list>               
 #include <iostream>
+#include <list>
 
 #include <basics/utilities/UbObserver.h>
 
@@ -49,8 +49,8 @@ class UbObserver;
 //!             this destructor is called AFTER the destructor of the
 //!             child classes. if you down_cast the pointer sent with the
 //!             objectWillBeDeleted(UbObserver* objpointer) then have to go this:
-//!               
-//!               if(dynamic_cast<UbObserver*>(observedObj)==objpointer) 
+//!
+//!               if(dynamic_cast<UbObserver*>(observedObj)==objpointer)
 //!                     (e.g.) observedObj=NULL;
 //!   example: see end of file
 //!
@@ -66,159 +66,149 @@ class UbObserver;
 //!
 //////////////////////////////////////////////////////////////////////////
 
-class UbObservable 
+class UbObservable
 {
 protected:
-   /*======================================================================*/
-   /*  Konstruktoren                                                       */
-   /*                                                                      */
-   /**
-     Creates a UbObservable itself to be the object to be observed.
-     Usually this constructor is used in extended classes.
-   */
-   UbObservable()
-   = default;
-   
-   UbObservable(const UbObservable&  /*src*/)
-   {
-      //no copy of observers !!!
-   }
-   
-   //falls irgendein schlaumeier den =operator von UbObservable aufrufen sollte,
-   //dann macht diesr auch keine kopie! (Allg: zuweisungsoperatoren werden nie vererbt
-   UbObservable& operator=(const UbObservable&  /*src*/)
-   {
-      return *this;
-   }
-   
-   //   /**
-   //     Creates a UbObservable for the specified Object to be observed.
-   //     Usually this constructor is used in associating UbObservable.
-   //     @param object Object to be observed
-   //   */
+    /*======================================================================*/
+    /*  Konstruktoren                                                       */
+    /*                                                                      */
+    /**
+      Creates a UbObservable itself to be the object to be observed.
+      Usually this constructor is used in extended classes.
+    */
+    UbObservable() = default;
+
+    UbObservable(const UbObservable & /*src*/)
+    {
+        // no copy of observers !!!
+    }
+
+    // falls irgendein schlaumeier den =operator von UbObservable aufrufen sollte,
+    // dann macht diesr auch keine kopie! (Allg: zuweisungsoperatoren werden nie vererbt
+    UbObservable &operator=(const UbObservable & /*src*/) { return *this; }
+
+    //   /**
+    //     Creates a UbObservable for the specified Object to be observed.
+    //     Usually this constructor is used in associating UbObservable.
+    //     @param object Object to be observed
+    //   */
 public:
-   /*======================================================================*/
-   /*  Destruktor                                                          */
-   /*                                                                      */
-   /**
-   */
-   virtual ~UbObservable()
-   {
-      this->notifyObserversObjectWillBeDeleted();
-   } 
+    /*======================================================================*/
+    /*  Destruktor                                                          */
+    /*                                                                      */
+    /**
+     */
+    virtual ~UbObservable() { this->notifyObserversObjectWillBeDeleted(); }
+
+    /*======================================================================*/
+    /*  methods                                                            */
+    /*                                                                      */
 
-   /*======================================================================*/
-   /*  methods                                                            */
-   /*                                                                      */
-   
-   /**
-   Adds an UbObserver to the observerlist.
-   @param observer the observer to add to this observable (note that an observer may observe c1 observable more than once)
-   */
-   virtual void addObserver(UbObserver* observer)
-   {
-      if(!observer) return;
-      for(std::list<UbObserver*>::iterator pos=mObserverList.begin();pos!=mObserverList.end();++pos)
-      {
-         if(*pos == observer) return;
-      }
-      this->mObserverList.push_back(observer);
-   }
-   /**
-   Deletes an UbObserver from the observerlist.
-   @param observer the observer to remove from this observable (note that all observers identical are deleted)
-   ( delete means delete Heap... but here we're only removing a pointer)
-   */
-   virtual void removeObserver(UbObserver* observer)
-   {
-      if(!observer) return;
-      this->mObserverList.remove(observer);
+    /**
+    Adds an UbObserver to the observerlist.
+    @param observer the observer to add to this observable (note that an observer may observe c1 observable more than
+    once)
+    */
+    virtual void addObserver(UbObserver *observer)
+    {
+        if (!observer)
+            return;
+        for (std::list<UbObserver *>::iterator pos = mObserverList.begin(); pos != mObserverList.end(); ++pos) {
+            if (*pos == observer)
+                return;
+        }
+        this->mObserverList.push_back(observer);
+    }
+    /**
+    Deletes an UbObserver from the observerlist.
+    @param observer the observer to remove from this observable (note that all observers identical are deleted)
+    ( delete means delete Heap... but here we're only removing a pointer)
+    */
+    virtual void removeObserver(UbObserver *observer)
+    {
+        if (!observer)
+            return;
+        this->mObserverList.remove(observer);
+    }
+    /**
+    Deletes all Observers from the observerlist.
+    ( delete means delete Heap... but here we're only removing a pointer)
+    */
+    virtual void removeAllObservers() { this->mObserverList.clear(); }
 
-   }
-   /**
-   Deletes all Observers from the observerlist.
-   ( delete means delete Heap... but here we're only removing a pointer)
-   */
-   virtual void removeAllObservers()
-   {
-      this->mObserverList.clear();
-   }
-   
-   /**
-     Checks whether the specified UbObserver observes this observable.
-     @param observer the observer to remove from this observable (note that all observers identical are deleted)
-     @return true if the specified observer observes this observable
-   */
-   virtual bool isObservedBy(UbObserver* observer)
-   {
-      if(!observer) return false;
-      for(std::list<UbObserver*>::iterator pos=mObserverList.begin();pos!=mObserverList.end();++pos)
-      {
-         if(*pos == observer) return true;
-      }
-      return false;
-   }
-   /**
-     Notifies all of its observers that something happened. Does nothing, if the observed object is null.
-     Calls the Method UbObserver.objectChanged(Object) with the object of this observable as parameter.
-     The Method UbObserver.objectChanged(Object) must be defined
-     by each class implementing the interface TiObserver
-   */
-   virtual void notifyObserversObjectChanged()
-   {
-      std::list<UbObserver*>::iterator tmp_pos; //es kann sein, dass der aktuelle observer waehrend
-                                           //objectChanged() removed wird...
-      for(std::list<UbObserver*>::iterator pos=mObserverList.begin();pos!=mObserverList.end();)
-      {
-        //cout<<"in notifyObserversObjectChanged\n";
-        //cout<<this->mObserverList.size()<<endl;
+    /**
+      Checks whether the specified UbObserver observes this observable.
+      @param observer the observer to remove from this observable (note that all observers identical are deleted)
+      @return true if the specified observer observes this observable
+    */
+    virtual bool isObservedBy(UbObserver *observer)
+    {
+        if (!observer)
+            return false;
+        for (std::list<UbObserver *>::iterator pos = mObserverList.begin(); pos != mObserverList.end(); ++pos) {
+            if (*pos == observer)
+                return true;
+        }
+        return false;
+    }
+    /**
+      Notifies all of its observers that something happened. Does nothing, if the observed object is null.
+      Calls the Method UbObserver.objectChanged(Object) with the object of this observable as parameter.
+      The Method UbObserver.objectChanged(Object) must be defined
+      by each class implementing the interface TiObserver
+    */
+    virtual void notifyObserversObjectChanged()
+    {
+        std::list<UbObserver *>::iterator tmp_pos; // es kann sein, dass der aktuelle observer waehrend
+                                                   // objectChanged() removed wird...
+        for (std::list<UbObserver *>::iterator pos = mObserverList.begin(); pos != mObserverList.end();) {
+            // cout<<"in notifyObserversObjectChanged\n";
+            // cout<<this->mObserverList.size()<<endl;
 
-         tmp_pos = pos++; // erst tmp_pos=pos und dann pos++
-         (*tmp_pos)->objectChanged(this);
-      }
-   }
+            tmp_pos = pos++; // erst tmp_pos=pos und dann pos++
+            (*tmp_pos)->objectChanged(this);
+        }
+    }
 
-   std::list<UbObserver*>* getObserverList() { return &mObserverList;}
+    std::list<UbObserver *> *getObserverList() { return &mObserverList; }
 
-   virtual std::string toString() { return "UbObservable - toString()"; }
+    virtual std::string toString() { return "UbObservable - toString()"; }
 
 private:
-   /**
-     Notifies all of its observers that something happened. Does nothing, if the observed object is null.
-     Calls the Method UbObserver.objectChanged(Object) with the object of this observable as parameter.
-     The Method UbObserver.objectChanged(Object) must be defined
-     by each class implementing the interface TiObserver
-   */
-   virtual void notifyObserversObjectWillBeDeleted()
-   {
-      std::list<UbObserver*>::iterator tmp_pos; //es kann sein, dass der aktuelle observer waehrend
-                                          //objectWillBeDeleted() removed wird...
-      for(std::list<UbObserver*>::iterator pos=mObserverList.begin();pos!=mObserverList.end();)
-      {
-         //cout<<"in notifyObserversObjectWillBeDeleted\n";
-         //cout<<this->mObserverList.size()<<endl;
+    /**
+      Notifies all of its observers that something happened. Does nothing, if the observed object is null.
+      Calls the Method UbObserver.objectChanged(Object) with the object of this observable as parameter.
+      The Method UbObserver.objectChanged(Object) must be defined
+      by each class implementing the interface TiObserver
+    */
+    virtual void notifyObserversObjectWillBeDeleted()
+    {
+        std::list<UbObserver *>::iterator tmp_pos; // es kann sein, dass der aktuelle observer waehrend
+                                                   // objectWillBeDeleted() removed wird...
+        for (std::list<UbObserver *>::iterator pos = mObserverList.begin(); pos != mObserverList.end();) {
+            // cout<<"in notifyObserversObjectWillBeDeleted\n";
+            // cout<<this->mObserverList.size()<<endl;
 
-         tmp_pos = pos++;
-         (*tmp_pos)->objectWillBeDeleted(this);
-      }
-   }
+            tmp_pos = pos++;
+            (*tmp_pos)->objectWillBeDeleted(this);
+        }
+    }
 
-   std::list<UbObserver*> mObserverList;
+    std::list<UbObserver *> mObserverList;
 };
 /*=========================================================================*/
 
-
 #ifdef RCF_USE_SF_SERIALIZATION
-   SF_NO_CTOR(UbObservable);
-#endif //RCF_USE_SF_SERIALIZATION
+SF_NO_CTOR(UbObservable);
+#endif // RCF_USE_SF_SERIALIZATION
 
 #endif
 
-////  E X A M P L E 
+////  E X A M P L E
 ////===================
-//class Point : public UbObservable
+// class Point : public UbObservable
 //{
-//public:
+// public:
 //   Point(){x=y=0;}
 //   ~Point(){}
 //   void setXCorrdinates(int x,int y)
@@ -226,14 +216,14 @@ private:
 //     this->x = x; this->y = y;
 //     this->notifyObserverObjectChanged();
 //   }
-//private:
+// private:
 //   int x,y;
 //};
-//class VisPoint : public UbObserver
+// class VisPoint : public UbObserver
 //{
-//public:
+// public:
 //   VisPoint(Point* point)
-//   { 
+//   {
 //      this->point = point;
 //      this->point->addObserver(this);
 //   }
@@ -264,6 +254,6 @@ private:
 //      //was hingegen immer moeglich sein sollte:
 //      //if(dynamic_cast<void*>(objectForDeletion)==dynamic_cast<void*>(this->point))
 //   }
-//private:
+// private:
 //   Point* point;
 //};
diff --git a/src/basics/basics/utilities/UbObserver.h b/src/basics/basics/utilities/UbObserver.h
index dab5d28c0cc83a4a73fdba8d9be7f979f9d96c2b..ecba69207f2c7f76d36ef0699b23eb0c088968a6 100644
--- a/src/basics/basics/utilities/UbObserver.h
+++ b/src/basics/basics/utilities/UbObserver.h
@@ -1,28 +1,28 @@
 //=======================================================================================
-// ____          ____    __    ______     __________   __      __       __        __         
-// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |        
-//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |        
-//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |        
-//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____    
-//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|   
-//      \    \  |    |   ________________________________________________________________    
-//       \    \ |    |  |  ______________________________________________________________|   
-//        \    \|    |  |  |         __          __     __     __     ______      _______    
-//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)   
-//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______    
+// ____          ____    __    ______     __________   __      __       __        __
+// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |
+//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |
+//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |
+//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____
+//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|
+//      \    \  |    |   ________________________________________________________________
+//       \    \ |    |  |  ______________________________________________________________|
+//        \    \|    |  |  |         __          __     __     __     ______      _______
+//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)
+//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______
 //           \       |  |  |        |  |_____   |   \_/   |   |  |   |  |_/  /    _____  |
-//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/   
+//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/
 //
-//  This file is part of VirtualFluids. VirtualFluids is free software: you can 
+//  This file is part of VirtualFluids. VirtualFluids is free software: you can
 //  redistribute it and/or modify it under the terms of the GNU General Public
-//  License as published by the Free Software Foundation, either version 3 of 
+//  License as published by the Free Software Foundation, either version 3 of
 //  the License, or (at your option) any later version.
-//  
-//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT 
-//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
-//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License 
+//
+//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT
+//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 //  for more details.
-//  
+//
 //  You should have received a copy of the GNU General Public License along
 //  with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>.
 //
@@ -46,33 +46,29 @@ class UbObservable;
 //!
 //////////////////////////////////////////////////////////////////////////
 
-class UbObserver 
+class UbObserver
 {
 protected:
-
-   UbObserver()= default;
+    UbObserver() = default;
 
 public:
+    virtual ~UbObserver() = default;
 
-   virtual ~UbObserver()= default;
-
-   /*======================================================================*/
-   /*  Methods                                                           */
-   /*                                                                      */
-   /*!
-   This function is called when the observable indicated that an object
-   has changed.
-   \param changedObject Object which has changed
-   */
-   virtual void objectChanged(UbObservable* changedObject)=0;
-   /*!
-   This function is called when the observable indicated that an object
-   should be deleted.
-   \param objectForDeletion Object which should be deleted
-   */
-   virtual void objectWillBeDeleted(UbObservable* objectForDeletion)=0;
+    /*======================================================================*/
+    /*  Methods                                                           */
+    /*                                                                      */
+    /*!
+    This function is called when the observable indicated that an object
+    has changed.
+    \param changedObject Object which has changed
+    */
+    virtual void objectChanged(UbObservable *changedObject) = 0;
+    /*!
+    This function is called when the observable indicated that an object
+    should be deleted.
+    \param objectForDeletion Object which should be deleted
+    */
+    virtual void objectWillBeDeleted(UbObservable *objectForDeletion) = 0;
 };
 
 #endif
-
-
diff --git a/src/basics/basics/utilities/UbRandom.h b/src/basics/basics/utilities/UbRandom.h
index dd3b4671e69e504db5f3fdb3cba0c4a2ad7c8b43..aed28014b0a866f9223162dc9a07237c7da4b1b0 100644
--- a/src/basics/basics/utilities/UbRandom.h
+++ b/src/basics/basics/utilities/UbRandom.h
@@ -4,13 +4,13 @@
 // | |/ / / /  / /_/ /_/ / /_/ / / __/ / / /_/ / / /_/ (__  )
 // |___/_/_/   \__/\__,_/\__,_/_/_/   /_/\__,_/_/\__,_/____/
 //
-#ifndef UBRANDOM_H 
-#define UBRANDOM_H 
+#ifndef UBRANDOM_H
+#define UBRANDOM_H
 
-#include <cstdlib> 
-#include <ctime> 
-#include <cassert> 
-#include <cmath> 
+#include <cassert>
+#include <cmath>
+#include <cstdlib>
+#include <ctime>
 
 /*=========================================================================*/
 /*  UbRandom                                                             */
@@ -20,41 +20,41 @@ generates a random number
 <BR><BR>
 @author <A HREF="mailto:muffmolch@gmx.de">S. Freudiger</A>
 @version 1.0 - 04.10.2007
-*/ 
+*/
 /*
-usage: 
-   int main() 
-   { 
-      char* hand[] = {"Schere", "Stein", "Papier"}; 
-      for (unsigned u = 0; u < 20; u++) 
-      { 
-         cout << hand[UbRandom::rand(0, 2, 1)] << endl; 
-      } 
+usage:
+   int main()
+   {
+      char* hand[] = {"Schere", "Stein", "Papier"};
+      for (unsigned u = 0; u < 20; u++)
+      {
+         cout << hand[UbRandom::rand(0, 2, 1)] << endl;
+      }
 
-      return 0; 
-   } 
+      return 0;
+   }
 */
 
-class UbRandom 
-{ 
-private: 
-   UbRandom() { std::srand(static_cast<int>(std::time(NULL)));  } 
+class UbRandom
+{
+private:
+    UbRandom() { std::srand(static_cast<int>(std::time(NULL))); }
 
-public: 
-   //returns arbitrary int value element of [min ; max]
-   static inline int rand(const int& min, const int& max) 
-   { 
-      static UbRandom dummy; 
-      assert(max - min < RAND_MAX); 
-      return ( min + std::rand() % (max - min + 1) ); 
-   } 
-   //returns arbitrary float value element of "( (max - min) / gran ) * [min ; max]"
-   //with other words: val = min+n*(max-min)/gran, n=0..gran-1
-   static inline double rand(const double& min, const double& max, const double& gran)
-   {
-      static UbRandom dummy; 
-      return (min + std::floor( std::rand() / (1.0 + RAND_MAX) * gran)* (max - min) / gran);
-   }
-}; 
+public:
+    // returns arbitrary int value element of [min ; max]
+    static inline int rand(const int &min, const int &max)
+    {
+        static UbRandom dummy;
+        assert(max - min < RAND_MAX);
+        return (min + std::rand() % (max - min + 1));
+    }
+    // returns arbitrary float value element of "( (max - min) / gran ) * [min ; max]"
+    // with other words: val = min+n*(max-min)/gran, n=0..gran-1
+    static inline double rand(const double &min, const double &max, const double &gran)
+    {
+        static UbRandom dummy;
+        return (min + std::floor(std::rand() / (1.0 + RAND_MAX) * gran) * (max - min) / gran);
+    }
+};
 
-#endif //UBRANDOM_H
+#endif // UBRANDOM_H
diff --git a/src/basics/basics/utilities/UbScheduler.h b/src/basics/basics/utilities/UbScheduler.h
index fcb410b2270843ee8e6c8a274228be71446d2841..08bb38ba8ae8755d8ef1e38cd92279e26b994610 100644
--- a/src/basics/basics/utilities/UbScheduler.h
+++ b/src/basics/basics/utilities/UbScheduler.h
@@ -1,28 +1,28 @@
 //=======================================================================================
-// ____          ____    __    ______     __________   __      __       __        __         
-// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |        
-//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |        
-//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |        
-//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____    
-//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|   
-//      \    \  |    |   ________________________________________________________________    
-//       \    \ |    |  |  ______________________________________________________________|   
-//        \    \|    |  |  |         __          __     __     __     ______      _______    
-//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)   
-//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______    
+// ____          ____    __    ______     __________   __      __       __        __
+// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |
+//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |
+//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |
+//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____
+//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|
+//      \    \  |    |   ________________________________________________________________
+//       \    \ |    |  |  ______________________________________________________________|
+//        \    \|    |  |  |         __          __     __     __     ______      _______
+//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)
+//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______
 //           \       |  |  |        |  |_____   |   \_/   |   |  |   |  |_/  /    _____  |
-//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/   
+//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/
 //
-//  This file is part of VirtualFluids. VirtualFluids is free software: you can 
+//  This file is part of VirtualFluids. VirtualFluids is free software: you can
 //  redistribute it and/or modify it under the terms of the GNU General Public
-//  License as published by the Free Software Foundation, either version 3 of 
+//  License as published by the Free Software Foundation, either version 3 of
 //  the License, or (at your option) any later version.
-//  
-//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT 
-//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
-//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License 
+//
+//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT
+//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 //  for more details.
-//  
+//
 //  You should have received a copy of the GNU General Public License along
 //  with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>.
 //
@@ -33,22 +33,22 @@
 #ifndef UBSCHEDULER_H
 #define UBSCHEDULER_H
 
+#include <algorithm>
+#include <cassert>
+#include <iomanip>
 #include <iostream>
-#include <string>
 #include <limits>
-#include <cassert> 
 #include <sstream>
-#include <iomanip>
-#include <algorithm>
+#include <string>
 
-#include <basics/utilities/UbSystem.h>
-#include <basics/utilities/UbMath.h>
-#include <basics/utilities/UbInfinity.h>
 #include <basics/utilities/UbComparators.h>
+#include <basics/utilities/UbInfinity.h>
+#include <basics/utilities/UbMath.h>
+#include <basics/utilities/UbSystem.h>
 
 //////////////////////////////////////////////////////////////////////////
 //!
-//! \brief A class implements scheduling. 
+//! \brief A class implements scheduling.
 //! \details This class is not thread save.
 //!
 //////////////////////////////////////////////////////////////////////////
@@ -56,276 +56,278 @@
 class UbScheduler
 {
 public:
-   class UbSchedule
-   {
-      friend class UbScheduler;
-   public:
-      UbSchedule() :  step(Ub::inf), begin(Ub::inf), end(Ub::inf) { }
-      UbSchedule(const double& step, const double& begin=0.0, const double& end=Ub::inf) 
-         : step(step), begin(begin), end(end) 
-      {  
-      }
-      double getStep()  const { return this->step;  }
-      double getBegin() const { return this->begin; }
-      double getEnd()   const { return this->end;   }
-      
-      /*==========================================================*/
-      std::string toString() { std::stringstream text; text<<*this; return text.str(); }
-      /*==========================================================*/
-      friend inline std::ostream& operator << (std::ostream& os, const UbSchedule& schedule) 
-      {
-         os<<"Schedule[start,end,step]=["<<schedule.begin<<", "<<schedule.end<<", "<<schedule.step<<"]";
-         return os;
-      }
+    class UbSchedule
+    {
+        friend class UbScheduler;
 
-   private:
-      double step, begin, end;
-   };
+    public:
+        UbSchedule() : step(Ub::inf), begin(Ub::inf), end(Ub::inf) {}
+        UbSchedule(const double &step, const double &begin = 0.0, const double &end = Ub::inf)
+            : step(step), begin(begin), end(end)
+        {
+        }
+        double getStep() const { return this->step; }
+        double getBegin() const { return this->begin; }
+        double getEnd() const { return this->end; }
+
+        /*==========================================================*/
+        std::string toString()
+        {
+            std::stringstream text;
+            text << *this;
+            return text.str();
+        }
+        /*==========================================================*/
+        friend inline std::ostream &operator<<(std::ostream &os, const UbSchedule &schedule)
+        {
+            os << "Schedule[start,end,step]=[" << schedule.begin << ", " << schedule.end << ", " << schedule.step
+               << "]";
+            return os;
+        }
+
+    private:
+        double step, begin, end;
+    };
 
 public:
-   UbScheduler() 
-   {
-      this->initVals();
-   }
-   /*==========================================================*/                         
-   UbScheduler(const double& step,const double& begin=0, const double& end=Ub::inf ) 
-   {
-      this->initVals();
-      this->addSchedule(step,begin,end);
-   }
-   /*==========================================================*/
-   UbScheduler(const UbSchedule& schedule) 
-   {
-      this->initVals();
-      this->addSchedule(schedule);
-   }
-   /*==========================================================*/
-   virtual ~UbScheduler() = default;
-   /*==========================================================*/
-   inline void addSchedule(const UbSchedule& schedule)
-   {
-      this->addSchedule(schedule.step, schedule.begin, schedule.end);
-   }
-   /*==========================================================*/
-   bool addSchedule(const double& step, const double& begin, double end)
-   {
-      if( UbMath::zero(step) || begin>end )
-      { 
-         std::cerr<<"UbScheduler::addSchedule - invalid Schedule:\n\t"<<UbSchedule(step, begin, end)<<std::endl;
-         return false; 
-      }
-      
-      if( UbMath::less( end, (double)Ub::inf )  )
-      {
-         //es kann vorkommen, dass man mit dem intervall nicht genau auf den letzten wert kommt
-         //(z.B. step=2; start=0; end=9; -> ende wird angepasst)
-         //also wenn end-begin>Ub::inf ist, dann geht es halt nicht.. ein cast in long double half hier nichts
-         double multiplier=0.0;
-         double fractpart =  modf( (end-begin)/step, &multiplier);
-         if( !UbMath::zero(fractpart) )
-         {
-            //tmp-speicherung (fuer cerr)
-            fractpart = end;
-            //neues ende
-            end = begin+multiplier*step;
-            
-            std::cerr<<"Warning: UbScheduler::addSchedule - "
-                      <<"end of schedule was adapted to intervall \n\t"
-                      <<"from "<< UbSchedule(step, begin, fractpart) <<" to "<< UbSchedule(step, begin, end) <<std::endl;
-         }
-      }
+    UbScheduler() { this->initVals(); }
+    /*==========================================================*/
+    UbScheduler(const double &step, const double &begin = 0, const double &end = Ub::inf)
+    {
+        this->initVals();
+        this->addSchedule(step, begin, end);
+    }
+    /*==========================================================*/
+    UbScheduler(const UbSchedule &schedule)
+    {
+        this->initVals();
+        this->addSchedule(schedule);
+    }
+    /*==========================================================*/
+    virtual ~UbScheduler() = default;
+    /*==========================================================*/
+    inline void addSchedule(const UbSchedule &schedule)
+    {
+        this->addSchedule(schedule.step, schedule.begin, schedule.end);
+    }
+    /*==========================================================*/
+    bool addSchedule(const double &step, const double &begin, double end)
+    {
+        if (UbMath::zero(step) || begin > end) {
+            std::cerr << "UbScheduler::addSchedule - invalid Schedule:\n\t" << UbSchedule(step, begin, end)
+                      << std::endl;
+            return false;
+        }
+
+        if (UbMath::less(end, (double)Ub::inf)) {
+            // es kann vorkommen, dass man mit dem intervall nicht genau auf den letzten wert kommt
+            //(z.B. step=2; start=0; end=9; -> ende wird angepasst)
+            // also wenn end-begin>Ub::inf ist, dann geht es halt nicht.. ein cast in long double half hier nichts
+            double multiplier = 0.0;
+            double fractpart  = modf((end - begin) / step, &multiplier);
+            if (!UbMath::zero(fractpart)) {
+                // tmp-speicherung (fuer cerr)
+                fractpart = end;
+                // neues ende
+                end = begin + multiplier * step;
+
+                std::cerr << "Warning: UbScheduler::addSchedule - "
+                          << "end of schedule was adapted to intervall \n\t"
+                          << "from " << UbSchedule(step, begin, fractpart) << " to " << UbSchedule(step, begin, end)
+                          << std::endl;
+            }
+        }
+
+        // nu aber:
+        schedules.emplace_back(step, begin, end);
 
-      //nu aber:
-      schedules.emplace_back(step, begin, end);
+        if (end > maxT)
+            maxT = end;
 
-      if( end>maxT ) maxT = end;
+        double potentialDueTime;
+        if (calcNextDueTimeForSchedule(schedules.back(), lastUsedT, potentialDueTime) &&
+            potentialDueTime < nextDueTime) {
+            nextDueTime = potentialDueTime;
+        }
 
-      double potentialDueTime;
-      if(   calcNextDueTimeForSchedule(schedules.back(), lastUsedT, potentialDueTime)
-         && potentialDueTime < nextDueTime   )
-      {
-         nextDueTime = potentialDueTime;
-      }
+        return true;
+    }
+    /*==========================================================*/
+    // returns true if scheduler contains schedules
+    bool hasSchedules() const { return !schedules.empty(); }
+    /*==========================================================*/
+    // time bei dem das letzte mal isDue(time) true war
+    double getLastDueTime() const { return lastDueTime; }
+    /*==========================================================*/
+    // time bei dem das naechste mal isDue(time) true ergibt
+    double getNextDueTime() const { return nextDueTime; }
+    /*==========================================================*/
+    // maxDueTime (maxTime der Schedules!
+    double getMaxDueTime() const { return this->maxT; }
+    /*==========================================================*/
+    bool isDue(const double &t)
+    {
+        lastUsedT = t;
+        if (UbMath::greaterEqual(t, nextDueTime)) {
+            // groesser maxT is nicht
+            if (UbMath::greater(t, maxT))
+                return false;
 
-      return true;
-   }
-   /*==========================================================*/
-   //returns true if scheduler contains schedules
-   bool   hasSchedules() const { return !schedules.empty(); }
-   /*==========================================================*/
-   //time bei dem das letzte mal isDue(time) true war
-   double getLastDueTime() const { return lastDueTime; }
-   /*==========================================================*/
-   //time bei dem das naechste mal isDue(time) true ergibt
-   double getNextDueTime() const { return nextDueTime; }
-   /*==========================================================*/
-   //maxDueTime (maxTime der Schedules!
-   double getMaxDueTime()  const { return this->maxT; }
-   /*==========================================================*/
-   bool isDue(const double& t)
-   {
-      lastUsedT = t;
-      if( UbMath::greaterEqual(t,nextDueTime) ) 
-      {
-         //groesser maxT is nicht
-         if( UbMath::greater(t,maxT) )  return false;
-         
-         //temp var
-         double actDueTime = nextDueTime;
+            // temp var
+            double actDueTime = nextDueTime;
 
-         //um Suche nach nextDueTime bei "Zukunfts-t" zu optimieren, setzt man die "start"-suchzeit auf "t-1":
-         nextDueTime = t-1; //t-1 deshlab, damit falls z.B. while Schleife nicht durchlaufen wird
-                            //die folgende if Abfrage nicht faelschlicher Weise true ist!
-         while( UbMath::greaterEqual(t,nextDueTime) && !UbMath::equal(nextDueTime, maxT) )
-         {
-            double tmpNextDueTime = maxT, potentialDueTime=-1.0;
-            for(std::size_t i=0; i<schedules.size(); i++)
-            {
-               if(   calcNextDueTimeForSchedule(schedules[i], nextDueTime, potentialDueTime)
-                  && potentialDueTime < tmpNextDueTime                 )
-               {
-                  assert( nextDueTime < potentialDueTime );
-                  tmpNextDueTime = potentialDueTime;
-               }
+            // um Suche nach nextDueTime bei "Zukunfts-t" zu optimieren, setzt man die "start"-suchzeit auf "t-1":
+            nextDueTime = t - 1; // t-1 deshlab, damit falls z.B. while Schleife nicht durchlaufen wird
+                                 // die folgende if Abfrage nicht faelschlicher Weise true ist!
+            while (UbMath::greaterEqual(t, nextDueTime) && !UbMath::equal(nextDueTime, maxT)) {
+                double tmpNextDueTime = maxT, potentialDueTime = -1.0;
+                for (std::size_t i = 0; i < schedules.size(); i++) {
+                    if (calcNextDueTimeForSchedule(schedules[i], nextDueTime, potentialDueTime) &&
+                        potentialDueTime < tmpNextDueTime) {
+                        assert(nextDueTime < potentialDueTime);
+                        tmpNextDueTime = potentialDueTime;
+                    }
+                }
+                actDueTime  = nextDueTime;
+                nextDueTime = tmpNextDueTime;
             }
-            actDueTime  = nextDueTime;
-            nextDueTime = tmpNextDueTime;
-         } 
 
-         //wenn t = der aktuuellen oder gar schon der naechstmoeglichen ist (hierbei wurde
-         //zuvor actDueTime und nextDueTime ggf. angepasst)
-         //Bsp.: nextDuTime war 5, aber fuer t=400 gilt andere schedule -> Bsp actDue=350 und nextDue 405
-         if(    UbMath::equal(t,actDueTime)    
-             || UbMath::equal(t,nextDueTime) ) 
-         {
-            lastDueTime = t;
-            return true;
-         }
-      }
-      else if( UbMath::lessEqual(t, lastDueTime) ) 
-      {
-         if(UbMath::equal(t, lastDueTime) ) return true; //braucht man, wenn man fuer dasselbe t isDue(t) aufruft
-         else  
-         {
-            //Fall: Zeit liegt faktisch in der Vergangenheit -> neu initialsisieren
-            double tmpNextDueTime = maxT, potentialDueTime=-1.0;
-            for(size_t i=0; i<schedules.size(); i++)
-            {
-               if(   calcNextDueTimeForSchedule(schedules[i], t-1, potentialDueTime)
-                  && potentialDueTime < tmpNextDueTime                 )
-               {
-                  tmpNextDueTime = potentialDueTime;
-               }
+            // wenn t = der aktuuellen oder gar schon der naechstmoeglichen ist (hierbei wurde
+            // zuvor actDueTime und nextDueTime ggf. angepasst)
+            // Bsp.: nextDuTime war 5, aber fuer t=400 gilt andere schedule -> Bsp actDue=350 und nextDue 405
+            if (UbMath::equal(t, actDueTime) || UbMath::equal(t, nextDueTime)) {
+                lastDueTime = t;
+                return true;
             }
-            nextDueTime = tmpNextDueTime;
+        } else if (UbMath::lessEqual(t, lastDueTime)) {
+            if (UbMath::equal(t, lastDueTime))
+                return true; // braucht man, wenn man fuer dasselbe t isDue(t) aufruft
+            else {
+                // Fall: Zeit liegt faktisch in der Vergangenheit -> neu initialsisieren
+                double tmpNextDueTime = maxT, potentialDueTime = -1.0;
+                for (size_t i = 0; i < schedules.size(); i++) {
+                    if (calcNextDueTimeForSchedule(schedules[i], t - 1, potentialDueTime) &&
+                        potentialDueTime < tmpNextDueTime) {
+                        tmpNextDueTime = potentialDueTime;
+                    }
+                }
+                nextDueTime = tmpNextDueTime;
 
-            return UbMath::equal(t, nextDueTime);
-         }
-      }
+                return UbMath::equal(t, nextDueTime);
+            }
+        }
 
-      return false;
-   }
-   /*==========================================================*/
-   inline double getMinBegin( ) const
-   {
-      if( schedules.empty() ) return Ub::inf;
-      return std::min_element(schedules.begin(), schedules.end(),UbComparators::membercomp(&UbSchedule::getBegin) )->getBegin();
-   }
-   /*==========================================================*/
-   inline double getMaxBegin( ) const
-   {
-      if( schedules.empty() ) return Ub::inf;
-      return std::max_element(schedules.begin(), schedules.end(),UbComparators::membercomp(&UbSchedule::getBegin) )->getBegin();
-   }
-   /*==========================================================*/
-   inline double getMinEnd( ) const
-   {
-      if( schedules.empty() ) return Ub::inf;
-      return std::min_element(schedules.begin(), schedules.end(),UbComparators::membercomp(&UbSchedule::getEnd) )->getEnd();
-   }
-   /*==========================================================*/
-   inline double getMaxEnd( ) const
-   {
-      if( schedules.empty() ) return Ub::inf;
-      return std::max_element(schedules.begin(), schedules.end(),UbComparators::membercomp(&UbSchedule::getEnd) )->getEnd();
-   }
-   /*==========================================================*/
-   inline double getMinStep( ) const
-   {
-      if( schedules.empty() ) return Ub::inf;
-      return std::min_element(schedules.begin(), schedules.end(),UbComparators::membercomp(&UbSchedule::getStep) )->getStep();
-   }
-   /*==========================================================*/
-   inline double getMaxStep( ) const
-   {
-      if( schedules.empty() ) return Ub::inf;
-      return std::max_element(schedules.begin(), schedules.end(),UbComparators::membercomp(&UbSchedule::getStep) )->getStep();
-   }
-   /*==========================================================*/
-   inline std::string toString() const
-   {
-      std::stringstream text;
-      text<<*this;
-      return text.str();
-   }
-   /*==========================================================*/
-   friend inline std::ostream& operator << (std::ostream& os, const UbScheduler& scheduler) 
-   {
-      os<<"UbScheduler\n";
-      os<<"Schedule |       start       |        end        |     intervall     "<<std::endl;
-      for(std::size_t i=0; i<scheduler.schedules.size(); i++)
-         os<<std::setw(9)<<i<<"|"
-           <<std::setw(19)<<scheduler.schedules[i].getBegin()<<"|"
-           <<std::setw(19)<<scheduler.schedules[i].getEnd()  <<"|"
-           <<std::setw(19)<<scheduler.schedules[i].getStep() <<std::endl;
-      return os;
-   }
+        return false;
+    }
+    /*==========================================================*/
+    inline double getMinBegin() const
+    {
+        if (schedules.empty())
+            return Ub::inf;
+        return std::min_element(schedules.begin(), schedules.end(), UbComparators::membercomp(&UbSchedule::getBegin))
+            ->getBegin();
+    }
+    /*==========================================================*/
+    inline double getMaxBegin() const
+    {
+        if (schedules.empty())
+            return Ub::inf;
+        return std::max_element(schedules.begin(), schedules.end(), UbComparators::membercomp(&UbSchedule::getBegin))
+            ->getBegin();
+    }
+    /*==========================================================*/
+    inline double getMinEnd() const
+    {
+        if (schedules.empty())
+            return Ub::inf;
+        return std::min_element(schedules.begin(), schedules.end(), UbComparators::membercomp(&UbSchedule::getEnd))
+            ->getEnd();
+    }
+    /*==========================================================*/
+    inline double getMaxEnd() const
+    {
+        if (schedules.empty())
+            return Ub::inf;
+        return std::max_element(schedules.begin(), schedules.end(), UbComparators::membercomp(&UbSchedule::getEnd))
+            ->getEnd();
+    }
+    /*==========================================================*/
+    inline double getMinStep() const
+    {
+        if (schedules.empty())
+            return Ub::inf;
+        return std::min_element(schedules.begin(), schedules.end(), UbComparators::membercomp(&UbSchedule::getStep))
+            ->getStep();
+    }
+    /*==========================================================*/
+    inline double getMaxStep() const
+    {
+        if (schedules.empty())
+            return Ub::inf;
+        return std::max_element(schedules.begin(), schedules.end(), UbComparators::membercomp(&UbSchedule::getStep))
+            ->getStep();
+    }
+    /*==========================================================*/
+    inline std::string toString() const
+    {
+        std::stringstream text;
+        text << *this;
+        return text.str();
+    }
+    /*==========================================================*/
+    friend inline std::ostream &operator<<(std::ostream &os, const UbScheduler &scheduler)
+    {
+        os << "UbScheduler\n";
+        os << "Schedule |       start       |        end        |     intervall     " << std::endl;
+        for (std::size_t i = 0; i < scheduler.schedules.size(); i++)
+            os << std::setw(9) << i << "|" << std::setw(19) << scheduler.schedules[i].getBegin() << "|" << std::setw(19)
+               << scheduler.schedules[i].getEnd() << "|" << std::setw(19) << scheduler.schedules[i].getStep()
+               << std::endl;
+        return os;
+    }
 
 protected:
-   /*==========================================================*/
-   void initVals()
-   {
-      lastUsedT   = -Ub::inf; 
-      lastDueTime = -Ub::inf;
-      nextDueTime =  Ub::inf;
-      maxT        = -Ub::inf;
-   }
-   /*==========================================================*/
-   // calculates next due time for a schedule 
-   // with  nextDueTime > searchStart
-   bool calcNextDueTimeForSchedule(const UbSchedule& schedule, const double& searchStart, double& nextDueTime )
-   {
-      if     ( UbMath::greater(searchStart, schedule.end  ) ) return false;
-      else if( UbMath::less(   searchStart, schedule.begin) ) nextDueTime = schedule.begin;
-      else                            
-      {
-         nextDueTime = schedule.begin + ((int)((searchStart-schedule.begin)/schedule.step)+1)*schedule.step;
-         if(   UbMath::less(   nextDueTime, searchStart )
-            || UbMath::greater(nextDueTime, schedule.end) ) 
-         {
+    /*==========================================================*/
+    void initVals()
+    {
+        lastUsedT   = -Ub::inf;
+        lastDueTime = -Ub::inf;
+        nextDueTime = Ub::inf;
+        maxT        = -Ub::inf;
+    }
+    /*==========================================================*/
+    // calculates next due time for a schedule
+    // with  nextDueTime > searchStart
+    bool calcNextDueTimeForSchedule(const UbSchedule &schedule, const double &searchStart, double &nextDueTime)
+    {
+        if (UbMath::greater(searchStart, schedule.end))
             return false;
-         }
-      }
-      return true;
-   }
+        else if (UbMath::less(searchStart, schedule.begin))
+            nextDueTime = schedule.begin;
+        else {
+            nextDueTime = schedule.begin + ((int)((searchStart - schedule.begin) / schedule.step) + 1) * schedule.step;
+            if (UbMath::less(nextDueTime, searchStart) || UbMath::greater(nextDueTime, schedule.end)) {
+                return false;
+            }
+        }
+        return true;
+    }
 
 protected:
-   double lastUsedT;
-   double lastDueTime;
-   double nextDueTime;
-   double maxT;
-   
-   std::vector<UbSchedule> schedules;
+    double lastUsedT;
+    double lastDueTime;
+    double nextDueTime;
+    double maxT;
+
+    std::vector<UbSchedule> schedules;
 };
 
 using UbSchedule = UbScheduler::UbSchedule;
 
-#endif //UBSCHEDULER_H
+#endif // UBSCHEDULER_H
 
-
-
-//int main(int argc, char** argv)            
-//{   
+// int main(int argc, char** argv)
+//{
 //	UbScheduler writeSchedule;
 ////	writeSchedule.addSchedule(0,2000,100);
 ////	writeSchedule.addSchedule(3005,4500,300);
@@ -343,4 +345,3 @@ using UbSchedule = UbScheduler::UbSchedule;
 //	}
 //	return 0;
 //}
-
diff --git a/src/basics/basics/utilities/UbStringInputASCII.cpp b/src/basics/basics/utilities/UbStringInputASCII.cpp
index b100a51c377f26f2aed2b0b7e197237c0b7a4953..6a04f86aeb8d5b7be9e96ca39d1808b987c1f711 100644
--- a/src/basics/basics/utilities/UbStringInputASCII.cpp
+++ b/src/basics/basics/utilities/UbStringInputASCII.cpp
@@ -1,10 +1,10 @@
 //#include <basics/utilities/UbStringInputASCII.h>
 //#include <cstring>
 //
-//using namespace std;
+// using namespace std;
 //
 //
-//UbStringInputASCII::UbStringInputASCII(string inputString) : UbFileInputASCII("")
+// UbStringInputASCII::UbStringInputASCII(string inputString) : UbFileInputASCII("")
 //{
 //	instream.str(inputString);
 //
@@ -16,88 +16,88 @@
 //
 //}
 ///*==========================================================*/
-//int UbStringInputASCII::readInteger()
+// int UbStringInputASCII::readInteger()
 //{
 //	int dummy;
 //	instream>>dummy;
 //	return dummy;
 //}
 ///*==========================================================*/
-//std::size_t UbStringInputASCII::readSize_t()
+// std::size_t UbStringInputASCII::readSize_t()
 //{
 //   std::size_t dummy;
 //   instream>>dummy;
 //   return dummy;
 //}
 ///*==========================================================*/
-//string UbStringInputASCII::getFileName()
+// string UbStringInputASCII::getFileName()
 //{
 //	return this->filename;
 //}
 //
 ///*==========================================================*/
-//void UbStringInputASCII::skipLine()
+// void UbStringInputASCII::skipLine()
 //{
 //	string dummy;
 //	getline(instream, dummy);
 //}
 ///*==========================================================*/
-//void UbStringInputASCII::readLine()
+// void UbStringInputASCII::readLine()
 //{
 //	string dummy;
 //	getline(instream, dummy);
 //}
 ///*==========================================================*/
-//string UbStringInputASCII::readStringLine()
+// string UbStringInputASCII::readStringLine()
 //{
 //   string dummy;
 //   getline(instream, dummy);
 //   return dummy;
 //}
 ///*==========================================================*/
-//string UbStringInputASCII::readLineTill(char stop)
+// string UbStringInputASCII::readLineTill(char stop)
 //{
 //	string dummy;
 //	getline(instream, dummy, stop);
 //	return dummy;
 //}
 ///*==========================================================*/
-//string UbStringInputASCII::parseString()
+// string UbStringInputASCII::parseString()
 //{
 //	string dummy;
 //	getline(instream, dummy, ' ');
 //	return dummy;
 //}
 ///*==========================================================*/
-//double UbStringInputASCII::readDouble()
+// double UbStringInputASCII::readDouble()
 //{
 //   double dummy;
 //   instream>>dummy;
 //   return dummy;
 //}
 ///*==========================================================*/
-//float UbStringInputASCII::readFloat()
+// float UbStringInputASCII::readFloat()
 //{
 //   float dummy;
 //   instream>>dummy;
 //   return dummy;
 //}
 ///*==========================================================*/
-//char UbStringInputASCII::readChar()
+// char UbStringInputASCII::readChar()
 //{
 //   char dummy;
 //   instream>>dummy;
 //   return dummy;
 //}
 ///*==========================================================*/
-//string UbStringInputASCII::readString()
+// string UbStringInputASCII::readString()
 //{
 //	string dummy;
 //	instream>>dummy;
 //	return dummy;
 //}
 ///*==========================================================*/
-//bool UbStringInputASCII::containsString(string var)
+// bool UbStringInputASCII::containsString(string var)
 //{
 //   instream.seekg(0L, ios::beg); //Positionszeiger der Datei auf den Anfang setzen
 //   char line[512];
@@ -110,7 +110,7 @@
 //   return true;
 //}
 ///*==========================================================*/
-//void UbStringInputASCII::setPosAfterLineWithString(string var)
+// void UbStringInputASCII::setPosAfterLineWithString(string var)
 //{
 //   instream.seekg(0L, ios::beg); //Positionszeiger der Datei auf den Anfang setzen
 //   char line[512];
@@ -121,7 +121,7 @@
 //   }while (strstr(line,var.c_str()) != line);		// Ende Schleife, wenn varname ganz in zeile vorkommt
 //}
 ///*==========================================================*/
-//int UbStringInputASCII::readIntegerAfterString(string var)
+// int UbStringInputASCII::readIntegerAfterString(string var)
 //// last change [10.3.2004] at [9:46]
 ////suchts in einer Datei nach varname und gibt den dahinter stehenden int-Wert zurueck
 ////z.B. timesteps 9
@@ -145,7 +145,7 @@
 //// last change [10.3.2004] at [9:46]
 ////sucht in einer Datei nach varname und gibt den dahinter stehenden int-Wert zurueck
 ////z.B. nue 9.5
-//double UbStringInputASCII::readDoubleAfterString(string var)
+// double UbStringInputASCII::readDoubleAfterString(string var)
 //{
 //   instream.seekg(0L, ios::beg); //Positionszeiger der Datei auf den Anfang setzen
 //
@@ -155,7 +155,8 @@
 //   {
 //      instream.getline(line,512);
 //      if(instream.eof()) UB_THROW( UbException(UB_EXARGS,var+" wasn't found in "+this->filename) );
-//   }while (/*!strncmp(varname,line,sizeof(varname))==0*/strstr(line,var.c_str()) != line);		// Ende Schleife, wenn varname ganz in zeile vorkommt
+//   }while (/*!strncmp(varname,line,sizeof(varname))==0*/strstr(line,var.c_str()) != line);		// Ende Schleife, wenn
+//   varname ganz in zeile vorkommt
 //
 //
 //   strcpy (line, (line+strlen(var.c_str())));	    // zeile um "varname" kuerzen
@@ -167,7 +168,7 @@
 ////  [9.9.2002]
 //// liefert sring-Wert der hinter dem uebergebenen char feld in der datei instream steht
 //// zudem wird der wert in die uebergebene variable value uebertragen (falls man das ergebniss als char benoetig)
-//string UbStringInputASCII::readStringAfterString(string var)
+// string UbStringInputASCII::readStringAfterString(string var)
 //{
 //   instream.seekg(0L, ios::beg); //Positionszeiger der Datei auf den Anfang setzen
 //
@@ -192,7 +193,7 @@
 //// last change [10.3.2004] at [9:46]
 ////sucht in einer Datei nach varname und gibt den dahinter stehenden int-Wert zurueck
 ////z.B. nue 9.5
-//bool UbStringInputASCII::readBoolAfterString(string var)
+// bool UbStringInputASCII::readBoolAfterString(string var)
 //{
 //   if(this->readStringAfterString(var.c_str())      == "true" ) return true;
 //   else if(this->readStringAfterString(var.c_str()) == "false") return false;
@@ -202,7 +203,7 @@
 //// last change [10.3.2004] at [9:46]
 ////sucht in einer Datei nach varname und gibt den dahinter stehenden int-Wert zurueck
 ////z.B. nue 9.5
-//bool UbStringInputASCII::readBool()
+// bool UbStringInputASCII::readBool()
 //{
 //   string tmp = this->readString();
 //   if(     tmp == "true" ) return true;
diff --git a/src/basics/basics/utilities/UbStringInputASCII.h b/src/basics/basics/utilities/UbStringInputASCII.h
index eb2e01376952c56fe6a48489201c357f39a69933..d83adde4dee62f703a6a6070b7a2c0eb6c66360f 100644
--- a/src/basics/basics/utilities/UbStringInputASCII.h
+++ b/src/basics/basics/utilities/UbStringInputASCII.h
@@ -16,9 +16,9 @@
 //
 //#include <basics/utilities/UbFileInputASCII.h>
 //
-//class UbStringInputASCII : public UbFileInputASCII
+// class UbStringInputASCII : public UbFileInputASCII
 //{
-//public:
+// public:
 //	UbStringInputASCII(std::string inputString);
 //
 //	std::string getFileName();
@@ -45,7 +45,7 @@
 //
 //   FILETYPE getFileType() { return ASCII; }
 //
-//private:
+// private:
 //	std::istringstream instream;
 //};
 //
diff --git a/src/basics/basics/utilities/UbSystem.h b/src/basics/basics/utilities/UbSystem.h
index 975e7027525c0c6f0b115279db08c006ddd8788b..8e676811a152b176efd617a944f4e22ea538721e 100644
--- a/src/basics/basics/utilities/UbSystem.h
+++ b/src/basics/basics/utilities/UbSystem.h
@@ -1,28 +1,28 @@
 //=======================================================================================
-// ____          ____    __    ______     __________   __      __       __        __         
-// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |        
-//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |        
-//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |        
-//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____    
-//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|   
-//      \    \  |    |   ________________________________________________________________    
-//       \    \ |    |  |  ______________________________________________________________|   
-//        \    \|    |  |  |         __          __     __     __     ______      _______    
-//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)   
-//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______    
+// ____          ____    __    ______     __________   __      __       __        __
+// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |
+//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |
+//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |
+//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____
+//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|
+//      \    \  |    |   ________________________________________________________________
+//       \    \ |    |  |  ______________________________________________________________|
+//        \    \|    |  |  |         __          __     __     __     ______      _______
+//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)
+//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______
 //           \       |  |  |        |  |_____   |   \_/   |   |  |   |  |_/  /    _____  |
-//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/   
+//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/
 //
-//  This file is part of VirtualFluids. VirtualFluids is free software: you can 
+//  This file is part of VirtualFluids. VirtualFluids is free software: you can
 //  redistribute it and/or modify it under the terms of the GNU General Public
-//  License as published by the Free Software Foundation, either version 3 of 
+//  License as published by the Free Software Foundation, either version 3 of
 //  the License, or (at your option) any later version.
-//  
-//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT 
-//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
-//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License 
+//
+//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT
+//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 //  for more details.
-//  
+//
 //  You should have received a copy of the GNU General Public License along
 //  with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>.
 //
@@ -34,60 +34,59 @@
 #define UBSYSTEM_H
 
 #if defined(_WIN32) || defined(_WIN64)
-   #define UBSYSTEM_WINDOWS
-   #include <process.h>
-   #include <io.h>
-   #include <direct.h>
-   //#ifndef _WINSOCK2API_  //ansonsten gibt es mecker bei #include "Windows.h" und ::Sleep()
-   //   #define _WINSOCK2API_
-   //   #include<WinSock2.h> 
-   //#endif
-  #include <windows.h>
-  //#include <Windows.h>
-  //#include <tchar.h>
+#define UBSYSTEM_WINDOWS
+#include <direct.h>
+#include <io.h>
+#include <process.h>
+//#ifndef _WINSOCK2API_  //ansonsten gibt es mecker bei #include "Windows.h" und ::Sleep()
+//   #define _WINSOCK2API_
+//   #include<WinSock2.h>
+//#endif
+#include <windows.h>
+//#include <Windows.h>
+//#include <tchar.h>
 #elif defined(__APPLE__)
-   #define UBSYSTEM_APPLE
-   #include "dirent.h"
-   #include "sys/stat.h"
-   #include <sys/syscall.h>
-   #include <sys/stat.h>
-   #include <unistd.h>
+#define UBSYSTEM_APPLE
+#include "dirent.h"
+#include "sys/stat.h"
+#include <sys/stat.h>
+#include <sys/syscall.h>
+#include <unistd.h>
 #elif (defined(__amd64) || defined(__amd64__) || defined(__unix__)) && !defined(__AIX__)
-   #define UBSYSTEM_LINUX
-   #include "dirent.h"
-   #include <sys/stat.h>
-   #include <unistd.h>
-   #include <cstring>
+#define UBSYSTEM_LINUX
+#include "dirent.h"
+#include <cstring>
+#include <sys/stat.h>
+#include <unistd.h>
 #elif defined(__AIX__)
-   #define UBSYSTEM_AIX
-   #include "dirent.h"
-   #include <unistd.h>
-   #include <sys/stat.h>
-   #include <sys/types.h>
+#define UBSYSTEM_AIX
+#include "dirent.h"
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <unistd.h>
 #else
-   #error "UbSystem::UnknownMachine"
+#error "UbSystem::UnknownMachine"
 #endif
 
 #if defined(__unix__) && defined(__CYGWIN__)
-   #define UBSYSTEM_CYGWIN
-   #include <windows.h>
+#define UBSYSTEM_CYGWIN
+#include <windows.h>
 #elif defined(__unix__)
-    #include <sys/syscall.h>
+#include <sys/syscall.h>
 #endif
 
-#if defined(min) || defined(max) //daruch kann man sich spaeter #undef min; #undef max erparen
-#   error add NOMINMAX to preprocessor defines
+#if defined(min) || defined(max) // daruch kann man sich spaeter #undef min; #undef max erparen
+#error add NOMINMAX to preprocessor defines
 #endif
 
-
-#include <iostream>
-#include <iomanip>
-#include <string>
-#include <sstream>
 #include <algorithm>
-#include <typeinfo>
 #include <cctype> //for toupper
 #include <ctime>
+#include <iomanip>
+#include <iostream>
+#include <sstream>
+#include <string>
+#include <typeinfo>
 
 #include <basics/utilities/UbException.h>
 #include <basics/utilities/UbLogger.h>
@@ -96,475 +95,463 @@
 #include <boost/thread.hpp>
 #endif // CAB_BOOST
 
-//DEFINE TO STRING
-//e.g. #define FOO hallo
+// DEFINE TO STRING
+// e.g. #define FOO hallo
 //     -> QUOTEME(FOO) == "hallo"
 #define _QUOTEME(x) #x
 #define QUOTEME(x) _QUOTEME(x)
 
-//allg.:
-//const int * C1        -> C1 is variable pointer to a constant integer
-//int const * C2        -> C2 is variable pointer to a constant integer (same as above)
-//int * const C3        -> C3 is constant pointer to a variable integer
-//int const * const C4  -> C4 is constant pointer to a constant integer
+// allg.:
+// const int * C1        -> C1 is variable pointer to a constant integer
+// int const * C2        -> C2 is variable pointer to a constant integer (same as above)
+// int * const C3        -> C3 is constant pointer to a variable integer
+// int const * const C4  -> C4 is constant pointer to a constant integer
 
 //////////////////////////////////////////////////////////////////////////
-//UbSystem
+// UbSystem
 //////////////////////////////////////////////////////////////////////////
 namespace UbSystem
 {
-   template<bool> struct ub_static_assert;     //deklaration (ub_xxx da static_assert in C++0x ein keyword werden wird)
-   template<> struct ub_static_assert<true>{}; //deklaration + definition der spezialisierung fuer "true"
-                                               //ub_static_assert<false> fuehrt zu compiler fehler, da dafuer
-                                               //keine implementierung vorhanden!  //UB_STATIC_ASSERT(false)
-
-   /*==========================================================*/
-   inline void sleepMs(const unsigned int& msec)
-   {
-      #if defined(UBSYSTEM_WINDOWS)
-         ::Sleep(  (msec==0) ? 1 : msec );  // +1 here causes a context switch if SleepMSec(0) is called
-      #elif (defined(UBSYSTEM_LINUX) || defined(UBSYSTEM_APPLE) || defined(UBSYSTEM_AIX)) && !defined(UBSYSTEM_CYGWIN)
-         ::usleep(1000*msec);
-      #elif defined(UBSYSTEM_CYGWIN)
-       ::Sleep(  (msec==0) ? 1 : msec );
-      #else
-         #error "UbSystem::sleepMSec - UnknownMachine"
-      #endif
-   }
-   /*==========================================================*/
-   inline void sleepS(const unsigned int& sec)
-   {
-      #if defined(UBSYSTEM_WINDOWS) || defined(UBSYSTEM_CYGWIN)
-         ::Sleep( (sec==0) ? 1 : sec*1000 );  // +1 here causes a context switch if sleepS(0) is called
-      #elif defined(UBSYSTEM_LINUX) || defined(UBSYSTEM_APPLE) || defined(UBSYSTEM_AIX) && !defined(UBSYSTEM_CYGWIN)
-         ::sleep(sec);
-      #else
-         #error "UbSystem::sleepS - UnknownMachine"
-      #endif
-   }
-   /*==========================================================*/
-   //checks if the bits of bitmask are set in value
-   template<typename T>
-   inline bool bitCheck(const T& value, const T& bitmask)
-   {
-      return  ( (value & bitmask) == bitmask);
-   }
-   /*==========================================================*/
-   //checks if the bits of bitmask are set in value
-   template<typename T>
-   inline void setBit(T& value, const T& bitmask)
-   {
-      value |= bitmask;
-   }
-   /*==========================================================*/
-   template<typename T>
-   inline void unsetBit(T& value, const T& bitmask)
-   {
-      value &= ~bitmask;
-   }
-   /*==========================================================*/
-   //returns bitmask as string e.g. 0001 0100 1101
-   template<typename T>
-   inline std::string getBitString(const T& value)
-   {
-      std::stringstream text;
-      for(int i=sizeof(value)*8-1/*8 bits per byte*/; i>=0; i--)
-      {
-         text<<(char) ( ((value>>i) & 1) + '0');
-         if(i%4 == 0 && i>0) text<<' ';
-      }
-      return text.str();
-   }
-   /*==========================================================*/
-   //converts string to type T
-   // usage: int x = stringTo<int>("123");
-   template<typename T>
-   inline T stringTo(const std::string& s)
-   {
-     std::istringstream iss(s);
-     T x;
-     iss >> x;
-     if(!iss)
-        UB_THROW( UbException(UB_EXARGS," cannot convert \""+s+"\" to type <"+static_cast<std::string>(typeid(x).name())+">") );
-
-     return x;
-   }
-   /*==========================================================*/
-   // usage: string s = toString(x);
-   template<typename T>
-   inline std::string toString(const T& x, int precision=15)
-   {
-     std::ostringstream oss;
-     oss<<std::setprecision(precision);
-     oss<<x;
-     return oss.str();
-   }
-   /*==========================================================*/
-   //e.g. str="iHcsnW" -> "IHCSNW"
-   inline std::string toUpperString(const std::string& str)
-   {
-      std::string tmp(str);
-      std::transform(tmp.begin(),tmp.end(),tmp.begin(), static_cast<int (*)(int)>(std::toupper));
-
-      return tmp;
-   }
-   /*==========================================================*/
-   //e.g. str="iHcsnW" -> "ihcsnw"
-   inline std::string toLowerString(const std::string& str)
-   {
-      std::string tmp(str);
-      std::transform(tmp.begin(),tmp.end(),tmp.begin(), static_cast<int (*)(int)>(std::tolower));
-
-      return tmp;
-   }
-   /*==========================================================*/
-   // usage: std::string s = replaceInString(str,"\\","/");
-   //        std::string s = replaceInString(str,"ich","du");
-   static std::string replaceInString(std::string original, const std::string& replace, const std::string& replaceWith )
-   {
-      size_t pos=0;
-      while( (pos=original.find(replace,pos))!=std::string::npos )
-      {
-         original.replace(pos,replace.size(),replaceWith);
-         pos+=replaceWith.size();
-      }
-      return original;
-   }
-   /*==========================================================*/
-   //returns content of an enviroment variable
-   inline std::string getEnv(const std::string& var)
-   {
-      char* str = getenv( var.c_str());
-      if(  str == NULL  ) 
-      {
-         return std::string("");
-      }
-      
-      return static_cast<std::string>( str );
-   }
-   /*==========================================================*/
-   inline bool isDirectory(const std::string& dir, const unsigned&  /*attemptions*/ = 3)
-   {
-      if( dir.empty() ) 
-         UB_THROW( UbException(UB_EXARGS,"dir is empty") );
-      
-      std::string path = UbSystem::replaceInString(dir,"\\","/");
-
-      #if defined UBSYSTEM_WINDOWS
-         #ifndef _UNICODE 
-            if( _access(path.c_str(), 0  ) == -1 ) return false;
-         #else
-            if( _waccess(path.c_str(), 0 ) == -1 ) return false;
-         #endif
-      #elif defined(UBSYSTEM_LINUX) || defined(UBSYSTEM_APPLE) || defined(UBSYSTEM_AIX)
-         struct stat stFileInfo;
-         if( stat(path.c_str(),&stFileInfo) != 0) 
-         {
-            return false;
-         }
-      #endif
-      
-      return true;
-   }
-   /*==========================================================*/
-   // usage:  makeDirectory("c:/temp");
-   //         makeDirectory("c:/temp/");
-   // return: true  -> successful
-   //         false -> failed
-   #if defined(CAB_BOOST) 
-      static boost::mutex mtx_makeDirectory;
-   #endif
-   inline bool makeDirectory(const std::string& dir, const unsigned& attemptions = 3)
-   {
-      UBLOG(logDEBUG5,"UbSystem::makeDirectory - start, dir="<<dir<<" #attemptions="<<attemptions);
-
-      if( dir.empty() ) UB_THROW( UbException(UB_EXARGS,"dir is empty") );
-      std::string path = UbSystem::replaceInString(dir,"\\","/");
-
-      bool dirCreated = true;
-      #if defined UBSYSTEM_WINDOWS
-         if(path[path.size()-1] != '/') path+="/";
-         size_t  pos = 0;
-         while( ( pos=path.find("/",pos+1) ) != std::string::npos )
-         {
-            std::string tmpdir = path.substr(0,pos);
-            #if defined(CAB_BOOST) 
-            boost::mutex::scoped_lock lock(mtx_makeDirectory);
-            #endif
-            if( 
-                #ifndef _UNICODE 
-                 _access(tmpdir.c_str(), 0 ) == -1 && _mkdir(tmpdir.c_str() ) == -1
-                #else
-                 _waccess(tmpdir.c_str(), 0) == -1 && _wmkdir(tmpdir.c_str()) == -1
-                #endif
-               )
-               {
-                  UBLOG(logDEBUG5,"UbSystem::makeDirectory-  dir=\""<<tmpdir<<"\" doesn't exit or makedir failed");
-                  dirCreated = false;
-                  break;
-               }
-         }
-      #elif defined(UBSYSTEM_LINUX) || defined(UBSYSTEM_APPLE) || defined(UBSYSTEM_AIX)
-         std::string command = "mkdir -p \""+path+"\"";
-         {
-            #if defined(CAB_BOOST) 
-               boost::mutex::scoped_lock lock(mtx_makeDirectory);
-            #endif
-            if(system(command.c_str())!=0)
-            {
-               UBLOG(logDEBUG5,"UbSystem::makeDirectory-  dir=\""<<path<<"\" doesn't exit or makedir failed");
-               dirCreated = false;
-            }
-         }
-      #else
-         #error "UbSystem::makeDirectory - UnknownMachine"
-      #endif
-
-      if(!dirCreated && attemptions > 1)
-      {
-         UBLOG(logDEBUG5,"UbSystem::makeDirectory - internal call of UbSystem::makeDirectory");
-         UbSystem::sleepMs(500);
-         dirCreated = UbSystem::makeDirectory(path, attemptions-1);
-      }
-      
-      UBLOG(logDEBUG5,"UbSystem::makeDirectory - end (success="<<dirCreated<<", attemptions = "<<attemptions<<")");
-      return dirCreated;
-   }
-   /*==========================================================*/
-#if defined(CAB_BOOST) 
-   static boost::mutex mtx_removeDirectory;
+template <bool>
+struct ub_static_assert; // deklaration (ub_xxx da static_assert in C++0x ein keyword werden wird)
+template <>
+struct ub_static_assert<true> {
+}; // deklaration + definition der spezialisierung fuer "true"
+   // ub_static_assert<false> fuehrt zu compiler fehler, da dafuer
+   // keine implementierung vorhanden!  //UB_STATIC_ASSERT(false)
+
+/*==========================================================*/
+inline void sleepMs(const unsigned int &msec)
+{
+#if defined(UBSYSTEM_WINDOWS)
+    ::Sleep((msec == 0) ? 1 : msec); // +1 here causes a context switch if SleepMSec(0) is called
+#elif (defined(UBSYSTEM_LINUX) || defined(UBSYSTEM_APPLE) || defined(UBSYSTEM_AIX)) && !defined(UBSYSTEM_CYGWIN)
+    ::usleep(1000 * msec);
+#elif defined(UBSYSTEM_CYGWIN)
+    ::Sleep((msec == 0) ? 1 : msec);
+#else
+#error "UbSystem::sleepMSec - UnknownMachine"
+#endif
+}
+/*==========================================================*/
+inline void sleepS(const unsigned int &sec)
+{
+#if defined(UBSYSTEM_WINDOWS) || defined(UBSYSTEM_CYGWIN)
+    ::Sleep((sec == 0) ? 1 : sec * 1000); // +1 here causes a context switch if sleepS(0) is called
+#elif defined(UBSYSTEM_LINUX) || defined(UBSYSTEM_APPLE) || defined(UBSYSTEM_AIX) && !defined(UBSYSTEM_CYGWIN)
+    ::sleep(sec);
+#else
+#error "UbSystem::sleepS - UnknownMachine"
+#endif
+}
+/*==========================================================*/
+// checks if the bits of bitmask are set in value
+template <typename T>
+inline bool bitCheck(const T &value, const T &bitmask)
+{
+    return ((value & bitmask) == bitmask);
+}
+/*==========================================================*/
+// checks if the bits of bitmask are set in value
+template <typename T>
+inline void setBit(T &value, const T &bitmask)
+{
+    value |= bitmask;
+}
+/*==========================================================*/
+template <typename T>
+inline void unsetBit(T &value, const T &bitmask)
+{
+    value &= ~bitmask;
+}
+/*==========================================================*/
+// returns bitmask as string e.g. 0001 0100 1101
+template <typename T>
+inline std::string getBitString(const T &value)
+{
+    std::stringstream text;
+    for (int i = sizeof(value) * 8 - 1 /*8 bits per byte*/; i >= 0; i--) {
+        text << (char)(((value >> i) & 1) + '0');
+        if (i % 4 == 0 && i > 0)
+            text << ' ';
+    }
+    return text.str();
+}
+/*==========================================================*/
+// converts string to type T
+// usage: int x = stringTo<int>("123");
+template <typename T>
+inline T stringTo(const std::string &s)
+{
+    std::istringstream iss(s);
+    T x;
+    iss >> x;
+    if (!iss)
+        UB_THROW(UbException(UB_EXARGS, " cannot convert \"" + s + "\" to type <" +
+                                            static_cast<std::string>(typeid(x).name()) + ">"));
+
+    return x;
+}
+/*==========================================================*/
+// usage: string s = toString(x);
+template <typename T>
+inline std::string toString(const T &x, int precision = 15)
+{
+    std::ostringstream oss;
+    oss << std::setprecision(precision);
+    oss << x;
+    return oss.str();
+}
+/*==========================================================*/
+// e.g. str="iHcsnW" -> "IHCSNW"
+inline std::string toUpperString(const std::string &str)
+{
+    std::string tmp(str);
+    std::transform(tmp.begin(), tmp.end(), tmp.begin(), static_cast<int (*)(int)>(std::toupper));
+
+    return tmp;
+}
+/*==========================================================*/
+// e.g. str="iHcsnW" -> "ihcsnw"
+inline std::string toLowerString(const std::string &str)
+{
+    std::string tmp(str);
+    std::transform(tmp.begin(), tmp.end(), tmp.begin(), static_cast<int (*)(int)>(std::tolower));
+
+    return tmp;
+}
+/*==========================================================*/
+// usage: std::string s = replaceInString(str,"\\","/");
+//        std::string s = replaceInString(str,"ich","du");
+static std::string replaceInString(std::string original, const std::string &replace, const std::string &replaceWith)
+{
+    size_t pos = 0;
+    while ((pos = original.find(replace, pos)) != std::string::npos) {
+        original.replace(pos, replace.size(), replaceWith);
+        pos += replaceWith.size();
+    }
+    return original;
+}
+/*==========================================================*/
+// returns content of an enviroment variable
+inline std::string getEnv(const std::string &var)
+{
+    char *str = getenv(var.c_str());
+    if (str == NULL) {
+        return std::string("");
+    }
+
+    return static_cast<std::string>(str);
+}
+/*==========================================================*/
+inline bool isDirectory(const std::string &dir, const unsigned & /*attemptions*/ = 3)
+{
+    if (dir.empty())
+        UB_THROW(UbException(UB_EXARGS, "dir is empty"));
+
+    std::string path = UbSystem::replaceInString(dir, "\\", "/");
+
+#if defined UBSYSTEM_WINDOWS
+#ifndef _UNICODE
+    if (_access(path.c_str(), 0) == -1)
+        return false;
+#else
+    if (_waccess(path.c_str(), 0) == -1)
+        return false;
+#endif
+#elif defined(UBSYSTEM_LINUX) || defined(UBSYSTEM_APPLE) || defined(UBSYSTEM_AIX)
+    struct stat stFileInfo;
+    if (stat(path.c_str(), &stFileInfo) != 0) {
+        return false;
+    }
 #endif
-   inline int removeDirectory(const std::string& dir)
-   {
-      #if defined(CAB_BOOST) 
-         boost::mutex::scoped_lock lock(mtx_removeDirectory);
-      #endif
-      std::string command = "rmdir \""+dir+"\"";
-      return std::system(command.c_str());
-   }
-   /*==========================================================*/
-   // usage  : getPathFromString("c:/temp/foo.txt");
-   //returns: "c:/temp"
-   // usage  : getPathFromString("c:\\temp\\foo.txt");
-   //returns: "c:/temp"
-   // usage  : getPathFromString("foo.txt");
-   // returns: ""
-   inline std::string getPathFromString(const std::string& fileStringWithPath)
-   {
-      std::string tmp = UbSystem::replaceInString(fileStringWithPath,"\\","/");
-      std::size_t last = tmp.rfind("/");
-      if(last!=std::string::npos) tmp.resize(last);
-      else                        tmp = "";
-      return tmp;
-   }
-   /*==========================================================*/
-   // usage  : getFilenameFromString("c:/temp/foo.txt");
-   // returns: "foo.txt"
-   // usage  : getFilenameFromString("c:/temp/foo.txt",false);
-   // returns: "foo"
-   // usage  : getFilenameFromString("c:/temp/");
-   // returns: ""
-   inline std::string getFilenameFromString(const std::string& fileStringWithPath, bool withExtension = true)
-   {
-      std::string tmp = UbSystem::replaceInString(fileStringWithPath,"\\","/");
-      
-      //remove path
-      std::size_t last = tmp.rfind("/");
-      if(last!=std::string::npos && (last+1)<tmp.size()) tmp.erase(0,last+1);
-      
-      //remove extension
-      if(!withExtension)
-      {
-         last = tmp.rfind(".");
-         if(last!=std::string::npos) tmp.erase(last);
-      }
-
-      return tmp;
-   }
-   /*==========================================================*/
-   inline int getProcessID()
-   {
-      #if defined UBSYSTEM_WINDOWS
-         return _getpid();
-      #elif defined(UBSYSTEM_LINUX) || defined(UBSYSTEM_APPLE) || defined(UBSYSTEM_AIX)
-         return getpid();
-      #else
-         #error "int UbSystem::getProcessID() - UnknownMachine"
-      #endif
-   }
-   /*==========================================================*/
-   inline unsigned long getCurrentThreadID()
-   {
-      #if defined UBSYSTEM_WINDOWS || defined(UBSYSTEM_CYGWIN)
-         return (unsigned long)GetCurrentThreadId();
-      #elif defined(UBSYSTEM_APPLE)
-         uint64_t tid;
-         pthread_threadid_np(nullptr, &tid);
-         return (unsigned long)tid;
-      #elif defined(UBSYSTEM_LINUX)
-         return (unsigned long)syscall(SYS_gettid);
-      #elif defined(UBSYSTEM_AIX)
-         return (unsigned long) getpid(); //WORKAROUND for IBM (for get thread id is another function necessary) 
-      #else
-         #error "unsigned long UbSystem::getCurrentThreadID() - UnknownMachine"
-      #endif
-   }
-   /*==========================================================*/
-   inline bool isBigEndian()
-   {
-      short word = 0x4321;
-      if((*(char*)& word) != 0x21 ) return true;
-      else                           return false;
-   }
-   /*==========================================================*/
-   inline bool isLittleEndian()
-   {
-      return !isBigEndian();
-   }
-   /*==========================================================*/
-   inline std::string getTimeStamp()
-   {
-      time_t t = time(NULL);
-      tm* localTime = localtime(&t); 	
-      
-      std::stringstream tmp;
-      tmp.fill('0');
-      
-      tmp << localTime->tm_year+1900 
-          << "." << std::setw(2) <<localTime->tm_mon+1
-          << "." << std::setw(2) << localTime->tm_mday 
-          << "@" << std::setw(2) << localTime->tm_hour  
-          << "." << std::setw(2) << localTime->tm_min   
-          << "." << std::setw(2) << localTime->tm_sec  ;
-
-      return tmp.str();
-   }
-   /*==========================================================*/
-   //swap Byte Order
-   //usage: int test = 8;
-   //       swapByteOrder((unsigned char*)& test, sizeof(int))
-   //#define ByteSwap5(x) ByteSwap((unsigned char *) &x,sizeof(x))
-   inline void swapByteOrder(unsigned char* toSwap, int length)
-   {
-      int i = 0;
-      int j = length-1;
-      while(i<j)
-      {
-         std::swap(toSwap[i], toSwap[j]);
-         i++, j--;
-      }
-   }
-   //////////////////////////////////////////////////////////////////////////
-   //get host name
-   inline std::string getMachineName()
-   {
-      char Name[150];
+
+    return true;
+}
+/*==========================================================*/
+// usage:  makeDirectory("c:/temp");
+//         makeDirectory("c:/temp/");
+// return: true  -> successful
+//         false -> failed
+#if defined(CAB_BOOST)
+static boost::mutex mtx_makeDirectory;
+#endif
+inline bool makeDirectory(const std::string &dir, const unsigned &attemptions = 3)
+{
+    UBLOG(logDEBUG5, "UbSystem::makeDirectory - start, dir=" << dir << " #attemptions=" << attemptions);
+
+    if (dir.empty())
+        UB_THROW(UbException(UB_EXARGS, "dir is empty"));
+    std::string path = UbSystem::replaceInString(dir, "\\", "/");
+
+    bool dirCreated = true;
+#if defined UBSYSTEM_WINDOWS
+    if (path[path.size() - 1] != '/')
+        path += "/";
+    size_t pos = 0;
+    while ((pos = path.find("/", pos + 1)) != std::string::npos) {
+        std::string tmpdir = path.substr(0, pos);
+#if defined(CAB_BOOST)
+        boost::mutex::scoped_lock lock(mtx_makeDirectory);
+#endif
+        if (
+#ifndef _UNICODE
+            _access(tmpdir.c_str(), 0) == -1 && _mkdir(tmpdir.c_str()) == -1
+#else
+            _waccess(tmpdir.c_str(), 0) == -1 && _wmkdir(tmpdir.c_str()) == -1
+#endif
+        ) {
+            UBLOG(logDEBUG5, "UbSystem::makeDirectory-  dir=\"" << tmpdir << "\" doesn't exit or makedir failed");
+            dirCreated = false;
+            break;
+        }
+    }
+#elif defined(UBSYSTEM_LINUX) || defined(UBSYSTEM_APPLE) || defined(UBSYSTEM_AIX)
+    std::string command = "mkdir -p \"" + path + "\"";
+    {
+#if defined(CAB_BOOST)
+        boost::mutex::scoped_lock lock(mtx_makeDirectory);
+#endif
+        if (system(command.c_str()) != 0) {
+            UBLOG(logDEBUG5, "UbSystem::makeDirectory-  dir=\"" << path << "\" doesn't exit or makedir failed");
+            dirCreated = false;
+        }
+    }
+#else
+#error "UbSystem::makeDirectory - UnknownMachine"
+#endif
+
+    if (!dirCreated && attemptions > 1) {
+        UBLOG(logDEBUG5, "UbSystem::makeDirectory - internal call of UbSystem::makeDirectory");
+        UbSystem::sleepMs(500);
+        dirCreated = UbSystem::makeDirectory(path, attemptions - 1);
+    }
+
+    UBLOG(logDEBUG5,
+          "UbSystem::makeDirectory - end (success=" << dirCreated << ", attemptions = " << attemptions << ")");
+    return dirCreated;
+}
+/*==========================================================*/
+#if defined(CAB_BOOST)
+static boost::mutex mtx_removeDirectory;
+#endif
+inline int removeDirectory(const std::string &dir)
+{
+#if defined(CAB_BOOST)
+    boost::mutex::scoped_lock lock(mtx_removeDirectory);
+#endif
+    std::string command = "rmdir \"" + dir + "\"";
+    return std::system(command.c_str());
+}
+/*==========================================================*/
+// usage  : getPathFromString("c:/temp/foo.txt");
+// returns: "c:/temp"
+// usage  : getPathFromString("c:\\temp\\foo.txt");
+// returns: "c:/temp"
+// usage  : getPathFromString("foo.txt");
+// returns: ""
+inline std::string getPathFromString(const std::string &fileStringWithPath)
+{
+    std::string tmp  = UbSystem::replaceInString(fileStringWithPath, "\\", "/");
+    std::size_t last = tmp.rfind("/");
+    if (last != std::string::npos)
+        tmp.resize(last);
+    else
+        tmp = "";
+    return tmp;
+}
+/*==========================================================*/
+// usage  : getFilenameFromString("c:/temp/foo.txt");
+// returns: "foo.txt"
+// usage  : getFilenameFromString("c:/temp/foo.txt",false);
+// returns: "foo"
+// usage  : getFilenameFromString("c:/temp/");
+// returns: ""
+inline std::string getFilenameFromString(const std::string &fileStringWithPath, bool withExtension = true)
+{
+    std::string tmp = UbSystem::replaceInString(fileStringWithPath, "\\", "/");
+
+    // remove path
+    std::size_t last = tmp.rfind("/");
+    if (last != std::string::npos && (last + 1) < tmp.size())
+        tmp.erase(0, last + 1);
+
+    // remove extension
+    if (!withExtension) {
+        last = tmp.rfind(".");
+        if (last != std::string::npos)
+            tmp.erase(last);
+    }
+
+    return tmp;
+}
+/*==========================================================*/
+inline int getProcessID()
+{
+#if defined UBSYSTEM_WINDOWS
+    return _getpid();
+#elif defined(UBSYSTEM_LINUX) || defined(UBSYSTEM_APPLE) || defined(UBSYSTEM_AIX)
+    return getpid();
+#else
+#error "int UbSystem::getProcessID() - UnknownMachine"
+#endif
+}
+/*==========================================================*/
+inline unsigned long getCurrentThreadID()
+{
+#if defined UBSYSTEM_WINDOWS || defined(UBSYSTEM_CYGWIN)
+    return (unsigned long)GetCurrentThreadId();
+#elif defined(UBSYSTEM_APPLE)
+    uint64_t tid;
+    pthread_threadid_np(nullptr, &tid);
+    return (unsigned long)tid;
+#elif defined(UBSYSTEM_LINUX)
+    return (unsigned long)syscall(SYS_gettid);
+#elif defined(UBSYSTEM_AIX)
+    return (unsigned long)getpid(); // WORKAROUND for IBM (for get thread id is another function necessary)
+#else
+#error "unsigned long UbSystem::getCurrentThreadID() - UnknownMachine"
+#endif
+}
+/*==========================================================*/
+inline bool isBigEndian()
+{
+    short word = 0x4321;
+    if ((*(char *)&word) != 0x21)
+        return true;
+    else
+        return false;
+}
+/*==========================================================*/
+inline bool isLittleEndian() { return !isBigEndian(); }
+/*==========================================================*/
+inline std::string getTimeStamp()
+{
+    time_t t      = time(NULL);
+    tm *localTime = localtime(&t);
+
+    std::stringstream tmp;
+    tmp.fill('0');
+
+    tmp << localTime->tm_year + 1900 << "." << std::setw(2) << localTime->tm_mon + 1 << "." << std::setw(2)
+        << localTime->tm_mday << "@" << std::setw(2) << localTime->tm_hour << "." << std::setw(2) << localTime->tm_min
+        << "." << std::setw(2) << localTime->tm_sec;
+
+    return tmp.str();
+}
+/*==========================================================*/
+// swap Byte Order
+// usage: int test = 8;
+//       swapByteOrder((unsigned char*)& test, sizeof(int))
+//#define ByteSwap5(x) ByteSwap((unsigned char *) &x,sizeof(x))
+inline void swapByteOrder(unsigned char *toSwap, int length)
+{
+    int i = 0;
+    int j = length - 1;
+    while (i < j) {
+        std::swap(toSwap[i], toSwap[j]);
+        i++, j--;
+    }
+}
+//////////////////////////////////////////////////////////////////////////
+// get host name
+inline std::string getMachineName()
+{
+    char Name[150];
 
 #if defined(UBSYSTEM_WINDOWS) || defined(UBSYSTEM_CYGWIN)
-      TCHAR infoBuf[150];
-      DWORD bufCharCount = 150;
-      memset(Name, 0, 150);
-      if (GetComputerName(infoBuf, &bufCharCount))
-      {
-         for (int i = 0; i<150; i++)
-         {
+    TCHAR infoBuf[150];
+    DWORD bufCharCount = 150;
+    memset(Name, 0, 150);
+    if (GetComputerName(infoBuf, &bufCharCount)) {
+        for (int i = 0; i < 150; i++) {
             Name[i] = infoBuf[i];
-         }
-      }
-      else
-      {
-         strcpy_s(Name, "Unknown_Host_Name");
-      }
+        }
+    } else {
+        strcpy_s(Name, "Unknown_Host_Name");
+    }
 #elif (defined(UBSYSTEM_LINUX) || defined(UBSYSTEM_APPLE) || defined(UBSYSTEM_AIX)) && !defined(UBSYSTEM_CYGWIN)
-      memset(Name, 0, 150);
-      gethostname(Name, 150);
+    memset(Name, 0, 150);
+    gethostname(Name, 150);
 #endif
-      return std::string(Name);
-   }
-
-   //////////////////////////////////////////////////////////////////////////
-   // generic IfThenElse - start
-   //////////////////////////////////////////////////////////////////////////
-   // primary template: yield second or third argument depending on first argument
-   template<bool C, typename Ta, typename Tb>
-   class IfThenElse;
-
-   // partial specialization: true yields second argument
-   template<typename Ta, typename Tb>
-   class IfThenElse<true, Ta, Tb> {
-   public:
-      using ResultT = Ta;
-   };
-
-   // partial specialization: false yields third argument
-   template<typename Ta, typename Tb>
-   class IfThenElse<false, Ta, Tb> {
-   public:
-      using ResultT = Tb;
-   };
-   //////////////////////////////////////////////////////////////////////////
-   // generic IfThenElse - end
-   //////////////////////////////////////////////////////////////////////////
-
-   //////////////////////////////////////////////////////////////////////////
-   //help struct for overloading methods in template classes for specific types
-   //////////////////////////////////////////////////////////////////////////
-   template< typename T>
-   struct type2type
-   {
-      using type = T;
-   };
-
-
-   //////////////////////////////////////////////////////////////////////////
-   // pair selector
-   //////////////////////////////////////////////////////////////////////////
-   template <typename Pair>
-   struct select1st
-   {
-      using argument_type = Pair ;
-      using result_type = typename Pair::first_type ;
-
-      const result_type&  operator()(const argument_type &p) const
-      {
-         return p.first ;
-      }
-   };
-
-   template <typename Pair>
-   struct select2nd
-   {
-      using argument_type = Pair ;
-      using result_type = typename Pair::second_type ;
-
-      const result_type& operator()(const argument_type &p) const
-      {
-         return p.second ;
-      }
-   };
+    return std::string(Name);
+}
 
+//////////////////////////////////////////////////////////////////////////
+// generic IfThenElse - start
+//////////////////////////////////////////////////////////////////////////
+// primary template: yield second or third argument depending on first argument
+template <bool C, typename Ta, typename Tb>
+class IfThenElse;
+
+// partial specialization: true yields second argument
+template <typename Ta, typename Tb>
+class IfThenElse<true, Ta, Tb>
+{
+public:
+    using ResultT = Ta;
+};
+
+// partial specialization: false yields third argument
+template <typename Ta, typename Tb>
+class IfThenElse<false, Ta, Tb>
+{
+public:
+    using ResultT = Tb;
+};
+//////////////////////////////////////////////////////////////////////////
+// generic IfThenElse - end
+//////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////
+// help struct for overloading methods in template classes for specific types
+//////////////////////////////////////////////////////////////////////////
+template <typename T>
+struct type2type {
+    using type = T;
 };
 
-#define UB_STATIC_ASSERT(expr) static_cast<void>(sizeof( UbSystem::ub_static_assert<expr> ));
-//zum ueberpruefen von STATISCHEN ausdruecken waehrend der compile-zeit
+//////////////////////////////////////////////////////////////////////////
+// pair selector
+//////////////////////////////////////////////////////////////////////////
+template <typename Pair>
+struct select1st {
+    using argument_type = Pair;
+    using result_type   = typename Pair::first_type;
+
+    const result_type &operator()(const argument_type &p) const { return p.first; }
+};
+
+template <typename Pair>
+struct select2nd {
+    using argument_type = Pair;
+    using result_type   = typename Pair::second_type;
+
+    const result_type &operator()(const argument_type &p) const { return p.second; }
+};
+
+}; // namespace UbSystem
+
+#define UB_STATIC_ASSERT(expr) static_cast<void>(sizeof(UbSystem::ub_static_assert<expr>));
+// zum ueberpruefen von STATISCHEN ausdruecken waehrend der compile-zeit
 //--> Ausdruecke muessen schon ZUR compilerzeit auswertbar sein !!!
-//Anwendung z.B. zur Ueberpruefung von Funktionalitaeten, wie z.B. bei UbMath::getNegativeInfinity<double>();
+// Anwendung z.B. zur Ueberpruefung von Funktionalitaeten, wie z.B. bei UbMath::getNegativeInfinity<double>();
 //
-//Grund fuer macro ist einfach, dass es besser anzuwenden ist in der praxis!
-//ansonsten wuerde es so aussehen:
+// Grund fuer macro ist einfach, dass es besser anzuwenden ist in der praxis!
+// ansonsten wuerde es so aussehen:
 //     UbSystem::ub_static_assert< aaa == 1 > test();
 //    da ist  UB_STATIC_ASSERT(aaa == 1); schoener
 //
-//um das zu vermeiden machtman hier diesen static_cast<void>(sizeof(...) )
-//Code-Snippet:
+// um das zu vermeiden machtman hier diesen static_cast<void>(sizeof(...) )
+// Code-Snippet:
 // struct Test { const static bool m_const_bool = true; bool m_bool; };
 // int main() {
 //  UB_STATIC_ASSERT( Test::m_const_bool == true );
 //  --> okay, assert bestanden
 //  UB_STATIC_ASSERT( Test::m_const_bool == false); //:
-//  --> assert nicht bestanden z.B. error C2027: use of undefined type 'UbSystem::ub_static_assert<__formal> with __formal = false --> funzt nicht. fehler im code
-//  UB_STATIC_ASSERT( Test::m_bool == true );
+//  --> assert nicht bestanden z.B. error C2027: use of undefined type 'UbSystem::ub_static_assert<__formal> with
+//  __formal = false --> funzt nicht. fehler im code UB_STATIC_ASSERT( Test::m_bool == true );
 //  --> nicht erlaubt, da m_bool nicht statisch und nicht const ist.
 //}
 
-#endif //UBSYSTEM_H
+#endif // UBSYSTEM_H
diff --git a/src/basics/basics/utilities/UbTiming.h b/src/basics/basics/utilities/UbTiming.h
index 35181c4198b818458145a4fa3879f355b24b6536..a99c4ec39acfa64c99bb2a61a8ceec4fc8ba604a 100644
--- a/src/basics/basics/utilities/UbTiming.h
+++ b/src/basics/basics/utilities/UbTiming.h
@@ -1,28 +1,28 @@
 //=======================================================================================
-// ____          ____    __    ______     __________   __      __       __        __         
-// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |        
-//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |        
-//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |        
-//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____    
-//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|   
-//      \    \  |    |   ________________________________________________________________    
-//       \    \ |    |  |  ______________________________________________________________|   
-//        \    \|    |  |  |         __          __     __     __     ______      _______    
-//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)   
-//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______    
+// ____          ____    __    ______     __________   __      __       __        __
+// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |
+//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |
+//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |
+//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____
+//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|
+//      \    \  |    |   ________________________________________________________________
+//       \    \ |    |  |  ______________________________________________________________|
+//        \    \|    |  |  |         __          __     __     __     ______      _______
+//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)
+//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______
 //           \       |  |  |        |  |_____   |   \_/   |   |  |   |  |_/  /    _____  |
-//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/   
+//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/
 //
-//  This file is part of VirtualFluids. VirtualFluids is free software: you can 
+//  This file is part of VirtualFluids. VirtualFluids is free software: you can
 //  redistribute it and/or modify it under the terms of the GNU General Public
-//  License as published by the Free Software Foundation, either version 3 of 
+//  License as published by the Free Software Foundation, either version 3 of
 //  the License, or (at your option) any later version.
-//  
-//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT 
-//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
-//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License 
+//
+//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT
+//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 //  for more details.
-//  
+//
 //  You should have received a copy of the GNU General Public License along
 //  with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>.
 //
@@ -33,344 +33,321 @@
 #ifndef UBTIMING_H
 #define UBTIMING_H
 
-#include <string>
-#include <limits>
+#include <ctime>
 #include <iostream>
+#include <limits>
 #include <sstream>
+#include <string>
 #include <vector>
-#include <ctime>
 
 #ifdef VF_MPI
-   #include <mpi.h>
-   #include <basics/parallel/PbMpi.h>
-#endif //VF_MPI
+#include <basics/parallel/PbMpi.h>
+#include <mpi.h>
+#endif // VF_MPI
 
 class UbTiming
 {
 public:
-	UbTiming()
-   {
-      this->duration		= 0.0;
-      this->deltaT		= 0.0;
-      this->startTime	= 0;
-      this->name        = "noname";
-   }
-   /*==========================================================*/
-   UbTiming(const std::string& name)
-   {
-      this->duration		= 0.0;
-      this->deltaT		= 0.0;
-      this->startTime	= 0;
-      this->name        = name;
-   }
-   /*==========================================================*/
-   virtual ~UbTiming() = default;  
-   /*==========================================================*/
-   virtual void initTiming()
-   {
-      this->duration = 0.0;	
-   }
-   /*==========================================================*/
-   virtual void startTiming()
-   {
-      #if defined(VF_MPI) && !defined(CAB_RUBY)
-         this->startTime = PbMpi::Wtime();
-      #else
-         this->startTime = (double)clock();	
-      #endif //VF_MPI 
-   }
-   /*==========================================================*/
-   virtual void initAndStartTiming()
-   {
-      this->initTiming();
-      this->startTiming();
-   }
-   /*==========================================================*/
-   virtual void endTiming()
-   {
-      this->stopTiming();
-   }
-   /*==========================================================*/
-   virtual void stopTiming()
-   {
-      #if defined(VF_MPI) && !defined(CAB_RUBY)
-            this->deltaT   = PbMpi::Wtime()-this->startTime;
-      #else
-         this->deltaT   = ((double)clock()-this->startTime)/(double)CLOCKS_PER_SEC;
-      #endif //VF_MPI 
+    UbTiming()
+    {
+        this->duration  = 0.0;
+        this->deltaT    = 0.0;
+        this->startTime = 0;
+        this->name      = "noname";
+    }
+    /*==========================================================*/
+    UbTiming(const std::string &name)
+    {
+        this->duration  = 0.0;
+        this->deltaT    = 0.0;
+        this->startTime = 0;
+        this->name      = name;
+    }
+    /*==========================================================*/
+    virtual ~UbTiming() = default;
+    /*==========================================================*/
+    virtual void initTiming() { this->duration = 0.0; }
+    /*==========================================================*/
+    virtual void startTiming()
+    {
+#if defined(VF_MPI) && !defined(CAB_RUBY)
+        this->startTime = PbMpi::Wtime();
+#else
+        this->startTime = (double)clock();
+#endif // VF_MPI
+    }
+    /*==========================================================*/
+    virtual void initAndStartTiming()
+    {
+        this->initTiming();
+        this->startTiming();
+    }
+    /*==========================================================*/
+    virtual void endTiming() { this->stopTiming(); }
+    /*==========================================================*/
+    virtual void stopTiming()
+    {
+#if defined(VF_MPI) && !defined(CAB_RUBY)
+        this->deltaT = PbMpi::Wtime() - this->startTime;
+#else
+        this->deltaT    = ((double)clock() - this->startTime) / (double)CLOCKS_PER_SEC;
+#endif // VF_MPI
 
-      this->duration += this->deltaT;
-   }
-   /*==========================================================*/
-   virtual double getDuration() const
-   {
-      return this->duration;
-   }
-   /*==========================================================*/
-   virtual void setName(const std::string& name)
-   {
-      this->name = name;
-   }
-   /*==========================================================*/
-   virtual std::string getName() const
-   { 
-      return this->name; 
-   }
-   /*==========================================================*/
-   void start()
-   {
-      this->duration = 0.0;
+        this->duration += this->deltaT;
+    }
+    /*==========================================================*/
+    virtual double getDuration() const { return this->duration; }
+    /*==========================================================*/
+    virtual void setName(const std::string &name) { this->name = name; }
+    /*==========================================================*/
+    virtual std::string getName() const { return this->name; }
+    /*==========================================================*/
+    void start()
+    {
+        this->duration = 0.0;
 
-      #if defined(VF_MPI) && !defined(CAB_RUBY)
-         this->startTime = PbMpi::Wtime();
-      #else
-         this->startTime = (double)clock();
-      #endif //VF_MPI 
-   }
-   /*==========================================================*/
-   void pause()
-   {
-      #if defined(VF_MPI) && !defined(CAB_RUBY)
-         this->duration += PbMpi::Wtime()-this->startTime;
-      #else
-         this->duration +=((double)clock()-this->startTime)/(double)CLOCKS_PER_SEC;
-      #endif //VF_MPI 
-   }
-   /*==========================================================*/
-   void unpause()
-   {
-      #if defined(VF_MPI) && !defined(CAB_RUBY)
-         this->startTime   = PbMpi::Wtime();
-      #else
-         this->startTime = (double)clock();
-      #endif //VF_MPI 
-   }
-   /*==========================================================*/
-   void stop()
-   {
-      #if defined(VF_MPI) && !defined(CAB_RUBY)
-         this->duration += PbMpi::Wtime()-this->startTime;
-      #else
-         this->duration +=((double)clock()-this->startTime)/(double)CLOCKS_PER_SEC;
-      #endif //VF_MPI 
-   }
-   /*==========================================================*/
-   double getTicks() const            
-   { 
-      #if defined(VF_MPI) && !defined(CAB_RUBY)
-         return PbMpi::Wtick();
-      #else
-         return double(1.0)/double(CLOCKS_PER_SEC);
-      #endif  //VF_MPI 
-   }
+#if defined(VF_MPI) && !defined(CAB_RUBY)
+        this->startTime = PbMpi::Wtime();
+#else
+        this->startTime = (double)clock();
+#endif // VF_MPI
+    }
+    /*==========================================================*/
+    void pause()
+    {
+#if defined(VF_MPI) && !defined(CAB_RUBY)
+        this->duration += PbMpi::Wtime() - this->startTime;
+#else
+        this->duration += ((double)clock() - this->startTime) / (double)CLOCKS_PER_SEC;
+#endif // VF_MPI
+    }
+    /*==========================================================*/
+    void unpause()
+    {
+#if defined(VF_MPI) && !defined(CAB_RUBY)
+        this->startTime = PbMpi::Wtime();
+#else
+        this->startTime = (double)clock();
+#endif // VF_MPI
+    }
+    /*==========================================================*/
+    void stop()
+    {
+#if defined(VF_MPI) && !defined(CAB_RUBY)
+        this->duration += PbMpi::Wtime() - this->startTime;
+#else
+        this->duration += ((double)clock() - this->startTime) / (double)CLOCKS_PER_SEC;
+#endif // VF_MPI
+    }
+    /*==========================================================*/
+    double getTicks() const
+    {
+#if defined(VF_MPI) && !defined(CAB_RUBY)
+        return PbMpi::Wtick();
+#else
+        return double(1.0) / double(CLOCKS_PER_SEC);
+#endif // VF_MPI
+    }
 
 protected:
-   std::string name;
+    std::string name;
 
-   double startTime;
-   double duration;
-	double deltaT;
+    double startTime;
+    double duration;
+    double deltaT;
 };
 
 #include <basics/utilities/UbSystem.h> //for definitons of system/OS type
 
-#ifdef UBSYSTEM_APPLE   //Apple hack
-   #include <mach/mach_time.h>  
-   #include <ctime>
-   #include <cstdio>
-   inline void mach_absolute_difference(const uint64_t& end, const uint64_t& start, struct timespec *tp) 
-   {  
-         uint64_t difference = end - start;  
-         static mach_timebase_info_data_t info = {0,0};  
-   
-         if (info.denom == 0)  
-                 mach_timebase_info(&info);  
-   
-         uint64_t elapsednano = difference * (info.numer / info.denom);  
-   
-         tp->tv_sec = elapsednano * 1e-9;  
-         tp->tv_nsec = elapsednano - (tp->tv_sec * 1e9);  
-   } 
+#ifdef UBSYSTEM_APPLE // Apple hack
+#include <cstdio>
+#include <ctime>
+#include <mach/mach_time.h>
+inline void mach_absolute_difference(const uint64_t &end, const uint64_t &start, struct timespec *tp)
+{
+    uint64_t difference                   = end - start;
+    static mach_timebase_info_data_t info = { 0, 0 };
+
+    if (info.denom == 0)
+        mach_timebase_info(&info);
+
+    uint64_t elapsednano = difference * (info.numer / info.denom);
+
+    tp->tv_sec  = elapsednano * 1e-9;
+    tp->tv_nsec = elapsednano - (tp->tv_sec * 1e9);
+}
 #elif defined(UBSYSTEM_LINUX) || defined(UBSYSTEM_AIX)
-   #include <ctime>
-   #include <unistd.h> // for sysconf
-   #include <pthread.h>
+#include <ctime>
+#include <pthread.h>
+#include <unistd.h> // for sysconf
 #endif
 
 /*=========================================================================*/
-//! \brief Time Measuring                                              
-//! \details                                                                         
+//! \brief Time Measuring
+//! \details
 //! example:
 //! \code
-//! t=0  start 
-//! t=1 
+//! t=0  start
+//! t=1
 //! t=2  stop  -> return 2; getLapTime=2; getTotalTime 2; getLapTimes:  2
-//! t=3 
-//! t=4 
+//! t=3
+//! t=4
 //! t=5  stop  -> return 3; getLapTime=3; getTotalTime 5; getLapTimes:  2,3
 //! t=6  stop  -> return 1; getLapTime=1; getTotalTime 6; getLapTimes:  2,3,1
-//! t=7  
-//! t=8  start ->no consideration of time 7 and 8 
-//! t=9  
+//! t=7
+//! t=8  start ->no consideration of time 7 and 8
+//! t=9
 //! t=10 stop  -> return 2; getLapTime=2; getTotalTime 8; getLapTimes:  2,3,1,2
 //! t=11 resetAndStart -> Timer is reset and restarted
 //! t=12
-//! t=13 
+//! t=13
 //! t=14 stop  -> return 3; getLapTime=3; getTotalTime 3; getLapTimes:  3
 //! \endcode
 
 class UbTimer
 {
 public:
-   UbTimer(const bool& storeLapTimes = false) 
-      :  name("unamed"),  storeLapTimes(storeLapTimes)
-        
-   {
+    UbTimer(const bool &storeLapTimes = false) : name("unamed"), storeLapTimes(storeLapTimes) {}
+    /*==========================================================*/
+    UbTimer(const std::string &name, const bool &storeLapTimes = false) : name(name), storeLapTimes(storeLapTimes) {}
+    /*==========================================================*/
+    virtual ~UbTimer() = default;
+    /*==========================================================*/
+    double getLapTime() const { return this->lapTime; }
+    std::vector<double> getLapTimes() const { return this->lapTimes; }
+    void setName(const std::string &name) { this->name = name; }
+    std::string getName() const { return this->name; }
+    bool isRunning() const { return isMeasuring; }
+    bool isStoringLapTimes() const { return storeLapTimes; }
+    /*==========================================================*/
+    void setStoreLapTimes(const bool &storeLapTimes) { this->storeLapTimes = storeLapTimes; }
+    /*==========================================================*/
+    void start()
+    {
+        this->isMeasuring = true;
+
+#if defined(VF_MPI) && !defined(CAB_RUBY)
+        this->startTime = PbMpi::Wtime();
+#elif defined(UBSYSTEM_APPLE)
+        this->startTime = mach_absolute_time();
+#elif defined(UBSYSTEM_LINUX) || defined(UBSYSTEM_AIX)
+        timespec tp;
+        clock_gettime(CLOCK_REALTIME, &tp);
+        this->startTime = (double)(tp.tv_sec) * 1.0e9 + (double)(tp.tv_nsec);
+#else
+        this->startTime = (double)clock();
+#endif // VF_MPI
+    }
+    /*==========================================================*/
+    void resetAndStart()
+    {
+        this->reset();
+        this->start();
+    }
+    /*==========================================================*/
+    // stop: - stops the calculation and returns the time elapsed since last start/stop
+    //      - timing continues
+    double stop()
+    {
+        // if start() was never activated before:
+        if (!isMeasuring)
+            return 0.0;
 
-   }
-   /*==========================================================*/
-   UbTimer(const std::string& name, const bool& storeLapTimes = false) 
-      :  name(name), storeLapTimes(storeLapTimes)
-   {
+#if defined(VF_MPI) && !defined(CAB_RUBY)
+        double actTime = PbMpi::Wtime();
+        this->lapTime  = actTime - this->startTime;
+#elif defined(UBSYSTEM_APPLE)
+        double actTime  = mach_absolute_time();
+        timespec tp;
+        mach_absolute_difference(actTime, this->startTime, &tp);
+        this->lapTime = tp.tv_sec + tp.tv_nsec * 1e-9;
+#elif defined(UBSYSTEM_LINUX) || defined(UBSYSTEM_AIX)
+        timespec tp;
+        clock_gettime(CLOCK_REALTIME, &tp);
+        double actTime = (double)(tp.tv_sec) * 1.0e9 + (double)(tp.tv_nsec);
+        this->lapTime  = (actTime - this->startTime) * 1.0e-9;
+#else
+        double actTime  = (double)clock();
+        this->lapTime   = (actTime - this->startTime) / (double)CLOCKS_PER_SEC;
+#endif // VF_MPI
 
-   }
-   /*==========================================================*/
-   virtual ~UbTimer() = default;  
-   /*==========================================================*/
-   double              getLapTime() const               { return this->lapTime;  }
-   std::vector<double> getLapTimes() const              { return this->lapTimes; }
-   void                setName(const std::string& name) { this->name = name;     }
-   std::string         getName() const                  { return this->name;     }
-   bool                isRunning() const                { return isMeasuring;    }
-   bool                isStoringLapTimes() const        { return storeLapTimes;  }
-   /*==========================================================*/
-   void setStoreLapTimes(const bool& storeLapTimes) { this->storeLapTimes = storeLapTimes; }
-   /*==========================================================*/
-   void start()
-   {
-      this->isMeasuring = true;
+        this->startTime = actTime;
+        this->totalTime += this->lapTime;
+        if (storeLapTimes)
+            lapTimes.push_back(this->lapTime);
 
-      #if defined(VF_MPI) && !defined(CAB_RUBY)
-          this->startTime = PbMpi::Wtime();
-      #elif defined(UBSYSTEM_APPLE)
-    	 this->startTime = mach_absolute_time();  
-      #elif defined(UBSYSTEM_LINUX) || defined(UBSYSTEM_AIX)
-         timespec tp;
-         clock_gettime(CLOCK_REALTIME,&tp);
-         this->startTime = (double)(tp.tv_sec)*1.0e9 + (double)(tp.tv_nsec);
-      #else
-         this->startTime = (double)clock();
-      #endif //VF_MPI
-   }
-   /*==========================================================*/
-   void resetAndStart() { this->reset(); this->start(); }
-   /*==========================================================*/
-   //stop: - stops the calculation and returns the time elapsed since last start/stop
-   //      - timing continues
-   double stop()
-   {
-      //if start() was never activated before:
-      if(!isMeasuring) return 0.0; 
-      
-      #if defined(VF_MPI) && !defined(CAB_RUBY)
-         double actTime = PbMpi::Wtime();
-         this->lapTime  = actTime-this->startTime;
-      #elif defined(UBSYSTEM_APPLE)
-    	 double actTime = mach_absolute_time();  
-         timespec tp;  
-         mach_absolute_difference(actTime, this->startTime, &tp);
-         this->lapTime  =  tp.tv_sec + tp.tv_nsec*1e-9;
-	  #elif defined(UBSYSTEM_LINUX) || defined(UBSYSTEM_AIX)
-         timespec tp;
-         clock_gettime(CLOCK_REALTIME,&tp);
-         double actTime = (double)(tp.tv_sec)*1.0e9 + (double)(tp.tv_nsec);
-         this->lapTime  = (actTime-this->startTime)*1.0e-9;
-      #else
-         double actTime = (double)clock();
-         this->lapTime  = (actTime-this->startTime)/(double)CLOCKS_PER_SEC;
-      #endif //VF_MPI 
-      
-      this->startTime  = actTime;
-      this->totalTime += this->lapTime;
-      if(storeLapTimes) lapTimes.push_back(this->lapTime);
+        return lapTime;
+    }
+    /*==========================================================*/
+    void reset()
+    {
+        this->isMeasuring = false;
 
-      return lapTime;
-   }
-   /*==========================================================*/
-   void reset()
-   {
-      this->isMeasuring = false;
-      
-      this->startTime   = 0.0;
-      this->totalTime   = 0.0;
-      this->lapTime     = 0.0;
+        this->startTime = 0.0;
+        this->totalTime = 0.0;
+        this->lapTime   = 0.0;
 
-      lapTimes.resize(0);
-   }
-   /*==========================================================*/
-   double getCurrentLapTime() const
-   {
-     //if start() was never activated before:
-      if(!isMeasuring) return 0.0; 
-      
-      #if defined(VF_MPI) && !defined(CAB_RUBY)
-         return PbMpi::Wtime() - this->startTime;
-      #elif defined(UBSYSTEM_APPLE)
-         timespec tp;  
-         mach_absolute_difference(mach_absolute_time(), this->startTime, &tp);
-         return tp.tv_sec + tp.tv_nsec*1e-9;
-      #elif defined(UBSYSTEM_LINUX) || defined(UBSYSTEM_AIX)
-         timespec tp;
-         clock_gettime(CLOCK_REALTIME,&tp);
-         return ((double)(tp.tv_sec)*1.0e9 + (double)(tp.tv_nsec) - this->startTime)*1.0e-9;
-      #else
-         return ( (double)clock() - this->startTime ) / (double)CLOCKS_PER_SEC;
-      #endif //VF_MPI 
-      
-   }
-   /*==========================================================*/
-   double getTotalTime() const
-   {
-      return this->totalTime;
-   }
-   /*==========================================================*/
-   std::string toString()
-   {
-      std::stringstream text;
-      text<<*this;
-      return text.str();
-   }
+        lapTimes.resize(0);
+    }
+    /*==========================================================*/
+    double getCurrentLapTime() const
+    {
+        // if start() was never activated before:
+        if (!isMeasuring)
+            return 0.0;
 
-   //ueberladene Operatoren
-   /*==========================================================*/
-   friend inline std::ostream& operator << (std::ostream& os, const UbTimer& timer) 
-   {
-       os<<"UbTimer[totalTime="<<timer.totalTime<<"sec, lapTimes(";
-       for(std::size_t i=0; i<timer.lapTimes.size(); i++) os<<timer.lapTimes[i]<<",";
-       os<<")]";
-       return os;
-   }
+#if defined(VF_MPI) && !defined(CAB_RUBY)
+        return PbMpi::Wtime() - this->startTime;
+#elif defined(UBSYSTEM_APPLE)
+        timespec tp;
+        mach_absolute_difference(mach_absolute_time(), this->startTime, &tp);
+        return tp.tv_sec + tp.tv_nsec * 1e-9;
+#elif defined(UBSYSTEM_LINUX) || defined(UBSYSTEM_AIX)
+        timespec tp;
+        clock_gettime(CLOCK_REALTIME, &tp);
+        return ((double)(tp.tv_sec) * 1.0e9 + (double)(tp.tv_nsec) - this->startTime) * 1.0e-9;
+#else
+        return ((double)clock() - this->startTime) / (double)CLOCKS_PER_SEC;
+#endif // VF_MPI
+    }
+    /*==========================================================*/
+    double getTotalTime() const { return this->totalTime; }
+    /*==========================================================*/
+    std::string toString()
+    {
+        std::stringstream text;
+        text << *this;
+        return text.str();
+    }
 
+    // ueberladene Operatoren
+    /*==========================================================*/
+    friend inline std::ostream &operator<<(std::ostream &os, const UbTimer &timer)
+    {
+        os << "UbTimer[totalTime=" << timer.totalTime << "sec, lapTimes(";
+        for (std::size_t i = 0; i < timer.lapTimes.size(); i++)
+            os << timer.lapTimes[i] << ",";
+        os << ")]";
+        return os;
+    }
 
 protected:
-   std::string name;
-   bool        isMeasuring{false};
-   bool        storeLapTimes;
+    std::string name;
+    bool isMeasuring{ false };
+    bool storeLapTimes;
 
-   double      startTime{0.0};
-   double      totalTime{0.0};
-   double      lapTime{0.0};
-   
-   std::vector<double> lapTimes;
-};
+    double startTime{ 0.0 };
+    double totalTime{ 0.0 };
+    double lapTime{ 0.0 };
 
+    std::vector<double> lapTimes;
+};
 
 /*=========================================================================*/
-//! \brief Time Measuring                                              
-//! 
-//! \details UbProressTimer measures the time from its instantiation to destruction and spend the elapsed time on "os" in [s]
-//! example:
-//! \code
+//! \brief Time Measuring
+//!
+//! \details UbProressTimer measures the time from its instantiation to destruction and spend the elapsed time on "os"
+//! in [s] example: \code
 //!  {
 //!     UbProgressTimer timer;
 //!     UbSystem::sleepS(10);
@@ -380,36 +357,29 @@ protected:
 class UbProgressTimer : public UbTimer
 {
 public:
-    UbProgressTimer(const UbProgressTimer& rhs) = delete;
+    UbProgressTimer(const UbProgressTimer &rhs) = delete;
 
-  explicit UbProgressTimer( std::ostream & os = std::cout )
-     : UbTimer(),os(os) 
-  {
-  	  this->start();
-  }
-  /*==========================================================*/
-  ~UbProgressTimer() override
-  {
-  //  A) Throwing an exception from a destructor is a Bad Thing.
-  //  B) The progress_timer destructor does output which may throw.
-  //  C) A progress_timer is usually not critical to the application.
-  //  Therefore, wrap the I/O in a try block, catch and ignore all exceptions.
-    try
+    explicit UbProgressTimer(std::ostream &os = std::cout) : UbTimer(), os(os) { this->start(); }
+    /*==========================================================*/
+    ~UbProgressTimer() override
     {
-      // use istream instead of ios_base to workaround GNU problem (Greg Chicares)
-      std::istream::fmtflags old_flags = os.setf( std::istream::fixed,
-                                                  std::istream::floatfield );
-      std::streamsize old_prec = os.precision( 2 );
-      os << stop() << " s" << std::endl;
-      os.flags( old_flags );
-      os.precision( old_prec );
+        //  A) Throwing an exception from a destructor is a Bad Thing.
+        //  B) The progress_timer destructor does output which may throw.
+        //  C) A progress_timer is usually not critical to the application.
+        //  Therefore, wrap the I/O in a try block, catch and ignore all exceptions.
+        try {
+            // use istream instead of ios_base to workaround GNU problem (Greg Chicares)
+            std::istream::fmtflags old_flags = os.setf(std::istream::fixed, std::istream::floatfield);
+            std::streamsize old_prec         = os.precision(2);
+            os << stop() << " s" << std::endl;
+            os.flags(old_flags);
+            os.precision(old_prec);
+        } catch (...) {
+        } // eat any exceptions
     }
-    catch (...) {} // eat any exceptions
-  } 
 
 private:
-  std::ostream & os;
+    std::ostream &os;
 };
 
-
-#endif //UBTIMING_H
+#endif // UBTIMING_H
diff --git a/src/basics/basics/utilities/UbTuple.h b/src/basics/basics/utilities/UbTuple.h
index f081f2e9e0a054e320a2dfb1fd6e6e49d0489216..fe9c787cead38621beafab3d082122277bdcff73 100644
--- a/src/basics/basics/utilities/UbTuple.h
+++ b/src/basics/basics/utilities/UbTuple.h
@@ -1,28 +1,28 @@
 //=======================================================================================
-// ____          ____    __    ______     __________   __      __       __        __         
-// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |        
-//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |        
-//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |        
-//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____    
-//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|   
-//      \    \  |    |   ________________________________________________________________    
-//       \    \ |    |  |  ______________________________________________________________|   
-//        \    \|    |  |  |         __          __     __     __     ______      _______    
-//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)   
-//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______    
+// ____          ____    __    ______     __________   __      __       __        __
+// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |
+//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |
+//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |
+//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____
+//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|
+//      \    \  |    |   ________________________________________________________________
+//       \    \ |    |  |  ______________________________________________________________|
+//        \    \|    |  |  |         __          __     __     __     ______      _______
+//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)
+//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______
 //           \       |  |  |        |  |_____   |   \_/   |   |  |   |  |_/  /    _____  |
-//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/   
+//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/
 //
-//  This file is part of VirtualFluids. VirtualFluids is free software: you can 
+//  This file is part of VirtualFluids. VirtualFluids is free software: you can
 //  redistribute it and/or modify it under the terms of the GNU General Public
-//  License as published by the Free Software Foundation, either version 3 of 
+//  License as published by the Free Software Foundation, either version 3 of
 //  the License, or (at your option) any later version.
-//  
-//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT 
-//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
-//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License 
+//
+//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT
+//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 //  for more details.
-//  
+//
 //  You should have received a copy of the GNU General Public License along
 //  with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>.
 //
@@ -34,8 +34,8 @@
 #define UBTUPLE_H
 
 #include <iostream>
-#include <string>
 #include <ostream>
+#include <string>
 
 //////////////////////////////////////////////////////////////////////////
 //! \brief A class implements a tuple
@@ -62,7 +62,7 @@
 //! val<2>(t3) = 42;
 //! val<3>(t3) = 0.2;
 //! t3 = makeUbTuple(false, 23, 13.13);
-//! 
+//!
 //! std::cout << val<1>(t3) << ", ";
 //! std::cout << val<2>(t3) << ", ";
 //! std::cout << val<3>(t3) << std::endl;
@@ -75,343 +75,347 @@
 //! \endcode
 
 template <typename T>
-class UbTypeOp    // primary template
-{           
+class UbTypeOp // primary template
+{
 public:
-   using ArgT = T;
-   using BareT = T;
-   using ConstT = const T;
-   using RefT = T &;
-   using RefBareT = T &;
-   using RefConstT = const T &;
+    using ArgT      = T;
+    using BareT     = T;
+    using ConstT    = const T;
+    using RefT      = T &;
+    using RefBareT  = T &;
+    using RefConstT = const T &;
 };
 /**** end of typeop1.hpp ****/
 
 // partial specialization for const
 /**********************************
-* typeop2.hpp:
-**********************************/
+ * typeop2.hpp:
+ **********************************/
 template <typename T>
-class UbTypeOp <T const>  // partial specialization for const types
-{
- public:
-   using ArgT = const T;
-   using BareT = T;
-   using ConstT = const T;
-   using RefT = const T &;
-   using RefBareT = T &;
-   using RefConstT = const T &;
+class UbTypeOp<T const> // partial specialization for const types
+{
+public:
+    using ArgT      = const T;
+    using BareT     = T;
+    using ConstT    = const T;
+    using RefT      = const T &;
+    using RefBareT  = T &;
+    using RefConstT = const T &;
 };
 /**** end of typeop2.hpp ****/
 
 // partial specialization for references
 /**********************************
-* typeop3.hpp:
-**********************************/
+ * typeop3.hpp:
+ **********************************/
 template <typename T>
-class UbTypeOp <T&>        // partial specialization for references
+class UbTypeOp<T &> // partial specialization for references
 {
 public:
-   using ArgT = T &;
-   using BareT = typename UbTypeOp<T>::BareT;
-   using ConstT = const T;
-   using RefT = T &;
-   using RefBareT = typename UbTypeOp<T>::BareT &;
-   using RefConstT = const T &;
+    using ArgT      = T &;
+    using BareT     = typename UbTypeOp<T>::BareT;
+    using ConstT    = const T;
+    using RefT      = T &;
+    using RefBareT  = typename UbTypeOp<T>::BareT &;
+    using RefConstT = const T &;
 };
 /**** end of typeop3.hpp ****/
 
 // full specialization for void
 /**********************************
-* typeop4.hpp:
-**********************************/
-template<>
-class UbTypeOp <void>      // full specialization for void
+ * typeop4.hpp:
+ **********************************/
+template <>
+class UbTypeOp<void> // full specialization for void
 {
 public:
-   using ArgT = void;
-   using BareT = void;
-   using ConstT = const void;
-   using RefT = void;
-   using RefBareT = void;
-   using RefConstT = void;
+    using ArgT      = void;
+    using BareT     = void;
+    using ConstT    = const void;
+    using RefT      = void;
+    using RefBareT  = void;
+    using RefConstT = void;
 };
 /**** end of typeop4.hpp ****/
 
 template <typename T1, typename T2>
-class  UbDuo;
+class UbDuo;
 
 template <typename T1, typename T2>
-std::ostream& operator << (std::ostream& os, UbDuo<T1, T2> const& d1);
+std::ostream &operator<<(std::ostream &os, UbDuo<T1, T2> const &d1);
 
-//duo1.hpp
+// duo1.hpp
 template <typename T1, typename T2>
-class UbDuo 
+class UbDuo
 {
 public:
-   using Type1 = T1;  // type of first field
-   using Type2 = T2;  // type of second field
-   enum { N = 2 };    // number of fields
+    using Type1 = T1; // type of first field
+    using Type2 = T2; // type of second field
+    enum { N = 2 };   // number of fields
 
 public:
-   // constructors
-   UbDuo() : value1(), value2() {  }
-   UbDuo (T1 const & a, T2 const & b) : value1(a), value2(b)  {  }
-
-   // for implicit type conversion during construction
-   template <typename U1, typename U2>
-   UbDuo (UbDuo<U1,U2> const & d) : value1(d.v1()), value2(d.v2()) {  }
-
-   // for implicit type conversion during assignments
-   template <typename U1, typename U2>
-   UbDuo<T1, T2>& operator = (UbDuo<U1,U2> const & d) 
-   {
-      value1 = d.v1();//value1;
-      value2 = d.v2();//value2;
-      return *this;
-   }
-
-   // field access
-   T1& v1()             { return value1; }
-   T1 const& v1() const { return value1; }
-
-   T2& v2()             { return value2; }
-   T2 const& v2() const { return value2; }
+    // constructors
+    UbDuo() : value1(), value2() {}
+    UbDuo(T1 const &a, T2 const &b) : value1(a), value2(b) {}
+
+    // for implicit type conversion during construction
+    template <typename U1, typename U2>
+    UbDuo(UbDuo<U1, U2> const &d) : value1(d.v1()), value2(d.v2())
+    {
+    }
+
+    // for implicit type conversion during assignments
+    template <typename U1, typename U2>
+    UbDuo<T1, T2> &operator=(UbDuo<U1, U2> const &d)
+    {
+        value1 = d.v1(); // value1;
+        value2 = d.v2(); // value2;
+        return *this;
+    }
+
+    // field access
+    T1 &v1() { return value1; }
+    T1 const &v1() const { return value1; }
+
+    T2 &v2() { return value2; }
+    T2 const &v2() const { return value2; }
 
 private:
-   T1 value1;         // value of first field
-   T2 value2;         // value of second field
+    T1 value1; // value of first field
+    T2 value2; // value of second field
 };
 
 // comparison operators (allow mixed types):
-template <typename T1, typename T2,typename U1, typename U2>
-inline bool operator == (UbDuo<T1,T2> const& d1, UbDuo<U1,U2> const& d2)
+template <typename T1, typename T2, typename U1, typename U2>
+inline bool operator==(UbDuo<T1, T2> const &d1, UbDuo<U1, U2> const &d2)
 {
-   return d1.v1()==d2.v1() && d1.v2()==d2.v2();
+    return d1.v1() == d2.v1() && d1.v2() == d2.v2();
 }
 
-template <typename T1, typename T2,typename U1, typename U2>
-inline bool operator != (UbDuo<T1,T2> const& d1, UbDuo<U1,U2> const& d2)
+template <typename T1, typename T2, typename U1, typename U2>
+inline bool operator!=(UbDuo<T1, T2> const &d1, UbDuo<U1, U2> const &d2)
 {
-   return !(d1==d2);
+    return !(d1 == d2);
 }
 
-template <typename T1, typename T2,typename U1, typename U2>
-inline bool operator < (UbDuo<T1,T2> const& d1, UbDuo<U1,U2> const& d2)
+template <typename T1, typename T2, typename U1, typename U2>
+inline bool operator<(UbDuo<T1, T2> const &d1, UbDuo<U1, U2> const &d2)
 {
-   if     (d1.v1() <  d2.v1() ) return true;
-   else if(d1.v1() == d2.v1() ) return d1.v2() < d2.v2();
+    if (d1.v1() < d2.v1())
+        return true;
+    else if (d1.v1() == d2.v1())
+        return d1.v2() < d2.v2();
 
-   return false;
+    return false;
 }
 
 template <typename T1, typename T2>
-std::ostream& operator << (std::ostream& os, UbDuo<T1, T2> const& d1)
+std::ostream &operator<<(std::ostream &os, UbDuo<T1, T2> const &d1)
 {
     os << d1.v1() << ", " << d1.v2();
     return os;
 }
 
 // convenience function  for creation and initialization
-template <typename T1, typename T2> 
-inline UbDuo<T1,T2> makeUbDuo(T1 const & a, T2 const & b)
+template <typename T1, typename T2>
+inline UbDuo<T1, T2> makeUbDuo(T1 const &a, T2 const &b)
 {
-   return UbDuo<T1,T2>(a,b);
+    return UbDuo<T1, T2>(a, b);
 }
 
-//duo2.hpp
+// duo2.hpp
 template <typename A, typename B, typename C>
-class UbDuo<A, UbDuo<B,C> > 
+class UbDuo<A, UbDuo<B, C>>
 {
 public:
-   using T1 = A;           // type of first field
-   using T2 = UbDuo<B, C>;           // type of second field
-   enum { N = UbDuo<B,C>::N + 1 };  // number of fields
- 
+    using T1 = A;                    // type of first field
+    using T2 = UbDuo<B, C>;          // type of second field
+    enum { N = UbDuo<B, C>::N + 1 }; // number of fields
+
 public:
-   // constructors
-   UbDuo() : value1(), value2() { }
-   UbDuo (T1 const & a, T2 const & b) : value1(a), value2(b) { }
-
-   // for implicit type conversion during construction
-   template <typename U1, typename U2>
-   UbDuo (UbDuo<U1,U2> const & d) : value1(d.v1()), value2(d.v2()) { }
-
-   // for implicit type conversion during assignments
-   template <typename U1, typename U2>
-   UbDuo<T1, T2>& operator = (UbDuo<U1,U2> const & d) 
-   { 
-      value1 = d.v1();//value1;     
-      value2 = d.v2();//value2;
-      return *this;
-   }
-
-   // field access
-   T1& v1()             { return value1; }
-   T1 const& v1() const { return value1; }
-
-   T2& v2()             { return value2; }
-   T2 const& v2() const { return value2; }
+    // constructors
+    UbDuo() : value1(), value2() {}
+    UbDuo(T1 const &a, T2 const &b) : value1(a), value2(b) {}
+
+    // for implicit type conversion during construction
+    template <typename U1, typename U2>
+    UbDuo(UbDuo<U1, U2> const &d) : value1(d.v1()), value2(d.v2())
+    {
+    }
+
+    // for implicit type conversion during assignments
+    template <typename U1, typename U2>
+    UbDuo<T1, T2> &operator=(UbDuo<U1, U2> const &d)
+    {
+        value1 = d.v1(); // value1;
+        value2 = d.v2(); // value2;
+        return *this;
+    }
+
+    // field access
+    T1 &v1() { return value1; }
+    T1 const &v1() const { return value1; }
+
+    T2 &v2() { return value2; }
+    T2 const &v2() const { return value2; }
 
 private:
-   T1 value1;         // value of first field
-   T2 value2;         // value of second field
+    T1 value1; // value of first field
+    T2 value2; // value of second field
 };
 
-//duo3.hpp
+// duo3.hpp
 // primary template for type of Nth field of (duo) T
 template <int N, typename T>
-class UbDuoT 
+class UbDuoT
 {
 public:
-   using ResultT = void;    // in general, the result type is void
+    using ResultT = void; // in general, the result type is void
 };
 
 // specialization for 1st field of a plain duo
 template <typename A, typename B>
-class UbDuoT<1, UbDuo<A,B> > 
+class UbDuoT<1, UbDuo<A, B>>
 {
 public:
-   using ResultT = A;
+    using ResultT = A;
 };
 
 // specialization for 2nd field of a plain duo
 template <typename A, typename B>
-class UbDuoT<2, UbDuo<A,B> > 
+class UbDuoT<2, UbDuo<A, B>>
 {
 public:
-   using ResultT = B;
+    using ResultT = B;
 };
 
 // specialization for Nth field of a recursive duo
 template <int N, typename A, typename B, typename C>
-class UbDuoT<N, UbDuo<A, UbDuo<B,C> > > 
+class UbDuoT<N, UbDuo<A, UbDuo<B, C>>>
 {
 public:
-   using ResultT = typename UbDuoT<N - 1, UbDuo<B, C> >::ResultT;
+    using ResultT = typename UbDuoT<N - 1, UbDuo<B, C>>::ResultT;
 };
 
 // specialization for 1st field of a recursive duo
 template <typename A, typename B, typename C>
-class UbDuoT<1, UbDuo<A, UbDuo<B,C> > > 
+class UbDuoT<1, UbDuo<A, UbDuo<B, C>>>
 {
 public:
-   using ResultT = A;
+    using ResultT = A;
 };
 
 // specialization for 2nd field of a recursive duo
 template <typename A, typename B, typename C>
-class UbDuoT<2, UbDuo<A, UbDuo<B,C> > > 
+class UbDuoT<2, UbDuo<A, UbDuo<B, C>>>
 {
 public:
-   using ResultT = B;
+    using ResultT = B;
 };
 
-//duo4.hpp
+// duo4.hpp
 // primary template for value of Nth field of (duo) T
 template <int N, typename T>
-class DuoValue 
+class DuoValue
 {
 public:
-   static void get(T&) {  }      // in general, we have no value
-   static void get(T const&) { }
+    static void get(T &) {} // in general, we have no value
+    static void get(T const &) {}
 };
 
 // specialization for 1st field of a plain duo
 template <typename A, typename B>
-class DuoValue<1, UbDuo<A, B> > 
+class DuoValue<1, UbDuo<A, B>>
 {
 public:
-   static A& get(UbDuo<A, B> &d)             { return d.v1(); }
-   static A const& get(UbDuo<A, B> const &d) { return d.v1(); }
+    static A &get(UbDuo<A, B> &d) { return d.v1(); }
+    static A const &get(UbDuo<A, B> const &d) { return d.v1(); }
 };
 
 // specialization for 2nd field of a plain duo
 template <typename A, typename B>
-class DuoValue<2, UbDuo<A, B> > 
+class DuoValue<2, UbDuo<A, B>>
 {
 public:
-   static B& get(UbDuo<A, B> &d)             { return d.v2(); }
-   static B const& get(UbDuo<A, B> const &d) { return d.v2(); }
+    static B &get(UbDuo<A, B> &d) { return d.v2(); }
+    static B const &get(UbDuo<A, B> const &d) { return d.v2(); }
 };
 
 // specialization for Nth field of recursive duo
 template <int N, typename A, typename B, typename C>
-struct DuoValue<N, UbDuo<A, UbDuo<B,C> > >
-{
-   static typename UbTypeOp<typename UbDuoT<N-1, UbDuo<B,C> >::ResultT>::RefT  get(UbDuo<A, UbDuo<B,C> > &d)
-   { 
-      return DuoValue<N-1, UbDuo<B,C> >::get(d.v2()); 
-   }
-   static typename UbTypeOp<typename UbDuoT<N-1, UbDuo<B,C> >::ResultT>::RefConstT  get(UbDuo<A, UbDuo<B,C> > const &d)
-   { 
-      return DuoValue<N-1, UbDuo<B,C> >::get(d.v2()); 
-   }
+struct DuoValue<N, UbDuo<A, UbDuo<B, C>>> {
+    static typename UbTypeOp<typename UbDuoT<N - 1, UbDuo<B, C>>::ResultT>::RefT get(UbDuo<A, UbDuo<B, C>> &d)
+    {
+        return DuoValue<N - 1, UbDuo<B, C>>::get(d.v2());
+    }
+    static typename UbTypeOp<typename UbDuoT<N - 1, UbDuo<B, C>>::ResultT>::RefConstT
+    get(UbDuo<A, UbDuo<B, C>> const &d)
+    {
+        return DuoValue<N - 1, UbDuo<B, C>>::get(d.v2());
+    }
 };
 
 // specialization for 1st field of recursive duo
 template <typename A, typename B, typename C>
-class DuoValue<1, UbDuo<A, UbDuo<B,C> > > 
+class DuoValue<1, UbDuo<A, UbDuo<B, C>>>
 {
 public:
-   static A& get(UbDuo<A, UbDuo<B,C> > &d)             { return d.v1(); }
-   static A const& get(UbDuo<A, UbDuo<B,C> > const &d) { return d.v1(); }
+    static A &get(UbDuo<A, UbDuo<B, C>> &d) { return d.v1(); }
+    static A const &get(UbDuo<A, UbDuo<B, C>> const &d) { return d.v1(); }
 };
 
 // specialization for 2nd field of recursive duo
 template <typename A, typename B, typename C>
-class DuoValue<2, UbDuo<A, UbDuo<B,C> > > 
+class DuoValue<2, UbDuo<A, UbDuo<B, C>>>
 {
 public:
-   static B& get(UbDuo<A, UbDuo<B,C> > &d)             { return d.v2().v1(); }
-   static B const& get(UbDuo<A, UbDuo<B,C> > const &d) { return d.v2().v1(); }
+    static B &get(UbDuo<A, UbDuo<B, C>> &d) { return d.v2().v1(); }
+    static B const &get(UbDuo<A, UbDuo<B, C>> const &d) { return d.v2().v1(); }
 };
 
-//duo5.hpp
+// duo5.hpp
 // return Nth value of variable duo
-template <int N, typename A, typename B> 
-inline typename UbTypeOp<typename UbDuoT<N, UbDuo<A, B> >::ResultT>::RefT val(UbDuo<A, B>& d)
+template <int N, typename A, typename B>
+inline typename UbTypeOp<typename UbDuoT<N, UbDuo<A, B>>::ResultT>::RefT val(UbDuo<A, B> &d)
 {
-   return DuoValue<N, UbDuo<A, B> >::get(d);
+    return DuoValue<N, UbDuo<A, B>>::get(d);
 }
 
 // return Nth value of constant duo
-template <int N, typename A, typename B> 
-inline typename UbTypeOp<typename UbDuoT<N, UbDuo<A, B> >::ResultT>::RefConstT val(UbDuo<A, B> const& d)
+template <int N, typename A, typename B>
+inline typename UbTypeOp<typename UbDuoT<N, UbDuo<A, B>>::ResultT>::RefConstT val(UbDuo<A, B> const &d)
 {
-   return DuoValue<N, UbDuo<A, B> >::get(d);
+    return DuoValue<N, UbDuo<A, B>>::get(d);
 }
 
-//duo6.hpp
+// duo6.hpp
 // partial specialization for UbDuo<> with only c1 field
 template <typename A>
-struct UbDuo<A,void> 
-{
+struct UbDuo<A, void> {
 public:
-   using T1 = A;  // type of first field
-   using T2 = void;  // type of second field
-   enum { N = 1 };   // number of fields
+    using T1 = A;    // type of first field
+    using T2 = void; // type of second field
+    enum { N = 1 };  // number of fields
 
 private:
-   T1 value1;        // value of first field
+    T1 value1; // value of first field
 
 public:
-   // constructors
-   UbDuo() : value1() { }
-   UbDuo (T1 const & a) : value1(a) { }
+    // constructors
+    UbDuo() : value1() {}
+    UbDuo(T1 const &a) : value1(a) {}
 
-   // field access
-   T1& v1()             { return value1; }
-   T1 const& v1() const { return value1; }
-
-   void v2() { }
-   void v2() const { }
+    // field access
+    T1 &v1() { return value1; }
+    T1 const &v1() const { return value1; }
 
+    void v2() {}
+    void v2() const {}
 };
 
-//tupel1.hpp
+// tupel1.hpp
 // type that represents unused type parameters
-class UbNullT 
+class UbNullT
 {
 };
 
@@ -440,7 +444,7 @@ class UbNullT
 //! val<2>(t3) = 42;
 //! val<3>(t3) = 0.2;
 //! t3 = makeUbTuple(false, 23, 13.13);
-//! 
+//!
 //! std::cout << val<1>(t3) << ", ";
 //! std::cout << val<2>(t3) << ", ";
 //! std::cout << val<3>(t3) << std::endl;
@@ -453,181 +457,164 @@ class UbNullT
 //! \endcode
 
 // UbTuple<> in general derives from UbTuple<> with c1 more UbNullT
-template <typename P1,
-          typename P2 = UbNullT,
-          typename P3 = UbNullT,
-          typename P4 = UbNullT,
-          typename P5 = UbNullT,
-          typename P6 = UbNullT,
-          typename P7 = UbNullT,
-          typename P8 = UbNullT >
-class UbTuple : public UbDuo<P1, typename UbTuple<P2,P3,P4,P5,P6,P7,P8,UbNullT>::BaseT> 
+template <typename P1, typename P2 = UbNullT, typename P3 = UbNullT, typename P4 = UbNullT, typename P5 = UbNullT,
+          typename P6 = UbNullT, typename P7 = UbNullT, typename P8 = UbNullT>
+class UbTuple : public UbDuo<P1, typename UbTuple<P2, P3, P4, P5, P6, P7, P8, UbNullT>::BaseT>
 {
 public:
-   using BaseT = UbDuo<P1, typename UbTuple<P2, P3, P4, P5, P6, P7, P8, UbNullT>::BaseT>;
-
-   // constructor:
-   UbTuple() = default;
-   UbTuple( typename UbTypeOp<P1>::RefConstT a1,
-            typename UbTypeOp<P2>::RefConstT a2,
-            typename UbTypeOp<P3>::RefConstT a3 = UbNullT(),
-            typename UbTypeOp<P4>::RefConstT a4 = UbNullT(),
-            typename UbTypeOp<P5>::RefConstT a5 = UbNullT(),
-            typename UbTypeOp<P6>::RefConstT a6 = UbNullT(),
-            typename UbTypeOp<P7>::RefConstT a7 = UbNullT(),
-            typename UbTypeOp<P8>::RefConstT a8 = UbNullT() )
-      : BaseT(a1, UbTuple<P2,P3,P4,P5,P6,P7,P8,UbNullT>(a2,a3,a4,a5,a6,a7,a8))
-   {
-   }
-
-   // for implicit type conversion during assignments
-   template <typename U1,typename U2, typename U3, typename U4, typename U5, typename U6, typename U7, typename U8 >
-   UbTuple<P1,P2,P3,P4,P5,P6,P7,P8>& operator = ( const UbTuple<U1,U2,U3,U4,U5,U6,U7,U8>& rhs)
-   {
-      this->BaseT::operator=( typename UbTuple<U1,U2,U3,U4,U5,U6,U7,U8>::BaseT(rhs) );
-      return *this;
-   }
-
+    using BaseT = UbDuo<P1, typename UbTuple<P2, P3, P4, P5, P6, P7, P8, UbNullT>::BaseT>;
+
+    // constructor:
+    UbTuple() = default;
+    UbTuple(typename UbTypeOp<P1>::RefConstT a1, typename UbTypeOp<P2>::RefConstT a2,
+            typename UbTypeOp<P3>::RefConstT a3 = UbNullT(), typename UbTypeOp<P4>::RefConstT a4 = UbNullT(),
+            typename UbTypeOp<P5>::RefConstT a5 = UbNullT(), typename UbTypeOp<P6>::RefConstT a6 = UbNullT(),
+            typename UbTypeOp<P7>::RefConstT a7 = UbNullT(), typename UbTypeOp<P8>::RefConstT a8 = UbNullT())
+        : BaseT(a1, UbTuple<P2, P3, P4, P5, P6, P7, P8, UbNullT>(a2, a3, a4, a5, a6, a7, a8))
+    {
+    }
+
+    // for implicit type conversion during assignments
+    template <typename U1, typename U2, typename U3, typename U4, typename U5, typename U6, typename U7, typename U8>
+    UbTuple<P1, P2, P3, P4, P5, P6, P7, P8> &operator=(const UbTuple<U1, U2, U3, U4, U5, U6, U7, U8> &rhs)
+    {
+        this->BaseT::operator=(typename UbTuple<U1, U2, U3, U4, U5, U6, U7, U8>::BaseT(rhs));
+        return *this;
+    }
 };
 
 // specialization to end deriving recursion
 template <typename P1, typename P2>
-class UbTuple<P1,P2,UbNullT,UbNullT,UbNullT,UbNullT,UbNullT,UbNullT> : public UbDuo<P1,P2> {
+class UbTuple<P1, P2, UbNullT, UbNullT, UbNullT, UbNullT, UbNullT, UbNullT> : public UbDuo<P1, P2>
+{
 public:
-   using BaseT = UbDuo<P1, P2>;
-   
-   // constructor:
-   UbTuple() = default;
-   UbTuple( typename UbTypeOp<P1>::RefConstT a1,
-            typename UbTypeOp<P2>::RefConstT a2,
-            typename UbTypeOp<UbNullT>::RefConstT = UbNullT(),
-            typename UbTypeOp<UbNullT>::RefConstT = UbNullT(),
-            typename UbTypeOp<UbNullT>::RefConstT = UbNullT(),
-            typename UbTypeOp<UbNullT>::RefConstT = UbNullT(),
-            typename UbTypeOp<UbNullT>::RefConstT = UbNullT(),
-            typename UbTypeOp<UbNullT>::RefConstT = UbNullT() )
-      : BaseT(a1, a2) 
-   {
-   }
-
-   // for implicit type conversion during assignments
-   template <typename U1,typename U2 >
-   UbTuple<P1,P2>& operator = ( const UbTuple<U1,U2>& rhs)
-   {
-      this->BaseT::operator=( typename UbTuple<U1,U2>::BaseT(rhs) );
-      return *this;
-   }
-
+    using BaseT = UbDuo<P1, P2>;
+
+    // constructor:
+    UbTuple() = default;
+    UbTuple(typename UbTypeOp<P1>::RefConstT a1, typename UbTypeOp<P2>::RefConstT a2,
+            typename UbTypeOp<UbNullT>::RefConstT = UbNullT(), typename UbTypeOp<UbNullT>::RefConstT = UbNullT(),
+            typename UbTypeOp<UbNullT>::RefConstT = UbNullT(), typename UbTypeOp<UbNullT>::RefConstT = UbNullT(),
+            typename UbTypeOp<UbNullT>::RefConstT = UbNullT(), typename UbTypeOp<UbNullT>::RefConstT = UbNullT())
+        : BaseT(a1, a2)
+    {
+    }
+
+    // for implicit type conversion during assignments
+    template <typename U1, typename U2>
+    UbTuple<P1, P2> &operator=(const UbTuple<U1, U2> &rhs)
+    {
+        this->BaseT::operator=(typename UbTuple<U1, U2>::BaseT(rhs));
+        return *this;
+    }
 };
 
 // specialization for singletons
 template <typename P1>
-class UbTuple<P1,UbNullT,UbNullT,UbNullT,UbNullT,UbNullT,UbNullT,UbNullT> : public UbDuo<P1,void>
+class UbTuple<P1, UbNullT, UbNullT, UbNullT, UbNullT, UbNullT, UbNullT, UbNullT> : public UbDuo<P1, void>
 {
 public:
-   using BaseT = UbDuo<P1, void>;
-
-   // constructor:
-   UbTuple() = default;
-   UbTuple( typename UbTypeOp<P1>::RefConstT a1,
-            typename UbTypeOp<UbNullT>::RefConstT = UbNullT(),
-            typename UbTypeOp<UbNullT>::RefConstT = UbNullT(),
-            typename UbTypeOp<UbNullT>::RefConstT = UbNullT(),
-            typename UbTypeOp<UbNullT>::RefConstT = UbNullT(),
-            typename UbTypeOp<UbNullT>::RefConstT = UbNullT(),
-            typename UbTypeOp<UbNullT>::RefConstT = UbNullT(),
-            typename UbTypeOp<UbNullT>::RefConstT = UbNullT() )
-      : BaseT(a1) 
-   {
-   }
-
-   // for implicit type conversion during assignments
-   template <typename U1 >
-   UbTuple<P1>& operator = ( const UbTuple<U1>& rhs)
-   {
-      this->v1() = rhs.v1();
-      return *this;
-   }
-
+    using BaseT = UbDuo<P1, void>;
+
+    // constructor:
+    UbTuple() = default;
+    UbTuple(typename UbTypeOp<P1>::RefConstT a1, typename UbTypeOp<UbNullT>::RefConstT = UbNullT(),
+            typename UbTypeOp<UbNullT>::RefConstT = UbNullT(), typename UbTypeOp<UbNullT>::RefConstT = UbNullT(),
+            typename UbTypeOp<UbNullT>::RefConstT = UbNullT(), typename UbTypeOp<UbNullT>::RefConstT = UbNullT(),
+            typename UbTypeOp<UbNullT>::RefConstT = UbNullT(), typename UbTypeOp<UbNullT>::RefConstT = UbNullT())
+        : BaseT(a1)
+    {
+    }
+
+    // for implicit type conversion during assignments
+    template <typename U1>
+    UbTuple<P1> &operator=(const UbTuple<U1> &rhs)
+    {
+        this->v1() = rhs.v1();
+        return *this;
+    }
 };
 
 // convenience function for 1 argument
-template <typename T1> 
+template <typename T1>
 inline UbTuple<T1> makeUbTuple(T1 const &a1)
 {
-   return UbTuple<T1>(a1);
+    return UbTuple<T1>(a1);
 }
 
 // convenience function for 2 arguments
 template <typename T1, typename T2>
-inline UbTuple<T1,T2> makeUbTuple(T1 const &a1, T2 const &a2)
+inline UbTuple<T1, T2> makeUbTuple(T1 const &a1, T2 const &a2)
 {
-   return UbTuple<T1,T2>(a1,a2);
+    return UbTuple<T1, T2>(a1, a2);
 }
 
 // convenience function for 3 arguments
 template <typename T1, typename T2, typename T3>
-inline UbTuple<T1,T2,T3> makeUbTuple(T1 const &a1, T2 const &a2, T3 const &a3)
+inline UbTuple<T1, T2, T3> makeUbTuple(T1 const &a1, T2 const &a2, T3 const &a3)
 {
-   return UbTuple<T1,T2,T3>(a1,a2,a3);
+    return UbTuple<T1, T2, T3>(a1, a2, a3);
 }
 
 // convenience function for 4 arguments
 template <typename T1, typename T2, typename T3, typename T4>
-inline UbTuple<T1,T2,T3,T4> makeUbTuple(T1 const &a1, T2 const &a2, T3 const &a3, T4 const &a4)
+inline UbTuple<T1, T2, T3, T4> makeUbTuple(T1 const &a1, T2 const &a2, T3 const &a3, T4 const &a4)
 {
-   return UbTuple<T1,T2,T3,T4>(a1,a2,a3,a4);
+    return UbTuple<T1, T2, T3, T4>(a1, a2, a3, a4);
 }
 
 // convenience function for 5 arguments
 template <typename T1, typename T2, typename T3, typename T4, typename T5>
-inline UbTuple<T1,T2,T3,T4,T5> makeUbTuple(T1 const &a1, T2 const &a2, T3 const &a3, T4 const &a4,T5 const &a5)
+inline UbTuple<T1, T2, T3, T4, T5> makeUbTuple(T1 const &a1, T2 const &a2, T3 const &a3, T4 const &a4, T5 const &a5)
 {
-   return UbTuple<T1,T2,T3,T4,T5>(a1,a2,a3,a4,a5);
+    return UbTuple<T1, T2, T3, T4, T5>(a1, a2, a3, a4, a5);
 }
 
 // convenience function for 6 arguments
 template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
-inline UbTuple<T1,T2,T3,T4,T5,T6> makeUbTuple(T1 const &a1, T2 const &a2, T3 const &a3, T4 const &a4, T5 const &a5, T6 const &a6)
+inline UbTuple<T1, T2, T3, T4, T5, T6> makeUbTuple(T1 const &a1, T2 const &a2, T3 const &a3, T4 const &a4, T5 const &a5,
+                                                   T6 const &a6)
 {
-   return UbTuple<T1,T2,T3,T4,T5,T6>(a1,a2,a3,a4,a5,a6);
+    return UbTuple<T1, T2, T3, T4, T5, T6>(a1, a2, a3, a4, a5, a6);
 }
 
 // convenience function for 7 arguments
 template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7>
-inline UbTuple<T1,T2,T3,T4,T5,T6,T7> makeUbTuple(T1 const &a1, T2 const &a2, T3 const &a3, T4 const &a4, T5 const &a5, T6 const &a6, T7 const &a7)
+inline UbTuple<T1, T2, T3, T4, T5, T6, T7> makeUbTuple(T1 const &a1, T2 const &a2, T3 const &a3, T4 const &a4,
+                                                       T5 const &a5, T6 const &a6, T7 const &a7)
 {
-   return UbTuple<T1,T2,T3,T4,T5,T6,T7>(a1,a2,a3,a4,a5,a6,a7);
+    return UbTuple<T1, T2, T3, T4, T5, T6, T7>(a1, a2, a3, a4, a5, a6, a7);
 }
 
 // convenience function for 8 arguments
 template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8>
-inline UbTuple<T1,T2,T3,T4,T5,T6,T7,T8> makeUbTuple(T1 const &a1, T2 const &a2,T3 const &a3, T4 const &a4,T5 const &a5, T6 const &a6,T7 const &a7, T8 const &a8 )
+inline UbTuple<T1, T2, T3, T4, T5, T6, T7, T8> makeUbTuple(T1 const &a1, T2 const &a2, T3 const &a3, T4 const &a4,
+                                                           T5 const &a5, T6 const &a6, T7 const &a7, T8 const &a8)
 {
-   return UbTuple<T1,T2,T3,T4,T5,T6,T7,T8>(a1,a2,a3,a4,a5,a6,a7,a8);
+    return UbTuple<T1, T2, T3, T4, T5, T6, T7, T8>(a1, a2, a3, a4, a5, a6, a7, a8);
 }
 
-//some typedefs
-using UbTupleFloat2 = UbTuple<float, float>;
-using UbTupleFloat3 = UbTuple<float, float, float>;
-using UbTupleInt2 = UbTuple<int, int>;
-using UbTupleInt3 = UbTuple<int, int, int>;
-using UbTupleInt4 = UbTuple<int, int, int, int>;
-using UbTupleInt5 = UbTuple<int, int, int, int, int>;
-using UbTupleInt6 = UbTuple<int, int, int, int, int, int>;
-using UbTupleInt8 = UbTuple<int, int, int, int, int, int, int, int>;
-using UbTupleUInt8 = UbTuple<unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int>;
-using UbTupleDouble2 = UbTuple<double, double>;
-using UbTupleDouble3 = UbTuple<double, double, double>;
-using UbTupleDouble4 = UbTuple<double, double, double, double>;
-using UbTupleDouble6 = UbTuple<double, double, double, double, double, double>;
+// some typedefs
+using UbTupleFloat2        = UbTuple<float, float>;
+using UbTupleFloat3        = UbTuple<float, float, float>;
+using UbTupleInt2          = UbTuple<int, int>;
+using UbTupleInt3          = UbTuple<int, int, int>;
+using UbTupleInt4          = UbTuple<int, int, int, int>;
+using UbTupleInt5          = UbTuple<int, int, int, int, int>;
+using UbTupleInt6          = UbTuple<int, int, int, int, int, int>;
+using UbTupleInt8          = UbTuple<int, int, int, int, int, int, int, int>;
+using UbTupleUInt8         = UbTuple<unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int,
+                             unsigned int, unsigned int>;
+using UbTupleDouble2       = UbTuple<double, double>;
+using UbTupleDouble3       = UbTuple<double, double, double>;
+using UbTupleDouble4       = UbTuple<double, double, double, double>;
+using UbTupleDouble6       = UbTuple<double, double, double, double, double, double>;
 using UbTupleStringDouble2 = UbTuple<std::string, double, double>;
 using UbTupleStringDouble3 = UbTuple<std::string, double, double, double>;
-using UbTupleStringInt3 = UbTuple<std::string, int, int, int>;
-using UbTupleShort4 = UbTuple<short, short, short, short>;
-using UbTupleBool3 = UbTuple<bool, bool, bool>;
-using UbTupleIntDouble2 = UbTuple<int, double, double>;
-using UbTupleIntBool = UbTuple<int, bool>;
-
+using UbTupleStringInt3    = UbTuple<std::string, int, int, int>;
+using UbTupleShort4        = UbTuple<short, short, short, short>;
+using UbTupleBool3         = UbTuple<bool, bool, bool>;
+using UbTupleIntDouble2    = UbTuple<int, double, double>;
+using UbTupleIntBool       = UbTuple<int, bool>;
 
-#endif //UBTUPLE_H
+#endif // UBTUPLE_H
diff --git a/src/basics/basics/utilities/Vector3D.cpp b/src/basics/basics/utilities/Vector3D.cpp
index 75ab1b814c33f9f1d631dec6189d0117f6168b18..6ff9dc8738f869d75e7fc9870bb5bb7468d83468 100644
--- a/src/basics/basics/utilities/Vector3D.cpp
+++ b/src/basics/basics/utilities/Vector3D.cpp
@@ -1,28 +1,28 @@
 //=======================================================================================
-// ____          ____    __    ______     __________   __      __       __        __         
-// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |        
-//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |        
-//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |        
-//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____    
-//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|   
-//      \    \  |    |   ________________________________________________________________    
-//       \    \ |    |  |  ______________________________________________________________|   
-//        \    \|    |  |  |         __          __     __     __     ______      _______    
-//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)   
-//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______    
+// ____          ____    __    ______     __________   __      __       __        __
+// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |
+//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |
+//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |
+//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____
+//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|
+//      \    \  |    |   ________________________________________________________________
+//       \    \ |    |  |  ______________________________________________________________|
+//        \    \|    |  |  |         __          __     __     __     ______      _______
+//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)
+//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______
 //           \       |  |  |        |  |_____   |   \_/   |   |  |   |  |_/  /    _____  |
-//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/   
+//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/
 //
-//  This file is part of VirtualFluids. VirtualFluids is free software: you can 
+//  This file is part of VirtualFluids. VirtualFluids is free software: you can
 //  redistribute it and/or modify it under the terms of the GNU General Public
-//  License as published by the Free Software Foundation, either version 3 of 
+//  License as published by the Free Software Foundation, either version 3 of
 //  the License, or (at your option) any later version.
-//  
-//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT 
-//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
-//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License 
+//
+//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT
+//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 //  for more details.
-//  
+//
 //  You should have received a copy of the GNU General Public License along
 //  with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>.
 //
@@ -35,611 +35,490 @@
 #include <cassert>
 #include <sstream>
 
-#include <basics/utilities/UbMath.h>
 #include <basics/utilities/UbInfinity.h>
+#include <basics/utilities/UbMath.h>
 
-
-
-const Vector3D Vector3D::ZERO(0.0,0.0,0.0);
-const Vector3D Vector3D::UNIT_X1(1.0,0.0,0.0);
-const Vector3D Vector3D::UNIT_X2(0.0,1.0,0.0);
-const Vector3D Vector3D::UNIT_X3(0.0,0.0,1.0);
+const Vector3D Vector3D::ZERO(0.0, 0.0, 0.0);
+const Vector3D Vector3D::UNIT_X1(1.0, 0.0, 0.0);
+const Vector3D Vector3D::UNIT_X2(0.0, 1.0, 0.0);
+const Vector3D Vector3D::UNIT_X3(0.0, 0.0, 1.0);
 
 /*=======================================================*/
-Vector3D::Vector3D() 
-{                                      
-   m_afTuple[0] = 0.0;
-   m_afTuple[1] = 0.0;
-   m_afTuple[2] = 0.0;
-}
-/*=======================================================*/
-Vector3D::Vector3D(const double& fX, const double& fY, const double& fZ) 
+Vector3D::Vector3D()
 {
-   m_afTuple[0] = fX;
-   m_afTuple[1] = fY;
-   m_afTuple[2] = fZ;
+    m_afTuple[0] = 0.0;
+    m_afTuple[1] = 0.0;
+    m_afTuple[2] = 0.0;
 }
 /*=======================================================*/
-Vector3D::Vector3D (const Vector3D& rkV) 
+Vector3D::Vector3D(const double &fX, const double &fY, const double &fZ)
 {
-   m_afTuple[0] = rkV.m_afTuple[0];
-   m_afTuple[1] = rkV.m_afTuple[1];
-   m_afTuple[2] = rkV.m_afTuple[2];
+    m_afTuple[0] = fX;
+    m_afTuple[1] = fY;
+    m_afTuple[2] = fZ;
 }
 /*=======================================================*/
-std::string Vector3D::toString()  const
+Vector3D::Vector3D(const Vector3D &rkV)
 {
-   std::stringstream os;
-   os<< "Vector3D["<<m_afTuple[0]<<","<<m_afTuple[1]<<","<<m_afTuple[2]<<"]";
-   return os.str();
+    m_afTuple[0] = rkV.m_afTuple[0];
+    m_afTuple[1] = rkV.m_afTuple[1];
+    m_afTuple[2] = rkV.m_afTuple[2];
 }
 /*=======================================================*/
-Vector3D::operator const double*() const
+std::string Vector3D::toString() const
 {
-   return m_afTuple;
+    std::stringstream os;
+    os << "Vector3D[" << m_afTuple[0] << "," << m_afTuple[1] << "," << m_afTuple[2] << "]";
+    return os.str();
 }
 /*=======================================================*/
-Vector3D::operator double*()
-{
-   return m_afTuple;
-}
+Vector3D::operator const double *() const { return m_afTuple; }
 /*=======================================================*/
-double Vector3D::operator[](const int& i) const
-{
-   assert( i >= 0 && i <= 2 );
-   return m_afTuple[i];
-}
+Vector3D::operator double *() { return m_afTuple; }
 /*=======================================================*/
-double& Vector3D::operator[](const int& i)
+double Vector3D::operator[](const int &i) const
 {
-   assert( i >= 0 && i <= 2 );
-   return m_afTuple[i];
+    assert(i >= 0 && i <= 2);
+    return m_afTuple[i];
 }
 /*=======================================================*/
-double Vector3D::X1() const
+double &Vector3D::operator[](const int &i)
 {
-   return m_afTuple[0];
+    assert(i >= 0 && i <= 2);
+    return m_afTuple[i];
 }
 /*=======================================================*/
-double& Vector3D::X1()
-{
-   return m_afTuple[0];
-}
+double Vector3D::X1() const { return m_afTuple[0]; }
 /*=======================================================*/
-double Vector3D::X2() const
-{
-   return m_afTuple[1];
-}
+double &Vector3D::X1() { return m_afTuple[0]; }
 /*=======================================================*/
-double& Vector3D::X2()
-{
-   return m_afTuple[1];
-}
+double Vector3D::X2() const { return m_afTuple[1]; }
 /*=======================================================*/
-double Vector3D::X3() const
-{
-   return m_afTuple[2];
-}
+double &Vector3D::X2() { return m_afTuple[1]; }
 /*=======================================================*/
-double& Vector3D::X3()
-{
-   return m_afTuple[2];
-}
+double Vector3D::X3() const { return m_afTuple[2]; }
 /*=======================================================*/
-Vector3D& Vector3D::operator=(const Vector3D& rkV)
+double &Vector3D::X3() { return m_afTuple[2]; }
+/*=======================================================*/
+Vector3D &Vector3D::operator=(const Vector3D &rkV)
 {
-    if(this == &rkV)
+    if (this == &rkV)
         return *this;
 
-   m_afTuple[0] = rkV.m_afTuple[0];
-   m_afTuple[1] = rkV.m_afTuple[1];
-   m_afTuple[2] = rkV.m_afTuple[2];
-   return *this;
+    m_afTuple[0] = rkV.m_afTuple[0];
+    m_afTuple[1] = rkV.m_afTuple[1];
+    m_afTuple[2] = rkV.m_afTuple[2];
+    return *this;
 }
 /*=======================================================*/
-int Vector3D::CompareArrays(const Vector3D& rkV) const
-{
-   return memcmp(m_afTuple,rkV.m_afTuple,3*sizeof(double));
-}
+int Vector3D::CompareArrays(const Vector3D &rkV) const { return memcmp(m_afTuple, rkV.m_afTuple, 3 * sizeof(double)); }
 /*=======================================================*/
-bool Vector3D::operator==(const Vector3D& rkV) const
-{
-   return CompareArrays(rkV) == 0;
-}
+bool Vector3D::operator==(const Vector3D &rkV) const { return CompareArrays(rkV) == 0; }
 /*=======================================================*/
-bool Vector3D::operator!=(const Vector3D& rkV) const
-{
-   return CompareArrays(rkV) != 0;
-}
+bool Vector3D::operator!=(const Vector3D &rkV) const { return CompareArrays(rkV) != 0; }
 /*=======================================================*/
-bool Vector3D::operator<(const Vector3D& rkV) const
-{
-   return CompareArrays(rkV) < 0;
-}
+bool Vector3D::operator<(const Vector3D &rkV) const { return CompareArrays(rkV) < 0; }
 /*=======================================================*/
-bool Vector3D::operator<=(const Vector3D& rkV) const
-{
-   return CompareArrays(rkV) <= 0;
-}
+bool Vector3D::operator<=(const Vector3D &rkV) const { return CompareArrays(rkV) <= 0; }
 /*=======================================================*/
-bool Vector3D::operator> (const Vector3D& rkV) const
-{
-   return CompareArrays(rkV) > 0;
-}
+bool Vector3D::operator>(const Vector3D &rkV) const { return CompareArrays(rkV) > 0; }
 /*=======================================================*/
-bool Vector3D::operator>=(const Vector3D& rkV) const
-{
-   return CompareArrays(rkV) >= 0;
-}
+bool Vector3D::operator>=(const Vector3D &rkV) const { return CompareArrays(rkV) >= 0; }
 /*=======================================================*/
-Vector3D Vector3D::operator+(const Vector3D& rkV) const
+Vector3D Vector3D::operator+(const Vector3D &rkV) const
 {
-   return Vector3D( m_afTuple[0]+rkV.m_afTuple[0],
-                    m_afTuple[1]+rkV.m_afTuple[1],
-                    m_afTuple[2]+rkV.m_afTuple[2] );
+    return Vector3D(m_afTuple[0] + rkV.m_afTuple[0], m_afTuple[1] + rkV.m_afTuple[1], m_afTuple[2] + rkV.m_afTuple[2]);
 }
 /*=======================================================*/
-Vector3D Vector3D::Add(Vector3D& vector)
+Vector3D Vector3D::Add(Vector3D &vector)
 {
-   return Vector3D( m_afTuple[0]+vector.m_afTuple[0],
-                    m_afTuple[1]+vector.m_afTuple[1],
-                    m_afTuple[2]+vector.m_afTuple[2] );
+    return Vector3D(m_afTuple[0] + vector.m_afTuple[0], m_afTuple[1] + vector.m_afTuple[1],
+                    m_afTuple[2] + vector.m_afTuple[2]);
 }
 /*=======================================================*/
-Vector3D Vector3D::operator- (const Vector3D& rkV) const
+Vector3D Vector3D::operator-(const Vector3D &rkV) const
 {
-   return Vector3D( m_afTuple[0]-rkV.m_afTuple[0],
-                    m_afTuple[1]-rkV.m_afTuple[1],
-                    m_afTuple[2]-rkV.m_afTuple[2] );
+    return Vector3D(m_afTuple[0] - rkV.m_afTuple[0], m_afTuple[1] - rkV.m_afTuple[1], m_afTuple[2] - rkV.m_afTuple[2]);
 }
 /*=======================================================*/
-Vector3D Vector3D::Subtract(Vector3D& vector)
+Vector3D Vector3D::Subtract(Vector3D &vector)
 {
-   return Vector3D( m_afTuple[0]-vector.m_afTuple[0],
-                    m_afTuple[1]-vector.m_afTuple[1],
-                    m_afTuple[2]-vector.m_afTuple[2] );
+    return Vector3D(m_afTuple[0] - vector.m_afTuple[0], m_afTuple[1] - vector.m_afTuple[1],
+                    m_afTuple[2] - vector.m_afTuple[2]);
 }
 /*=======================================================*/
-Vector3D Vector3D::operator*(const double& fScalar) const
+Vector3D Vector3D::operator*(const double &fScalar) const
 {
-   return Vector3D( fScalar*m_afTuple[0],
-                    fScalar*m_afTuple[1],
-                    fScalar*m_afTuple[2]  );
+    return Vector3D(fScalar * m_afTuple[0], fScalar * m_afTuple[1], fScalar * m_afTuple[2]);
 }
 /*=======================================================*/
-Vector3D Vector3D::operator/(const double& fScalar) const
+Vector3D Vector3D::operator/(const double &fScalar) const
 {
-   Vector3D kQuot;
+    Vector3D kQuot;
 
-   if ( fScalar != 0.0 )
-   {
-      double fInvScalar = 1.0/fScalar;
-      kQuot.m_afTuple[0] = fInvScalar*m_afTuple[0];
-      kQuot.m_afTuple[1] = fInvScalar*m_afTuple[1];
-      kQuot.m_afTuple[2] = fInvScalar*m_afTuple[2];
-   }
-   else
-   {
-      kQuot.m_afTuple[0] = Ub::inf;
-      kQuot.m_afTuple[1] = Ub::inf;
-      kQuot.m_afTuple[2] = Ub::inf;
-   }
+    if (fScalar != 0.0) {
+        double fInvScalar  = 1.0 / fScalar;
+        kQuot.m_afTuple[0] = fInvScalar * m_afTuple[0];
+        kQuot.m_afTuple[1] = fInvScalar * m_afTuple[1];
+        kQuot.m_afTuple[2] = fInvScalar * m_afTuple[2];
+    } else {
+        kQuot.m_afTuple[0] = Ub::inf;
+        kQuot.m_afTuple[1] = Ub::inf;
+        kQuot.m_afTuple[2] = Ub::inf;
+    }
 
-   return kQuot;
+    return kQuot;
 }
 /*=======================================================*/
-Vector3D Vector3D::operator-() const
-{
-   return Vector3D( -m_afTuple[0],
-                    -m_afTuple[1],
-                    -m_afTuple[2] );
-}
+Vector3D Vector3D::operator-() const { return Vector3D(-m_afTuple[0], -m_afTuple[1], -m_afTuple[2]); }
 /*=======================================================*/
-Vector3D& Vector3D::operator+=(const Vector3D& rkV)
+Vector3D &Vector3D::operator+=(const Vector3D &rkV)
 {
-   m_afTuple[0] += rkV.m_afTuple[0];
-   m_afTuple[1] += rkV.m_afTuple[1];
-   m_afTuple[2] += rkV.m_afTuple[2];
-   return *this;
+    m_afTuple[0] += rkV.m_afTuple[0];
+    m_afTuple[1] += rkV.m_afTuple[1];
+    m_afTuple[2] += rkV.m_afTuple[2];
+    return *this;
 }
 /*=======================================================*/
-Vector3D& Vector3D::operator-=(const Vector3D& rkV)
+Vector3D &Vector3D::operator-=(const Vector3D &rkV)
 {
-   m_afTuple[0] -= rkV.m_afTuple[0];
-   m_afTuple[1] -= rkV.m_afTuple[1];
-   m_afTuple[2] -= rkV.m_afTuple[2];
-   return *this;
+    m_afTuple[0] -= rkV.m_afTuple[0];
+    m_afTuple[1] -= rkV.m_afTuple[1];
+    m_afTuple[2] -= rkV.m_afTuple[2];
+    return *this;
 }
 /*=======================================================*/
-Vector3D& Vector3D::operator*=(const double& fScalar)
+Vector3D &Vector3D::operator*=(const double &fScalar)
 {
-   m_afTuple[0] *= fScalar;
-   m_afTuple[1] *= fScalar;
-   m_afTuple[2] *= fScalar;
-   return *this;
+    m_afTuple[0] *= fScalar;
+    m_afTuple[1] *= fScalar;
+    m_afTuple[2] *= fScalar;
+    return *this;
 }
 /*=======================================================*/
-Vector3D& Vector3D::operator/=(const double& fScalar)
+Vector3D &Vector3D::operator/=(const double &fScalar)
 {
-   if ( !UbMath::zero(fScalar) )
-   {
-      double fInvScalar = 1.0/fScalar;
-      m_afTuple[0] *= fInvScalar;
-      m_afTuple[1] *= fInvScalar;
-      m_afTuple[2] *= fInvScalar;
-   }
-   else
-   {
-      m_afTuple[0] = Ub::inf;
-      m_afTuple[1] = Ub::inf;
-      m_afTuple[2] = Ub::inf;
-   }
+    if (!UbMath::zero(fScalar)) {
+        double fInvScalar = 1.0 / fScalar;
+        m_afTuple[0] *= fInvScalar;
+        m_afTuple[1] *= fInvScalar;
+        m_afTuple[2] *= fInvScalar;
+    } else {
+        m_afTuple[0] = Ub::inf;
+        m_afTuple[1] = Ub::inf;
+        m_afTuple[2] = Ub::inf;
+    }
 
-   return *this;
+    return *this;
 }
 /*=======================================================*/
-Vector3D Vector3D::Scale(const double& x)
+Vector3D Vector3D::Scale(const double &x)
 {
-   Vector3D PointA(0.0,0.0,0.0);
-   PointA.m_afTuple[0] = x * m_afTuple[0];
-   PointA.m_afTuple[1] = x * m_afTuple[1];
-   PointA.m_afTuple[2] = x * m_afTuple[2];
-   return PointA;	
+    Vector3D PointA(0.0, 0.0, 0.0);
+    PointA.m_afTuple[0] = x * m_afTuple[0];
+    PointA.m_afTuple[1] = x * m_afTuple[1];
+    PointA.m_afTuple[2] = x * m_afTuple[2];
+    return PointA;
 }
 /*=======================================================*/
 double Vector3D::Length() const
 {
-   return std::sqrt( m_afTuple[0]*m_afTuple[0] +
-                     m_afTuple[1]*m_afTuple[1] +
-                     m_afTuple[2]*m_afTuple[2] );
+    return std::sqrt(m_afTuple[0] * m_afTuple[0] + m_afTuple[1] * m_afTuple[1] + m_afTuple[2] * m_afTuple[2]);
 }
 /*=======================================================*/
 double Vector3D::SquaredLength() const
 {
-   return m_afTuple[0]*m_afTuple[0] +
-          m_afTuple[1]*m_afTuple[1] +
-          m_afTuple[2]*m_afTuple[2];
+    return m_afTuple[0] * m_afTuple[0] + m_afTuple[1] * m_afTuple[1] + m_afTuple[2] * m_afTuple[2];
 }
 /*=======================================================*/
-double Vector3D::Dot(const Vector3D& rkV) const
+double Vector3D::Dot(const Vector3D &rkV) const
 {
-   return m_afTuple[0]*rkV.m_afTuple[0] +
-          m_afTuple[1]*rkV.m_afTuple[1] +
-          m_afTuple[2]*rkV.m_afTuple[2];
+    return m_afTuple[0] * rkV.m_afTuple[0] + m_afTuple[1] * rkV.m_afTuple[1] + m_afTuple[2] * rkV.m_afTuple[2];
 }
 /*=======================================================*/
 double Vector3D::Normalize()
 {
-   double fLength = Length();
+    double fLength = Length();
 
-   if( !UbMath::zero(fLength) )
-   {
-      double fInvLength = 1.0/fLength;
-      m_afTuple[0] *= fInvLength;
-      m_afTuple[1] *= fInvLength;
-      m_afTuple[2] *= fInvLength;
-   }
-   else
-   {
-      fLength = 0.0;
-      m_afTuple[0] = 0.0;
-      m_afTuple[1] = 0.0;
-      m_afTuple[2] = 0.0;
-   }
+    if (!UbMath::zero(fLength)) {
+        double fInvLength = 1.0 / fLength;
+        m_afTuple[0] *= fInvLength;
+        m_afTuple[1] *= fInvLength;
+        m_afTuple[2] *= fInvLength;
+    } else {
+        fLength      = 0.0;
+        m_afTuple[0] = 0.0;
+        m_afTuple[1] = 0.0;
+        m_afTuple[2] = 0.0;
+    }
 
-   return fLength;
+    return fLength;
 }
 /*=======================================================*/
-Vector3D Vector3D::Cross(const Vector3D& rkV) const
+Vector3D Vector3D::Cross(const Vector3D &rkV) const
 {
-   return Vector3D( m_afTuple[1]*rkV.m_afTuple[2] - m_afTuple[2]*rkV.m_afTuple[1],
-                    m_afTuple[2]*rkV.m_afTuple[0] - m_afTuple[0]*rkV.m_afTuple[2],
-                    m_afTuple[0]*rkV.m_afTuple[1] - m_afTuple[1]*rkV.m_afTuple[0] );
+    return Vector3D(m_afTuple[1] * rkV.m_afTuple[2] - m_afTuple[2] * rkV.m_afTuple[1],
+                    m_afTuple[2] * rkV.m_afTuple[0] - m_afTuple[0] * rkV.m_afTuple[2],
+                    m_afTuple[0] * rkV.m_afTuple[1] - m_afTuple[1] * rkV.m_afTuple[0]);
 }
 /*=======================================================*/
-Vector3D Vector3D::UnitCross(const Vector3D& rkV) const
+Vector3D Vector3D::UnitCross(const Vector3D &rkV) const
 {
-   Vector3D kCross( m_afTuple[1]*rkV.m_afTuple[2] - m_afTuple[2]*rkV.m_afTuple[1],
-                    m_afTuple[2]*rkV.m_afTuple[0] - m_afTuple[0]*rkV.m_afTuple[2],
-                    m_afTuple[0]*rkV.m_afTuple[1] - m_afTuple[1]*rkV.m_afTuple[0] );
-   kCross.Normalize();
-   return kCross;
+    Vector3D kCross(m_afTuple[1] * rkV.m_afTuple[2] - m_afTuple[2] * rkV.m_afTuple[1],
+                    m_afTuple[2] * rkV.m_afTuple[0] - m_afTuple[0] * rkV.m_afTuple[2],
+                    m_afTuple[0] * rkV.m_afTuple[1] - m_afTuple[1] * rkV.m_afTuple[0]);
+    kCross.Normalize();
+    return kCross;
 }
 /*=======================================================*/
-void Vector3D::GetBarycentrics(const Vector3D& rkV0,const Vector3D& rkV1, const Vector3D& rkV2,const Vector3D& rkV3, double afBary[4]) const
+void Vector3D::GetBarycentrics(const Vector3D &rkV0, const Vector3D &rkV1, const Vector3D &rkV2, const Vector3D &rkV3,
+                               double afBary[4]) const
 {
-   // compute the vectors relative to V3 of the tetrahedron
-   Vector3D akDiff[4] = { rkV0  - rkV3,
-                          rkV1  - rkV3,
-                          rkV2  - rkV3,
-                          *this - rkV3 };
+    // compute the vectors relative to V3 of the tetrahedron
+    Vector3D akDiff[4] = { rkV0 - rkV3, rkV1 - rkV3, rkV2 - rkV3, *this - rkV3 };
+
+    // If the vertices have large magnitude, the linear system of
+    // equations for computing barycentric coordinates can be
+    // ill-conditioned.  To avoid this, uniformly scale the tetrahedron
+    // edges to be of order 1.  The scaling of all differences does not
+    // change the barycentric coordinates.
+    double fMax = 0.0, fValue = 0.0;
+    for (int i = 0; i < 3; i++)
+        for (int j = 0; j < 3; j++) {
+            fValue = std::fabs(akDiff[i][j]);
+            if (fValue > fMax)
+                fMax = fValue;
+        }
+
+    // scale down only large data
+    if (UbMath::greater(fMax, 1.0)) {
+        double fInvMax = ((double)1.0) / fMax;
+        for (int i = 0; i < 4; i++)
+            akDiff[i] *= fInvMax;
+    }
 
-   // If the vertices have large magnitude, the linear system of
-   // equations for computing barycentric coordinates can be
-   // ill-conditioned.  To avoid this, uniformly scale the tetrahedron
-   // edges to be of order 1.  The scaling of all differences does not
-   // change the barycentric coordinates.
-   double fMax = 0.0,fValue=0.0;
-   for(int i=0; i<3; i++)
-      for (int j=0; j<3; j++)
-      {
-         fValue = std::fabs(akDiff[i][j]);
-         if ( fValue > fMax )  fMax = fValue;
-      }
-   
-   // scale down only large data
-   if(UbMath::greater(fMax,1.0) )
-   {
-      double fInvMax = ((double)1.0)/fMax;
-      for( int i=0; i<4; i++)
-         akDiff[i] *= fInvMax;
-   }
+    double fDet     = akDiff[0].Dot(akDiff[1].Cross(akDiff[2]));
+    Vector3D kE1cE2 = akDiff[1].Cross(akDiff[2]);
+    Vector3D kE2cE0 = akDiff[2].Cross(akDiff[0]);
+    Vector3D kE0cE1 = akDiff[0].Cross(akDiff[1]);
 
-   double     fDet = akDiff[0].Dot(akDiff[1].Cross(akDiff[2]));
-   Vector3D kE1cE2 = akDiff[1].Cross(akDiff[2]);
-   Vector3D kE2cE0 = akDiff[2].Cross(akDiff[0]);
-   Vector3D kE0cE1 = akDiff[0].Cross(akDiff[1]);
-   
-   if( !UbMath::zero( fDet ) )
-   {
-      double fInvDet = 1.0/fDet;
-      afBary[0] = akDiff[3].Dot(kE1cE2)*fInvDet;
-      afBary[1] = akDiff[3].Dot(kE2cE0)*fInvDet;
-      afBary[2] = akDiff[3].Dot(kE0cE1)*fInvDet;
-      afBary[3] = 1.0 - afBary[0] - afBary[1] - afBary[2];
-   }
-   else
-   {
-      // The tetrahedron is potentially flat.  Determine the face of
-      // maximum area and compute barycentric coordinates with respect
-      // to that face.
-      Vector3D kE02 = rkV0 - rkV2;
-      Vector3D kE12 = rkV1 - rkV2;
-      Vector3D kE02cE12 = kE02.Cross(kE12);
-      double fMaxSqrArea = kE02cE12.SquaredLength();
-      int iMaxIndex = 3;
-      double fSqrArea = kE0cE1.SquaredLength();
-      if ( fSqrArea > fMaxSqrArea )
-      {
-         iMaxIndex = 0;
-         fMaxSqrArea = fSqrArea;
-      }
-      fSqrArea = kE1cE2.SquaredLength();
-      if ( fSqrArea > fMaxSqrArea )
-      {
-         iMaxIndex = 1;
-         fMaxSqrArea = fSqrArea;
-      }
-      fSqrArea = kE2cE0.SquaredLength();
-      if ( fSqrArea > fMaxSqrArea )
-      {
-         iMaxIndex = 2;
-         fMaxSqrArea = fSqrArea;
-      }
+    if (!UbMath::zero(fDet)) {
+        double fInvDet = 1.0 / fDet;
+        afBary[0]      = akDiff[3].Dot(kE1cE2) * fInvDet;
+        afBary[1]      = akDiff[3].Dot(kE2cE0) * fInvDet;
+        afBary[2]      = akDiff[3].Dot(kE0cE1) * fInvDet;
+        afBary[3]      = 1.0 - afBary[0] - afBary[1] - afBary[2];
+    } else {
+        // The tetrahedron is potentially flat.  Determine the face of
+        // maximum area and compute barycentric coordinates with respect
+        // to that face.
+        Vector3D kE02      = rkV0 - rkV2;
+        Vector3D kE12      = rkV1 - rkV2;
+        Vector3D kE02cE12  = kE02.Cross(kE12);
+        double fMaxSqrArea = kE02cE12.SquaredLength();
+        int iMaxIndex      = 3;
+        double fSqrArea    = kE0cE1.SquaredLength();
+        if (fSqrArea > fMaxSqrArea) {
+            iMaxIndex   = 0;
+            fMaxSqrArea = fSqrArea;
+        }
+        fSqrArea = kE1cE2.SquaredLength();
+        if (fSqrArea > fMaxSqrArea) {
+            iMaxIndex   = 1;
+            fMaxSqrArea = fSqrArea;
+        }
+        fSqrArea = kE2cE0.SquaredLength();
+        if (fSqrArea > fMaxSqrArea) {
+            iMaxIndex   = 2;
+            fMaxSqrArea = fSqrArea;
+        }
 
-      if (UbMath::greater(fMaxSqrArea,0.0)  )
-      {
-         double fInvSqrArea = 1.0/fMaxSqrArea;
-         Vector3D kTmp;
-         if( iMaxIndex==0 )
-         {
-            kTmp      = akDiff[3].Cross(akDiff[1]);
-            afBary[0] = kE0cE1.Dot(kTmp)*fInvSqrArea;
-            kTmp      = akDiff[0].Cross(akDiff[3]);
-            afBary[1] = kE0cE1.Dot(kTmp)*fInvSqrArea;
-            afBary[2] = 0.0;
-            afBary[3] = 1.0 - afBary[0] - afBary[1];
-         }
-         else if( iMaxIndex == 1 )
-         {
-            afBary[0] = 0.0;
-            kTmp      = akDiff[3].Cross(akDiff[2]);
-            afBary[1] = kE1cE2.Dot(kTmp)*fInvSqrArea;
-            kTmp      = akDiff[1].Cross(akDiff[3]);
-            afBary[2] = kE1cE2.Dot(kTmp)*fInvSqrArea;
-            afBary[3] = 1.0 - afBary[1] - afBary[2];
-         }
-         else if( iMaxIndex == 2 )
-         {
-            kTmp      = akDiff[2].Cross(akDiff[3]);
-            afBary[0] = kE2cE0.Dot(kTmp)*fInvSqrArea;
-            afBary[1] = 0.0;
-            kTmp      = akDiff[3].Cross(akDiff[0]);
-            afBary[2] = kE2cE0.Dot(kTmp)*fInvSqrArea;
-            afBary[3] = 1.0 - afBary[0] - afBary[2];
-         }
-         else
-         {
-            akDiff[3] = *this - rkV2;
-            kTmp      = akDiff[3].Cross(kE12);
-            afBary[0] = kE02cE12.Dot(kTmp)*fInvSqrArea;
-            kTmp      = kE02.Cross(akDiff[3]);
-            afBary[1] = kE02cE12.Dot(kTmp)*fInvSqrArea;
-            afBary[2] = 1.0 - afBary[0] - afBary[1];
-            afBary[3] = 0.0;
-         }
-      }
-      else
-      {
-         // The tetrahedron is potentially a sliver.  Determine the edge of
-         // maximum length and compute barycentric coordinates with respect
-         // to that edge.
-         double fMaxSqrLength = akDiff[0].SquaredLength();
-         iMaxIndex            = 0;  // <V0,V3>
-         double fSqrLength    = akDiff[1].SquaredLength();
-         
-         if( fSqrLength > fMaxSqrLength )
-         {
-            iMaxIndex     = 1;  // <V1,V3>
-            fMaxSqrLength = fSqrLength;
-         }
-         fSqrLength = akDiff[2].SquaredLength();
-         
-         if( fSqrLength > fMaxSqrLength )
-         {
-            iMaxIndex     = 2;  // <V2,V3>
-            fMaxSqrLength = fSqrLength;
-         }
-         fSqrLength = kE02.SquaredLength();
-         
-         if( fSqrLength > fMaxSqrLength )
-         {
-            iMaxIndex     = 3;  // <V0,V2>
-            fMaxSqrLength = fSqrLength;
-         }
-         fSqrLength = kE12.SquaredLength();
-         
-         if( fSqrLength > fMaxSqrLength )
-         {
-            iMaxIndex     = 4;  // <V1,V2>
-            fMaxSqrLength = fSqrLength;
-         }
-         
-         Vector3D kE01 = rkV0 - rkV1;
-         fSqrLength    = kE01.SquaredLength();
-         
-         if( fSqrLength > fMaxSqrLength )
-         {
-            iMaxIndex     = 5;  // <V0,V1>
-            fMaxSqrLength = fSqrLength;
-         }
+        if (UbMath::greater(fMaxSqrArea, 0.0)) {
+            double fInvSqrArea = 1.0 / fMaxSqrArea;
+            Vector3D kTmp;
+            if (iMaxIndex == 0) {
+                kTmp      = akDiff[3].Cross(akDiff[1]);
+                afBary[0] = kE0cE1.Dot(kTmp) * fInvSqrArea;
+                kTmp      = akDiff[0].Cross(akDiff[3]);
+                afBary[1] = kE0cE1.Dot(kTmp) * fInvSqrArea;
+                afBary[2] = 0.0;
+                afBary[3] = 1.0 - afBary[0] - afBary[1];
+            } else if (iMaxIndex == 1) {
+                afBary[0] = 0.0;
+                kTmp      = akDiff[3].Cross(akDiff[2]);
+                afBary[1] = kE1cE2.Dot(kTmp) * fInvSqrArea;
+                kTmp      = akDiff[1].Cross(akDiff[3]);
+                afBary[2] = kE1cE2.Dot(kTmp) * fInvSqrArea;
+                afBary[3] = 1.0 - afBary[1] - afBary[2];
+            } else if (iMaxIndex == 2) {
+                kTmp      = akDiff[2].Cross(akDiff[3]);
+                afBary[0] = kE2cE0.Dot(kTmp) * fInvSqrArea;
+                afBary[1] = 0.0;
+                kTmp      = akDiff[3].Cross(akDiff[0]);
+                afBary[2] = kE2cE0.Dot(kTmp) * fInvSqrArea;
+                afBary[3] = 1.0 - afBary[0] - afBary[2];
+            } else {
+                akDiff[3] = *this - rkV2;
+                kTmp      = akDiff[3].Cross(kE12);
+                afBary[0] = kE02cE12.Dot(kTmp) * fInvSqrArea;
+                kTmp      = kE02.Cross(akDiff[3]);
+                afBary[1] = kE02cE12.Dot(kTmp) * fInvSqrArea;
+                afBary[2] = 1.0 - afBary[0] - afBary[1];
+                afBary[3] = 0.0;
+            }
+        } else {
+            // The tetrahedron is potentially a sliver.  Determine the edge of
+            // maximum length and compute barycentric coordinates with respect
+            // to that edge.
+            double fMaxSqrLength = akDiff[0].SquaredLength();
+            iMaxIndex            = 0; // <V0,V3>
+            double fSqrLength    = akDiff[1].SquaredLength();
 
-         if(UbMath::greater(fMaxSqrLength, 0.0) )
-         {
-            double fInvSqrLength = 1.0/fMaxSqrLength;
-            if( iMaxIndex == 0 )
-            {
-               // P-V3 = t*(V0-V3)
-               afBary[0] = akDiff[3].Dot(akDiff[0])*fInvSqrLength;
-               afBary[1] = 0.0;
-               afBary[2] = 0.0;
-               afBary[3] = 1.0 - afBary[0];
+            if (fSqrLength > fMaxSqrLength) {
+                iMaxIndex     = 1; // <V1,V3>
+                fMaxSqrLength = fSqrLength;
             }
-            else if( iMaxIndex == 1 )
-            {
-               // P-V3 = t*(V1-V3)
-               afBary[0] = 0.0;
-               afBary[1] = akDiff[3].Dot(akDiff[1])*fInvSqrLength;
-               afBary[2] = 0.0;
-               afBary[3] = 1.0 - afBary[1];
+            fSqrLength = akDiff[2].SquaredLength();
+
+            if (fSqrLength > fMaxSqrLength) {
+                iMaxIndex     = 2; // <V2,V3>
+                fMaxSqrLength = fSqrLength;
             }
-            else if( iMaxIndex == 2 )
-            {
-               // P-V3 = t*(V2-V3)
-               afBary[0] = 0.0;
-               afBary[1] = 0.0;
-               afBary[2] = akDiff[3].Dot(akDiff[2])*fInvSqrLength;
-               afBary[3] = 1.0 - afBary[2];
+            fSqrLength = kE02.SquaredLength();
+
+            if (fSqrLength > fMaxSqrLength) {
+                iMaxIndex     = 3; // <V0,V2>
+                fMaxSqrLength = fSqrLength;
             }
-            else if( iMaxIndex == 3 )
-            {      
-               // P-V2 = t*(V0-V2)
-               akDiff[3] = *this - rkV2;
-               afBary[0] = akDiff[3].Dot(kE02)*fInvSqrLength;
-               afBary[1] = 0.0;
-               afBary[2] = 1.0 - afBary[0];
-               afBary[3] = 0.0;
+            fSqrLength = kE12.SquaredLength();
+
+            if (fSqrLength > fMaxSqrLength) {
+                iMaxIndex     = 4; // <V1,V2>
+                fMaxSqrLength = fSqrLength;
             }
-            else if( iMaxIndex == 4 )
-            {
-               // P-V2 = t*(V1-V2)
-               akDiff[3] = *this - rkV2;
-               afBary[0] = 0.0;
-               afBary[1] = akDiff[3].Dot(kE12)*fInvSqrLength;
-               afBary[2] = 1.0 - afBary[1];
-               afBary[3] = 0.0;
+
+            Vector3D kE01 = rkV0 - rkV1;
+            fSqrLength    = kE01.SquaredLength();
+
+            if (fSqrLength > fMaxSqrLength) {
+                iMaxIndex     = 5; // <V0,V1>
+                fMaxSqrLength = fSqrLength;
             }
-            else
-            {
-               // P-V1 = t*(V0-V1)
-               akDiff[3] = *this - rkV1;
-               afBary[0] = akDiff[3].Dot(kE01)*fInvSqrLength;
-               afBary[1] = 1.0 - afBary[0];
-               afBary[2] = 0.0;
-               afBary[3] = 0.0;
+
+            if (UbMath::greater(fMaxSqrLength, 0.0)) {
+                double fInvSqrLength = 1.0 / fMaxSqrLength;
+                if (iMaxIndex == 0) {
+                    // P-V3 = t*(V0-V3)
+                    afBary[0] = akDiff[3].Dot(akDiff[0]) * fInvSqrLength;
+                    afBary[1] = 0.0;
+                    afBary[2] = 0.0;
+                    afBary[3] = 1.0 - afBary[0];
+                } else if (iMaxIndex == 1) {
+                    // P-V3 = t*(V1-V3)
+                    afBary[0] = 0.0;
+                    afBary[1] = akDiff[3].Dot(akDiff[1]) * fInvSqrLength;
+                    afBary[2] = 0.0;
+                    afBary[3] = 1.0 - afBary[1];
+                } else if (iMaxIndex == 2) {
+                    // P-V3 = t*(V2-V3)
+                    afBary[0] = 0.0;
+                    afBary[1] = 0.0;
+                    afBary[2] = akDiff[3].Dot(akDiff[2]) * fInvSqrLength;
+                    afBary[3] = 1.0 - afBary[2];
+                } else if (iMaxIndex == 3) {
+                    // P-V2 = t*(V0-V2)
+                    akDiff[3] = *this - rkV2;
+                    afBary[0] = akDiff[3].Dot(kE02) * fInvSqrLength;
+                    afBary[1] = 0.0;
+                    afBary[2] = 1.0 - afBary[0];
+                    afBary[3] = 0.0;
+                } else if (iMaxIndex == 4) {
+                    // P-V2 = t*(V1-V2)
+                    akDiff[3] = *this - rkV2;
+                    afBary[0] = 0.0;
+                    afBary[1] = akDiff[3].Dot(kE12) * fInvSqrLength;
+                    afBary[2] = 1.0 - afBary[1];
+                    afBary[3] = 0.0;
+                } else {
+                    // P-V1 = t*(V0-V1)
+                    akDiff[3] = *this - rkV1;
+                    afBary[0] = akDiff[3].Dot(kE01) * fInvSqrLength;
+                    afBary[1] = 1.0 - afBary[0];
+                    afBary[2] = 0.0;
+                    afBary[3] = 0.0;
+                }
+            } else {
+                // tetrahedron is a nearly a point, just return equal weights
+                afBary[0] = 0.25;
+                afBary[1] = afBary[0];
+                afBary[2] = afBary[0];
+                afBary[3] = afBary[0];
             }
-         }
-         else
-         {
-            // tetrahedron is a nearly a point, just return equal weights
-            afBary[0] = 0.25;
-            afBary[1] = afBary[0];
-            afBary[2] = afBary[0];
-            afBary[3] = afBary[0];
-         }
-      }
-   }
+        }
+    }
 }
 /*=======================================================*/
-void Vector3D::Orthonormalize(Vector3D& rkU, Vector3D& rkV, Vector3D& rkW)
+void Vector3D::Orthonormalize(Vector3D &rkU, Vector3D &rkV, Vector3D &rkW)
 {
-   // If the input vectors are v0, v1, and v2, then the Gram-Schmidt
-   // orthonormalization produces vectors u0, u1, and u2 as follows,
-   //
-   //   u0 = v0/|v0|
-   //   u1 = (v1-(u0*v1)u0)/|v1-(u0*v1)u0|
-   //   u2 = (v2-(u0*v2)u0-(u1*v2)u1)/|v2-(u0*v2)u0-(u1*v2)u1|
-   //
-   // where |A| indicates length of vector A and A*B indicates dot
-   // product of vectors A and B.
+    // If the input vectors are v0, v1, and v2, then the Gram-Schmidt
+    // orthonormalization produces vectors u0, u1, and u2 as follows,
+    //
+    //   u0 = v0/|v0|
+    //   u1 = (v1-(u0*v1)u0)/|v1-(u0*v1)u0|
+    //   u2 = (v2-(u0*v2)u0-(u1*v2)u1)/|v2-(u0*v2)u0-(u1*v2)u1|
+    //
+    // where |A| indicates length of vector A and A*B indicates dot
+    // product of vectors A and B.
 
-   // compute u0
-   rkU.Normalize();
+    // compute u0
+    rkU.Normalize();
 
-   // compute u1
-   double fDot0 = rkU.Dot(rkV); 
-   rkV -= fDot0*rkU;
-   rkV.Normalize();
+    // compute u1
+    double fDot0 = rkU.Dot(rkV);
+    rkV -= fDot0 * rkU;
+    rkV.Normalize();
 
-   // compute u2
-   double fDot1 = rkV.Dot(rkW);
-   fDot0 = rkU.Dot(rkW);
-   rkW  -= fDot0*rkU + fDot1*rkV;
-   rkW.Normalize();
+    // compute u2
+    double fDot1 = rkV.Dot(rkW);
+    fDot0        = rkU.Dot(rkW);
+    rkW -= fDot0 * rkU + fDot1 * rkV;
+    rkW.Normalize();
 }
 /*=======================================================*/
-void Vector3D::Orthonormalize(Vector3D* akV)
-{
-   Orthonormalize(akV[0],akV[1],akV[2]);
-}
+void Vector3D::Orthonormalize(Vector3D *akV) { Orthonormalize(akV[0], akV[1], akV[2]); }
 /*=======================================================*/
-void Vector3D::GenerateOrthonormalBasis(Vector3D& rkU, Vector3D& rkV,Vector3D& rkW, bool bUnitLengthW)
+void Vector3D::GenerateOrthonormalBasis(Vector3D &rkU, Vector3D &rkV, Vector3D &rkW, bool bUnitLengthW)
 {
-   if ( !bUnitLengthW )
-      rkW.Normalize();
+    if (!bUnitLengthW)
+        rkW.Normalize();
 
-   double fInvLength;
+    double fInvLength;
 
-   if (UbMath::greaterEqual( std::fabs(rkW.m_afTuple[0]),std::fabs(rkW.m_afTuple[1]) ) )
-   {
-      // W.x or W.z is the largest magnitude component, swap them
-      fInvLength = UbMath::invSqrt(rkW.m_afTuple[0]*rkW.m_afTuple[0] + rkW.m_afTuple[2]*rkW.m_afTuple[2]);
-      rkU.m_afTuple[0] = -rkW.m_afTuple[2]*fInvLength;
-      rkU.m_afTuple[1] = (double)0.0;
-      rkU.m_afTuple[2] = +rkW.m_afTuple[0]*fInvLength;
-   }
-   else
-   {
-      // W.y or W.z is the largest magnitude component, swap them
-      fInvLength = UbMath::invSqrt(rkW.m_afTuple[1]*rkW.m_afTuple[1] + rkW.m_afTuple[2]*rkW.m_afTuple[2]);
-      rkU.m_afTuple[0] = (double)0.0;
-      rkU.m_afTuple[1] = +rkW.m_afTuple[2]*fInvLength;
-      rkU.m_afTuple[2] = -rkW.m_afTuple[1]*fInvLength;
-   }
+    if (UbMath::greaterEqual(std::fabs(rkW.m_afTuple[0]), std::fabs(rkW.m_afTuple[1]))) {
+        // W.x or W.z is the largest magnitude component, swap them
+        fInvLength       = UbMath::invSqrt(rkW.m_afTuple[0] * rkW.m_afTuple[0] + rkW.m_afTuple[2] * rkW.m_afTuple[2]);
+        rkU.m_afTuple[0] = -rkW.m_afTuple[2] * fInvLength;
+        rkU.m_afTuple[1] = (double)0.0;
+        rkU.m_afTuple[2] = +rkW.m_afTuple[0] * fInvLength;
+    } else {
+        // W.y or W.z is the largest magnitude component, swap them
+        fInvLength       = UbMath::invSqrt(rkW.m_afTuple[1] * rkW.m_afTuple[1] + rkW.m_afTuple[2] * rkW.m_afTuple[2]);
+        rkU.m_afTuple[0] = (double)0.0;
+        rkU.m_afTuple[1] = +rkW.m_afTuple[2] * fInvLength;
+        rkU.m_afTuple[2] = -rkW.m_afTuple[1] * fInvLength;
+    }
 
-   rkV = rkW.Cross(rkU);
+    rkV = rkW.Cross(rkU);
 }
 /*=======================================================*/
-//globaler operator* 
-Vector3D operator*(const double& fScalar, const Vector3D& rkV)
+// globaler operator*
+Vector3D operator*(const double &fScalar, const Vector3D &rkV)
 {
-   return Vector3D( fScalar*rkV[0],
-                    fScalar*rkV[1],
-                    fScalar*rkV[2] );
+    return Vector3D(fScalar * rkV[0], fScalar * rkV[1], fScalar * rkV[2]);
 }
 /*=======================================================*/
-std::ostream& operator<< (std::ostream& os, const Vector3D& rkV)
+std::ostream &operator<<(std::ostream &os, const Vector3D &rkV)
 {
-   os<<rkV.toString();
-   return os;
+    os << rkV.toString();
+    return os;
 }
diff --git a/src/basics/basics/utilities/Vector3D.h b/src/basics/basics/utilities/Vector3D.h
index 03f47b033604520ed05cc895e327fe7b34ed32f8..b278a80d732115a9b1183547e61ff1fe6e82d057 100644
--- a/src/basics/basics/utilities/Vector3D.h
+++ b/src/basics/basics/utilities/Vector3D.h
@@ -1,28 +1,28 @@
 //=======================================================================================
-// ____          ____    __    ______     __________   __      __       __        __         
-// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |        
-//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |        
-//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |        
-//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____    
-//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|   
-//      \    \  |    |   ________________________________________________________________    
-//       \    \ |    |  |  ______________________________________________________________|   
-//        \    \|    |  |  |         __          __     __     __     ______      _______    
-//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)   
-//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______    
+// ____          ____    __    ______     __________   __      __       __        __
+// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |
+//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |
+//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |
+//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____
+//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|
+//      \    \  |    |   ________________________________________________________________
+//       \    \ |    |  |  ______________________________________________________________|
+//        \    \|    |  |  |         __          __     __     __     ______      _______
+//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)
+//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______
 //           \       |  |  |        |  |_____   |   \_/   |   |  |   |  |_/  /    _____  |
-//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/   
+//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/
 //
-//  This file is part of VirtualFluids. VirtualFluids is free software: you can 
+//  This file is part of VirtualFluids. VirtualFluids is free software: you can
 //  redistribute it and/or modify it under the terms of the GNU General Public
-//  License as published by the Free Software Foundation, either version 3 of 
+//  License as published by the Free Software Foundation, either version 3 of
 //  the License, or (at your option) any later version.
-//  
-//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT 
-//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
-//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License 
+//
+//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT
+//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 //  for more details.
-//  
+//
 //  You should have received a copy of the GNU General Public License along
 //  with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>.
 //
@@ -35,102 +35,102 @@
 
 #include <string>
 
-   class Vector3D
-   {
-   public:
-      // construction
-      Vector3D(); 
-      Vector3D(const double& fX1, const double& fX2, const double& fX3);
-      Vector3D(const Vector3D& rkV);
-
-      std::string toString() const;
-
-      // coordinate access
-      operator const double*() const;
-      operator double*();
-      double   operator[](const int& i) const;
-      double&  operator[](const int& i);
-      double   X1() const;
-      double&  X1();
-      double   X2() const;
-      double&  X2();                                    
-      double   X3() const;
-      double&  X3();
-
-      // assignment
-      Vector3D& operator=(const Vector3D& rkV);
-
-      // comparison
-      bool operator==(const Vector3D& rkV) const;
-      bool operator!=(const Vector3D& rkV) const;
-      bool operator< (const Vector3D& rkV) const;
-      bool operator<=(const Vector3D& rkV) const;
-      bool operator> (const Vector3D& rkV) const;
-      bool operator>=(const Vector3D& rkV) const;
-
-      // arithmetic operations
-      Vector3D operator+(const Vector3D& rkV) const;
-      Vector3D operator-(const Vector3D& rkV) const;
-      Vector3D operator*(const double& fScalar) const;
-      Vector3D operator/(const double& fScalar) const;
-      Vector3D operator-() const;
-
-      // arithmetic updates
-      Vector3D& operator+= (const Vector3D& rkV);
-      Vector3D& operator-= (const Vector3D& rkV);
-      Vector3D& operator*= (const double& fScalar);
-      Vector3D& operator/= (const double& fScalar);
-
-      Vector3D Add(Vector3D& vector);
-      Vector3D Subtract(Vector3D& vector);
-      Vector3D Scale(const double& x);
-
-      // vector operations
-      double Length () const;
-      double SquaredLength () const;
-      double Dot (const Vector3D& rkV) const;
-      double Normalize ();
-
-      // The cross products are computed using the right-handed rule.  Be aware
-      // that some graphics APIs use a left-handed rule.  If you have to compute
-      // a cross product with these functions and send the result to the API
-      // that expects left-handed, you will need to change sign on the vector
-      // (replace each component value c by -c).
-      Vector3D Cross (const Vector3D& rkV) const;
-      Vector3D UnitCross (const Vector3D& rkV) const;
-
-      // Compute the barycentric coordinates of the point with respect to the
-      // tetrahedron <V0,V1,V2,V3>, P = b0*V0 + b1*V1 + b2*V2 + b3*V3, where
-      // b0 + b1 + b2 + b3 = 1.
-      void GetBarycentrics (const Vector3D& rkV0, const Vector3D& rkV1, const Vector3D& rkV2, const Vector3D& rkV3, double afBary[4]) const;
-
-      // Gram-Schmidt orthonormalization.  Take linearly independent vectors
-      // U, V, and W and compute an orthonormal set (unit length, mutually
-      // perpendicular).
-      static void Orthonormalize (Vector3D& rkU, Vector3D& rkV, Vector3D& rkW);
-      static void Orthonormalize (Vector3D* akV);
-
-      // Input W must be initialized to a nonzero vector, output is {U,V,W},
-      // an orthonormal basis.  A hint is provided about whether or not W
-      // is already unit length.
-      static void GenerateOrthonormalBasis (Vector3D& rkU, Vector3D& rkV, Vector3D& rkW, bool bUnitLengthW);
-
-      // special vectors
-      static const Vector3D ZERO;
-      static const Vector3D UNIT_X1;
-      static const Vector3D UNIT_X2;
-      static const Vector3D UNIT_X3;
-
-   protected:
-      // support for comparisons
-      int CompareArrays (const Vector3D& rkV) const;
-
-      double m_afTuple[3];
-   };
-   
-   //globaler multiplaktor mit skalar
-   Vector3D operator*(const double& fScalar, const Vector3D& rkV);
-   std::ostream& operator<<(std::ostream& os, const Vector3D& rkV);
-
-  
+class Vector3D
+{
+public:
+    // construction
+    Vector3D();
+    Vector3D(const double &fX1, const double &fX2, const double &fX3);
+    Vector3D(const Vector3D &rkV);
+
+    std::string toString() const;
+
+    // coordinate access
+    operator const double *() const;
+    operator double *();
+    double operator[](const int &i) const;
+    double &operator[](const int &i);
+    double X1() const;
+    double &X1();
+    double X2() const;
+    double &X2();
+    double X3() const;
+    double &X3();
+
+    // assignment
+    Vector3D &operator=(const Vector3D &rkV);
+
+    // comparison
+    bool operator==(const Vector3D &rkV) const;
+    bool operator!=(const Vector3D &rkV) const;
+    bool operator<(const Vector3D &rkV) const;
+    bool operator<=(const Vector3D &rkV) const;
+    bool operator>(const Vector3D &rkV) const;
+    bool operator>=(const Vector3D &rkV) const;
+
+    // arithmetic operations
+    Vector3D operator+(const Vector3D &rkV) const;
+    Vector3D operator-(const Vector3D &rkV) const;
+    Vector3D operator*(const double &fScalar) const;
+    Vector3D operator/(const double &fScalar) const;
+    Vector3D operator-() const;
+
+    // arithmetic updates
+    Vector3D &operator+=(const Vector3D &rkV);
+    Vector3D &operator-=(const Vector3D &rkV);
+    Vector3D &operator*=(const double &fScalar);
+    Vector3D &operator/=(const double &fScalar);
+
+    Vector3D Add(Vector3D &vector);
+    Vector3D Subtract(Vector3D &vector);
+    Vector3D Scale(const double &x);
+
+    // vector operations
+    double Length() const;
+    double SquaredLength() const;
+    double Dot(const Vector3D &rkV) const;
+    double Normalize();
+
+    // The cross products are computed using the right-handed rule.  Be aware
+    // that some graphics APIs use a left-handed rule.  If you have to compute
+    // a cross product with these functions and send the result to the API
+    // that expects left-handed, you will need to change sign on the vector
+    // (replace each component value c by -c).
+    Vector3D Cross(const Vector3D &rkV) const;
+    Vector3D UnitCross(const Vector3D &rkV) const;
+
+    // Compute the barycentric coordinates of the point with respect to the
+    // tetrahedron <V0,V1,V2,V3>, P = b0*V0 + b1*V1 + b2*V2 + b3*V3, where
+    // b0 + b1 + b2 + b3 = 1.
+    void GetBarycentrics(const Vector3D &rkV0, const Vector3D &rkV1, const Vector3D &rkV2, const Vector3D &rkV3,
+                         double afBary[4]) const;
+
+    // Gram-Schmidt orthonormalization.  Take linearly independent vectors
+    // U, V, and W and compute an orthonormal set (unit length, mutually
+    // perpendicular).
+    static void Orthonormalize(Vector3D &rkU, Vector3D &rkV, Vector3D &rkW);
+    static void Orthonormalize(Vector3D *akV);
+
+    // Input W must be initialized to a nonzero vector, output is {U,V,W},
+    // an orthonormal basis.  A hint is provided about whether or not W
+    // is already unit length.
+    static void GenerateOrthonormalBasis(Vector3D &rkU, Vector3D &rkV, Vector3D &rkW, bool bUnitLengthW);
+
+    // special vectors
+    static const Vector3D ZERO;
+    static const Vector3D UNIT_X1;
+    static const Vector3D UNIT_X2;
+    static const Vector3D UNIT_X3;
+
+protected:
+    // support for comparisons
+    int CompareArrays(const Vector3D &rkV) const;
+
+    double m_afTuple[3];
+};
+
+// globaler multiplaktor mit skalar
+Vector3D operator*(const double &fScalar, const Vector3D &rkV);
+std::ostream &operator<<(std::ostream &os, const Vector3D &rkV);
+
 #endif
diff --git a/src/basics/basics/utilities/Vector3DTest.cpp b/src/basics/basics/utilities/Vector3DTest.cpp
index a1d634f513b66bbe2df450cf5f492ebad62f7373..0aaf474569b4baf58d8166a94ed37c394053eca4 100644
--- a/src/basics/basics/utilities/Vector3DTest.cpp
+++ b/src/basics/basics/utilities/Vector3DTest.cpp
@@ -1,20 +1,22 @@
-#include "gmock/gmock.h"
 #include "Vector3D.h"
+#include "gmock/gmock.h"
 
 #include <cmath>
 
 using namespace testing;
 
-class Vector3DTest : public Test 
+class Vector3DTest : public Test
 {
 public:
     Vector3D vec1;
     Vector3D vec2;
 
-    void SetUp() override 
-	{
+    void SetUp() override
+    {
         vec1[0] = vec1[1] = vec1[2] = 4.0f;
-        vec2[0] = 0.0f; vec2[0] = 2.4f; vec2[0] = -1.3f;
+        vec2[0]                     = 0.0f;
+        vec2[0]                     = 2.4f;
+        vec2[0]                     = -1.3f;
     }
 };
 
@@ -85,14 +87,14 @@ TEST_F(Vector3DTest, compareTwoVectors)
     ASSERT_TRUE(v == vec1);
 }
 //
-//TEST_F(Vector3DTest, checkEuclideanDistance)
+// TEST_F(Vector3DTest, checkEuclideanDistance)
 //{
 //    Vector3D v = Vector3D(3, 3, 3);
 //
 //    ASSERT_FLOAT_EQ(v.getEuclideanDistanceTo(vec1), (float)sqrt(3));
 //}
 //
-//TEST_F(Vector3DTest, checkEuclideanDistanceWithNullVector_ExpectNull)
+// TEST_F(Vector3DTest, checkEuclideanDistanceWithNullVector_ExpectNull)
 //{
 //    Vector3D v1 = Vector3D(0.0, 0.0, 0.0);
 //    Vector3D v2 = Vector3D(0.0, 0.0, 0.0);
@@ -100,7 +102,7 @@ TEST_F(Vector3DTest, compareTwoVectors)
 //    ASSERT_THAT((double)v1.getEuclideanDistanceTo(v2), DoubleEq(0.0));
 //}
 //
-//TEST(Vector3DAngleTest, checkInnerAngleBetweenToVectors_ExpectRightAngle)
+// TEST(Vector3DAngleTest, checkInnerAngleBetweenToVectors_ExpectRightAngle)
 //{
 //    Vector3D v1 = Vector3D(1.0, 4.0, -2.0);
 //    Vector3D v2 = Vector3D(-3.0, 3.0, 1);
@@ -108,7 +110,7 @@ TEST_F(Vector3DTest, compareTwoVectors)
 //    ASSERT_THAT((int)floor(v1.getInnerAngle(v2)), Eq(69));
 //}
 //
-//TEST(Vector3DAngleTest, checkInnerAngleBetweenSameVectors_ExpectNull)
+// TEST(Vector3DAngleTest, checkInnerAngleBetweenSameVectors_ExpectNull)
 //{
 //    Vector3D v1 = Vector3D(1.0, 4.0, -2.0);
 //    Vector3D v2 = Vector3D(1.0, 4.0, -2.0);
@@ -116,7 +118,7 @@ TEST_F(Vector3DTest, compareTwoVectors)
 //    ASSERT_THAT((int)floor(v1.getInnerAngle(v2)), Eq(0.0));
 //}
 //
-//TEST(Vector3DAngleTest, checkInnerAngleBetweenNullVectors_ExpectNull)
+// TEST(Vector3DAngleTest, checkInnerAngleBetweenNullVectors_ExpectNull)
 //{
 //    Vector3D v1 = Vector3D(0.0, 0.0, 0.0);
 //    Vector3D v2 = Vector3D(0.0, 0.0, 0.0);
@@ -125,7 +127,7 @@ TEST_F(Vector3DTest, compareTwoVectors)
 //}
 //
 //
-//TEST(Vector3DAngleTest, checkInnerAngleBetweenSecondNullVectors_ExpectNull)
+// TEST(Vector3DAngleTest, checkInnerAngleBetweenSecondNullVectors_ExpectNull)
 //{
 //    Vector3D v1 = Vector3D(1.0, 0.0, 0.0);
 //    Vector3D v2 = Vector3D(0.0, 0.0, 0.0);
@@ -133,7 +135,7 @@ TEST_F(Vector3DTest, compareTwoVectors)
 //    ASSERT_THAT((int)floor(v1.getInnerAngle(v2)), Eq(0.0));
 //}
 //
-//TEST(Vector3DAngleTest, checkInnerAngleBetweenFirstNullVectors_ExpectNull)
+// TEST(Vector3DAngleTest, checkInnerAngleBetweenFirstNullVectors_ExpectNull)
 //{
 //    Vector3D v1 = Vector3D(0.0, 0.0, 0.0);
 //    Vector3D v2 = Vector3D(2.0, 0.0, 0.0);
@@ -141,13 +143,12 @@ TEST_F(Vector3DTest, compareTwoVectors)
 //    ASSERT_THAT((int)floor(v1.getInnerAngle(v2)), Eq(0.0));
 //}
 
-
 TEST_F(Vector3DTest, crossProductBetweenTwoVectors)
 {
     Vector3D v1 = Vector3D(-5.0, -5.0, 0.0);
     Vector3D v2 = Vector3D(5.0, 0.0, 10);
 
-    Vector3D crossProd = Vector3D(-50.0, 50.0, 25.0);
+    Vector3D crossProd        = Vector3D(-50.0, 50.0, 25.0);
     Vector3D testCrossProduct = v1.Cross(v2);
 
     EXPECT_THAT(testCrossProduct[0], DoubleEq(crossProd[0]));
diff --git a/src/basics/basics/writer/WbWriter.h b/src/basics/basics/writer/WbWriter.h
index 8e5524416350c4704fc8a27882e6c9c61dc51c9f..26d43464c03311a2cbc14cd4fc9fe717d4b01531 100644
--- a/src/basics/basics/writer/WbWriter.h
+++ b/src/basics/basics/writer/WbWriter.h
@@ -1,28 +1,28 @@
 //=======================================================================================
-// ____          ____    __    ______     __________   __      __       __        __         
-// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |        
-//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |        
-//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |        
-//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____    
-//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|   
-//      \    \  |    |   ________________________________________________________________    
-//       \    \ |    |  |  ______________________________________________________________|   
-//        \    \|    |  |  |         __          __     __     __     ______      _______    
-//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)   
-//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______    
+// ____          ____    __    ______     __________   __      __       __        __
+// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |
+//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |
+//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |
+//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____
+//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|
+//      \    \  |    |   ________________________________________________________________
+//       \    \ |    |  |  ______________________________________________________________|
+//        \    \|    |  |  |         __          __     __     __     ______      _______
+//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)
+//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______
 //           \       |  |  |        |  |_____   |   \_/   |   |  |   |  |_/  /    _____  |
-//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/   
+//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/
 //
-//  This file is part of VirtualFluids. VirtualFluids is free software: you can 
+//  This file is part of VirtualFluids. VirtualFluids is free software: you can
 //  redistribute it and/or modify it under the terms of the GNU General Public
-//  License as published by the Free Software Foundation, either version 3 of 
+//  License as published by the Free Software Foundation, either version 3 of
 //  the License, or (at your option) any later version.
-//  
-//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT 
-//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
-//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License 
+//
+//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT
+//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 //  for more details.
-//  
+//
 //  You should have received a copy of the GNU General Public License along
 //  with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>.
 //
@@ -33,13 +33,12 @@
 #ifndef WBWRITER_H
 #define WBWRITER_H
 
-#include <vector>
-#include <string>
 #include <fstream>
-#include <sstream>
 #include <iostream>
 #include <map>
-
+#include <sstream>
+#include <string>
+#include <vector>
 
 #include <basics/utilities/UbException.h>
 #include <basics/utilities/UbSystem.h>
@@ -48,64 +47,133 @@
 class WbWriter
 {
 public:
-   //////////////////////////////////////////////////////////////////////////
-   virtual ~WbWriter() = default;
+    //////////////////////////////////////////////////////////////////////////
+    virtual ~WbWriter() = default;
 
-   //////////////////////////////////////////////////////////////////////////
-   //rein virtuelle Methoden
-   virtual std::string getFileExtension() = 0;
+    //////////////////////////////////////////////////////////////////////////
+    // rein virtuelle Methoden
+    virtual std::string getFileExtension() = 0;
 
-   //////////////////////////////////////////////////////////////////////////
-   //nodes
-   virtual std::string writeNodes(const std::string&  /*filename*/,std::vector< UbTupleFloat3 >&  /*nodes*/) { throw UbException(UB_EXARGS,"not implemented for "+(std::string)typeid(*this).name() );  }
-   virtual std::string writeNodesWithNodeData(const std::string&  /*filename*/,std::vector< UbTupleFloat3 >&  /*nodes*/, std::vector<std::string >&  /*datanames*/, std::vector<std::vector<double > >&  /*nodedata*/) { throw UbException(UB_EXARGS,"not implemented for "+(std::string)typeid(*this).name() );  }
-   virtual std::string writeNodesWithNodeDataDouble(const std::string&  /*filename*/,std::vector< UbTupleDouble3 >&  /*nodes*/, std::vector<std::string >&  /*datanames*/, std::vector<std::vector<double > >&  /*nodedata*/) { throw UbException(UB_EXARGS,"not implemented for "+(std::string)typeid(*this).name() );  }
+    //////////////////////////////////////////////////////////////////////////
+    // nodes
+    virtual std::string writeNodes(const std::string & /*filename*/, std::vector<UbTupleFloat3> & /*nodes*/)
+    {
+        throw UbException(UB_EXARGS, "not implemented for " + (std::string) typeid(*this).name());
+    }
+    virtual std::string writeNodesWithNodeData(const std::string & /*filename*/, std::vector<UbTupleFloat3> & /*nodes*/,
+                                               std::vector<std::string> & /*datanames*/,
+                                               std::vector<std::vector<double>> & /*nodedata*/)
+    {
+        throw UbException(UB_EXARGS, "not implemented for " + (std::string) typeid(*this).name());
+    }
+    virtual std::string writeNodesWithNodeDataDouble(const std::string & /*filename*/,
+                                                     std::vector<UbTupleDouble3> & /*nodes*/,
+                                                     std::vector<std::string> & /*datanames*/,
+                                                     std::vector<std::vector<double>> & /*nodedata*/)
+    {
+        throw UbException(UB_EXARGS, "not implemented for " + (std::string) typeid(*this).name());
+    }
 
-   //////////////////////////////////////////////////////////////////////////
-   //lines
-   //     0 ---- 1
-   //nodenumbering must start with 0!
-   virtual std::string writeLines(const std::string&  /*filename*/,std::vector<UbTupleFloat3 >&  /*nodes*/, std::vector<UbTupleInt2 >&  /*lines*/) { throw UbException(UB_EXARGS,"not implemented for "+(std::string)typeid(*this).name() );  }
-   virtual std::string writeLinesWithNodeData(const std::string&  /*filename*/,std::vector<UbTupleFloat3 >&  /*nodes*/, std::vector<UbTupleInt2 >&  /*lines*/) { throw UbException(UB_EXARGS,"not implemented for "+(std::string)typeid(*this).name() );  }
+    //////////////////////////////////////////////////////////////////////////
+    // lines
+    //     0 ---- 1
+    // nodenumbering must start with 0!
+    virtual std::string writeLines(const std::string & /*filename*/, std::vector<UbTupleFloat3> & /*nodes*/,
+                                   std::vector<UbTupleInt2> & /*lines*/)
+    {
+        throw UbException(UB_EXARGS, "not implemented for " + (std::string) typeid(*this).name());
+    }
+    virtual std::string writeLinesWithNodeData(const std::string & /*filename*/, std::vector<UbTupleFloat3> & /*nodes*/,
+                                               std::vector<UbTupleInt2> & /*lines*/)
+    {
+        throw UbException(UB_EXARGS, "not implemented for " + (std::string) typeid(*this).name());
+    }
 
-   //////////////////////////////////////////////////////////////////////////
-   //triangles
-   //cell numbering:
-   //                     2
-   //                      
-   //                  0 === 1
-   //nodenumbering must start with 0!
-   virtual std::string writeTriangles(const std::string&  /*filename*/,std::vector< UbTupleFloat3 >&  /*nodes*/, std::vector< UbTupleInt3 >&  /*cells*/){ throw UbException(UB_EXARGS,"not implemented for "+(std::string)typeid(*this).name() );  }
-   virtual std::string writeTrianglesWithNodeData(const std::string&  /*filename*/,std::vector< UbTupleFloat3 >&  /*nodes*/, std::vector< UbTupleInt3 >&  /*cells*/, std::vector<std::string >&  /*datanames*/, std::vector<std::vector<double > >&  /*nodedata*/){ throw UbException(UB_EXARGS,"not implemented for "+(std::string)typeid(*this).name() );  }
+    //////////////////////////////////////////////////////////////////////////
+    // triangles
+    // cell numbering:
+    //                     2
+    //
+    //                  0 === 1
+    // nodenumbering must start with 0!
+    virtual std::string writeTriangles(const std::string & /*filename*/, std::vector<UbTupleFloat3> & /*nodes*/,
+                                       std::vector<UbTupleInt3> & /*cells*/)
+    {
+        throw UbException(UB_EXARGS, "not implemented for " + (std::string) typeid(*this).name());
+    }
+    virtual std::string writeTrianglesWithNodeData(const std::string & /*filename*/,
+                                                   std::vector<UbTupleFloat3> & /*nodes*/,
+                                                   std::vector<UbTupleInt3> & /*cells*/,
+                                                   std::vector<std::string> & /*datanames*/,
+                                                   std::vector<std::vector<double>> & /*nodedata*/)
+    {
+        throw UbException(UB_EXARGS, "not implemented for " + (std::string) typeid(*this).name());
+    }
 
-   //////////////////////////////////////////////////////////////////////////
-   //quads
-   //cell numbering:
-   //                  3---2
-   //                  |   |
-   //                  0---1
-   //nodenumbering must start with 0!
-   virtual std::string writeQuads(const std::string&  /*filename*/,std::vector< UbTupleFloat3 >&  /*nodes*/, std::vector< UbTupleInt4 >&  /*cells*/){ throw UbException(UB_EXARGS,"not implemented for "+(std::string)typeid(*this).name() );  }
-   virtual std::string writeQuadsWithNodeData(const std::string&  /*filename*/,std::vector< UbTupleFloat3 >&  /*nodes*/, std::vector< UbTupleInt4 >&  /*cells*/, std::vector< std::string >&  /*datanames*/, std::vector< std::vector< double > >&  /*nodedata*/){ throw UbException(UB_EXARGS,"not implemented for "+(std::string)typeid(*this).name() );  }
-   virtual std::string writeQuadsWithCellData(const std::string&  /*filename*/,std::vector< UbTupleFloat3 >&  /*nodes*/, std::vector< UbTupleInt4 >&  /*cells*/, std::vector< std::string >&  /*datanames*/, std::vector< std::vector< double > >&  /*celldata*/){ throw UbException(UB_EXARGS,"not implemented for "+(std::string)typeid(*this).name() );  }
-   virtual std::string writeQuadsWithNodeAndCellData(const std::string&  /*filename*/,std::vector< UbTupleFloat3 >&  /*nodes*/, std::vector< UbTupleInt4 >&  /*cells*/, 
-                                                     std::vector< std::string >&  /*nodedatanames*/, std::vector< std::vector< double > >&  /*nodedata*/, std::vector< std::string >&  /*celldatanames*/, std::vector< std::vector< double > >& /*celldata*/) { throw UbException(UB_EXARGS,"not implemented for "+(std::string)typeid(*this).name() );  }
+    //////////////////////////////////////////////////////////////////////////
+    // quads
+    // cell numbering:
+    //                  3---2
+    //                  |   |
+    //                  0---1
+    // nodenumbering must start with 0!
+    virtual std::string writeQuads(const std::string & /*filename*/, std::vector<UbTupleFloat3> & /*nodes*/,
+                                   std::vector<UbTupleInt4> & /*cells*/)
+    {
+        throw UbException(UB_EXARGS, "not implemented for " + (std::string) typeid(*this).name());
+    }
+    virtual std::string writeQuadsWithNodeData(const std::string & /*filename*/, std::vector<UbTupleFloat3> & /*nodes*/,
+                                               std::vector<UbTupleInt4> & /*cells*/,
+                                               std::vector<std::string> & /*datanames*/,
+                                               std::vector<std::vector<double>> & /*nodedata*/)
+    {
+        throw UbException(UB_EXARGS, "not implemented for " + (std::string) typeid(*this).name());
+    }
+    virtual std::string writeQuadsWithCellData(const std::string & /*filename*/, std::vector<UbTupleFloat3> & /*nodes*/,
+                                               std::vector<UbTupleInt4> & /*cells*/,
+                                               std::vector<std::string> & /*datanames*/,
+                                               std::vector<std::vector<double>> & /*celldata*/)
+    {
+        throw UbException(UB_EXARGS, "not implemented for " + (std::string) typeid(*this).name());
+    }
+    virtual std::string writeQuadsWithNodeAndCellData(
+        const std::string & /*filename*/, std::vector<UbTupleFloat3> & /*nodes*/, std::vector<UbTupleInt4> & /*cells*/,
+        std::vector<std::string> & /*nodedatanames*/, std::vector<std::vector<double>> & /*nodedata*/,
+        std::vector<std::string> & /*celldatanames*/, std::vector<std::vector<double>> & /*celldata*/)
+    {
+        throw UbException(UB_EXARGS, "not implemented for " + (std::string) typeid(*this).name());
+    }
 
-   //////////////////////////////////////////////////////////////////////////
-   //octs
-   //     7 ---- 6
-   //    /|     /|
-   //   4 +--- 5 |
-   //   | |    | |
-   //   | 3 ---+ 2
-   //   |/     |/
-   //   0 ---- 1
-   virtual std::string writeOcts(const std::string&  /*filename*/,std::vector< UbTupleFloat3 >&  /*nodes*/, std::vector< UbTupleInt8 >&  /*cells*/){ throw UbException(UB_EXARGS,"not implemented for "+(std::string)typeid(*this).name() );  }
-   virtual std::string writeOctsWithCellData(const std::string&  /*filename*/,std::vector<UbTupleFloat3 >&  /*nodes*/, std::vector<UbTupleInt8 >&  /*cells*/, std::vector<std::string >&  /*datanames*/, std::vector<std::vector<double > >&  /*celldata*/){ throw UbException(UB_EXARGS,"not implemented for "+(std::string)typeid(*this).name() );  }
-   virtual std::string writeOctsWithNodeData(const std::string&  /*filename*/,std::vector<UbTupleFloat3 >&  /*nodes*/, std::vector<UbTupleUInt8 >&  /*cells*/, std::vector<std::string >&  /*datanames*/, std::vector<std::vector<double > >&  /*nodedata*/){ throw UbException(UB_EXARGS,"not implemented for "+(std::string)typeid(*this).name() );  }
+    //////////////////////////////////////////////////////////////////////////
+    // octs
+    //     7 ---- 6
+    //    /|     /|
+    //   4 +--- 5 |
+    //   | |    | |
+    //   | 3 ---+ 2
+    //   |/     |/
+    //   0 ---- 1
+    virtual std::string writeOcts(const std::string & /*filename*/, std::vector<UbTupleFloat3> & /*nodes*/,
+                                  std::vector<UbTupleInt8> & /*cells*/)
+    {
+        throw UbException(UB_EXARGS, "not implemented for " + (std::string) typeid(*this).name());
+    }
+    virtual std::string writeOctsWithCellData(const std::string & /*filename*/, std::vector<UbTupleFloat3> & /*nodes*/,
+                                              std::vector<UbTupleInt8> & /*cells*/,
+                                              std::vector<std::string> & /*datanames*/,
+                                              std::vector<std::vector<double>> & /*celldata*/)
+    {
+        throw UbException(UB_EXARGS, "not implemented for " + (std::string) typeid(*this).name());
+    }
+    virtual std::string writeOctsWithNodeData(const std::string & /*filename*/, std::vector<UbTupleFloat3> & /*nodes*/,
+                                              std::vector<UbTupleUInt8> & /*cells*/,
+                                              std::vector<std::string> & /*datanames*/,
+                                              std::vector<std::vector<double>> & /*nodedata*/)
+    {
+        throw UbException(UB_EXARGS, "not implemented for " + (std::string) typeid(*this).name());
+    }
 
 private:
-
 };
 
-#endif //WBWRITER_H
+#endif // WBWRITER_H
diff --git a/src/basics/basics/writer/WbWriterAvsASCII.cpp b/src/basics/basics/writer/WbWriterAvsASCII.cpp
index f55b86405a920df20445dc20e752848a9bbd56c6..31b922c92df182da53539e12dd4f0ad18adca5c0 100644
--- a/src/basics/basics/writer/WbWriterAvsASCII.cpp
+++ b/src/basics/basics/writer/WbWriterAvsASCII.cpp
@@ -1,699 +1,865 @@
-#include <basics/writer/WbWriterAvsASCII.h>
 #include <basics/utilities/UbLogger.h>
-#include <cstring>
 #include <basics/utilities/UbSystem.h>
+#include <basics/writer/WbWriterAvsASCII.h>
+#include <cstring>
 
 using namespace std;
 
-std::string WbWriterAvsASCII::writeQuads(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt4 >& cells)
+std::string WbWriterAvsASCII::writeQuads(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                                         std::vector<UbTupleInt4> &cells)
 {
-   string avsfilename = filename+getFileExtension();
-   UBLOG(logDEBUG1,"WbWriterAvsASCII::writeQuads to "<<avsfilename<<" - start");
-
-   ofstream out(avsfilename.c_str(),ios::out|ios::binary);
-   if(!out)
-   { 
-      out.clear(); //flags ruecksetzen (ansonsten liefert utern if(!outfile) weiterhin true!!!
-      string path = UbSystem::getPathFromString(avsfilename);
-      if(path.size()>0){UbSystem::makeDirectory(path);out.open(avsfilename.c_str(),ios::out|ios::binary);}
-      if(!out) throw UbException(UB_EXARGS,"couldn't open file "+avsfilename);
-   }
-   char magic = (char)7;
-   int   idummy;
-   float fdummy;
-
-   int nofNodes = (int)nodes.size();
-   int nofCells = (int)cells.size();
-
-   int nofNodeData     = 0;
-   int nofCellData     = 0;
-   int nofModelData    = 0;
-   int cellType        = 3; //=quad
-   int nofNodesPerCell = 4; 
-
-   out.write((char*)&magic,sizeof(char));      
-   out.write((char*)&nofNodes,sizeof(int));    
-   out.write((char*)&nofCells,sizeof(int));    
-   out.write((char*)&nofNodeData,sizeof(int)); 
-   out.write((char*)&nofCellData,sizeof(int)); 
-   out.write((char*)&nofModelData,sizeof(int));
-
-   idummy = (int)nofCells*nofNodesPerCell;
-   out.write((char*)&idummy,sizeof(int)); //(nof nodes) * (nodes per cell)
-   for(int c=0; c<nofCells; c++)
-   {
-      idummy=c+1;             out.write((char*)&idummy,sizeof(int)); //cell id
-      idummy=1;               out.write((char*)&idummy,sizeof(int)); //mat
-      idummy=nofNodesPerCell; out.write((char*)&idummy,sizeof(int)); //nodes per cell
-      idummy=cellType;        out.write((char*)&idummy,sizeof(int)); //cell type 
-   }
-   //knotennummern der einzelnen zellen
-   for(int c=0; c<nofCells; c++)
-   {
-      idummy = val<1>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-      idummy = val<2>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-      idummy = val<3>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-      idummy = val<4>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-   }
-
-   //coords
-   //x1-coords
-   for(int n=0; n<nofNodes; n++)
-   { fdummy = (float)( val<1>(nodes[n]) ); out.write((char*)&fdummy ,sizeof(float)); }
-   //x2-coords
-   for(int n=0; n<nofNodes; n++)
-   { fdummy = (float)( val<2>(nodes[n]) ); out.write((char*)&fdummy ,sizeof(float)); }
-   //x3-coords
-   for(int n=0; n<nofNodes; n++)
-   { fdummy = (float)( val<3>(nodes[n]) ); out.write((char*)&fdummy ,sizeof(float)); }
-   //out<<"\n";
-
-   out.close(); 
-   UBLOG(logDEBUG1,"WbWriterAvsASCII::writeQuads to "<<avsfilename<<" - end");
-
-   return avsfilename;
+    string avsfilename = filename + getFileExtension();
+    UBLOG(logDEBUG1, "WbWriterAvsASCII::writeQuads to " << avsfilename << " - start");
+
+    ofstream out(avsfilename.c_str(), ios::out | ios::binary);
+    if (!out) {
+        out.clear(); // flags ruecksetzen (ansonsten liefert utern if(!outfile) weiterhin true!!!
+        string path = UbSystem::getPathFromString(avsfilename);
+        if (path.size() > 0) {
+            UbSystem::makeDirectory(path);
+            out.open(avsfilename.c_str(), ios::out | ios::binary);
+        }
+        if (!out)
+            throw UbException(UB_EXARGS, "couldn't open file " + avsfilename);
+    }
+    char magic = (char)7;
+    int idummy;
+    float fdummy;
+
+    int nofNodes = (int)nodes.size();
+    int nofCells = (int)cells.size();
+
+    int nofNodeData     = 0;
+    int nofCellData     = 0;
+    int nofModelData    = 0;
+    int cellType        = 3; //=quad
+    int nofNodesPerCell = 4;
+
+    out.write((char *)&magic, sizeof(char));
+    out.write((char *)&nofNodes, sizeof(int));
+    out.write((char *)&nofCells, sizeof(int));
+    out.write((char *)&nofNodeData, sizeof(int));
+    out.write((char *)&nofCellData, sizeof(int));
+    out.write((char *)&nofModelData, sizeof(int));
+
+    idummy = (int)nofCells * nofNodesPerCell;
+    out.write((char *)&idummy, sizeof(int)); //(nof nodes) * (nodes per cell)
+    for (int c = 0; c < nofCells; c++) {
+        idummy = c + 1;
+        out.write((char *)&idummy, sizeof(int)); // cell id
+        idummy = 1;
+        out.write((char *)&idummy, sizeof(int)); // mat
+        idummy = nofNodesPerCell;
+        out.write((char *)&idummy, sizeof(int)); // nodes per cell
+        idummy = cellType;
+        out.write((char *)&idummy, sizeof(int)); // cell type
+    }
+    // knotennummern der einzelnen zellen
+    for (int c = 0; c < nofCells; c++) {
+        idummy = val<1>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+        idummy = val<2>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+        idummy = val<3>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+        idummy = val<4>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+    }
+
+    // coords
+    // x1-coords
+    for (int n = 0; n < nofNodes; n++) {
+        fdummy = (float)(val<1>(nodes[n]));
+        out.write((char *)&fdummy, sizeof(float));
+    }
+    // x2-coords
+    for (int n = 0; n < nofNodes; n++) {
+        fdummy = (float)(val<2>(nodes[n]));
+        out.write((char *)&fdummy, sizeof(float));
+    }
+    // x3-coords
+    for (int n = 0; n < nofNodes; n++) {
+        fdummy = (float)(val<3>(nodes[n]));
+        out.write((char *)&fdummy, sizeof(float));
+    }
+    // out<<"\n";
+
+    out.close();
+    UBLOG(logDEBUG1, "WbWriterAvsASCII::writeQuads to " << avsfilename << " - end");
+
+    return avsfilename;
 }
 /*===============================================================================*/
-std::string WbWriterAvsASCII::writeOcts(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt8 >& cells)
+std::string WbWriterAvsASCII::writeOcts(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                                        std::vector<UbTupleInt8> &cells)
 {
-   string avsfilename = filename+getFileExtension();
-   UBLOG(logDEBUG1,"WbWriterAvsASCII::writeOcts to "<<avsfilename<<" - start");
-
-   ofstream out(avsfilename.c_str(),ios::out|ios::binary);
-   if(!out)
-   { 
-      out.clear(); //flags ruecksetzen (ansonsten liefert utern if(!outfile) weiterhin true!!!
-      string path = UbSystem::getPathFromString(avsfilename);
-      if(path.size()>0){UbSystem::makeDirectory(path);out.open(avsfilename.c_str(),ios::out|ios::binary);}
-      if(!out) throw UbException(UB_EXARGS,"file konnte nicht geschrieben werden "+avsfilename);
-   }
-
-   char magic = (char)7;
-   int   idummy;
-   float fdummy;
-
-   int nofNodes = (int)nodes.size();
-   int nofCells = (int)cells.size();
-
-   int nofNodeData     = 0;
-   int nofCellData     = 0;
-   int nofModelData    = 0;
-   int cellType        = 7; //=hex
-   int nofNodesPerCell = 8; 
-
-   out.write((char*)&magic,sizeof(char));      
-   out.write((char*)&nofNodes,sizeof(int));    
-   out.write((char*)&nofCells,sizeof(int));    
-   out.write((char*)&nofNodeData,sizeof(int)); 
-   out.write((char*)&nofCellData,sizeof(int)); 
-   out.write((char*)&nofModelData,sizeof(int));
-
-   idummy = (int)nofCells*nofNodesPerCell;
-   out.write((char*)&idummy,sizeof(int)); //(nof nodes) * (nodes per cell)
-   for(int c=0; c<nofCells; c++)
-   {
-      idummy=c+1;             out.write((char*)&idummy,sizeof(int)); //cell id
-      idummy=1;               out.write((char*)&idummy,sizeof(int)); //mat
-      idummy=nofNodesPerCell; out.write((char*)&idummy,sizeof(int)); //nodes per cell
-      idummy=cellType;        out.write((char*)&idummy,sizeof(int)); //cell type 
-   }
-   //knotennummern der einzelnen zellen
-   for(int c=0; c<nofCells; c++)
-   {
-      idummy = val<1>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-      idummy = val<2>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-      idummy = val<3>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-      idummy = val<4>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-      idummy = val<5>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-      idummy = val<6>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-      idummy = val<7>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-      idummy = val<8>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-   }
-
-   //coords
-   //x1-coords
-   for(int n=0; n<nofNodes; n++)
-   { fdummy = (float)( val<1>(nodes[n]) ); out.write((char*)&fdummy ,sizeof(float)); }
-   //x2-coords
-   for(int n=0; n<nofNodes; n++)
-   { fdummy = (float)( val<2>(nodes[n]) ); out.write((char*)&fdummy ,sizeof(float)); }
-   //x3-coords
-   for(int n=0; n<nofNodes; n++)
-   { fdummy = (float)( val<3>(nodes[n]) ); out.write((char*)&fdummy ,sizeof(float)); }
-   //out<<"\n";
-
-   
-   out.close(); 
-   UBLOG(logDEBUG1,"WbWriterAvsASCII::writeOcts to "<<avsfilename<<" - end");
-
-   return avsfilename;
+    string avsfilename = filename + getFileExtension();
+    UBLOG(logDEBUG1, "WbWriterAvsASCII::writeOcts to " << avsfilename << " - start");
+
+    ofstream out(avsfilename.c_str(), ios::out | ios::binary);
+    if (!out) {
+        out.clear(); // flags ruecksetzen (ansonsten liefert utern if(!outfile) weiterhin true!!!
+        string path = UbSystem::getPathFromString(avsfilename);
+        if (path.size() > 0) {
+            UbSystem::makeDirectory(path);
+            out.open(avsfilename.c_str(), ios::out | ios::binary);
+        }
+        if (!out)
+            throw UbException(UB_EXARGS, "file konnte nicht geschrieben werden " + avsfilename);
+    }
+
+    char magic = (char)7;
+    int idummy;
+    float fdummy;
+
+    int nofNodes = (int)nodes.size();
+    int nofCells = (int)cells.size();
+
+    int nofNodeData     = 0;
+    int nofCellData     = 0;
+    int nofModelData    = 0;
+    int cellType        = 7; //=hex
+    int nofNodesPerCell = 8;
+
+    out.write((char *)&magic, sizeof(char));
+    out.write((char *)&nofNodes, sizeof(int));
+    out.write((char *)&nofCells, sizeof(int));
+    out.write((char *)&nofNodeData, sizeof(int));
+    out.write((char *)&nofCellData, sizeof(int));
+    out.write((char *)&nofModelData, sizeof(int));
+
+    idummy = (int)nofCells * nofNodesPerCell;
+    out.write((char *)&idummy, sizeof(int)); //(nof nodes) * (nodes per cell)
+    for (int c = 0; c < nofCells; c++) {
+        idummy = c + 1;
+        out.write((char *)&idummy, sizeof(int)); // cell id
+        idummy = 1;
+        out.write((char *)&idummy, sizeof(int)); // mat
+        idummy = nofNodesPerCell;
+        out.write((char *)&idummy, sizeof(int)); // nodes per cell
+        idummy = cellType;
+        out.write((char *)&idummy, sizeof(int)); // cell type
+    }
+    // knotennummern der einzelnen zellen
+    for (int c = 0; c < nofCells; c++) {
+        idummy = val<1>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+        idummy = val<2>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+        idummy = val<3>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+        idummy = val<4>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+        idummy = val<5>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+        idummy = val<6>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+        idummy = val<7>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+        idummy = val<8>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+    }
+
+    // coords
+    // x1-coords
+    for (int n = 0; n < nofNodes; n++) {
+        fdummy = (float)(val<1>(nodes[n]));
+        out.write((char *)&fdummy, sizeof(float));
+    }
+    // x2-coords
+    for (int n = 0; n < nofNodes; n++) {
+        fdummy = (float)(val<2>(nodes[n]));
+        out.write((char *)&fdummy, sizeof(float));
+    }
+    // x3-coords
+    for (int n = 0; n < nofNodes; n++) {
+        fdummy = (float)(val<3>(nodes[n]));
+        out.write((char *)&fdummy, sizeof(float));
+    }
+    // out<<"\n";
+
+    out.close();
+    UBLOG(logDEBUG1, "WbWriterAvsASCII::writeOcts to " << avsfilename << " - end");
+
+    return avsfilename;
 }
 /*===============================================================================*/
-std::string WbWriterAvsASCII::writeQuadsWithNodeData(const string& filename,vector< UbTupleFloat3 >& nodes, vector< UbTupleInt4 >& cells, vector< string >& datanames, vector< vector< double > >& nodedata)
+std::string WbWriterAvsASCII::writeQuadsWithNodeData(const string &filename, vector<UbTupleFloat3> &nodes,
+                                                     vector<UbTupleInt4> &cells, vector<string> &datanames,
+                                                     vector<vector<double>> &nodedata)
 {
-   string avsfilename = filename+getFileExtension();
-   UBLOG(logDEBUG1,"WbWriterAvsASCII::writeQuadsWithNodeData to "<<avsfilename<<" - start");
-
-   ofstream out(avsfilename.c_str(),ios::out|ios::binary);
-   if(!out)
-   { 
-      out.clear(); //flags ruecksetzen (ansonsten liefert utern if(!outfile) weiterhin true!!!
-      string path = UbSystem::getPathFromString(avsfilename);
-      if(path.size()>0){UbSystem::makeDirectory(path);out.open(avsfilename.c_str(),ios::out|ios::binary);}
-      if(!out) throw UbException(UB_EXARGS,"write UCD File "+avsfilename+" konnte nicht geschrieben werden");
-   }
-   char magic = (char)7;
-   int   idummy;
-   float fdummy;
-
-   int nofNodes = (int)nodes.size();
-   int nofCells = (int)cells.size();
-
-   int nofNodeData     = (int)datanames.size();
-   int nofCellData     = 0;
-   int nofModelData    = 0;
-   int cellType        = 3; //=quad
-   int nofNodesPerCell = 4; 
-
-   out.write((char*)&magic,sizeof(char));      
-   out.write((char*)&nofNodes,sizeof(int));    
-   out.write((char*)&nofCells,sizeof(int));    
-   out.write((char*)&nofNodeData,sizeof(int)); 
-   out.write((char*)&nofCellData,sizeof(int)); 
-   out.write((char*)&nofModelData,sizeof(int));
-
-   idummy = (int)nofCells*nofNodesPerCell;
-   out.write((char*)&idummy,sizeof(int)); //(nof nodes) * (nodes per cell)
-   for(int c=0; c<nofCells; c++)
-   {
-      idummy=c+1;             out.write((char*)&idummy,sizeof(int)); //cell id
-      idummy=1;               out.write((char*)&idummy,sizeof(int)); //mat
-      idummy=nofNodesPerCell; out.write((char*)&idummy,sizeof(int)); //nodes per cell
-      idummy=cellType;        out.write((char*)&idummy,sizeof(int)); //cell type 
-   }
-   //knotennummern der einzelnen zellen
-   for(int c=0; c<nofCells; c++)
-   {
-      idummy = val<1>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-      idummy = val<2>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-      idummy = val<3>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-      idummy = val<4>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-   }
-
-   //coords
-   //x1-coords
-   for(int n=0; n<nofNodes; n++)
-      { fdummy = (float)( val<1>(nodes[n]) ); out.write((char*)&fdummy ,sizeof(float)); }
-   //x2-coords
-   for(int n=0; n<nofNodes; n++)
-      { fdummy = (float)( val<2>(nodes[n]) ); out.write((char*)&fdummy ,sizeof(float)); }
-   //x3-coords
-   for(int n=0; n<nofNodes; n++)
-      { fdummy = (float)( val<3>(nodes[n]) ); out.write((char*)&fdummy ,sizeof(float)); }
-   //out<<"\n";
-
-   //NODE DATA
-   char labels[1024];
-   char units[1024];
-   strcpy(labels, "");
-   strcpy(units, "");
-
-   for(int d=0; d<nofNodeData-1; ++d) 
-      { strcat(labels, datanames[d].c_str() ); strcat(labels,"."); }
-   strcat(labels, datanames[nofNodeData-1].c_str()); 
-
-   for(int i=0;i<(nofNodeData-1);i++) strcat(units, "no_unit.");
-   strcat(units, "no_unit");
-
-   out.write((char*)&labels,sizeof(labels));
-   out.write((char*)&units,sizeof(units));
-
-   //nof and type of data
-   idummy = nofNodeData;
-   out.write((char*)&idummy,sizeof(int)); //Datentypen pro knoten (hier = nof_node_data, da NUR skalare)
-
-   idummy = 1;
-   for(int i=0;i<nofNodeData;i++) out.write((char*)&idummy,sizeof(int)); //jeder Datentyp ist ein skalarer Wert
-
-   //min and max of data
-   fdummy = 0.0;
-   for(int i=0;i<nofNodeData;i++) out.write((char*)&fdummy,sizeof(float)); //min Wert pro Datentyp
-   fdummy = 1.0;
-   for(int i=0;i<nofNodeData;i++) out.write((char*)&fdummy,sizeof(float)); //max Wert pro Datentyp
-
-   //daten ins file schreiben
-   for(int d=0; d<nofNodeData; ++d)
-      for(int n=0; n<(int)nodedata[d].size(); n++)
-      { fdummy=(float)nodedata[d][n]; out.write((char*)&fdummy,sizeof(float)); }
-
-   fdummy = 1.;
-   for(int i=0;i<nofNodeData;i++) out.write((char*)&fdummy,sizeof(float)); //max Wert pro Datentyp
-
-   out.close(); 
-   UBLOG(logDEBUG1,"WbWriterAvsASCII::writeQuadsWithNodeData to "<<avsfilename<<" - end");
-
-   return avsfilename;
+    string avsfilename = filename + getFileExtension();
+    UBLOG(logDEBUG1, "WbWriterAvsASCII::writeQuadsWithNodeData to " << avsfilename << " - start");
+
+    ofstream out(avsfilename.c_str(), ios::out | ios::binary);
+    if (!out) {
+        out.clear(); // flags ruecksetzen (ansonsten liefert utern if(!outfile) weiterhin true!!!
+        string path = UbSystem::getPathFromString(avsfilename);
+        if (path.size() > 0) {
+            UbSystem::makeDirectory(path);
+            out.open(avsfilename.c_str(), ios::out | ios::binary);
+        }
+        if (!out)
+            throw UbException(UB_EXARGS, "write UCD File " + avsfilename + " konnte nicht geschrieben werden");
+    }
+    char magic = (char)7;
+    int idummy;
+    float fdummy;
+
+    int nofNodes = (int)nodes.size();
+    int nofCells = (int)cells.size();
+
+    int nofNodeData     = (int)datanames.size();
+    int nofCellData     = 0;
+    int nofModelData    = 0;
+    int cellType        = 3; //=quad
+    int nofNodesPerCell = 4;
+
+    out.write((char *)&magic, sizeof(char));
+    out.write((char *)&nofNodes, sizeof(int));
+    out.write((char *)&nofCells, sizeof(int));
+    out.write((char *)&nofNodeData, sizeof(int));
+    out.write((char *)&nofCellData, sizeof(int));
+    out.write((char *)&nofModelData, sizeof(int));
+
+    idummy = (int)nofCells * nofNodesPerCell;
+    out.write((char *)&idummy, sizeof(int)); //(nof nodes) * (nodes per cell)
+    for (int c = 0; c < nofCells; c++) {
+        idummy = c + 1;
+        out.write((char *)&idummy, sizeof(int)); // cell id
+        idummy = 1;
+        out.write((char *)&idummy, sizeof(int)); // mat
+        idummy = nofNodesPerCell;
+        out.write((char *)&idummy, sizeof(int)); // nodes per cell
+        idummy = cellType;
+        out.write((char *)&idummy, sizeof(int)); // cell type
+    }
+    // knotennummern der einzelnen zellen
+    for (int c = 0; c < nofCells; c++) {
+        idummy = val<1>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+        idummy = val<2>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+        idummy = val<3>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+        idummy = val<4>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+    }
+
+    // coords
+    // x1-coords
+    for (int n = 0; n < nofNodes; n++) {
+        fdummy = (float)(val<1>(nodes[n]));
+        out.write((char *)&fdummy, sizeof(float));
+    }
+    // x2-coords
+    for (int n = 0; n < nofNodes; n++) {
+        fdummy = (float)(val<2>(nodes[n]));
+        out.write((char *)&fdummy, sizeof(float));
+    }
+    // x3-coords
+    for (int n = 0; n < nofNodes; n++) {
+        fdummy = (float)(val<3>(nodes[n]));
+        out.write((char *)&fdummy, sizeof(float));
+    }
+    // out<<"\n";
+
+    // NODE DATA
+    char labels[1024];
+    char units[1024];
+    strcpy(labels, "");
+    strcpy(units, "");
+
+    for (int d = 0; d < nofNodeData - 1; ++d) {
+        strcat(labels, datanames[d].c_str());
+        strcat(labels, ".");
+    }
+    strcat(labels, datanames[nofNodeData - 1].c_str());
+
+    for (int i = 0; i < (nofNodeData - 1); i++)
+        strcat(units, "no_unit.");
+    strcat(units, "no_unit");
+
+    out.write((char *)&labels, sizeof(labels));
+    out.write((char *)&units, sizeof(units));
+
+    // nof and type of data
+    idummy = nofNodeData;
+    out.write((char *)&idummy, sizeof(int)); // Datentypen pro knoten (hier = nof_node_data, da NUR skalare)
+
+    idummy = 1;
+    for (int i = 0; i < nofNodeData; i++)
+        out.write((char *)&idummy, sizeof(int)); // jeder Datentyp ist ein skalarer Wert
+
+    // min and max of data
+    fdummy = 0.0;
+    for (int i = 0; i < nofNodeData; i++)
+        out.write((char *)&fdummy, sizeof(float)); // min Wert pro Datentyp
+    fdummy = 1.0;
+    for (int i = 0; i < nofNodeData; i++)
+        out.write((char *)&fdummy, sizeof(float)); // max Wert pro Datentyp
+
+    // daten ins file schreiben
+    for (int d = 0; d < nofNodeData; ++d)
+        for (int n = 0; n < (int)nodedata[d].size(); n++) {
+            fdummy = (float)nodedata[d][n];
+            out.write((char *)&fdummy, sizeof(float));
+        }
+
+    fdummy = 1.;
+    for (int i = 0; i < nofNodeData; i++)
+        out.write((char *)&fdummy, sizeof(float)); // max Wert pro Datentyp
+
+    out.close();
+    UBLOG(logDEBUG1, "WbWriterAvsASCII::writeQuadsWithNodeData to " << avsfilename << " - end");
+
+    return avsfilename;
 }
 /*===============================================================================*/
-std::string WbWriterAvsASCII::writeQuadsWithCellData(const string& filename,vector< UbTupleFloat3 >& nodes, vector< UbTupleInt4 >& cells, vector< string >& datanames, vector< vector< double > >& celldata)
+std::string WbWriterAvsASCII::writeQuadsWithCellData(const string &filename, vector<UbTupleFloat3> &nodes,
+                                                     vector<UbTupleInt4> &cells, vector<string> &datanames,
+                                                     vector<vector<double>> &celldata)
 {
-   string avsfilename = filename+getFileExtension();
-   UBLOG(logDEBUG1,"WbWriterAvsASCII::writeQuadsWithCellData to "<<avsfilename<<" - start");
-
-   ofstream out(avsfilename.c_str(),ios::out|ios::binary);
-   if(!out)
-   { 
-      out.clear(); //flags ruecksetzen (ansonsten liefert utern if(!outfile) weiterhin true!!!
-      string path = UbSystem::getPathFromString(avsfilename);
-      if(path.size()>0){UbSystem::makeDirectory(path);out.open(avsfilename.c_str(),ios::out|ios::binary);}
-      if(!out) throw UbException(UB_EXARGS,"write_OutputFile-UCD File  "+avsfilename+" konnte nicht geschrieben werden");
-   }
-
-   char magic = (char)7;
-   int   idummy;
-   float fdummy;
-
-   int nofNodes = (int)nodes.size();
-   int nofCells = (int)cells.size();
-
-   int nofNodeData     = 0;
-   int nofCellData     = (int)datanames.size();
-   int nofModelData    = 0;
-   int cellType        = 3; //=quad
-   int nofNodesPerCell = 4; 
-
-   out.write((char*)&magic,sizeof(char));      
-   out.write((char*)&nofNodes,sizeof(int));    
-   out.write((char*)&nofCells,sizeof(int));    
-   out.write((char*)&nofNodeData,sizeof(int)); 
-   out.write((char*)&nofCellData,sizeof(int)); 
-   out.write((char*)&nofModelData,sizeof(int));
-
-   idummy = (int)nofCells*nofNodesPerCell;
-   out.write((char*)&idummy,sizeof(int)); //(nof nodes) * (nodes per cell)
-   for(int c=0; c<nofCells; c++)
-   {
-      idummy=c+1;             out.write((char*)&idummy,sizeof(int)); //cell id
-      idummy=1;               out.write((char*)&idummy,sizeof(int)); //mat
-      idummy=nofNodesPerCell; out.write((char*)&idummy,sizeof(int)); //nodes per cell
-      idummy=cellType;        out.write((char*)&idummy,sizeof(int)); //cell type 
-   }
-   //knotennummern der einzelnen zellen
-   for(int c=0; c<nofCells; c++)
-   {
-      idummy = val<1>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-      idummy = val<2>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-      idummy = val<3>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-      idummy = val<4>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-   }
-
-   //coords
-   //x1-coords
-   for(int n=0; n<nofNodes; n++)
-      { fdummy = (float)( val<1>(nodes[n]) ); out.write((char*)&fdummy ,sizeof(float)); }
-   //x2-coords
-   for(int n=0; n<nofNodes; n++)
-      { fdummy = (float)( val<2>(nodes[n]) ); out.write((char*)&fdummy ,sizeof(float)); }
-   //x3-coords
-   fdummy=0.0;
-   for(int n=0; n<nofNodes; n++)
-      { fdummy = (float)( val<3>(nodes[n]) ); out.write((char*)&fdummy ,sizeof(float)); }
-   //out<<"\n";
-
-   //CELL DATA
-   char labels[1024];
-   char units[1024];
-   strcpy(labels, "");
-   strcpy(units, "");
-
-   for(int d=0; d<nofCellData-1; ++d) { strcat(labels, datanames[d].c_str() ); strcat(labels,"."); }
-   strcat(labels, datanames[nofCellData-1].c_str()); 
-
-   for(int d=0; d<nofCellData-1; ++d) strcat(units, "no_unit.");
-   strcat(units, "no_unit");
-
-   out.write((char*)&labels,sizeof(labels));
-   out.write((char*)&units,sizeof(units));
-
-   //nof and type of data
-   idummy = nofCellData;
-   out.write((char*)&idummy,sizeof(int)); //Datentypen pro knoten (hier = nof_node_data, da NUR skalare)
-
-   idummy = 1;
-   for(int i=0;i<nofCellData;i++) out.write((char*)&idummy,sizeof(int)); //jeder Datentyp ist ein skalarer Wert
-
-   //min and max of data
-   fdummy = 0.0;
-   for(int i=0;i<nofCellData;i++) out.write((char*)&fdummy,sizeof(float)); //min Wert pro Datentyp
-   fdummy = 1.0;
-   for(int i=0;i<nofCellData;i++) out.write((char*)&fdummy,sizeof(float)); //max Wert pro Datentyp
-
-   //daten ins file schreiben
-   for(int d=0; d<nofCellData; ++d)
-      for(int n=0; n<(int)celldata[d].size(); n++)
-         { fdummy=(float)celldata[d][n]; out.write((char*)&fdummy,sizeof(float)); }
-
-   fdummy = 1.;
-   for(int i=0;i<nofCellData;i++) out.write((char*)&fdummy,sizeof(float)); //max Wert pro Datentyp
-
-   out.close(); 
-   UBLOG(logDEBUG1,"WbWriterAvsASCII::writeQuadsWithCellData to "<<avsfilename<<" - end");
-
-   return avsfilename;
+    string avsfilename = filename + getFileExtension();
+    UBLOG(logDEBUG1, "WbWriterAvsASCII::writeQuadsWithCellData to " << avsfilename << " - start");
+
+    ofstream out(avsfilename.c_str(), ios::out | ios::binary);
+    if (!out) {
+        out.clear(); // flags ruecksetzen (ansonsten liefert utern if(!outfile) weiterhin true!!!
+        string path = UbSystem::getPathFromString(avsfilename);
+        if (path.size() > 0) {
+            UbSystem::makeDirectory(path);
+            out.open(avsfilename.c_str(), ios::out | ios::binary);
+        }
+        if (!out)
+            throw UbException(UB_EXARGS,
+                              "write_OutputFile-UCD File  " + avsfilename + " konnte nicht geschrieben werden");
+    }
+
+    char magic = (char)7;
+    int idummy;
+    float fdummy;
+
+    int nofNodes = (int)nodes.size();
+    int nofCells = (int)cells.size();
+
+    int nofNodeData     = 0;
+    int nofCellData     = (int)datanames.size();
+    int nofModelData    = 0;
+    int cellType        = 3; //=quad
+    int nofNodesPerCell = 4;
+
+    out.write((char *)&magic, sizeof(char));
+    out.write((char *)&nofNodes, sizeof(int));
+    out.write((char *)&nofCells, sizeof(int));
+    out.write((char *)&nofNodeData, sizeof(int));
+    out.write((char *)&nofCellData, sizeof(int));
+    out.write((char *)&nofModelData, sizeof(int));
+
+    idummy = (int)nofCells * nofNodesPerCell;
+    out.write((char *)&idummy, sizeof(int)); //(nof nodes) * (nodes per cell)
+    for (int c = 0; c < nofCells; c++) {
+        idummy = c + 1;
+        out.write((char *)&idummy, sizeof(int)); // cell id
+        idummy = 1;
+        out.write((char *)&idummy, sizeof(int)); // mat
+        idummy = nofNodesPerCell;
+        out.write((char *)&idummy, sizeof(int)); // nodes per cell
+        idummy = cellType;
+        out.write((char *)&idummy, sizeof(int)); // cell type
+    }
+    // knotennummern der einzelnen zellen
+    for (int c = 0; c < nofCells; c++) {
+        idummy = val<1>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+        idummy = val<2>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+        idummy = val<3>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+        idummy = val<4>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+    }
+
+    // coords
+    // x1-coords
+    for (int n = 0; n < nofNodes; n++) {
+        fdummy = (float)(val<1>(nodes[n]));
+        out.write((char *)&fdummy, sizeof(float));
+    }
+    // x2-coords
+    for (int n = 0; n < nofNodes; n++) {
+        fdummy = (float)(val<2>(nodes[n]));
+        out.write((char *)&fdummy, sizeof(float));
+    }
+    // x3-coords
+    fdummy = 0.0;
+    for (int n = 0; n < nofNodes; n++) {
+        fdummy = (float)(val<3>(nodes[n]));
+        out.write((char *)&fdummy, sizeof(float));
+    }
+    // out<<"\n";
+
+    // CELL DATA
+    char labels[1024];
+    char units[1024];
+    strcpy(labels, "");
+    strcpy(units, "");
+
+    for (int d = 0; d < nofCellData - 1; ++d) {
+        strcat(labels, datanames[d].c_str());
+        strcat(labels, ".");
+    }
+    strcat(labels, datanames[nofCellData - 1].c_str());
+
+    for (int d = 0; d < nofCellData - 1; ++d)
+        strcat(units, "no_unit.");
+    strcat(units, "no_unit");
+
+    out.write((char *)&labels, sizeof(labels));
+    out.write((char *)&units, sizeof(units));
+
+    // nof and type of data
+    idummy = nofCellData;
+    out.write((char *)&idummy, sizeof(int)); // Datentypen pro knoten (hier = nof_node_data, da NUR skalare)
+
+    idummy = 1;
+    for (int i = 0; i < nofCellData; i++)
+        out.write((char *)&idummy, sizeof(int)); // jeder Datentyp ist ein skalarer Wert
+
+    // min and max of data
+    fdummy = 0.0;
+    for (int i = 0; i < nofCellData; i++)
+        out.write((char *)&fdummy, sizeof(float)); // min Wert pro Datentyp
+    fdummy = 1.0;
+    for (int i = 0; i < nofCellData; i++)
+        out.write((char *)&fdummy, sizeof(float)); // max Wert pro Datentyp
+
+    // daten ins file schreiben
+    for (int d = 0; d < nofCellData; ++d)
+        for (int n = 0; n < (int)celldata[d].size(); n++) {
+            fdummy = (float)celldata[d][n];
+            out.write((char *)&fdummy, sizeof(float));
+        }
+
+    fdummy = 1.;
+    for (int i = 0; i < nofCellData; i++)
+        out.write((char *)&fdummy, sizeof(float)); // max Wert pro Datentyp
+
+    out.close();
+    UBLOG(logDEBUG1, "WbWriterAvsASCII::writeQuadsWithCellData to " << avsfilename << " - end");
+
+    return avsfilename;
 }
 /*===============================================================================*/
-std::string WbWriterAvsASCII::writeQuadsWithNodeAndCellData(const string& filename,vector< UbTupleFloat3 >& nodes, vector< UbTupleInt4 >& cells, vector< string >& nodedatanames, vector< vector< double > >& nodedata, vector< string >& celldatanames, vector< vector< double > >& celldata)
+std::string WbWriterAvsASCII::writeQuadsWithNodeAndCellData(const string &filename, vector<UbTupleFloat3> &nodes,
+                                                            vector<UbTupleInt4> &cells, vector<string> &nodedatanames,
+                                                            vector<vector<double>> &nodedata,
+                                                            vector<string> &celldatanames,
+                                                            vector<vector<double>> &celldata)
 {
-   string avsfilename = filename+getFileExtension();
-   UBLOG(logDEBUG1,"WbWriterAvsASCII::writeQuadsWithNodeAndCellData to "<<avsfilename<<" - start");
-
-   ofstream out(avsfilename.c_str(),ios::out|ios::binary);
-   if(!out)
-   { 
-      out.clear(); //flags ruecksetzen (ansonsten liefert utern if(!outfile) weiterhin true!!!
-      string path = UbSystem::getPathFromString(avsfilename);
-      if(path.size()>0){UbSystem::makeDirectory(path);out.open(avsfilename.c_str(),ios::out|ios::binary);}
-      if(!out) throw UbException(UB_EXARGS,"write_OutputFile-UCD File  "+avsfilename+" konnte nicht geschrieben werden");
-   }
-
-   char magic = (char)7;
-   int   idummy;
-   float fdummy;
-
-   int nofNodes = (int)nodes.size();
-   int nofCells = (int)cells.size();
-
-   int nofNodeData     = (int)nodedatanames.size();
-   int nofCellData     = (int)celldatanames.size();
-   int nofModelData    = 0;
-   int cellType        = 3; //=quad
-   int nofNodesPerCell = 4; 
-
-   out.write((char*)&magic,sizeof(char));      
-   out.write((char*)&nofNodes,sizeof(int));    
-   out.write((char*)&nofCells,sizeof(int));    
-   out.write((char*)&nofNodeData,sizeof(int)); 
-   out.write((char*)&nofCellData,sizeof(int)); 
-   out.write((char*)&nofModelData,sizeof(int));
-
-   idummy = (int)nofCells*nofNodesPerCell;
-   out.write((char*)&idummy,sizeof(int)); //(nof nodes) * (nodes per cell)
-   for(int c=0; c<nofCells; c++)
-   {
-      idummy=c+1;             out.write((char*)&idummy,sizeof(int)); //cell id
-      idummy=1;               out.write((char*)&idummy,sizeof(int)); //mat
-      idummy=nofNodesPerCell; out.write((char*)&idummy,sizeof(int)); //nodes per cell
-      idummy=cellType;        out.write((char*)&idummy,sizeof(int)); //cell type 
-   }
-   //knotennummern der einzelnen zellen
-   for(int c=0; c<nofCells; c++)
-   {
-      idummy = val<1>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-      idummy = val<2>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-      idummy = val<3>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-      idummy = val<4>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-   }
-
-   //coords
-   //x1-coords
-   for(int n=0; n<nofNodes; n++)
-      { fdummy = (float)( val<1>(nodes[n]) ); out.write((char*)&fdummy ,sizeof(float)); }
-   //x2-coords
-   for(int n=0; n<nofNodes; n++)
-      { fdummy = (float)( val<2>(nodes[n]) ); out.write((char*)&fdummy ,sizeof(float)); }
-   //x3-coords
-   for(int n=0; n<nofNodes; n++)
-      { fdummy = (float)( val<3>(nodes[n]) ); out.write((char*)&fdummy ,sizeof(float)); }
-   //out<<"\n";
-
-   //NODE DATA
-   char nodelabels[1024];
-   char nodeunits[1024];
-   strcpy(nodelabels, "");
-   strcpy(nodeunits, "");
-
-   for(int d=0; d<nofNodeData-1; ++d) { strcat(nodelabels, nodedatanames[d].c_str() ); strcat(nodelabels,"."); }
-   strcat(nodelabels, nodedatanames[nofNodeData-1].c_str()); 
-
-   for(int i=0;i<(nofNodeData-1);i++) strcat(nodeunits, "no_unit.");
-   strcat(nodeunits, "no_unit");
-
-   out.write((char*)&nodelabels,sizeof(nodelabels));
-   out.write((char*)&nodeunits,sizeof(nodeunits));
-
-   //nof and type of data
-   idummy = nofNodeData;
-   out.write((char*)&idummy,sizeof(int)); //Datentypen pro knoten (hier = nof_node_data, da NUR skalare)
-
-   idummy = 1;
-   for(int i=0;i<nofNodeData;i++) out.write((char*)&idummy,sizeof(int)); //jeder Datentyp ist ein skalarer Wert
-
-   //min and max of data
-   fdummy = 0.0;
-   for(int i=0;i<nofNodeData;i++) out.write((char*)&fdummy,sizeof(float)); //min Wert pro Datentyp
-   fdummy = 1.0;
-   for(int i=0;i<nofNodeData;i++) out.write((char*)&fdummy,sizeof(float)); //max Wert pro Datentyp
-
-   //daten ins file schreiben
-   for(int d=0; d<nofNodeData; ++d)
-      for(int n=0; n<(int)nodedata[d].size(); n++)
-      { fdummy=(float)nodedata[d][n]; out.write((char*)&fdummy,sizeof(float)); }
-
-   fdummy = 1.;
-   for(int i=0;i<nofNodeData;i++) out.write((char*)&fdummy,sizeof(float)); //max Wert pro Datentyp
-
-   //CELL DATA
-   char celllabels[1024];
-   char cellunits[1024];
-   strcpy(celllabels, "");
-   strcpy(cellunits, "");
-
-   for(int d=0; d<nofCellData-1; ++d) { strcat(celllabels, celldatanames[d].c_str() ); strcat(celllabels,"."); }
-   strcat(celllabels, celldatanames[nofCellData-1].c_str()); 
-
-   for(int d=0; d<nofCellData-1; ++d) strcat(cellunits, "no_unit.");
-   strcat(cellunits, "no_unit");
-
-   out.write((char*)&celllabels,sizeof(celllabels));
-   out.write((char*)&cellunits,sizeof(cellunits));
-
-   //nof and type of data
-   idummy = nofCellData;
-   out.write((char*)&idummy,sizeof(int)); //Datentypen pro knoten (hier = nof_node_data, da NUR skalare)
-
-   idummy = 1;
-   for(int i=0;i<nofCellData;i++) out.write((char*)&idummy,sizeof(int)); //jeder Datentyp ist ein skalarer Wert
-
-   //min and max of data
-   fdummy = 0.0;
-   for(int i=0;i<nofCellData;i++) out.write((char*)&fdummy,sizeof(float)); //min Wert pro Datentyp
-   fdummy = 1.0;
-   for(int i=0;i<nofCellData;i++) out.write((char*)&fdummy,sizeof(float)); //max Wert pro Datentyp
-
-   //daten ins file schreiben
-   for(int d=0; d<nofCellData; ++d)
-      for(int n=0; n<(int)celldata[d].size(); n++)
-      { fdummy=(float)celldata[d][n]; out.write((char*)&fdummy,sizeof(float)); }
-
-   fdummy = 1.;
-   for(int i=0;i<nofCellData;i++) out.write((char*)&fdummy,sizeof(float)); //max Wert pro Datentyp
-
-   out.close(); 
-   UBLOG(logDEBUG1,"WbWriterAvsASCII::writeQuadsWithNodeAndCellData to "<<avsfilename<<" - end");
-
-   return avsfilename;
+    string avsfilename = filename + getFileExtension();
+    UBLOG(logDEBUG1, "WbWriterAvsASCII::writeQuadsWithNodeAndCellData to " << avsfilename << " - start");
+
+    ofstream out(avsfilename.c_str(), ios::out | ios::binary);
+    if (!out) {
+        out.clear(); // flags ruecksetzen (ansonsten liefert utern if(!outfile) weiterhin true!!!
+        string path = UbSystem::getPathFromString(avsfilename);
+        if (path.size() > 0) {
+            UbSystem::makeDirectory(path);
+            out.open(avsfilename.c_str(), ios::out | ios::binary);
+        }
+        if (!out)
+            throw UbException(UB_EXARGS,
+                              "write_OutputFile-UCD File  " + avsfilename + " konnte nicht geschrieben werden");
+    }
+
+    char magic = (char)7;
+    int idummy;
+    float fdummy;
+
+    int nofNodes = (int)nodes.size();
+    int nofCells = (int)cells.size();
+
+    int nofNodeData     = (int)nodedatanames.size();
+    int nofCellData     = (int)celldatanames.size();
+    int nofModelData    = 0;
+    int cellType        = 3; //=quad
+    int nofNodesPerCell = 4;
+
+    out.write((char *)&magic, sizeof(char));
+    out.write((char *)&nofNodes, sizeof(int));
+    out.write((char *)&nofCells, sizeof(int));
+    out.write((char *)&nofNodeData, sizeof(int));
+    out.write((char *)&nofCellData, sizeof(int));
+    out.write((char *)&nofModelData, sizeof(int));
+
+    idummy = (int)nofCells * nofNodesPerCell;
+    out.write((char *)&idummy, sizeof(int)); //(nof nodes) * (nodes per cell)
+    for (int c = 0; c < nofCells; c++) {
+        idummy = c + 1;
+        out.write((char *)&idummy, sizeof(int)); // cell id
+        idummy = 1;
+        out.write((char *)&idummy, sizeof(int)); // mat
+        idummy = nofNodesPerCell;
+        out.write((char *)&idummy, sizeof(int)); // nodes per cell
+        idummy = cellType;
+        out.write((char *)&idummy, sizeof(int)); // cell type
+    }
+    // knotennummern der einzelnen zellen
+    for (int c = 0; c < nofCells; c++) {
+        idummy = val<1>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+        idummy = val<2>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+        idummy = val<3>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+        idummy = val<4>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+    }
+
+    // coords
+    // x1-coords
+    for (int n = 0; n < nofNodes; n++) {
+        fdummy = (float)(val<1>(nodes[n]));
+        out.write((char *)&fdummy, sizeof(float));
+    }
+    // x2-coords
+    for (int n = 0; n < nofNodes; n++) {
+        fdummy = (float)(val<2>(nodes[n]));
+        out.write((char *)&fdummy, sizeof(float));
+    }
+    // x3-coords
+    for (int n = 0; n < nofNodes; n++) {
+        fdummy = (float)(val<3>(nodes[n]));
+        out.write((char *)&fdummy, sizeof(float));
+    }
+    // out<<"\n";
+
+    // NODE DATA
+    char nodelabels[1024];
+    char nodeunits[1024];
+    strcpy(nodelabels, "");
+    strcpy(nodeunits, "");
+
+    for (int d = 0; d < nofNodeData - 1; ++d) {
+        strcat(nodelabels, nodedatanames[d].c_str());
+        strcat(nodelabels, ".");
+    }
+    strcat(nodelabels, nodedatanames[nofNodeData - 1].c_str());
+
+    for (int i = 0; i < (nofNodeData - 1); i++)
+        strcat(nodeunits, "no_unit.");
+    strcat(nodeunits, "no_unit");
+
+    out.write((char *)&nodelabels, sizeof(nodelabels));
+    out.write((char *)&nodeunits, sizeof(nodeunits));
+
+    // nof and type of data
+    idummy = nofNodeData;
+    out.write((char *)&idummy, sizeof(int)); // Datentypen pro knoten (hier = nof_node_data, da NUR skalare)
+
+    idummy = 1;
+    for (int i = 0; i < nofNodeData; i++)
+        out.write((char *)&idummy, sizeof(int)); // jeder Datentyp ist ein skalarer Wert
+
+    // min and max of data
+    fdummy = 0.0;
+    for (int i = 0; i < nofNodeData; i++)
+        out.write((char *)&fdummy, sizeof(float)); // min Wert pro Datentyp
+    fdummy = 1.0;
+    for (int i = 0; i < nofNodeData; i++)
+        out.write((char *)&fdummy, sizeof(float)); // max Wert pro Datentyp
+
+    // daten ins file schreiben
+    for (int d = 0; d < nofNodeData; ++d)
+        for (int n = 0; n < (int)nodedata[d].size(); n++) {
+            fdummy = (float)nodedata[d][n];
+            out.write((char *)&fdummy, sizeof(float));
+        }
+
+    fdummy = 1.;
+    for (int i = 0; i < nofNodeData; i++)
+        out.write((char *)&fdummy, sizeof(float)); // max Wert pro Datentyp
+
+    // CELL DATA
+    char celllabels[1024];
+    char cellunits[1024];
+    strcpy(celllabels, "");
+    strcpy(cellunits, "");
+
+    for (int d = 0; d < nofCellData - 1; ++d) {
+        strcat(celllabels, celldatanames[d].c_str());
+        strcat(celllabels, ".");
+    }
+    strcat(celllabels, celldatanames[nofCellData - 1].c_str());
+
+    for (int d = 0; d < nofCellData - 1; ++d)
+        strcat(cellunits, "no_unit.");
+    strcat(cellunits, "no_unit");
+
+    out.write((char *)&celllabels, sizeof(celllabels));
+    out.write((char *)&cellunits, sizeof(cellunits));
+
+    // nof and type of data
+    idummy = nofCellData;
+    out.write((char *)&idummy, sizeof(int)); // Datentypen pro knoten (hier = nof_node_data, da NUR skalare)
+
+    idummy = 1;
+    for (int i = 0; i < nofCellData; i++)
+        out.write((char *)&idummy, sizeof(int)); // jeder Datentyp ist ein skalarer Wert
+
+    // min and max of data
+    fdummy = 0.0;
+    for (int i = 0; i < nofCellData; i++)
+        out.write((char *)&fdummy, sizeof(float)); // min Wert pro Datentyp
+    fdummy = 1.0;
+    for (int i = 0; i < nofCellData; i++)
+        out.write((char *)&fdummy, sizeof(float)); // max Wert pro Datentyp
+
+    // daten ins file schreiben
+    for (int d = 0; d < nofCellData; ++d)
+        for (int n = 0; n < (int)celldata[d].size(); n++) {
+            fdummy = (float)celldata[d][n];
+            out.write((char *)&fdummy, sizeof(float));
+        }
+
+    fdummy = 1.;
+    for (int i = 0; i < nofCellData; i++)
+        out.write((char *)&fdummy, sizeof(float)); // max Wert pro Datentyp
+
+    out.close();
+    UBLOG(logDEBUG1, "WbWriterAvsASCII::writeQuadsWithNodeAndCellData to " << avsfilename << " - end");
+
+    return avsfilename;
 }
 /*===============================================================================*/
-std::string WbWriterAvsASCII::writeLines(const string& filename,vector<UbTupleFloat3 >& nodes, vector<UbTupleInt2 >& lines)
+std::string WbWriterAvsASCII::writeLines(const string &filename, vector<UbTupleFloat3> &nodes,
+                                         vector<UbTupleInt2> &lines)
 {
-   string avsfilename = filename+getFileExtension();
-   UBLOG(logDEBUG1,"WbWriterAvsASCII::writeLines to "<<avsfilename<<" - start");
-
-   ofstream out(avsfilename.c_str(),ios::out);
-   if(!out)
-   { 
-      out.clear(); //flags ruecksetzen (ansonsten liefert utern if(!outfile) weiterhin true!!!
-      string path = UbSystem::getPathFromString(avsfilename);
-      if(path.size()>0){UbSystem::makeDirectory(path);out.open(avsfilename.c_str(),ios::out);}
-      if(!out) throw UbException(UB_EXARGS,avsfilename+" konnte nicht geschrieben werden");
-   }
-
-   int nofNodes = (int)nodes.size(); 
-   int nofLines = (int)lines.size(); 
-   
-   out<<"# UCD-File created by WbWriterAvsASCII\n";
-   out<<nofNodes<<" "<<nofLines<<" 0 0 0 "<<endl;
-
-   for(int n=0; n<nofNodes; n++)
-      out<<n+1<<" "<< val<1>(nodes[n]) <<" "<< val<2>(nodes[n]) <<" "<< val<3>(nodes[n])<<" \n";
-
-   for(int l=0; l<nofLines; l++)
-       out<<l+1<<" 2 line "<< val<1>(lines[l])+1 <<" "<< val<2>(lines[l])+1 <<" "<<endl;
-
-   out.close();
-   UBLOG(logDEBUG1,"WbWriterAvsASCII::writeLines to "<<avsfilename<<" - end");
-
-   return avsfilename;
+    string avsfilename = filename + getFileExtension();
+    UBLOG(logDEBUG1, "WbWriterAvsASCII::writeLines to " << avsfilename << " - start");
+
+    ofstream out(avsfilename.c_str(), ios::out);
+    if (!out) {
+        out.clear(); // flags ruecksetzen (ansonsten liefert utern if(!outfile) weiterhin true!!!
+        string path = UbSystem::getPathFromString(avsfilename);
+        if (path.size() > 0) {
+            UbSystem::makeDirectory(path);
+            out.open(avsfilename.c_str(), ios::out);
+        }
+        if (!out)
+            throw UbException(UB_EXARGS, avsfilename + " konnte nicht geschrieben werden");
+    }
+
+    int nofNodes = (int)nodes.size();
+    int nofLines = (int)lines.size();
+
+    out << "# UCD-File created by WbWriterAvsASCII\n";
+    out << nofNodes << " " << nofLines << " 0 0 0 " << endl;
+
+    for (int n = 0; n < nofNodes; n++)
+        out << n + 1 << " " << val<1>(nodes[n]) << " " << val<2>(nodes[n]) << " " << val<3>(nodes[n]) << " \n";
+
+    for (int l = 0; l < nofLines; l++)
+        out << l + 1 << " 2 line " << val<1>(lines[l]) + 1 << " " << val<2>(lines[l]) + 1 << " " << endl;
+
+    out.close();
+    UBLOG(logDEBUG1, "WbWriterAvsASCII::writeLines to " << avsfilename << " - end");
+
+    return avsfilename;
 }
 /*===============================================================================*/
-std::string WbWriterAvsASCII::writeTriangles(const string& filename,vector<UbTupleFloat3 >& nodes, vector<UbTupleInt3 >& triangles)
+std::string WbWriterAvsASCII::writeTriangles(const string &filename, vector<UbTupleFloat3> &nodes,
+                                             vector<UbTupleInt3> &triangles)
 {
-   string avsfilename = filename+getFileExtension();
-   UBLOG(logDEBUG1,"WbWriterAvsASCII::writeTriangles to "<<avsfilename<<" - start");
-
-   ofstream out(avsfilename.c_str(),ios::out);
-   if(!out)
-   { 
-      out.clear(); //flags ruecksetzen (ansonsten liefert utern if(!outfile) weiterhin true!!!
-      string path = UbSystem::getPathFromString(avsfilename);
-      if(path.size()>0){UbSystem::makeDirectory(path);out.open(avsfilename.c_str(),ios::out);}
-      if(!out) throw UbException(UB_EXARGS,"file konnte nicht geschrieben werden "+avsfilename);
-   }
+    string avsfilename = filename + getFileExtension();
+    UBLOG(logDEBUG1, "WbWriterAvsASCII::writeTriangles to " << avsfilename << " - start");
+
+    ofstream out(avsfilename.c_str(), ios::out);
+    if (!out) {
+        out.clear(); // flags ruecksetzen (ansonsten liefert utern if(!outfile) weiterhin true!!!
+        string path = UbSystem::getPathFromString(avsfilename);
+        if (path.size() > 0) {
+            UbSystem::makeDirectory(path);
+            out.open(avsfilename.c_str(), ios::out);
+        }
+        if (!out)
+            throw UbException(UB_EXARGS, "file konnte nicht geschrieben werden " + avsfilename);
+    }
 
-   int nofNodes = (int)nodes.size(); 
-   int nofTrian = (int)triangles.size(); 
+    int nofNodes = (int)nodes.size();
+    int nofTrian = (int)triangles.size();
 
-   out<<"# UCD-File created by WbWriterAvsASCII\n";
-   out<<nofNodes<<" "<<nofTrian<<" 0 0 0 "<<endl;
+    out << "# UCD-File created by WbWriterAvsASCII\n";
+    out << nofNodes << " " << nofTrian << " 0 0 0 " << endl;
 
-   for(int n=0; n<nofNodes; n++)
-   out<<n+1<<" "<< val<1>(nodes[n]) <<" "<< val<2>(nodes[n]) <<" "<< val<3>(nodes[n])<<" \n";
+    for (int n = 0; n < nofNodes; n++)
+        out << n + 1 << " " << val<1>(nodes[n]) << " " << val<2>(nodes[n]) << " " << val<3>(nodes[n]) << " \n";
 
-   for(int l=0; l<nofTrian; l++)
-   out<<l+1<<" 2 tri "<< val<1>(triangles[l])+1 <<" "<< val<2>(triangles[l])+1 <<" "<< val<3>(triangles[l])+1 <<" "<<endl;
+    for (int l = 0; l < nofTrian; l++)
+        out << l + 1 << " 2 tri " << val<1>(triangles[l]) + 1 << " " << val<2>(triangles[l]) + 1 << " "
+            << val<3>(triangles[l]) + 1 << " " << endl;
 
-   out.close();
-   UBLOG(logDEBUG1,"WbWriterAvsASCII::writeTriangles to "<<avsfilename<<" - end");
+    out.close();
+    UBLOG(logDEBUG1, "WbWriterAvsASCII::writeTriangles to " << avsfilename << " - end");
 
-   return avsfilename;
+    return avsfilename;
 }
 /*===============================================================================*/
-std::string WbWriterAvsASCII::writeTrianglesWithNodeData(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt3 >& cells, std::vector< std::string >& datanames, std::vector< std::vector< double > >& nodedata)
+std::string WbWriterAvsASCII::writeTrianglesWithNodeData(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                                                         std::vector<UbTupleInt3> &cells,
+                                                         std::vector<std::string> &datanames,
+                                                         std::vector<std::vector<double>> &nodedata)
 {
-   string avsfilename = filename+getFileExtension();
-   UBLOG(logDEBUG1,"WbWriterAvsASCII::writeTrianglesWithNodeData to "<<avsfilename<<" - end");
-
-   ofstream out(avsfilename.c_str(),ios::out|ios::binary);
-   if(!out)
-   { 
-      out.clear(); //flags ruecksetzen (ansonsten liefert utern if(!outfile) weiterhin true!!!
-      string path = UbSystem::getPathFromString(avsfilename);
-      if(path.size()>0){UbSystem::makeDirectory(path);out.open(avsfilename.c_str(),ios::out|ios::binary);}
-      if(!out) throw UbException(UB_EXARGS,"write_OutputFile-UCD File "+avsfilename+" konnte nicht geschrieben werden");
-   }
-   char magic = (char)7;
-   int   idummy;
-   float fdummy;
-
-   int nofNodes = (int)nodes.size();
-   int nofCells = (int)cells.size();
-
-   int nofNodeData     = (int)datanames.size();
-   int nofCellData     = 0;
-   int nofModelData    = 0;
-   int cellType        = 2; //triangle
-   int nofNodesPerCell = 3; 
-
-   out.write((char*)&magic,sizeof(char));      
-   out.write((char*)&nofNodes,sizeof(int));    
-   out.write((char*)&nofCells,sizeof(int));    
-   out.write((char*)&nofNodeData,sizeof(int)); 
-   out.write((char*)&nofCellData,sizeof(int)); 
-   out.write((char*)&nofModelData,sizeof(int));
-
-   idummy = (int)nofCells*nofNodesPerCell;
-   out.write((char*)&idummy,sizeof(int)); //(nof nodes) * (nodes per cell)
-   for(int c=0; c<nofCells; c++)
-   {
-      idummy=c+1;             out.write((char*)&idummy,sizeof(int)); //cell id
-      idummy=1;               out.write((char*)&idummy,sizeof(int)); //mat
-      idummy=nofNodesPerCell; out.write((char*)&idummy,sizeof(int)); //nodes per cell
-      idummy=cellType;        out.write((char*)&idummy,sizeof(int)); //cell type 
-   }
-   //knotennummern der einzelnen zellen
-   for(int c=0; c<nofCells; c++)
-   {
-      idummy = val<1>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-      idummy = val<2>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-      idummy = val<3>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-   }
-
-   //coords
-   //x1-coords
-   for(int n=0; n<nofNodes; n++)
-   { fdummy = (float)( val<1>(nodes[n]) ); out.write((char*)&fdummy ,sizeof(float)); }
-   //x2-coords
-   for(int n=0; n<nofNodes; n++)
-   { fdummy = (float)( val<2>(nodes[n]) ); out.write((char*)&fdummy ,sizeof(float)); }
-   //x3-coords
-   for(int n=0; n<nofNodes; n++)
-   { fdummy = (float)( val<3>(nodes[n]) ); out.write((char*)&fdummy ,sizeof(float)); }
-   //out<<"\n";
-
-   //NODE DATA
-   char labels[1024];
-   char units[1024];
-   strcpy(labels, "");
-   strcpy(units, "");
-
-   for(int d=0; d<nofNodeData-1; ++d) 
-   { strcat(labels, datanames[d].c_str() ); strcat(labels,"."); }
-   strcat(labels, datanames[nofNodeData-1].c_str()); 
-
-   for(int i=0;i<(nofNodeData-1);i++) strcat(units, "no_unit.");
-   strcat(units, "no_unit");
-
-   out.write((char*)&labels,sizeof(labels));
-   out.write((char*)&units,sizeof(units));
-
-   //nof and type of data
-   idummy = nofNodeData;
-   out.write((char*)&idummy,sizeof(int)); //Datentypen pro knoten (hier = nof_node_data, da NUR skalare)
-
-   idummy = 1;
-   for(int i=0;i<nofNodeData;i++) out.write((char*)&idummy,sizeof(int)); //jeder Datentyp ist ein skalarer Wert
-
-   //min and max of data
-   fdummy = 0.0;
-   for(int i=0;i<nofNodeData;i++) out.write((char*)&fdummy,sizeof(float)); //min Wert pro Datentyp
-   fdummy = 1.0;
-   for(int i=0;i<nofNodeData;i++) out.write((char*)&fdummy,sizeof(float)); //max Wert pro Datentyp
-
-   //daten ins file schreiben
-   for(int d=0; d<nofNodeData; ++d){
-      for(int n=0; n<(int)nodedata[d].size(); n++)
-      { 
-         fdummy=(float)nodedata[d][n];
-         out.write((char*)&fdummy,sizeof(float));
-      }
-   }
-
-      fdummy = 1.;
-      for(int i=0;i<nofNodeData;i++) 
-         out.write((char*)&fdummy,sizeof(float)); //max Wert pro Datentyp
-
-   out.close(); 
-   UBLOG(logDEBUG1,"WbWriterAvsASCII::writeTrianglesWithNodeData to "<<avsfilename<<" - end");
-
-   return avsfilename;
+    string avsfilename = filename + getFileExtension();
+    UBLOG(logDEBUG1, "WbWriterAvsASCII::writeTrianglesWithNodeData to " << avsfilename << " - end");
+
+    ofstream out(avsfilename.c_str(), ios::out | ios::binary);
+    if (!out) {
+        out.clear(); // flags ruecksetzen (ansonsten liefert utern if(!outfile) weiterhin true!!!
+        string path = UbSystem::getPathFromString(avsfilename);
+        if (path.size() > 0) {
+            UbSystem::makeDirectory(path);
+            out.open(avsfilename.c_str(), ios::out | ios::binary);
+        }
+        if (!out)
+            throw UbException(UB_EXARGS,
+                              "write_OutputFile-UCD File " + avsfilename + " konnte nicht geschrieben werden");
+    }
+    char magic = (char)7;
+    int idummy;
+    float fdummy;
+
+    int nofNodes = (int)nodes.size();
+    int nofCells = (int)cells.size();
+
+    int nofNodeData     = (int)datanames.size();
+    int nofCellData     = 0;
+    int nofModelData    = 0;
+    int cellType        = 2; // triangle
+    int nofNodesPerCell = 3;
+
+    out.write((char *)&magic, sizeof(char));
+    out.write((char *)&nofNodes, sizeof(int));
+    out.write((char *)&nofCells, sizeof(int));
+    out.write((char *)&nofNodeData, sizeof(int));
+    out.write((char *)&nofCellData, sizeof(int));
+    out.write((char *)&nofModelData, sizeof(int));
+
+    idummy = (int)nofCells * nofNodesPerCell;
+    out.write((char *)&idummy, sizeof(int)); //(nof nodes) * (nodes per cell)
+    for (int c = 0; c < nofCells; c++) {
+        idummy = c + 1;
+        out.write((char *)&idummy, sizeof(int)); // cell id
+        idummy = 1;
+        out.write((char *)&idummy, sizeof(int)); // mat
+        idummy = nofNodesPerCell;
+        out.write((char *)&idummy, sizeof(int)); // nodes per cell
+        idummy = cellType;
+        out.write((char *)&idummy, sizeof(int)); // cell type
+    }
+    // knotennummern der einzelnen zellen
+    for (int c = 0; c < nofCells; c++) {
+        idummy = val<1>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+        idummy = val<2>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+        idummy = val<3>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+    }
+
+    // coords
+    // x1-coords
+    for (int n = 0; n < nofNodes; n++) {
+        fdummy = (float)(val<1>(nodes[n]));
+        out.write((char *)&fdummy, sizeof(float));
+    }
+    // x2-coords
+    for (int n = 0; n < nofNodes; n++) {
+        fdummy = (float)(val<2>(nodes[n]));
+        out.write((char *)&fdummy, sizeof(float));
+    }
+    // x3-coords
+    for (int n = 0; n < nofNodes; n++) {
+        fdummy = (float)(val<3>(nodes[n]));
+        out.write((char *)&fdummy, sizeof(float));
+    }
+    // out<<"\n";
+
+    // NODE DATA
+    char labels[1024];
+    char units[1024];
+    strcpy(labels, "");
+    strcpy(units, "");
+
+    for (int d = 0; d < nofNodeData - 1; ++d) {
+        strcat(labels, datanames[d].c_str());
+        strcat(labels, ".");
+    }
+    strcat(labels, datanames[nofNodeData - 1].c_str());
+
+    for (int i = 0; i < (nofNodeData - 1); i++)
+        strcat(units, "no_unit.");
+    strcat(units, "no_unit");
+
+    out.write((char *)&labels, sizeof(labels));
+    out.write((char *)&units, sizeof(units));
+
+    // nof and type of data
+    idummy = nofNodeData;
+    out.write((char *)&idummy, sizeof(int)); // Datentypen pro knoten (hier = nof_node_data, da NUR skalare)
+
+    idummy = 1;
+    for (int i = 0; i < nofNodeData; i++)
+        out.write((char *)&idummy, sizeof(int)); // jeder Datentyp ist ein skalarer Wert
+
+    // min and max of data
+    fdummy = 0.0;
+    for (int i = 0; i < nofNodeData; i++)
+        out.write((char *)&fdummy, sizeof(float)); // min Wert pro Datentyp
+    fdummy = 1.0;
+    for (int i = 0; i < nofNodeData; i++)
+        out.write((char *)&fdummy, sizeof(float)); // max Wert pro Datentyp
+
+    // daten ins file schreiben
+    for (int d = 0; d < nofNodeData; ++d) {
+        for (int n = 0; n < (int)nodedata[d].size(); n++) {
+            fdummy = (float)nodedata[d][n];
+            out.write((char *)&fdummy, sizeof(float));
+        }
+    }
+
+    fdummy = 1.;
+    for (int i = 0; i < nofNodeData; i++)
+        out.write((char *)&fdummy, sizeof(float)); // max Wert pro Datentyp
+
+    out.close();
+    UBLOG(logDEBUG1, "WbWriterAvsASCII::writeTrianglesWithNodeData to " << avsfilename << " - end");
+
+    return avsfilename;
 }
 /*===============================================================================*/
-std::string WbWriterAvsASCII::writeOctsWithCellData(const string& filename,vector<UbTupleFloat3 >& nodes, vector<UbTupleInt8 >& cells, vector<string >& datanames, vector<vector<double > >& celldata)
+std::string WbWriterAvsASCII::writeOctsWithCellData(const string &filename, vector<UbTupleFloat3> &nodes,
+                                                    vector<UbTupleInt8> &cells, vector<string> &datanames,
+                                                    vector<vector<double>> &celldata)
 {
-    string avsfilename = filename+getFileExtension();
-    UBLOG(logDEBUG1,"WbWriterAvsASCII::writeOctsWithCellData to "<<avsfilename<<" - start");
-
-    ofstream out(avsfilename.c_str(),ios::out|ios::binary);
-    if(!out)
-    { 
-       out.clear(); //flags ruecksetzen (ansonsten liefert utern if(!outfile) weiterhin true!!!
-       string path = UbSystem::getPathFromString(avsfilename);
-       if(path.size()>0){UbSystem::makeDirectory(path);out.open(avsfilename.c_str(),ios::out|ios::binary);}
-       if(!out) throw UbException(UB_EXARGS,"file konnte nicht geschrieben werden "+avsfilename);
+    string avsfilename = filename + getFileExtension();
+    UBLOG(logDEBUG1, "WbWriterAvsASCII::writeOctsWithCellData to " << avsfilename << " - start");
+
+    ofstream out(avsfilename.c_str(), ios::out | ios::binary);
+    if (!out) {
+        out.clear(); // flags ruecksetzen (ansonsten liefert utern if(!outfile) weiterhin true!!!
+        string path = UbSystem::getPathFromString(avsfilename);
+        if (path.size() > 0) {
+            UbSystem::makeDirectory(path);
+            out.open(avsfilename.c_str(), ios::out | ios::binary);
+        }
+        if (!out)
+            throw UbException(UB_EXARGS, "file konnte nicht geschrieben werden " + avsfilename);
     }
 
     char magic = (char)7;
-    int   idummy;
+    int idummy;
     float fdummy;
 
     int nofNodes = (int)nodes.size();
@@ -703,110 +869,143 @@ std::string WbWriterAvsASCII::writeOctsWithCellData(const string& filename,vecto
     int nofCellData     = (int)datanames.size();
     int nofModelData    = 0;
     int cellType        = 7; //=hex
-    int nofNodesPerCell = 8; 
-
-    out.write((char*)&magic,sizeof(char));      
-    out.write((char*)&nofNodes,sizeof(int));    
-    out.write((char*)&nofCells,sizeof(int));    
-    out.write((char*)&nofNodeData,sizeof(int)); 
-    out.write((char*)&nofCellData,sizeof(int)); 
-    out.write((char*)&nofModelData,sizeof(int));
-
-    idummy = (int)nofCells*nofNodesPerCell;
-    out.write((char*)&idummy,sizeof(int)); //(nof nodes) * (nodes per cell)
-    for(int c=0; c<nofCells; c++)
-    {
-       idummy=c+1;             out.write((char*)&idummy,sizeof(int)); //cell id
-       idummy=1;               out.write((char*)&idummy,sizeof(int)); //mat
-       idummy=nofNodesPerCell; out.write((char*)&idummy,sizeof(int)); //nodes per cell
-       idummy=cellType;        out.write((char*)&idummy,sizeof(int)); //cell type 
-    }
-    //knotennummern der einzelnen zellen
-    for(int c=0; c<nofCells; c++)
-    {
-       idummy = val<1>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-       idummy = val<2>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-       idummy = val<3>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-       idummy = val<4>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-       idummy = val<5>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-       idummy = val<6>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-       idummy = val<7>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-       idummy = val<8>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-    }
-
-    //coords
-    //x1-coords
-    for(int n=0; n<nofNodes; n++)
-      { fdummy = (float)( val<1>(nodes[n]) ); out.write((char*)&fdummy ,sizeof(float)); }
-    //x2-coords
-    for(int n=0; n<nofNodes; n++)
-      { fdummy = (float)( val<2>(nodes[n]) ); out.write((char*)&fdummy ,sizeof(float)); }
-    //x3-coords
-    for(int n=0; n<nofNodes; n++)
-      { fdummy = (float)( val<3>(nodes[n]) ); out.write((char*)&fdummy ,sizeof(float)); }
-    //out<<"\n";
-
-    //CELL DATA
+    int nofNodesPerCell = 8;
+
+    out.write((char *)&magic, sizeof(char));
+    out.write((char *)&nofNodes, sizeof(int));
+    out.write((char *)&nofCells, sizeof(int));
+    out.write((char *)&nofNodeData, sizeof(int));
+    out.write((char *)&nofCellData, sizeof(int));
+    out.write((char *)&nofModelData, sizeof(int));
+
+    idummy = (int)nofCells * nofNodesPerCell;
+    out.write((char *)&idummy, sizeof(int)); //(nof nodes) * (nodes per cell)
+    for (int c = 0; c < nofCells; c++) {
+        idummy = c + 1;
+        out.write((char *)&idummy, sizeof(int)); // cell id
+        idummy = 1;
+        out.write((char *)&idummy, sizeof(int)); // mat
+        idummy = nofNodesPerCell;
+        out.write((char *)&idummy, sizeof(int)); // nodes per cell
+        idummy = cellType;
+        out.write((char *)&idummy, sizeof(int)); // cell type
+    }
+    // knotennummern der einzelnen zellen
+    for (int c = 0; c < nofCells; c++) {
+        idummy = val<1>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+        idummy = val<2>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+        idummy = val<3>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+        idummy = val<4>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+        idummy = val<5>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+        idummy = val<6>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+        idummy = val<7>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+        idummy = val<8>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+    }
+
+    // coords
+    // x1-coords
+    for (int n = 0; n < nofNodes; n++) {
+        fdummy = (float)(val<1>(nodes[n]));
+        out.write((char *)&fdummy, sizeof(float));
+    }
+    // x2-coords
+    for (int n = 0; n < nofNodes; n++) {
+        fdummy = (float)(val<2>(nodes[n]));
+        out.write((char *)&fdummy, sizeof(float));
+    }
+    // x3-coords
+    for (int n = 0; n < nofNodes; n++) {
+        fdummy = (float)(val<3>(nodes[n]));
+        out.write((char *)&fdummy, sizeof(float));
+    }
+    // out<<"\n";
+
+    // CELL DATA
     char labels[1024];
     char units[1024];
     strcpy(labels, "");
     strcpy(units, "");
 
-    for(int d=0; d<nofCellData-1; ++d) { strcat(labels, datanames[d].c_str() ); strcat(labels,"."); }
-    strcat(labels, datanames[nofCellData-1].c_str()); 
+    for (int d = 0; d < nofCellData - 1; ++d) {
+        strcat(labels, datanames[d].c_str());
+        strcat(labels, ".");
+    }
+    strcat(labels, datanames[nofCellData - 1].c_str());
 
-    for(int d=0; d<nofCellData-1; ++d) strcat(units, "no_unit.");
+    for (int d = 0; d < nofCellData - 1; ++d)
+        strcat(units, "no_unit.");
     strcat(units, "no_unit");
 
-    out.write((char*)&labels,sizeof(labels));
-    out.write((char*)&units,sizeof(units));
+    out.write((char *)&labels, sizeof(labels));
+    out.write((char *)&units, sizeof(units));
 
-    //nof and type of data
+    // nof and type of data
     idummy = nofCellData;
-    out.write((char*)&idummy,sizeof(int)); //Datentypen pro knoten (hier = nof_node_data, da NUR skalare)
+    out.write((char *)&idummy, sizeof(int)); // Datentypen pro knoten (hier = nof_node_data, da NUR skalare)
 
     idummy = 1;
-    for(int i=0;i<nofCellData;i++) out.write((char*)&idummy,sizeof(int)); //jeder Datentyp ist ein skalarer Wert
+    for (int i = 0; i < nofCellData; i++)
+        out.write((char *)&idummy, sizeof(int)); // jeder Datentyp ist ein skalarer Wert
 
-    //min and max of data
+    // min and max of data
     fdummy = 0.0;
-    for(int i=0;i<nofCellData;i++) out.write((char*)&fdummy,sizeof(float)); //min Wert pro Datentyp
+    for (int i = 0; i < nofCellData; i++)
+        out.write((char *)&fdummy, sizeof(float)); // min Wert pro Datentyp
     fdummy = 1.0;
-    for(int i=0;i<nofCellData;i++) out.write((char*)&fdummy,sizeof(float)); //max Wert pro Datentyp
+    for (int i = 0; i < nofCellData; i++)
+        out.write((char *)&fdummy, sizeof(float)); // max Wert pro Datentyp
 
-    //daten ins file schreiben
-    for(int d=0; d<nofCellData; ++d)
-    for(int n=0; n<(int)celldata[d].size(); n++)
-    { fdummy=(float)celldata[d][n]; out.write((char*)&fdummy,sizeof(float)); }
+    // daten ins file schreiben
+    for (int d = 0; d < nofCellData; ++d)
+        for (int n = 0; n < (int)celldata[d].size(); n++) {
+            fdummy = (float)celldata[d][n];
+            out.write((char *)&fdummy, sizeof(float));
+        }
 
     fdummy = 1.;
-    for(int i=0;i<nofCellData;i++) out.write((char*)&fdummy,sizeof(float)); //max Wert pro Datentyp
+    for (int i = 0; i < nofCellData; i++)
+        out.write((char *)&fdummy, sizeof(float)); // max Wert pro Datentyp
 
-    out.close(); 
-    UBLOG(logDEBUG1,"WbWriterAvsASCII::writeOctsWithCellData to "<<avsfilename<<" - end");
+    out.close();
+    UBLOG(logDEBUG1, "WbWriterAvsASCII::writeOctsWithCellData to " << avsfilename << " - end");
 
     return avsfilename;
- }
+}
 /*===============================================================================*/
-std::string WbWriterAvsASCII::writeOctsWithNodeData(const string& filename,vector<UbTupleFloat3 >& nodes, vector<UbTupleUInt8 >& cells, vector<string >& datanames, vector<vector<double > >& nodedata)
+std::string WbWriterAvsASCII::writeOctsWithNodeData(const string &filename, vector<UbTupleFloat3> &nodes,
+                                                    vector<UbTupleUInt8> &cells, vector<string> &datanames,
+                                                    vector<vector<double>> &nodedata)
 {
-    string avsfilename = filename+getFileExtension();
-    UBLOG(logDEBUG1,"WbWriterAvsASCII::writeOctsWithNodeData to "<<avsfilename<<" - start");
-
-    ofstream out(avsfilename.c_str(),ios::out|ios::binary);
-    if(!out)
-    { 
-       out.clear(); //flags ruecksetzen (ansonsten liefert utern if(!outfile) weiterhin true!!!
-       string path = UbSystem::getPathFromString(avsfilename);
-       if(path.size()>0){UbSystem::makeDirectory(path);out.open(avsfilename.c_str(),ios::out|ios::binary);}
-       if(!out) throw UbException(UB_EXARGS,"file konnte nicht geschrieben werden "+avsfilename);
+    string avsfilename = filename + getFileExtension();
+    UBLOG(logDEBUG1, "WbWriterAvsASCII::writeOctsWithNodeData to " << avsfilename << " - start");
+
+    ofstream out(avsfilename.c_str(), ios::out | ios::binary);
+    if (!out) {
+        out.clear(); // flags ruecksetzen (ansonsten liefert utern if(!outfile) weiterhin true!!!
+        string path = UbSystem::getPathFromString(avsfilename);
+        if (path.size() > 0) {
+            UbSystem::makeDirectory(path);
+            out.open(avsfilename.c_str(), ios::out | ios::binary);
+        }
+        if (!out)
+            throw UbException(UB_EXARGS, "file konnte nicht geschrieben werden " + avsfilename);
     }
 
-    if((int)nodedata.size()==0) throw UbException(UB_EXARGS,"no nodedata!!!");
-    if(nodes.size()!=nodedata[0].size()) throw UbException(UB_EXARGS,"nodedata != nofNodes!!!");
+    if ((int)nodedata.size() == 0)
+        throw UbException(UB_EXARGS, "no nodedata!!!");
+    if (nodes.size() != nodedata[0].size())
+        throw UbException(UB_EXARGS, "nodedata != nofNodes!!!");
 
     char magic = (char)7;
-    int   idummy;
+    int idummy;
     float fdummy;
 
     int nofNodes = (int)nodes.size();
@@ -816,87 +1015,112 @@ std::string WbWriterAvsASCII::writeOctsWithNodeData(const string& filename,vecto
     int nofCellData     = 0;
     int nofModelData    = 0;
     int cellType        = 7; //=hex
-    int nofNodesPerCell = 8; 
-
-    out.write((char*)&magic,sizeof(char));      
-    out.write((char*)&nofNodes,sizeof(int));    
-    out.write((char*)&nofCells,sizeof(int));    
-    out.write((char*)&nofNodeData,sizeof(int)); 
-    out.write((char*)&nofCellData,sizeof(int)); 
-    out.write((char*)&nofModelData,sizeof(int));
-
-    idummy = (int)nofCells*nofNodesPerCell;
-    out.write((char*)&idummy,sizeof(int)); //(nof nodes) * (nodes per cell)
-    for(int c=0; c<nofCells; c++)
-    {
-       idummy=c+1;             out.write((char*)&idummy,sizeof(int)); //cell id
-       idummy=1;               out.write((char*)&idummy,sizeof(int)); //mat
-       idummy=nofNodesPerCell; out.write((char*)&idummy,sizeof(int)); //nodes per cell
-       idummy=cellType;        out.write((char*)&idummy,sizeof(int)); //cell type 
-    }
-    //knotennummern der einzelnen zellen
-    for(int c=0; c<nofCells; c++)
-    {
-       idummy = val<1>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-       idummy = val<2>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-       idummy = val<3>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-       idummy = val<4>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-       idummy = val<5>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-       idummy = val<6>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-       idummy = val<7>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-       idummy = val<8>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-    }
-
-    //coords
-    //x1-coords
-    for(int n=0; n<nofNodes; n++)
-      { fdummy = (float)( val<1>(nodes[n]) ); out.write((char*)&fdummy ,sizeof(float)); }
-    //x2-coords
-    for(int n=0; n<nofNodes; n++)
-       { fdummy = (float)( val<2>(nodes[n]) ); out.write((char*)&fdummy ,sizeof(float)); }
-    //x3-coords
-    for(int n=0; n<nofNodes; n++)
-       { fdummy = (float)( val<3>(nodes[n]) ); out.write((char*)&fdummy ,sizeof(float)); }
-
-    //NODE DATA
+    int nofNodesPerCell = 8;
+
+    out.write((char *)&magic, sizeof(char));
+    out.write((char *)&nofNodes, sizeof(int));
+    out.write((char *)&nofCells, sizeof(int));
+    out.write((char *)&nofNodeData, sizeof(int));
+    out.write((char *)&nofCellData, sizeof(int));
+    out.write((char *)&nofModelData, sizeof(int));
+
+    idummy = (int)nofCells * nofNodesPerCell;
+    out.write((char *)&idummy, sizeof(int)); //(nof nodes) * (nodes per cell)
+    for (int c = 0; c < nofCells; c++) {
+        idummy = c + 1;
+        out.write((char *)&idummy, sizeof(int)); // cell id
+        idummy = 1;
+        out.write((char *)&idummy, sizeof(int)); // mat
+        idummy = nofNodesPerCell;
+        out.write((char *)&idummy, sizeof(int)); // nodes per cell
+        idummy = cellType;
+        out.write((char *)&idummy, sizeof(int)); // cell type
+    }
+    // knotennummern der einzelnen zellen
+    for (int c = 0; c < nofCells; c++) {
+        idummy = val<1>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+        idummy = val<2>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+        idummy = val<3>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+        idummy = val<4>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+        idummy = val<5>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+        idummy = val<6>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+        idummy = val<7>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+        idummy = val<8>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+    }
+
+    // coords
+    // x1-coords
+    for (int n = 0; n < nofNodes; n++) {
+        fdummy = (float)(val<1>(nodes[n]));
+        out.write((char *)&fdummy, sizeof(float));
+    }
+    // x2-coords
+    for (int n = 0; n < nofNodes; n++) {
+        fdummy = (float)(val<2>(nodes[n]));
+        out.write((char *)&fdummy, sizeof(float));
+    }
+    // x3-coords
+    for (int n = 0; n < nofNodes; n++) {
+        fdummy = (float)(val<3>(nodes[n]));
+        out.write((char *)&fdummy, sizeof(float));
+    }
+
+    // NODE DATA
     char labels[1024];
     char units[1024];
     strcpy(labels, "");
     strcpy(units, "");
 
-    for(int d=0; d<nofNodeData-1; ++d) 
-    { strcat(labels, datanames[d].c_str() ); strcat(labels,"."); }
-    strcat(labels, datanames[nofNodeData-1].c_str()); 
+    for (int d = 0; d < nofNodeData - 1; ++d) {
+        strcat(labels, datanames[d].c_str());
+        strcat(labels, ".");
+    }
+    strcat(labels, datanames[nofNodeData - 1].c_str());
 
-    for(int i=0;i<(nofNodeData-1);i++) strcat(units, "no_unit.");
+    for (int i = 0; i < (nofNodeData - 1); i++)
+        strcat(units, "no_unit.");
     strcat(units, "no_unit");
 
-    out.write((char*)&labels,sizeof(labels));
-    out.write((char*)&units,sizeof(units));
+    out.write((char *)&labels, sizeof(labels));
+    out.write((char *)&units, sizeof(units));
 
-    //nof and type of data
+    // nof and type of data
     idummy = nofNodeData;
-    out.write((char*)&idummy,sizeof(int)); //Datentypen pro knoten (hier = nof_node_data, da NUR skalare)
+    out.write((char *)&idummy, sizeof(int)); // Datentypen pro knoten (hier = nof_node_data, da NUR skalare)
 
     idummy = 1;
-    for(int i=0;i<nofNodeData;i++) out.write((char*)&idummy,sizeof(int)); //jeder Datentyp ist ein skalarer Wert
+    for (int i = 0; i < nofNodeData; i++)
+        out.write((char *)&idummy, sizeof(int)); // jeder Datentyp ist ein skalarer Wert
 
-    //min and max of data
+    // min and max of data
     fdummy = 0.0;
-    for(int i=0;i<nofNodeData;i++) out.write((char*)&fdummy,sizeof(float)); //min Wert pro Datentyp
+    for (int i = 0; i < nofNodeData; i++)
+        out.write((char *)&fdummy, sizeof(float)); // min Wert pro Datentyp
     fdummy = 1.0;
-    for(int i=0;i<nofNodeData;i++) out.write((char*)&fdummy,sizeof(float)); //max Wert pro Datentyp
+    for (int i = 0; i < nofNodeData; i++)
+        out.write((char *)&fdummy, sizeof(float)); // max Wert pro Datentyp
 
-    //daten ins file schreiben
-    for(int d=0; d<nofNodeData; ++d)
-       for(int n=0; n<(int)nodedata[d].size(); n++)
-       { fdummy=(float)nodedata[d][n]; out.write((char*)&fdummy,sizeof(float)); }
+    // daten ins file schreiben
+    for (int d = 0; d < nofNodeData; ++d)
+        for (int n = 0; n < (int)nodedata[d].size(); n++) {
+            fdummy = (float)nodedata[d][n];
+            out.write((char *)&fdummy, sizeof(float));
+        }
 
     fdummy = 1.;
-    for(int i=0;i<nofNodeData;i++) out.write((char*)&fdummy,sizeof(float)); //max Wert pro Datentyp
+    for (int i = 0; i < nofNodeData; i++)
+        out.write((char *)&fdummy, sizeof(float)); // max Wert pro Datentyp
 
-    out.close(); 
-    UBLOG(logDEBUG1,"WbWriterAvsASCII::writeOctsWithNodeData to "<<avsfilename<<" - end");
+    out.close();
+    UBLOG(logDEBUG1, "WbWriterAvsASCII::writeOctsWithNodeData to " << avsfilename << " - end");
 
     return avsfilename;
- }
+}
diff --git a/src/basics/basics/writer/WbWriterAvsASCII.h b/src/basics/basics/writer/WbWriterAvsASCII.h
index 3e382f37dd3ebcf2c4a2f2ec453b1e789768578e..493d8b1e0fa3182b9acaf4bfa3f11e436c18d678 100644
--- a/src/basics/basics/writer/WbWriterAvsASCII.h
+++ b/src/basics/basics/writer/WbWriterAvsASCII.h
@@ -8,65 +8,85 @@
 #define WBWRITERAVSASCII_H
 
 #include <basics/writer/WbWriter.h>
-      
+
 class WbWriterAvsASCII : public WbWriter
 {
 public:
-   static WbWriterAvsASCII* getInstance()
-   {
-      static WbWriterAvsASCII instance;
-      return &instance;
-   }
+    static WbWriterAvsASCII *getInstance()
+    {
+        static WbWriterAvsASCII instance;
+        return &instance;
+    }
+
+    WbWriterAvsASCII(const WbWriterAvsASCII &) = delete;
+    const WbWriterAvsASCII &operator=(const WbWriterAvsASCII &) = delete;
 
-    WbWriterAvsASCII( const WbWriterAvsASCII& ) = delete;
-    const WbWriterAvsASCII& operator=( const WbWriterAvsASCII& ) = delete;
 private:
-   WbWriterAvsASCII() = default;
+    WbWriterAvsASCII() = default;
 
 public:
-   std::string getFileExtension() override { return ".ascii.inp"; }
-   
-   ///////////////////virtual std::string writeOcts(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt8 >& cells) = 0;
-   ///////////////////////////////////////////////////////
-   //lines
-   //     0 ---- 1
-   //nodenumbering must start with 0!
-   std::string writeLines(const std::string& filename,std::vector<UbTupleFloat3 >& nodes, std::vector<UbTupleInt2 >& lines) override;
+    std::string getFileExtension() override { return ".ascii.inp"; }
+
+    ///////////////////virtual std::string writeOcts(const std::string& filename,std::vector< UbTupleFloat3 >& nodes,
+    ///std::vector< UbTupleInt8 >& cells) = 0;
+    ///////////////////////////////////////////////////////
+    // lines
+    //     0 ---- 1
+    // nodenumbering must start with 0!
+    std::string writeLines(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                           std::vector<UbTupleInt2> &lines) override;
 
-   //////////////////////////////////////////////////////////////////////////
-   //triangles
-   //cell numbering:
-   //                    2
-   //                       
-   //                  0---1
-   //nodenumbering must start with 0!
-   std::string writeTriangles(const std::string& filename,std::vector<UbTupleFloat3 >& nodes, std::vector<UbTuple<int,int,int> >& triangles) override;
-   std::string writeTrianglesWithNodeData(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt3 >& cells, std::vector< std::string >& datanames, std::vector< std::vector< double > >& nodedata) override;
+    //////////////////////////////////////////////////////////////////////////
+    // triangles
+    // cell numbering:
+    //                    2
+    //
+    //                  0---1
+    // nodenumbering must start with 0!
+    std::string writeTriangles(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                               std::vector<UbTuple<int, int, int>> &triangles) override;
+    std::string writeTrianglesWithNodeData(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                                           std::vector<UbTupleInt3> &cells, std::vector<std::string> &datanames,
+                                           std::vector<std::vector<double>> &nodedata) override;
 
-   //////////////////////////////////////////////////////////////////////////
-   //quads
-   //cell numbering:
-   //                  3---2
-   //                  |   |
-   //                  0---1
-   //nodenumbering must start with 0!
-   std::string writeQuads(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt4 >& cells) override;
-   std::string writeQuadsWithNodeData(const std::string& filename, std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt4 >& cells, std::vector< std::string >& datanames, std::vector< std::vector< double > >& nodedata) override;
-   std::string writeQuadsWithCellData(const std::string& filename, std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt4 >& cells, std::vector< std::string >& datanames, std::vector< std::vector< double > >& celldata) override;
-   std::string writeQuadsWithNodeAndCellData(const std::string& filename, std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt4 >& cells, std::vector< std::string >& nodedatanames, std::vector< std::vector< double > >& nodedata, std::vector< std::string >& celldatanames, std::vector< std::vector< double > >& celldata) override;
+    //////////////////////////////////////////////////////////////////////////
+    // quads
+    // cell numbering:
+    //                  3---2
+    //                  |   |
+    //                  0---1
+    // nodenumbering must start with 0!
+    std::string writeQuads(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                           std::vector<UbTupleInt4> &cells) override;
+    std::string writeQuadsWithNodeData(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                                       std::vector<UbTupleInt4> &cells, std::vector<std::string> &datanames,
+                                       std::vector<std::vector<double>> &nodedata) override;
+    std::string writeQuadsWithCellData(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                                       std::vector<UbTupleInt4> &cells, std::vector<std::string> &datanames,
+                                       std::vector<std::vector<double>> &celldata) override;
+    std::string writeQuadsWithNodeAndCellData(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                                              std::vector<UbTupleInt4> &cells, std::vector<std::string> &nodedatanames,
+                                              std::vector<std::vector<double>> &nodedata,
+                                              std::vector<std::string> &celldatanames,
+                                              std::vector<std::vector<double>> &celldata) override;
 
-   //////////////////////////////////////////////////////////////////////////
-   //octs
-   //     7 ---- 6
-   //    /|     /|
-   //   4 +--- 5 |
-   //   | |    | |
-   //   | 3 ---+ 2
-   //   |/     |/
-   //   0 ---- 1
-   std::string writeOcts(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt8 >& cells) override;
-   std::string writeOctsWithCellData(const std::string& filename, std::vector<UbTupleFloat3 >& nodes, std::vector<UbTupleInt8 >& cells, std::vector<std::string >& datanames, std::vector< std::vector<double > >& celldata) override;
-   std::string writeOctsWithNodeData(const std::string& filename, std::vector<UbTupleFloat3 >& nodes, std::vector<UbTupleUInt8 >& cells, std::vector<std::string >& datanames, std::vector< std::vector<double > >& nodedata) override;
+    //////////////////////////////////////////////////////////////////////////
+    // octs
+    //     7 ---- 6
+    //    /|     /|
+    //   4 +--- 5 |
+    //   | |    | |
+    //   | 3 ---+ 2
+    //   |/     |/
+    //   0 ---- 1
+    std::string writeOcts(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                          std::vector<UbTupleInt8> &cells) override;
+    std::string writeOctsWithCellData(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                                      std::vector<UbTupleInt8> &cells, std::vector<std::string> &datanames,
+                                      std::vector<std::vector<double>> &celldata) override;
+    std::string writeOctsWithNodeData(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                                      std::vector<UbTupleUInt8> &cells, std::vector<std::string> &datanames,
+                                      std::vector<std::vector<double>> &nodedata) override;
 };
 
-#endif //WBWRITERAVSASCII_H
+#endif // WBWRITERAVSASCII_H
diff --git a/src/basics/basics/writer/WbWriterAvsBinary.cpp b/src/basics/basics/writer/WbWriterAvsBinary.cpp
index d3aa34aad278c86a9f0274017a7710055a40be00..e52b2232ad701e6c61df2b552545668c9f3d9989 100644
--- a/src/basics/basics/writer/WbWriterAvsBinary.cpp
+++ b/src/basics/basics/writer/WbWriterAvsBinary.cpp
@@ -1,774 +1,961 @@
-#include <basics/writer/WbWriterAvsBinary.h>
-#include <basics/writer/WbWriterAvsASCII.h>
 #include <basics/utilities/UbLogger.h>
 #include <basics/utilities/UbSystem.h>
+#include <basics/writer/WbWriterAvsASCII.h>
+#include <basics/writer/WbWriterAvsBinary.h>
 
 #include <cstring>
 
 using namespace std;
 
-std::string WbWriterAvsBinary::writeLines(const std::string& filename,std::vector<UbTupleFloat3 >& nodes, std::vector<UbTupleInt2 >& lines)
+std::string WbWriterAvsBinary::writeLines(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                                          std::vector<UbTupleInt2> &lines)
 {
-   string avsfilename = filename+getFileExtension();
-   UBLOG(logDEBUG1,"WbWriterAvsBinary::writeLines to "<<avsfilename<<" - start");
-
-   ofstream out(avsfilename.c_str(),ios::out|ios::binary);
-   if(!out)
-   { 
-      out.clear(); //flags ruecksetzen (ansonsten liefert utern if(!outfile) weiterhin true!!!
-      string path = UbSystem::getPathFromString(avsfilename);
-      if(path.size()>0){ UbSystem::makeDirectory(path);out.open(avsfilename.c_str(),ios::out|ios::binary); }
-      if(!out) throw UbException(UB_EXARGS,avsfilename+" konnte nicht geschrieben werden");
-   }
-
-   char magic = (char)7;
-   int   idummy;
-   float fdummy;
-
-   int nofNodes = (int)nodes.size();
-   int nofCells = (int)lines.size();
-
-   int nofNodeData     = 0;
-   int nofCellData     = 0;
-   int nofModelData    = 0;
-   int cellType        = 1; //line
-   int nofNodesPerCell = 2; 
-
-   out.write((char*)&magic,sizeof(char));      
-   out.write((char*)&nofNodes,sizeof(int));    
-   out.write((char*)&nofCells,sizeof(int));    
-   out.write((char*)&nofNodeData,sizeof(int)); 
-   out.write((char*)&nofCellData,sizeof(int)); 
-   out.write((char*)&nofModelData,sizeof(int));
-
-   idummy = (int)nofCells*nofNodesPerCell;
-   out.write((char*)&idummy,sizeof(int)); //(nof nodes) * (nodes per cell)
-   for(int c=0; c<nofCells; c++)
-   {
-      idummy=c+1;             out.write((char*)&idummy,sizeof(int)); //cell id
-      idummy=1;               out.write((char*)&idummy,sizeof(int)); //mat
-      idummy=nofNodesPerCell; out.write((char*)&idummy,sizeof(int)); //nodes per cell
-      idummy=cellType;        out.write((char*)&idummy,sizeof(int)); //cell type 
-   }
-   //knotennummern der einzelnen zellen
-   for(int c=0; c<nofCells; c++)
-   {
-      idummy = val<1>(lines[c])+1; out.write((char*)&idummy,sizeof(int)); 
-      idummy = val<2>(lines[c])+1; out.write((char*)&idummy,sizeof(int)); 
-     
-   }
-
-   //coords
-   //x1-coords
-   for(int n=0; n<nofNodes; n++)
-   { fdummy = (float)( val<1>(nodes[n]) ); out.write((char*)&fdummy ,sizeof(float)); }
-   //x2-coords
-   for(int n=0; n<nofNodes; n++)
-   { fdummy = (float)( val<2>(nodes[n]) ); out.write((char*)&fdummy ,sizeof(float)); }
-   //x3-coords
-   fdummy=0.0;
-   for(int n=0; n<nofNodes; n++)
-   { fdummy = (float)( val<3>(nodes[n]) ); out.write((char*)&fdummy ,sizeof(float)); }
-   //out<<"\n";
-
-   out.close(); 
-   UBLOG(logDEBUG1,"WbWriterAvsBinary::writeLines to "<<avsfilename<<" - end");
-
-   return avsfilename;
+    string avsfilename = filename + getFileExtension();
+    UBLOG(logDEBUG1, "WbWriterAvsBinary::writeLines to " << avsfilename << " - start");
+
+    ofstream out(avsfilename.c_str(), ios::out | ios::binary);
+    if (!out) {
+        out.clear(); // flags ruecksetzen (ansonsten liefert utern if(!outfile) weiterhin true!!!
+        string path = UbSystem::getPathFromString(avsfilename);
+        if (path.size() > 0) {
+            UbSystem::makeDirectory(path);
+            out.open(avsfilename.c_str(), ios::out | ios::binary);
+        }
+        if (!out)
+            throw UbException(UB_EXARGS, avsfilename + " konnte nicht geschrieben werden");
+    }
+
+    char magic = (char)7;
+    int idummy;
+    float fdummy;
+
+    int nofNodes = (int)nodes.size();
+    int nofCells = (int)lines.size();
+
+    int nofNodeData     = 0;
+    int nofCellData     = 0;
+    int nofModelData    = 0;
+    int cellType        = 1; // line
+    int nofNodesPerCell = 2;
+
+    out.write((char *)&magic, sizeof(char));
+    out.write((char *)&nofNodes, sizeof(int));
+    out.write((char *)&nofCells, sizeof(int));
+    out.write((char *)&nofNodeData, sizeof(int));
+    out.write((char *)&nofCellData, sizeof(int));
+    out.write((char *)&nofModelData, sizeof(int));
+
+    idummy = (int)nofCells * nofNodesPerCell;
+    out.write((char *)&idummy, sizeof(int)); //(nof nodes) * (nodes per cell)
+    for (int c = 0; c < nofCells; c++) {
+        idummy = c + 1;
+        out.write((char *)&idummy, sizeof(int)); // cell id
+        idummy = 1;
+        out.write((char *)&idummy, sizeof(int)); // mat
+        idummy = nofNodesPerCell;
+        out.write((char *)&idummy, sizeof(int)); // nodes per cell
+        idummy = cellType;
+        out.write((char *)&idummy, sizeof(int)); // cell type
+    }
+    // knotennummern der einzelnen zellen
+    for (int c = 0; c < nofCells; c++) {
+        idummy = val<1>(lines[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+        idummy = val<2>(lines[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+    }
+
+    // coords
+    // x1-coords
+    for (int n = 0; n < nofNodes; n++) {
+        fdummy = (float)(val<1>(nodes[n]));
+        out.write((char *)&fdummy, sizeof(float));
+    }
+    // x2-coords
+    for (int n = 0; n < nofNodes; n++) {
+        fdummy = (float)(val<2>(nodes[n]));
+        out.write((char *)&fdummy, sizeof(float));
+    }
+    // x3-coords
+    fdummy = 0.0;
+    for (int n = 0; n < nofNodes; n++) {
+        fdummy = (float)(val<3>(nodes[n]));
+        out.write((char *)&fdummy, sizeof(float));
+    }
+    // out<<"\n";
+
+    out.close();
+    UBLOG(logDEBUG1, "WbWriterAvsBinary::writeLines to " << avsfilename << " - end");
+
+    return avsfilename;
 }
 /*===============================================================================*/
-std::string WbWriterAvsBinary::writeTriangles(const std::string& filename,std::vector<UbTupleFloat3 >& nodes, std::vector<UbTuple<int,int,int> >& triangles)
+std::string WbWriterAvsBinary::writeTriangles(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                                              std::vector<UbTuple<int, int, int>> &triangles)
 {
-   string avsfilename = filename+getFileExtension();
-   UBLOG(logDEBUG1,"WbWriterAvsBinary::writeTriangles to "<<avsfilename<<" - start");
-
-   ofstream out(avsfilename.c_str(),ios::out|ios::binary);
-   if(!out)
-   { 
-      out.clear(); //flags ruecksetzen (ansonsten liefert utern if(!outfile) weiterhin true!!!
-      string path = UbSystem::getPathFromString(avsfilename);
-      if(path.size()>0){UbSystem::makeDirectory(path);out.open(avsfilename.c_str(),ios::out|ios::binary);}
-      if(!out) throw UbException(UB_EXARGS,avsfilename+" konnte nicht geschrieben werden");
-   }
-
-   char magic = (char)7;
-   int   idummy;
-   float fdummy;
-
-   int nofNodes = (int)nodes.size();
-   int nofCells = (int)triangles.size();
-
-   int nofNodeData     = 0;
-   int nofCellData     = 0;
-   int nofModelData    = 0;
-   int cellType        = 2; //triangle
-   int nofNodesPerCell = 3; 
-
-   out.write((char*)&magic,sizeof(char));      
-   out.write((char*)&nofNodes,sizeof(int));    
-   out.write((char*)&nofCells,sizeof(int));    
-   out.write((char*)&nofNodeData,sizeof(int)); 
-   out.write((char*)&nofCellData,sizeof(int)); 
-   out.write((char*)&nofModelData,sizeof(int));
-
-   idummy = (int)nofCells*nofNodesPerCell;
-   out.write((char*)&idummy,sizeof(int)); //(nof nodes) * (nodes per cell)
-   for(int c=0; c<nofCells; c++)
-   {
-      idummy=c+1;             out.write((char*)&idummy,sizeof(int)); //cell id
-      idummy=1;               out.write((char*)&idummy,sizeof(int)); //mat
-      idummy=nofNodesPerCell; out.write((char*)&idummy,sizeof(int)); //nodes per cell
-      idummy=cellType;        out.write((char*)&idummy,sizeof(int)); //cell type 
-   }
-   //knotennummern der einzelnen zellen
-   for(int c=0; c<nofCells; c++)
-   {
-      idummy = val<1>(triangles[c])+1; out.write((char*)&idummy,sizeof(int)); 
-      idummy = val<2>(triangles[c])+1; out.write((char*)&idummy,sizeof(int)); 
-      idummy = val<3>(triangles[c])+1; out.write((char*)&idummy,sizeof(int)); 
-
-   }
-
-   //coords
-   //x1-coords
-   for(int n=0; n<nofNodes; n++)
-   { fdummy = (float)( val<1>(nodes[n]) ); out.write((char*)&fdummy ,sizeof(float)); }
-   //x2-coords
-   for(int n=0; n<nofNodes; n++)
-   { fdummy = (float)( val<2>(nodes[n]) ); out.write((char*)&fdummy ,sizeof(float)); }
-   //x3-coords
-   fdummy=0.0;
-   for(int n=0; n<nofNodes; n++)
-   { fdummy = (float)( val<3>(nodes[n]) ); out.write((char*)&fdummy ,sizeof(float)); }
-   //out<<"\n";
-
-   out.close(); 
-   UBLOG(logDEBUG1,"WbWriterAvsBinary::writeTriangles to "<<avsfilename<<" - end");
-
-   return avsfilename;
+    string avsfilename = filename + getFileExtension();
+    UBLOG(logDEBUG1, "WbWriterAvsBinary::writeTriangles to " << avsfilename << " - start");
+
+    ofstream out(avsfilename.c_str(), ios::out | ios::binary);
+    if (!out) {
+        out.clear(); // flags ruecksetzen (ansonsten liefert utern if(!outfile) weiterhin true!!!
+        string path = UbSystem::getPathFromString(avsfilename);
+        if (path.size() > 0) {
+            UbSystem::makeDirectory(path);
+            out.open(avsfilename.c_str(), ios::out | ios::binary);
+        }
+        if (!out)
+            throw UbException(UB_EXARGS, avsfilename + " konnte nicht geschrieben werden");
+    }
+
+    char magic = (char)7;
+    int idummy;
+    float fdummy;
+
+    int nofNodes = (int)nodes.size();
+    int nofCells = (int)triangles.size();
+
+    int nofNodeData     = 0;
+    int nofCellData     = 0;
+    int nofModelData    = 0;
+    int cellType        = 2; // triangle
+    int nofNodesPerCell = 3;
+
+    out.write((char *)&magic, sizeof(char));
+    out.write((char *)&nofNodes, sizeof(int));
+    out.write((char *)&nofCells, sizeof(int));
+    out.write((char *)&nofNodeData, sizeof(int));
+    out.write((char *)&nofCellData, sizeof(int));
+    out.write((char *)&nofModelData, sizeof(int));
+
+    idummy = (int)nofCells * nofNodesPerCell;
+    out.write((char *)&idummy, sizeof(int)); //(nof nodes) * (nodes per cell)
+    for (int c = 0; c < nofCells; c++) {
+        idummy = c + 1;
+        out.write((char *)&idummy, sizeof(int)); // cell id
+        idummy = 1;
+        out.write((char *)&idummy, sizeof(int)); // mat
+        idummy = nofNodesPerCell;
+        out.write((char *)&idummy, sizeof(int)); // nodes per cell
+        idummy = cellType;
+        out.write((char *)&idummy, sizeof(int)); // cell type
+    }
+    // knotennummern der einzelnen zellen
+    for (int c = 0; c < nofCells; c++) {
+        idummy = val<1>(triangles[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+        idummy = val<2>(triangles[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+        idummy = val<3>(triangles[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+    }
+
+    // coords
+    // x1-coords
+    for (int n = 0; n < nofNodes; n++) {
+        fdummy = (float)(val<1>(nodes[n]));
+        out.write((char *)&fdummy, sizeof(float));
+    }
+    // x2-coords
+    for (int n = 0; n < nofNodes; n++) {
+        fdummy = (float)(val<2>(nodes[n]));
+        out.write((char *)&fdummy, sizeof(float));
+    }
+    // x3-coords
+    fdummy = 0.0;
+    for (int n = 0; n < nofNodes; n++) {
+        fdummy = (float)(val<3>(nodes[n]));
+        out.write((char *)&fdummy, sizeof(float));
+    }
+    // out<<"\n";
+
+    out.close();
+    UBLOG(logDEBUG1, "WbWriterAvsBinary::writeTriangles to " << avsfilename << " - end");
+
+    return avsfilename;
 }
 /*===============================================================================*/
-std::string WbWriterAvsBinary::writeQuads(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt4 >& cells)
+std::string WbWriterAvsBinary::writeQuads(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                                          std::vector<UbTupleInt4> &cells)
 {
-   string avsfilename = filename+getFileExtension();
-   UBLOG(logDEBUG1,"WbWriterAvsBinary::writeQuads to "<<avsfilename<<" - start");
-
-   ofstream out(avsfilename.c_str(),ios::out|ios::binary);
-   if(!out)
-   { 
-      out.clear(); //flags ruecksetzen (ansonsten liefert utern if(!outfile) weiterhin true!!!
-      string path = UbSystem::getPathFromString(avsfilename);
-      if(path.size()>0){UbSystem::makeDirectory(path);out.open(avsfilename.c_str(),ios::out|ios::binary);}
-      if(!out) throw UbException(UB_EXARGS,avsfilename+" konnte nicht geschrieben werden");
-   }
-   char magic = (char)7;
-   int   idummy;
-   float fdummy;
-
-   int nofNodes = (int)nodes.size();
-   int nofCells = (int)cells.size();
-
-   int nofNodeData     = 0;
-   int nofCellData     = 0;
-   int nofModelData    = 0;
-   int cellType        = 3; //=quad
-   int nofNodesPerCell = 4; 
-
-   out.write((char*)&magic,sizeof(char));      
-   out.write((char*)&nofNodes,sizeof(int));    
-   out.write((char*)&nofCells,sizeof(int));    
-   out.write((char*)&nofNodeData,sizeof(int)); 
-   out.write((char*)&nofCellData,sizeof(int)); 
-   out.write((char*)&nofModelData,sizeof(int));
-
-   idummy = (int)nofCells*nofNodesPerCell;
-   out.write((char*)&idummy,sizeof(int)); //(nof nodes) * (nodes per cell)
-   for(int c=0; c<nofCells; c++)
-   {
-      idummy=c+1;             out.write((char*)&idummy,sizeof(int)); //cell id
-      idummy=1;               out.write((char*)&idummy,sizeof(int)); //mat
-      idummy=nofNodesPerCell; out.write((char*)&idummy,sizeof(int)); //nodes per cell
-      idummy=cellType;        out.write((char*)&idummy,sizeof(int)); //cell type 
-   }
-   //knotennummern der einzelnen zellen
-   for(int c=0; c<nofCells; c++)
-   {
-      idummy = val<1>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-      idummy = val<2>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-      idummy = val<3>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-      idummy = val<4>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-   }
-
-   //coords
-   //x1-coords
-   for(int n=0; n<nofNodes; n++)
-   { fdummy = (float)( val<1>(nodes[n]) ); out.write((char*)&fdummy ,sizeof(float)); }
-   //x2-coords
-   for(int n=0; n<nofNodes; n++)
-   { fdummy = (float)( val<2>(nodes[n]) ); out.write((char*)&fdummy ,sizeof(float)); }
-   //x3-coords
-   for(int n=0; n<nofNodes; n++)
-   { fdummy = (float)( val<3>(nodes[n]) ); out.write((char*)&fdummy ,sizeof(float)); }
-   //out<<"\n";
-
-  
-   out.close(); 
-   UBLOG(logDEBUG1,"WbWriterAvsBinary::writeQuads to "<<avsfilename<<" - end");
-
-   return avsfilename;
+    string avsfilename = filename + getFileExtension();
+    UBLOG(logDEBUG1, "WbWriterAvsBinary::writeQuads to " << avsfilename << " - start");
+
+    ofstream out(avsfilename.c_str(), ios::out | ios::binary);
+    if (!out) {
+        out.clear(); // flags ruecksetzen (ansonsten liefert utern if(!outfile) weiterhin true!!!
+        string path = UbSystem::getPathFromString(avsfilename);
+        if (path.size() > 0) {
+            UbSystem::makeDirectory(path);
+            out.open(avsfilename.c_str(), ios::out | ios::binary);
+        }
+        if (!out)
+            throw UbException(UB_EXARGS, avsfilename + " konnte nicht geschrieben werden");
+    }
+    char magic = (char)7;
+    int idummy;
+    float fdummy;
+
+    int nofNodes = (int)nodes.size();
+    int nofCells = (int)cells.size();
+
+    int nofNodeData     = 0;
+    int nofCellData     = 0;
+    int nofModelData    = 0;
+    int cellType        = 3; //=quad
+    int nofNodesPerCell = 4;
+
+    out.write((char *)&magic, sizeof(char));
+    out.write((char *)&nofNodes, sizeof(int));
+    out.write((char *)&nofCells, sizeof(int));
+    out.write((char *)&nofNodeData, sizeof(int));
+    out.write((char *)&nofCellData, sizeof(int));
+    out.write((char *)&nofModelData, sizeof(int));
+
+    idummy = (int)nofCells * nofNodesPerCell;
+    out.write((char *)&idummy, sizeof(int)); //(nof nodes) * (nodes per cell)
+    for (int c = 0; c < nofCells; c++) {
+        idummy = c + 1;
+        out.write((char *)&idummy, sizeof(int)); // cell id
+        idummy = 1;
+        out.write((char *)&idummy, sizeof(int)); // mat
+        idummy = nofNodesPerCell;
+        out.write((char *)&idummy, sizeof(int)); // nodes per cell
+        idummy = cellType;
+        out.write((char *)&idummy, sizeof(int)); // cell type
+    }
+    // knotennummern der einzelnen zellen
+    for (int c = 0; c < nofCells; c++) {
+        idummy = val<1>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+        idummy = val<2>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+        idummy = val<3>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+        idummy = val<4>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+    }
+
+    // coords
+    // x1-coords
+    for (int n = 0; n < nofNodes; n++) {
+        fdummy = (float)(val<1>(nodes[n]));
+        out.write((char *)&fdummy, sizeof(float));
+    }
+    // x2-coords
+    for (int n = 0; n < nofNodes; n++) {
+        fdummy = (float)(val<2>(nodes[n]));
+        out.write((char *)&fdummy, sizeof(float));
+    }
+    // x3-coords
+    for (int n = 0; n < nofNodes; n++) {
+        fdummy = (float)(val<3>(nodes[n]));
+        out.write((char *)&fdummy, sizeof(float));
+    }
+    // out<<"\n";
+
+    out.close();
+    UBLOG(logDEBUG1, "WbWriterAvsBinary::writeQuads to " << avsfilename << " - end");
+
+    return avsfilename;
 }
 /*===============================================================================*/
-std::string WbWriterAvsBinary::writeOcts(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt8 >& cells)
+std::string WbWriterAvsBinary::writeOcts(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                                         std::vector<UbTupleInt8> &cells)
 {
-   string avsfilename = filename+getFileExtension();
-   UBLOG(logDEBUG1,"WbWriterAvsBinary::writeOcts to "<<avsfilename<<" - start");
-
-   ofstream out(avsfilename.c_str(),ios::out|ios::binary);
-   if(!out)
-   { 
-      out.clear(); //flags ruecksetzen (ansonsten liefert utern if(!outfile) weiterhin true!!!
-      string path = UbSystem::getPathFromString(avsfilename);
-      if(path.size()>0){UbSystem::makeDirectory(path);out.open(avsfilename.c_str(),ios::out|ios::binary);}
-      if(!out) throw UbException(UB_EXARGS,"file konnte nicht geschrieben werden");
-   }
-
-   char magic = (char)7;
-   int   idummy;
-   float fdummy;
-
-   int nofNodes = (int)nodes.size();
-   int nofCells = (int)cells.size();
-
-   int nofNodeData     = 0;
-   int nofCellData     = 0;
-   int nofModelData    = 0;
-   int cellType        = 7; //=hex
-   int nofNodesPerCell = 8; 
-
-   out.write((char*)&magic,sizeof(char));      
-   out.write((char*)&nofNodes,sizeof(int));    
-   out.write((char*)&nofCells,sizeof(int));    
-   out.write((char*)&nofNodeData,sizeof(int)); 
-   out.write((char*)&nofCellData,sizeof(int)); 
-   out.write((char*)&nofModelData,sizeof(int));
-
-   idummy = (int)nofCells*nofNodesPerCell;
-   out.write((char*)&idummy,sizeof(int)); //(nof nodes) * (nodes per cell)
-   for(int c=0; c<nofCells; c++)
-   {
-      idummy=c+1;             out.write((char*)&idummy,sizeof(int)); //cell id
-      idummy=1;               out.write((char*)&idummy,sizeof(int)); //mat
-      idummy=nofNodesPerCell; out.write((char*)&idummy,sizeof(int)); //nodes per cell
-      idummy=cellType;        out.write((char*)&idummy,sizeof(int)); //cell type 
-   }
-   //knotennummern der einzelnen zellen
-   for(int c=0; c<nofCells; c++)
-   {
-      idummy = val<1>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-      idummy = val<2>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-      idummy = val<3>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-      idummy = val<4>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-      idummy = val<5>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-      idummy = val<6>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-      idummy = val<7>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-      idummy = val<8>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-   }
-
-   //coords
-   //x1-coords
-   for(int n=0; n<nofNodes; n++)
-   { fdummy = (float)( val<1>(nodes[n]) ); out.write((char*)&fdummy ,sizeof(float)); }
-   //x2-coords
-   for(int n=0; n<nofNodes; n++)
-   { fdummy = (float)( val<2>(nodes[n]) ); out.write((char*)&fdummy ,sizeof(float)); }
-   //x3-coords
-   for(int n=0; n<nofNodes; n++)
-   { fdummy = (float)( val<3>(nodes[n]) ); out.write((char*)&fdummy ,sizeof(float)); }
-   //out<<"\n";
-
-
-   out.close(); 
-   UBLOG(logDEBUG1,"WbWriterAvsBinary::writeOcts to "<<avsfilename<<" - end");
-
-   return avsfilename;
+    string avsfilename = filename + getFileExtension();
+    UBLOG(logDEBUG1, "WbWriterAvsBinary::writeOcts to " << avsfilename << " - start");
+
+    ofstream out(avsfilename.c_str(), ios::out | ios::binary);
+    if (!out) {
+        out.clear(); // flags ruecksetzen (ansonsten liefert utern if(!outfile) weiterhin true!!!
+        string path = UbSystem::getPathFromString(avsfilename);
+        if (path.size() > 0) {
+            UbSystem::makeDirectory(path);
+            out.open(avsfilename.c_str(), ios::out | ios::binary);
+        }
+        if (!out)
+            throw UbException(UB_EXARGS, "file konnte nicht geschrieben werden");
+    }
+
+    char magic = (char)7;
+    int idummy;
+    float fdummy;
+
+    int nofNodes = (int)nodes.size();
+    int nofCells = (int)cells.size();
+
+    int nofNodeData     = 0;
+    int nofCellData     = 0;
+    int nofModelData    = 0;
+    int cellType        = 7; //=hex
+    int nofNodesPerCell = 8;
+
+    out.write((char *)&magic, sizeof(char));
+    out.write((char *)&nofNodes, sizeof(int));
+    out.write((char *)&nofCells, sizeof(int));
+    out.write((char *)&nofNodeData, sizeof(int));
+    out.write((char *)&nofCellData, sizeof(int));
+    out.write((char *)&nofModelData, sizeof(int));
+
+    idummy = (int)nofCells * nofNodesPerCell;
+    out.write((char *)&idummy, sizeof(int)); //(nof nodes) * (nodes per cell)
+    for (int c = 0; c < nofCells; c++) {
+        idummy = c + 1;
+        out.write((char *)&idummy, sizeof(int)); // cell id
+        idummy = 1;
+        out.write((char *)&idummy, sizeof(int)); // mat
+        idummy = nofNodesPerCell;
+        out.write((char *)&idummy, sizeof(int)); // nodes per cell
+        idummy = cellType;
+        out.write((char *)&idummy, sizeof(int)); // cell type
+    }
+    // knotennummern der einzelnen zellen
+    for (int c = 0; c < nofCells; c++) {
+        idummy = val<1>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+        idummy = val<2>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+        idummy = val<3>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+        idummy = val<4>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+        idummy = val<5>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+        idummy = val<6>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+        idummy = val<7>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+        idummy = val<8>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+    }
+
+    // coords
+    // x1-coords
+    for (int n = 0; n < nofNodes; n++) {
+        fdummy = (float)(val<1>(nodes[n]));
+        out.write((char *)&fdummy, sizeof(float));
+    }
+    // x2-coords
+    for (int n = 0; n < nofNodes; n++) {
+        fdummy = (float)(val<2>(nodes[n]));
+        out.write((char *)&fdummy, sizeof(float));
+    }
+    // x3-coords
+    for (int n = 0; n < nofNodes; n++) {
+        fdummy = (float)(val<3>(nodes[n]));
+        out.write((char *)&fdummy, sizeof(float));
+    }
+    // out<<"\n";
+
+    out.close();
+    UBLOG(logDEBUG1, "WbWriterAvsBinary::writeOcts to " << avsfilename << " - end");
+
+    return avsfilename;
 }
 /*===============================================================================*/
-std::string WbWriterAvsBinary::writeTrianglesWithNodeData(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt3 >& cells, std::vector< std::string >& datanames, std::vector< std::vector< double > >& nodedata)
+std::string WbWriterAvsBinary::writeTrianglesWithNodeData(const std::string &filename,
+                                                          std::vector<UbTupleFloat3> &nodes,
+                                                          std::vector<UbTupleInt3> &cells,
+                                                          std::vector<std::string> &datanames,
+                                                          std::vector<std::vector<double>> &nodedata)
 {
-   string avsfilename = filename+getFileExtension();
-   UBLOG(logDEBUG1,"WbWriterAvsBinary::writeTrianglesWithNodeData to "<<avsfilename<<" - start");
-
-   ofstream out(avsfilename.c_str(),ios::out|ios::binary);
-   if(!out)
-   { 
-      out.clear(); //flags ruecksetzen (ansonsten liefert utern if(!outfile) weiterhin true!!!
-      string path = UbSystem::getPathFromString(avsfilename);
-      if(path.size()>0){UbSystem::makeDirectory(path);out.open(avsfilename.c_str(),ios::out|ios::binary);}
-      if(!out) throw UbException(UB_EXARGS,"write_OutputFile-UCD File "+avsfilename+" konnte nicht geschrieben werden");
-   }
-   char magic = (char)7;
-   int   idummy;
-   float fdummy;
-
-   int nofNodes = (int)nodes.size();
-   int nofCells = (int)cells.size();
-
-   int nofNodeData     = (int)datanames.size();
-   int nofCellData     = 0;
-   int nofModelData    = 0;
-   int cellType        = 2; //triangle
-   int nofNodesPerCell = 3; 
-
-   out.write((char*)&magic,sizeof(char));      
-   out.write((char*)&nofNodes,sizeof(int));    
-   out.write((char*)&nofCells,sizeof(int));    
-   out.write((char*)&nofNodeData,sizeof(int)); 
-   out.write((char*)&nofCellData,sizeof(int)); 
-   out.write((char*)&nofModelData,sizeof(int));
-
-   idummy = (int)nofCells*nofNodesPerCell;
-   out.write((char*)&idummy,sizeof(int)); //(nof nodes) * (nodes per cell)
-   for(int c=0; c<nofCells; c++)
-   {
-      idummy=c+1;             out.write((char*)&idummy,sizeof(int)); //cell id
-      idummy=1;               out.write((char*)&idummy,sizeof(int)); //mat
-      idummy=nofNodesPerCell; out.write((char*)&idummy,sizeof(int)); //nodes per cell
-      idummy=cellType;        out.write((char*)&idummy,sizeof(int)); //cell type 
-   }
-   //knotennummern der einzelnen zellen
-   for(int c=0; c<nofCells; c++)
-   {
-      idummy = val<1>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-      idummy = val<2>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-      idummy = val<3>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-   }
-
-   //coords
-   //x1-coords
-   for(int n=0; n<nofNodes; n++)
-      { fdummy = (float)( val<1>(nodes[n]) ); out.write((char*)&fdummy ,sizeof(float)); }
-   //x2-coords
-   for(int n=0; n<nofNodes; n++)
-      { fdummy = (float)( val<2>(nodes[n]) ); out.write((char*)&fdummy ,sizeof(float)); }
-   //x3-coords
-   for(int n=0; n<nofNodes; n++)
-      { fdummy = (float)( val<3>(nodes[n]) ); out.write((char*)&fdummy ,sizeof(float)); }
-   //out<<"\n";
-
-   //NODE DATA
-   char labels[1024];
-   char units[1024];
-   strcpy(labels, "");
-   strcpy(units, "");
-
-   for(int d=0; d<nofNodeData-1; ++d) 
-      { strcat(labels, datanames[d].c_str() ); strcat(labels,"."); }
-   strcat(labels, datanames[nofNodeData-1].c_str()); 
-
-   for(int i=0;i<(nofNodeData-1);i++) strcat(units, "no_unit.");
-   strcat(units, "no_unit");
-
-   out.write((char*)&labels,sizeof(labels));
-   out.write((char*)&units,sizeof(units));
-
-   //nof and type of data
-   idummy = nofNodeData;
-   out.write((char*)&idummy,sizeof(int)); //Datentypen pro knoten (hier = nof_node_data, da NUR skalare)
-
-   idummy = 1;
-   for(int i=0;i<nofNodeData;i++) out.write((char*)&idummy,sizeof(int)); //jeder Datentyp ist ein skalarer Wert
-
-   //min and max of data
-   fdummy = 0.0;
-   for(int i=0;i<nofNodeData;i++) out.write((char*)&fdummy,sizeof(float)); //min Wert pro Datentyp
-   fdummy = 1.0;
-   for(int i=0;i<nofNodeData;i++) out.write((char*)&fdummy,sizeof(float)); //max Wert pro Datentyp
-
-   //daten ins file schreiben
-   for(int d=0; d<nofNodeData; ++d)
-      for(int n=0; n<(int)nodedata[d].size(); n++)
-      { fdummy=(float)nodedata[d][n]; out.write((char*)&fdummy,sizeof(float)); }
-
-   fdummy = 1.;
-   for(int i=0;i<nofNodeData;i++) out.write((char*)&fdummy,sizeof(float)); //max Wert pro Datentyp
-
-   out.close(); 
-   UBLOG(logDEBUG1,"WbWriterAvsBinary::writeTrianglesWithNodeData to "<<avsfilename<<" - end");
-
-   return avsfilename;
+    string avsfilename = filename + getFileExtension();
+    UBLOG(logDEBUG1, "WbWriterAvsBinary::writeTrianglesWithNodeData to " << avsfilename << " - start");
+
+    ofstream out(avsfilename.c_str(), ios::out | ios::binary);
+    if (!out) {
+        out.clear(); // flags ruecksetzen (ansonsten liefert utern if(!outfile) weiterhin true!!!
+        string path = UbSystem::getPathFromString(avsfilename);
+        if (path.size() > 0) {
+            UbSystem::makeDirectory(path);
+            out.open(avsfilename.c_str(), ios::out | ios::binary);
+        }
+        if (!out)
+            throw UbException(UB_EXARGS,
+                              "write_OutputFile-UCD File " + avsfilename + " konnte nicht geschrieben werden");
+    }
+    char magic = (char)7;
+    int idummy;
+    float fdummy;
+
+    int nofNodes = (int)nodes.size();
+    int nofCells = (int)cells.size();
+
+    int nofNodeData     = (int)datanames.size();
+    int nofCellData     = 0;
+    int nofModelData    = 0;
+    int cellType        = 2; // triangle
+    int nofNodesPerCell = 3;
+
+    out.write((char *)&magic, sizeof(char));
+    out.write((char *)&nofNodes, sizeof(int));
+    out.write((char *)&nofCells, sizeof(int));
+    out.write((char *)&nofNodeData, sizeof(int));
+    out.write((char *)&nofCellData, sizeof(int));
+    out.write((char *)&nofModelData, sizeof(int));
+
+    idummy = (int)nofCells * nofNodesPerCell;
+    out.write((char *)&idummy, sizeof(int)); //(nof nodes) * (nodes per cell)
+    for (int c = 0; c < nofCells; c++) {
+        idummy = c + 1;
+        out.write((char *)&idummy, sizeof(int)); // cell id
+        idummy = 1;
+        out.write((char *)&idummy, sizeof(int)); // mat
+        idummy = nofNodesPerCell;
+        out.write((char *)&idummy, sizeof(int)); // nodes per cell
+        idummy = cellType;
+        out.write((char *)&idummy, sizeof(int)); // cell type
+    }
+    // knotennummern der einzelnen zellen
+    for (int c = 0; c < nofCells; c++) {
+        idummy = val<1>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+        idummy = val<2>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+        idummy = val<3>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+    }
+
+    // coords
+    // x1-coords
+    for (int n = 0; n < nofNodes; n++) {
+        fdummy = (float)(val<1>(nodes[n]));
+        out.write((char *)&fdummy, sizeof(float));
+    }
+    // x2-coords
+    for (int n = 0; n < nofNodes; n++) {
+        fdummy = (float)(val<2>(nodes[n]));
+        out.write((char *)&fdummy, sizeof(float));
+    }
+    // x3-coords
+    for (int n = 0; n < nofNodes; n++) {
+        fdummy = (float)(val<3>(nodes[n]));
+        out.write((char *)&fdummy, sizeof(float));
+    }
+    // out<<"\n";
+
+    // NODE DATA
+    char labels[1024];
+    char units[1024];
+    strcpy(labels, "");
+    strcpy(units, "");
+
+    for (int d = 0; d < nofNodeData - 1; ++d) {
+        strcat(labels, datanames[d].c_str());
+        strcat(labels, ".");
+    }
+    strcat(labels, datanames[nofNodeData - 1].c_str());
+
+    for (int i = 0; i < (nofNodeData - 1); i++)
+        strcat(units, "no_unit.");
+    strcat(units, "no_unit");
+
+    out.write((char *)&labels, sizeof(labels));
+    out.write((char *)&units, sizeof(units));
+
+    // nof and type of data
+    idummy = nofNodeData;
+    out.write((char *)&idummy, sizeof(int)); // Datentypen pro knoten (hier = nof_node_data, da NUR skalare)
+
+    idummy = 1;
+    for (int i = 0; i < nofNodeData; i++)
+        out.write((char *)&idummy, sizeof(int)); // jeder Datentyp ist ein skalarer Wert
+
+    // min and max of data
+    fdummy = 0.0;
+    for (int i = 0; i < nofNodeData; i++)
+        out.write((char *)&fdummy, sizeof(float)); // min Wert pro Datentyp
+    fdummy = 1.0;
+    for (int i = 0; i < nofNodeData; i++)
+        out.write((char *)&fdummy, sizeof(float)); // max Wert pro Datentyp
+
+    // daten ins file schreiben
+    for (int d = 0; d < nofNodeData; ++d)
+        for (int n = 0; n < (int)nodedata[d].size(); n++) {
+            fdummy = (float)nodedata[d][n];
+            out.write((char *)&fdummy, sizeof(float));
+        }
+
+    fdummy = 1.;
+    for (int i = 0; i < nofNodeData; i++)
+        out.write((char *)&fdummy, sizeof(float)); // max Wert pro Datentyp
+
+    out.close();
+    UBLOG(logDEBUG1, "WbWriterAvsBinary::writeTrianglesWithNodeData to " << avsfilename << " - end");
+
+    return avsfilename;
 }
 /*===============================================================================*/
-std::string WbWriterAvsBinary::writeQuadsWithNodeData(const string& filename,vector< UbTupleFloat3 >& nodes, vector< UbTupleInt4 >& cells, vector< string >& datanames, vector< vector< double > >& nodedata)
+std::string WbWriterAvsBinary::writeQuadsWithNodeData(const string &filename, vector<UbTupleFloat3> &nodes,
+                                                      vector<UbTupleInt4> &cells, vector<string> &datanames,
+                                                      vector<vector<double>> &nodedata)
 {
-   string avsfilename = filename+getFileExtension();
-   UBLOG(logDEBUG1,"WbWriterAvsBinary::writeQuadsWithNodeData to "<<avsfilename<<" - start");
-
-   ofstream out(avsfilename.c_str(),ios::out|ios::binary);
-   if(!out)
-   { 
-      out.clear(); //flags ruecksetzen (ansonsten liefert utern if(!outfile) weiterhin true!!!
-      string path = UbSystem::getPathFromString(avsfilename);
-      if(path.size()>0){UbSystem::makeDirectory(path);out.open(avsfilename.c_str(),ios::out|ios::binary);}
-      if(!out) throw UbException(UB_EXARGS,"write_OutputFile-UCD File "+avsfilename+" konnte nicht geschrieben werden");
-   }
-   char magic = (char)7;
-   int   idummy;
-   float fdummy;
-
-   int nofNodes = (int)nodes.size();
-   int nofCells = (int)cells.size();
-
-   int nofNodeData     = (int)datanames.size();
-   int nofCellData     = 0;
-   int nofModelData    = 0;
-   int cellType        = 3; //=quad
-   int nofNodesPerCell = 4; 
-
-   out.write((char*)&magic,sizeof(char));      
-   out.write((char*)&nofNodes,sizeof(int));    
-   out.write((char*)&nofCells,sizeof(int));    
-   out.write((char*)&nofNodeData,sizeof(int)); 
-   out.write((char*)&nofCellData,sizeof(int)); 
-   out.write((char*)&nofModelData,sizeof(int));
-
-   idummy = (int)nofCells*nofNodesPerCell;
-   out.write((char*)&idummy,sizeof(int)); //(nof nodes) * (nodes per cell)
-   for(int c=0; c<nofCells; c++)
-   {
-      idummy=c+1;             out.write((char*)&idummy,sizeof(int)); //cell id
-      idummy=1;               out.write((char*)&idummy,sizeof(int)); //mat
-      idummy=nofNodesPerCell; out.write((char*)&idummy,sizeof(int)); //nodes per cell
-      idummy=cellType;        out.write((char*)&idummy,sizeof(int)); //cell type 
-   }
-   //knotennummern der einzelnen zellen
-   for(int c=0; c<nofCells; c++)
-   {
-      idummy = val<1>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-      idummy = val<2>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-      idummy = val<3>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-      idummy = val<4>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-   }
-
-   //coords
-   //x1-coords
-   for(int n=0; n<nofNodes; n++)
-      { fdummy = (float)( val<1>(nodes[n]) ); out.write((char*)&fdummy ,sizeof(float)); }
-   //x2-coords
-   for(int n=0; n<nofNodes; n++)
-      { fdummy = (float)( val<2>(nodes[n]) ); out.write((char*)&fdummy ,sizeof(float)); }
-   //x3-coords
-   for(int n=0; n<nofNodes; n++)
-      { fdummy = (float)( val<3>(nodes[n]) ); out.write((char*)&fdummy ,sizeof(float)); }
-   //out<<"\n";
-
-   //NODE DATA
-   char labels[1024];
-   char units[1024];
-   strcpy(labels, "");
-   strcpy(units, "");
-
-   for(int d=0; d<nofNodeData-1; ++d) 
-      { strcat(labels, datanames[d].c_str() ); strcat(labels,"."); }
-   strcat(labels, datanames[nofNodeData-1].c_str()); 
-
-   for(int i=0;i<(nofNodeData-1);i++) strcat(units, "no_unit.");
-   strcat(units, "no_unit");
-
-   out.write((char*)&labels,sizeof(labels));
-   out.write((char*)&units,sizeof(units));
-
-   //nof and type of data
-   idummy = nofNodeData;
-   out.write((char*)&idummy,sizeof(int)); //Datentypen pro knoten (hier = nof_node_data, da NUR skalare)
-
-   idummy = 1;
-   for(int i=0;i<nofNodeData;i++) out.write((char*)&idummy,sizeof(int)); //jeder Datentyp ist ein skalarer Wert
-
-   //min and max of data
-   fdummy = 0.0;
-   for(int i=0;i<nofNodeData;i++) out.write((char*)&fdummy,sizeof(float)); //min Wert pro Datentyp
-   fdummy = 1.0;
-   for(int i=0;i<nofNodeData;i++) out.write((char*)&fdummy,sizeof(float)); //max Wert pro Datentyp
-
-   //daten ins file schreiben
-   for(int d=0; d<nofNodeData; ++d)
-      for(int n=0; n<(int)nodedata[d].size(); n++)
-      { fdummy=(float)nodedata[d][n]; out.write((char*)&fdummy,sizeof(float)); }
-
-   fdummy = 1.;
-   for(int i=0;i<nofNodeData;i++) out.write((char*)&fdummy,sizeof(float)); //max Wert pro Datentyp
-
-   out.close(); 
-   UBLOG(logDEBUG1,"WbWriterAvsBinary::writeQuadsWithNodeData to "<<avsfilename<<" - end");
-
-   return avsfilename;
+    string avsfilename = filename + getFileExtension();
+    UBLOG(logDEBUG1, "WbWriterAvsBinary::writeQuadsWithNodeData to " << avsfilename << " - start");
+
+    ofstream out(avsfilename.c_str(), ios::out | ios::binary);
+    if (!out) {
+        out.clear(); // flags ruecksetzen (ansonsten liefert utern if(!outfile) weiterhin true!!!
+        string path = UbSystem::getPathFromString(avsfilename);
+        if (path.size() > 0) {
+            UbSystem::makeDirectory(path);
+            out.open(avsfilename.c_str(), ios::out | ios::binary);
+        }
+        if (!out)
+            throw UbException(UB_EXARGS,
+                              "write_OutputFile-UCD File " + avsfilename + " konnte nicht geschrieben werden");
+    }
+    char magic = (char)7;
+    int idummy;
+    float fdummy;
+
+    int nofNodes = (int)nodes.size();
+    int nofCells = (int)cells.size();
+
+    int nofNodeData     = (int)datanames.size();
+    int nofCellData     = 0;
+    int nofModelData    = 0;
+    int cellType        = 3; //=quad
+    int nofNodesPerCell = 4;
+
+    out.write((char *)&magic, sizeof(char));
+    out.write((char *)&nofNodes, sizeof(int));
+    out.write((char *)&nofCells, sizeof(int));
+    out.write((char *)&nofNodeData, sizeof(int));
+    out.write((char *)&nofCellData, sizeof(int));
+    out.write((char *)&nofModelData, sizeof(int));
+
+    idummy = (int)nofCells * nofNodesPerCell;
+    out.write((char *)&idummy, sizeof(int)); //(nof nodes) * (nodes per cell)
+    for (int c = 0; c < nofCells; c++) {
+        idummy = c + 1;
+        out.write((char *)&idummy, sizeof(int)); // cell id
+        idummy = 1;
+        out.write((char *)&idummy, sizeof(int)); // mat
+        idummy = nofNodesPerCell;
+        out.write((char *)&idummy, sizeof(int)); // nodes per cell
+        idummy = cellType;
+        out.write((char *)&idummy, sizeof(int)); // cell type
+    }
+    // knotennummern der einzelnen zellen
+    for (int c = 0; c < nofCells; c++) {
+        idummy = val<1>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+        idummy = val<2>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+        idummy = val<3>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+        idummy = val<4>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+    }
+
+    // coords
+    // x1-coords
+    for (int n = 0; n < nofNodes; n++) {
+        fdummy = (float)(val<1>(nodes[n]));
+        out.write((char *)&fdummy, sizeof(float));
+    }
+    // x2-coords
+    for (int n = 0; n < nofNodes; n++) {
+        fdummy = (float)(val<2>(nodes[n]));
+        out.write((char *)&fdummy, sizeof(float));
+    }
+    // x3-coords
+    for (int n = 0; n < nofNodes; n++) {
+        fdummy = (float)(val<3>(nodes[n]));
+        out.write((char *)&fdummy, sizeof(float));
+    }
+    // out<<"\n";
+
+    // NODE DATA
+    char labels[1024];
+    char units[1024];
+    strcpy(labels, "");
+    strcpy(units, "");
+
+    for (int d = 0; d < nofNodeData - 1; ++d) {
+        strcat(labels, datanames[d].c_str());
+        strcat(labels, ".");
+    }
+    strcat(labels, datanames[nofNodeData - 1].c_str());
+
+    for (int i = 0; i < (nofNodeData - 1); i++)
+        strcat(units, "no_unit.");
+    strcat(units, "no_unit");
+
+    out.write((char *)&labels, sizeof(labels));
+    out.write((char *)&units, sizeof(units));
+
+    // nof and type of data
+    idummy = nofNodeData;
+    out.write((char *)&idummy, sizeof(int)); // Datentypen pro knoten (hier = nof_node_data, da NUR skalare)
+
+    idummy = 1;
+    for (int i = 0; i < nofNodeData; i++)
+        out.write((char *)&idummy, sizeof(int)); // jeder Datentyp ist ein skalarer Wert
+
+    // min and max of data
+    fdummy = 0.0;
+    for (int i = 0; i < nofNodeData; i++)
+        out.write((char *)&fdummy, sizeof(float)); // min Wert pro Datentyp
+    fdummy = 1.0;
+    for (int i = 0; i < nofNodeData; i++)
+        out.write((char *)&fdummy, sizeof(float)); // max Wert pro Datentyp
+
+    // daten ins file schreiben
+    for (int d = 0; d < nofNodeData; ++d)
+        for (int n = 0; n < (int)nodedata[d].size(); n++) {
+            fdummy = (float)nodedata[d][n];
+            out.write((char *)&fdummy, sizeof(float));
+        }
+
+    fdummy = 1.;
+    for (int i = 0; i < nofNodeData; i++)
+        out.write((char *)&fdummy, sizeof(float)); // max Wert pro Datentyp
+
+    out.close();
+    UBLOG(logDEBUG1, "WbWriterAvsBinary::writeQuadsWithNodeData to " << avsfilename << " - end");
+
+    return avsfilename;
 }
 /*===============================================================================*/
-std::string WbWriterAvsBinary::writeQuadsWithCellData(const string& filename,vector< UbTupleFloat3 >& nodes, vector< UbTupleInt4 >& cells, vector< string >& datanames, vector< vector< double > >& celldata)
+std::string WbWriterAvsBinary::writeQuadsWithCellData(const string &filename, vector<UbTupleFloat3> &nodes,
+                                                      vector<UbTupleInt4> &cells, vector<string> &datanames,
+                                                      vector<vector<double>> &celldata)
 {
-   string avsfilename = filename+getFileExtension();
-   UBLOG(logDEBUG1,"WbWriterAvsBinary::writeQuadsWithCellData to "<<avsfilename<<" - start");
-
-   ofstream out(avsfilename.c_str(),ios::out|ios::binary);
-   if(!out)
-   { 
-      out.clear(); //flags ruecksetzen (ansonsten liefert utern if(!outfile) weiterhin true!!!
-      string path = UbSystem::getPathFromString(avsfilename);
-      if(path.size()>0){UbSystem::makeDirectory(path);out.open(avsfilename.c_str(),ios::out|ios::binary);}
-      if(!out) throw UbException(UB_EXARGS,avsfilename+" konnte nicht geschrieben werden");
-   }
-
-   char magic = (char)7;
-   int   idummy;
-   float fdummy;
-
-   int nofNodes = (int)nodes.size();
-   int nofCells = (int)cells.size();
-
-   int nofNodeData     = 0;
-   int nofCellData     = (int)datanames.size();
-   int nofModelData    = 0;
-   int cellType        = 3; //=quad
-   int nofNodesPerCell = 4; 
-
-   out.write((char*)&magic,sizeof(char));      
-   out.write((char*)&nofNodes,sizeof(int));    
-   out.write((char*)&nofCells,sizeof(int));    
-   out.write((char*)&nofNodeData,sizeof(int)); 
-   out.write((char*)&nofCellData,sizeof(int)); 
-   out.write((char*)&nofModelData,sizeof(int));
-
-   idummy = (int)nofCells*nofNodesPerCell;
-   out.write((char*)&idummy,sizeof(int)); //(nof nodes) * (nodes per cell)
-   for(int c=0; c<nofCells; c++)
-   {
-      idummy=c+1;             out.write((char*)&idummy,sizeof(int)); //cell id
-      idummy=1;               out.write((char*)&idummy,sizeof(int)); //mat
-      idummy=nofNodesPerCell; out.write((char*)&idummy,sizeof(int)); //nodes per cell
-      idummy=cellType;        out.write((char*)&idummy,sizeof(int)); //cell type 
-   }
-   //knotennummern der einzelnen zellen
-   for(int c=0; c<nofCells; c++)
-   {
-      idummy = val<1>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-      idummy = val<2>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-      idummy = val<3>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-      idummy = val<4>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-   }
-
-   //coords
-   //x1-coords
-   for(int n=0; n<nofNodes; n++)
-      { fdummy = (float)( val<1>(nodes[n]) ); out.write((char*)&fdummy ,sizeof(float)); }
-   //x2-coords
-   for(int n=0; n<nofNodes; n++)
-      { fdummy = (float)( val<2>(nodes[n]) ); out.write((char*)&fdummy ,sizeof(float)); }
-   //x3-coords
-   fdummy=0.0;
-   for(int n=0; n<nofNodes; n++)
-      { fdummy = (float)( val<3>(nodes[n]) ); out.write((char*)&fdummy ,sizeof(float)); }
-   //out<<"\n";
-
-   //CELL DATA
-   char labels[1024];
-   char units[1024];
-   strcpy(labels, "");
-   strcpy(units, "");
-
-   for(int d=0; d<nofCellData-1; ++d) { strcat(labels, datanames[d].c_str() ); strcat(labels,"."); }
-   strcat(labels, datanames[nofCellData-1].c_str()); 
-
-   for(int d=0; d<nofCellData-1; ++d) strcat(units, "no_unit.");
-   strcat(units, "no_unit");
-
-   out.write((char*)&labels,sizeof(labels));
-   out.write((char*)&units,sizeof(units));
-
-   //nof and type of data
-   idummy = nofCellData;
-   out.write((char*)&idummy,sizeof(int)); //Datentypen pro knoten (hier = nof_node_data, da NUR skalare)
-
-   idummy = 1;
-   for(int i=0;i<nofCellData;i++) out.write((char*)&idummy,sizeof(int)); //jeder Datentyp ist ein skalarer Wert
-
-   //min and max of data
-   fdummy = 0.0;
-   for(int i=0;i<nofCellData;i++) out.write((char*)&fdummy,sizeof(float)); //min Wert pro Datentyp
-   fdummy = 1.0;
-   for(int i=0;i<nofCellData;i++) out.write((char*)&fdummy,sizeof(float)); //max Wert pro Datentyp
-
-   //daten ins file schreiben
-   for(int d=0; d<nofCellData; ++d)
-      for(int n=0; n<(int)celldata[d].size(); n++)
-         { fdummy=(float)celldata[d][n]; out.write((char*)&fdummy,sizeof(float)); }
-
-   fdummy = 1.;
-   for(int i=0;i<nofCellData;i++) out.write((char*)&fdummy,sizeof(float)); //max Wert pro Datentyp
-
-   out.close(); 
-   UBLOG(logDEBUG1,"WbWriterAvsBinary::writeQuadsWithCellData to "<<avsfilename<<" - end");
-
-   return avsfilename;
+    string avsfilename = filename + getFileExtension();
+    UBLOG(logDEBUG1, "WbWriterAvsBinary::writeQuadsWithCellData to " << avsfilename << " - start");
+
+    ofstream out(avsfilename.c_str(), ios::out | ios::binary);
+    if (!out) {
+        out.clear(); // flags ruecksetzen (ansonsten liefert utern if(!outfile) weiterhin true!!!
+        string path = UbSystem::getPathFromString(avsfilename);
+        if (path.size() > 0) {
+            UbSystem::makeDirectory(path);
+            out.open(avsfilename.c_str(), ios::out | ios::binary);
+        }
+        if (!out)
+            throw UbException(UB_EXARGS, avsfilename + " konnte nicht geschrieben werden");
+    }
+
+    char magic = (char)7;
+    int idummy;
+    float fdummy;
+
+    int nofNodes = (int)nodes.size();
+    int nofCells = (int)cells.size();
+
+    int nofNodeData     = 0;
+    int nofCellData     = (int)datanames.size();
+    int nofModelData    = 0;
+    int cellType        = 3; //=quad
+    int nofNodesPerCell = 4;
+
+    out.write((char *)&magic, sizeof(char));
+    out.write((char *)&nofNodes, sizeof(int));
+    out.write((char *)&nofCells, sizeof(int));
+    out.write((char *)&nofNodeData, sizeof(int));
+    out.write((char *)&nofCellData, sizeof(int));
+    out.write((char *)&nofModelData, sizeof(int));
+
+    idummy = (int)nofCells * nofNodesPerCell;
+    out.write((char *)&idummy, sizeof(int)); //(nof nodes) * (nodes per cell)
+    for (int c = 0; c < nofCells; c++) {
+        idummy = c + 1;
+        out.write((char *)&idummy, sizeof(int)); // cell id
+        idummy = 1;
+        out.write((char *)&idummy, sizeof(int)); // mat
+        idummy = nofNodesPerCell;
+        out.write((char *)&idummy, sizeof(int)); // nodes per cell
+        idummy = cellType;
+        out.write((char *)&idummy, sizeof(int)); // cell type
+    }
+    // knotennummern der einzelnen zellen
+    for (int c = 0; c < nofCells; c++) {
+        idummy = val<1>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+        idummy = val<2>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+        idummy = val<3>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+        idummy = val<4>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+    }
+
+    // coords
+    // x1-coords
+    for (int n = 0; n < nofNodes; n++) {
+        fdummy = (float)(val<1>(nodes[n]));
+        out.write((char *)&fdummy, sizeof(float));
+    }
+    // x2-coords
+    for (int n = 0; n < nofNodes; n++) {
+        fdummy = (float)(val<2>(nodes[n]));
+        out.write((char *)&fdummy, sizeof(float));
+    }
+    // x3-coords
+    fdummy = 0.0;
+    for (int n = 0; n < nofNodes; n++) {
+        fdummy = (float)(val<3>(nodes[n]));
+        out.write((char *)&fdummy, sizeof(float));
+    }
+    // out<<"\n";
+
+    // CELL DATA
+    char labels[1024];
+    char units[1024];
+    strcpy(labels, "");
+    strcpy(units, "");
+
+    for (int d = 0; d < nofCellData - 1; ++d) {
+        strcat(labels, datanames[d].c_str());
+        strcat(labels, ".");
+    }
+    strcat(labels, datanames[nofCellData - 1].c_str());
+
+    for (int d = 0; d < nofCellData - 1; ++d)
+        strcat(units, "no_unit.");
+    strcat(units, "no_unit");
+
+    out.write((char *)&labels, sizeof(labels));
+    out.write((char *)&units, sizeof(units));
+
+    // nof and type of data
+    idummy = nofCellData;
+    out.write((char *)&idummy, sizeof(int)); // Datentypen pro knoten (hier = nof_node_data, da NUR skalare)
+
+    idummy = 1;
+    for (int i = 0; i < nofCellData; i++)
+        out.write((char *)&idummy, sizeof(int)); // jeder Datentyp ist ein skalarer Wert
+
+    // min and max of data
+    fdummy = 0.0;
+    for (int i = 0; i < nofCellData; i++)
+        out.write((char *)&fdummy, sizeof(float)); // min Wert pro Datentyp
+    fdummy = 1.0;
+    for (int i = 0; i < nofCellData; i++)
+        out.write((char *)&fdummy, sizeof(float)); // max Wert pro Datentyp
+
+    // daten ins file schreiben
+    for (int d = 0; d < nofCellData; ++d)
+        for (int n = 0; n < (int)celldata[d].size(); n++) {
+            fdummy = (float)celldata[d][n];
+            out.write((char *)&fdummy, sizeof(float));
+        }
+
+    fdummy = 1.;
+    for (int i = 0; i < nofCellData; i++)
+        out.write((char *)&fdummy, sizeof(float)); // max Wert pro Datentyp
+
+    out.close();
+    UBLOG(logDEBUG1, "WbWriterAvsBinary::writeQuadsWithCellData to " << avsfilename << " - end");
+
+    return avsfilename;
 }
 /*===============================================================================*/
-std::string WbWriterAvsBinary::writeQuadsWithNodeAndCellData(const string& filename,vector< UbTupleFloat3 >& nodes, vector< UbTupleInt4 >& cells, vector< string >& nodedatanames, vector< vector< double > >& nodedata, vector< string >& celldatanames, vector< vector< double > >& celldata)
+std::string WbWriterAvsBinary::writeQuadsWithNodeAndCellData(const string &filename, vector<UbTupleFloat3> &nodes,
+                                                             vector<UbTupleInt4> &cells, vector<string> &nodedatanames,
+                                                             vector<vector<double>> &nodedata,
+                                                             vector<string> &celldatanames,
+                                                             vector<vector<double>> &celldata)
 {
-   string avsfilename = filename+getFileExtension();
-   UBLOG(logDEBUG1,"WbWriterAvsBinary::writeQuadsWithNodeAndCellData to "<<avsfilename<<" - start");
-
-   ofstream out(avsfilename.c_str(),ios::out|ios::binary);
-   if(!out)
-   { 
-      out.clear(); //flags ruecksetzen (ansonsten liefert utern if(!outfile) weiterhin true!!!
-      string path = UbSystem::getPathFromString(avsfilename);
-      if(path.size()>0){UbSystem::makeDirectory(path);out.open(avsfilename.c_str(),ios::out|ios::binary);}
-      if(!out) throw UbException(UB_EXARGS,avsfilename+" konnte nicht geschrieben werden");
-   }
-
-   char magic = (char)7;
-   int   idummy;
-   float fdummy;
-
-   int nofNodes = (int)nodes.size();
-   int nofCells = (int)cells.size();
-
-   int nofNodeData     = (int)nodedatanames.size();
-   int nofCellData     = (int)celldatanames.size();
-   int nofModelData    = 0;
-   int cellType        = 3; //=quad
-   int nofNodesPerCell = 4; 
-
-   out.write((char*)&magic,sizeof(char));      
-   out.write((char*)&nofNodes,sizeof(int));    
-   out.write((char*)&nofCells,sizeof(int));    
-   out.write((char*)&nofNodeData,sizeof(int)); 
-   out.write((char*)&nofCellData,sizeof(int)); 
-   out.write((char*)&nofModelData,sizeof(int));
-
-   idummy = (int)nofCells*nofNodesPerCell;
-   out.write((char*)&idummy,sizeof(int)); //(nof nodes) * (nodes per cell)
-   for(int c=0; c<nofCells; c++)
-   {
-      idummy=c+1;             out.write((char*)&idummy,sizeof(int)); //cell id
-      idummy=1;               out.write((char*)&idummy,sizeof(int)); //mat
-      idummy=nofNodesPerCell; out.write((char*)&idummy,sizeof(int)); //nodes per cell
-      idummy=cellType;        out.write((char*)&idummy,sizeof(int)); //cell type 
-   }
-   //knotennummern der einzelnen zellen
-   for(int c=0; c<nofCells; c++)
-   {
-      idummy = val<1>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-      idummy = val<2>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-      idummy = val<3>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-      idummy = val<4>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-   }
-
-   //coords
-   //x1-coords
-   for(int n=0; n<nofNodes; n++)
-      { fdummy = (float)( val<1>(nodes[n]) ); out.write((char*)&fdummy ,sizeof(float)); }
-   //x2-coords
-   for(int n=0; n<nofNodes; n++)
-      { fdummy = (float)( val<2>(nodes[n]) ); out.write((char*)&fdummy ,sizeof(float)); }
-   //x3-coords
-   for(int n=0; n<nofNodes; n++)
-      { fdummy = (float)( val<3>(nodes[n]) ); out.write((char*)&fdummy ,sizeof(float)); }
-   //out<<"\n";
-
-   //NODE DATA
-   char nodelabels[1024];
-   char nodeunits[1024];
-   strcpy(nodelabels, "");
-   strcpy(nodeunits, "");
-
-   for(int d=0; d<nofNodeData-1; ++d) { strcat(nodelabels, nodedatanames[d].c_str() ); strcat(nodelabels,"."); }
-   strcat(nodelabels, nodedatanames[nofNodeData-1].c_str()); 
-
-   for(int i=0;i<(nofNodeData-1);i++) strcat(nodeunits, "no_unit.");
-   strcat(nodeunits, "no_unit");
-
-   out.write((char*)&nodelabels,sizeof(nodelabels));
-   out.write((char*)&nodeunits,sizeof(nodeunits));
-
-   //nof and type of data
-   idummy = nofNodeData;
-   out.write((char*)&idummy,sizeof(int)); //Datentypen pro knoten (hier = nof_node_data, da NUR skalare)
-
-   idummy = 1;
-   for(int i=0;i<nofNodeData;i++) out.write((char*)&idummy,sizeof(int)); //jeder Datentyp ist ein skalarer Wert
-
-   //min and max of data
-   fdummy = 0.0;
-   for(int i=0;i<nofNodeData;i++) out.write((char*)&fdummy,sizeof(float)); //min Wert pro Datentyp
-   fdummy = 1.0;
-   for(int i=0;i<nofNodeData;i++) out.write((char*)&fdummy,sizeof(float)); //max Wert pro Datentyp
-
-   //daten ins file schreiben
-   for(int d=0; d<nofNodeData; ++d)
-      for(int n=0; n<(int)nodedata[d].size(); n++)
-      { fdummy=(float)nodedata[d][n]; out.write((char*)&fdummy,sizeof(float)); }
-
-   fdummy = 1.;
-   for(int i=0;i<nofNodeData;i++) out.write((char*)&fdummy,sizeof(float)); //max Wert pro Datentyp
-
-   //CELL DATA
-   char celllabels[1024];
-   char cellunits[1024];
-   strcpy(celllabels, "");
-   strcpy(cellunits, "");
-
-   for(int d=0; d<nofCellData-1; ++d) { strcat(celllabels, celldatanames[d].c_str() ); strcat(celllabels,"."); }
-   strcat(celllabels, celldatanames[nofCellData-1].c_str()); 
-
-   for(int d=0; d<nofCellData-1; ++d) strcat(cellunits, "no_unit.");
-   strcat(cellunits, "no_unit");
-
-   out.write((char*)&celllabels,sizeof(celllabels));
-   out.write((char*)&cellunits,sizeof(cellunits));
-
-   //nof and type of data
-   idummy = nofCellData;
-   out.write((char*)&idummy,sizeof(int)); //Datentypen pro knoten (hier = nof_node_data, da NUR skalare)
-
-   idummy = 1;
-   for(int i=0;i<nofCellData;i++) out.write((char*)&idummy,sizeof(int)); //jeder Datentyp ist ein skalarer Wert
-
-   //min and max of data
-   fdummy = 0.0;
-   for(int i=0;i<nofCellData;i++) out.write((char*)&fdummy,sizeof(float)); //min Wert pro Datentyp
-   fdummy = 1.0;
-   for(int i=0;i<nofCellData;i++) out.write((char*)&fdummy,sizeof(float)); //max Wert pro Datentyp
-
-   //daten ins file schreiben
-   for(int d=0; d<nofCellData; ++d)
-      for(int n=0; n<(int)celldata[d].size(); n++)
-      { fdummy=(float)celldata[d][n]; out.write((char*)&fdummy,sizeof(float)); }
-
-   fdummy = 1.;
-   for(int i=0;i<nofCellData;i++) out.write((char*)&fdummy,sizeof(float)); //max Wert pro Datentyp
-
-   out.close(); 
-   UBLOG(logDEBUG1,"WbWriterAvsBinary::writeQuadsWithNodeAndCellData to "<<avsfilename<<" - end");
-
-   return avsfilename;
+    string avsfilename = filename + getFileExtension();
+    UBLOG(logDEBUG1, "WbWriterAvsBinary::writeQuadsWithNodeAndCellData to " << avsfilename << " - start");
+
+    ofstream out(avsfilename.c_str(), ios::out | ios::binary);
+    if (!out) {
+        out.clear(); // flags ruecksetzen (ansonsten liefert utern if(!outfile) weiterhin true!!!
+        string path = UbSystem::getPathFromString(avsfilename);
+        if (path.size() > 0) {
+            UbSystem::makeDirectory(path);
+            out.open(avsfilename.c_str(), ios::out | ios::binary);
+        }
+        if (!out)
+            throw UbException(UB_EXARGS, avsfilename + " konnte nicht geschrieben werden");
+    }
+
+    char magic = (char)7;
+    int idummy;
+    float fdummy;
+
+    int nofNodes = (int)nodes.size();
+    int nofCells = (int)cells.size();
+
+    int nofNodeData     = (int)nodedatanames.size();
+    int nofCellData     = (int)celldatanames.size();
+    int nofModelData    = 0;
+    int cellType        = 3; //=quad
+    int nofNodesPerCell = 4;
+
+    out.write((char *)&magic, sizeof(char));
+    out.write((char *)&nofNodes, sizeof(int));
+    out.write((char *)&nofCells, sizeof(int));
+    out.write((char *)&nofNodeData, sizeof(int));
+    out.write((char *)&nofCellData, sizeof(int));
+    out.write((char *)&nofModelData, sizeof(int));
+
+    idummy = (int)nofCells * nofNodesPerCell;
+    out.write((char *)&idummy, sizeof(int)); //(nof nodes) * (nodes per cell)
+    for (int c = 0; c < nofCells; c++) {
+        idummy = c + 1;
+        out.write((char *)&idummy, sizeof(int)); // cell id
+        idummy = 1;
+        out.write((char *)&idummy, sizeof(int)); // mat
+        idummy = nofNodesPerCell;
+        out.write((char *)&idummy, sizeof(int)); // nodes per cell
+        idummy = cellType;
+        out.write((char *)&idummy, sizeof(int)); // cell type
+    }
+    // knotennummern der einzelnen zellen
+    for (int c = 0; c < nofCells; c++) {
+        idummy = val<1>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+        idummy = val<2>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+        idummy = val<3>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+        idummy = val<4>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+    }
+
+    // coords
+    // x1-coords
+    for (int n = 0; n < nofNodes; n++) {
+        fdummy = (float)(val<1>(nodes[n]));
+        out.write((char *)&fdummy, sizeof(float));
+    }
+    // x2-coords
+    for (int n = 0; n < nofNodes; n++) {
+        fdummy = (float)(val<2>(nodes[n]));
+        out.write((char *)&fdummy, sizeof(float));
+    }
+    // x3-coords
+    for (int n = 0; n < nofNodes; n++) {
+        fdummy = (float)(val<3>(nodes[n]));
+        out.write((char *)&fdummy, sizeof(float));
+    }
+    // out<<"\n";
+
+    // NODE DATA
+    char nodelabels[1024];
+    char nodeunits[1024];
+    strcpy(nodelabels, "");
+    strcpy(nodeunits, "");
+
+    for (int d = 0; d < nofNodeData - 1; ++d) {
+        strcat(nodelabels, nodedatanames[d].c_str());
+        strcat(nodelabels, ".");
+    }
+    strcat(nodelabels, nodedatanames[nofNodeData - 1].c_str());
+
+    for (int i = 0; i < (nofNodeData - 1); i++)
+        strcat(nodeunits, "no_unit.");
+    strcat(nodeunits, "no_unit");
+
+    out.write((char *)&nodelabels, sizeof(nodelabels));
+    out.write((char *)&nodeunits, sizeof(nodeunits));
+
+    // nof and type of data
+    idummy = nofNodeData;
+    out.write((char *)&idummy, sizeof(int)); // Datentypen pro knoten (hier = nof_node_data, da NUR skalare)
+
+    idummy = 1;
+    for (int i = 0; i < nofNodeData; i++)
+        out.write((char *)&idummy, sizeof(int)); // jeder Datentyp ist ein skalarer Wert
+
+    // min and max of data
+    fdummy = 0.0;
+    for (int i = 0; i < nofNodeData; i++)
+        out.write((char *)&fdummy, sizeof(float)); // min Wert pro Datentyp
+    fdummy = 1.0;
+    for (int i = 0; i < nofNodeData; i++)
+        out.write((char *)&fdummy, sizeof(float)); // max Wert pro Datentyp
+
+    // daten ins file schreiben
+    for (int d = 0; d < nofNodeData; ++d)
+        for (int n = 0; n < (int)nodedata[d].size(); n++) {
+            fdummy = (float)nodedata[d][n];
+            out.write((char *)&fdummy, sizeof(float));
+        }
+
+    fdummy = 1.;
+    for (int i = 0; i < nofNodeData; i++)
+        out.write((char *)&fdummy, sizeof(float)); // max Wert pro Datentyp
+
+    // CELL DATA
+    char celllabels[1024];
+    char cellunits[1024];
+    strcpy(celllabels, "");
+    strcpy(cellunits, "");
+
+    for (int d = 0; d < nofCellData - 1; ++d) {
+        strcat(celllabels, celldatanames[d].c_str());
+        strcat(celllabels, ".");
+    }
+    strcat(celllabels, celldatanames[nofCellData - 1].c_str());
+
+    for (int d = 0; d < nofCellData - 1; ++d)
+        strcat(cellunits, "no_unit.");
+    strcat(cellunits, "no_unit");
+
+    out.write((char *)&celllabels, sizeof(celllabels));
+    out.write((char *)&cellunits, sizeof(cellunits));
+
+    // nof and type of data
+    idummy = nofCellData;
+    out.write((char *)&idummy, sizeof(int)); // Datentypen pro knoten (hier = nof_node_data, da NUR skalare)
+
+    idummy = 1;
+    for (int i = 0; i < nofCellData; i++)
+        out.write((char *)&idummy, sizeof(int)); // jeder Datentyp ist ein skalarer Wert
+
+    // min and max of data
+    fdummy = 0.0;
+    for (int i = 0; i < nofCellData; i++)
+        out.write((char *)&fdummy, sizeof(float)); // min Wert pro Datentyp
+    fdummy = 1.0;
+    for (int i = 0; i < nofCellData; i++)
+        out.write((char *)&fdummy, sizeof(float)); // max Wert pro Datentyp
+
+    // daten ins file schreiben
+    for (int d = 0; d < nofCellData; ++d)
+        for (int n = 0; n < (int)celldata[d].size(); n++) {
+            fdummy = (float)celldata[d][n];
+            out.write((char *)&fdummy, sizeof(float));
+        }
+
+    fdummy = 1.;
+    for (int i = 0; i < nofCellData; i++)
+        out.write((char *)&fdummy, sizeof(float)); // max Wert pro Datentyp
+
+    out.close();
+    UBLOG(logDEBUG1, "WbWriterAvsBinary::writeQuadsWithNodeAndCellData to " << avsfilename << " - end");
+
+    return avsfilename;
 }
 /*===============================================================================*/
-std::string WbWriterAvsBinary::writeOctsWithCellData(const string& filename,vector<UbTupleFloat3 >& nodes, vector<UbTupleInt8 >& cells, vector<string >& datanames, vector<vector<double > >& celldata)
+std::string WbWriterAvsBinary::writeOctsWithCellData(const string &filename, vector<UbTupleFloat3> &nodes,
+                                                     vector<UbTupleInt8> &cells, vector<string> &datanames,
+                                                     vector<vector<double>> &celldata)
 {
-    string avsfilename = filename+getFileExtension();
-    UBLOG(logDEBUG1,"WbWriterAvsBinary::writeOctsWithCellData to "<<avsfilename<<" - start");
-
-    ofstream out(avsfilename.c_str(),ios::out|ios::binary);
-    if(!out)
-    { 
-       out.clear(); //flags ruecksetzen (ansonsten liefert utern if(!outfile) weiterhin true!!!
-       string path = UbSystem::getPathFromString(avsfilename);
-       if(path.size()>0){UbSystem::makeDirectory(path);out.open(avsfilename.c_str(),ios::out|ios::binary);}
-       if(!out) throw UbException(UB_EXARGS,"file konnte nicht geschrieben werden");
+    string avsfilename = filename + getFileExtension();
+    UBLOG(logDEBUG1, "WbWriterAvsBinary::writeOctsWithCellData to " << avsfilename << " - start");
+
+    ofstream out(avsfilename.c_str(), ios::out | ios::binary);
+    if (!out) {
+        out.clear(); // flags ruecksetzen (ansonsten liefert utern if(!outfile) weiterhin true!!!
+        string path = UbSystem::getPathFromString(avsfilename);
+        if (path.size() > 0) {
+            UbSystem::makeDirectory(path);
+            out.open(avsfilename.c_str(), ios::out | ios::binary);
+        }
+        if (!out)
+            throw UbException(UB_EXARGS, "file konnte nicht geschrieben werden");
     }
 
     char magic = (char)7;
-    int   idummy;
+    int idummy;
     float fdummy;
 
     int nofNodes = (int)nodes.size();
@@ -778,110 +965,143 @@ std::string WbWriterAvsBinary::writeOctsWithCellData(const string& filename,vect
     int nofCellData     = (int)datanames.size();
     int nofModelData    = 0;
     int cellType        = 7; //=hex
-    int nofNodesPerCell = 8; 
-
-    out.write((char*)&magic,sizeof(char));      
-    out.write((char*)&nofNodes,sizeof(int));    
-    out.write((char*)&nofCells,sizeof(int));    
-    out.write((char*)&nofNodeData,sizeof(int)); 
-    out.write((char*)&nofCellData,sizeof(int)); 
-    out.write((char*)&nofModelData,sizeof(int));
-
-    idummy = (int)nofCells*nofNodesPerCell;
-    out.write((char*)&idummy,sizeof(int)); //(nof nodes) * (nodes per cell)
-    for(int c=0; c<nofCells; c++)
-    {
-       idummy=c+1;             out.write((char*)&idummy,sizeof(int)); //cell id
-       idummy=1;               out.write((char*)&idummy,sizeof(int)); //mat
-       idummy=nofNodesPerCell; out.write((char*)&idummy,sizeof(int)); //nodes per cell
-       idummy=cellType;        out.write((char*)&idummy,sizeof(int)); //cell type 
-    }
-    //knotennummern der einzelnen zellen
-    for(int c=0; c<nofCells; c++)
-    {
-       idummy = val<1>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-       idummy = val<2>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-       idummy = val<3>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-       idummy = val<4>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-       idummy = val<5>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-       idummy = val<6>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-       idummy = val<7>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-       idummy = val<8>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-    }
-
-    //coords
-    //x1-coords
-    for(int n=0; n<nofNodes; n++)
-      { fdummy = (float)( val<1>(nodes[n]) ); out.write((char*)&fdummy ,sizeof(float)); }
-    //x2-coords
-    for(int n=0; n<nofNodes; n++)
-      { fdummy = (float)( val<2>(nodes[n]) ); out.write((char*)&fdummy ,sizeof(float)); }
-    //x3-coords
-    for(int n=0; n<nofNodes; n++)
-      { fdummy = (float)( val<3>(nodes[n]) ); out.write((char*)&fdummy ,sizeof(float)); }
-    //out<<"\n";
-
-    //CELL DATA
+    int nofNodesPerCell = 8;
+
+    out.write((char *)&magic, sizeof(char));
+    out.write((char *)&nofNodes, sizeof(int));
+    out.write((char *)&nofCells, sizeof(int));
+    out.write((char *)&nofNodeData, sizeof(int));
+    out.write((char *)&nofCellData, sizeof(int));
+    out.write((char *)&nofModelData, sizeof(int));
+
+    idummy = (int)nofCells * nofNodesPerCell;
+    out.write((char *)&idummy, sizeof(int)); //(nof nodes) * (nodes per cell)
+    for (int c = 0; c < nofCells; c++) {
+        idummy = c + 1;
+        out.write((char *)&idummy, sizeof(int)); // cell id
+        idummy = 1;
+        out.write((char *)&idummy, sizeof(int)); // mat
+        idummy = nofNodesPerCell;
+        out.write((char *)&idummy, sizeof(int)); // nodes per cell
+        idummy = cellType;
+        out.write((char *)&idummy, sizeof(int)); // cell type
+    }
+    // knotennummern der einzelnen zellen
+    for (int c = 0; c < nofCells; c++) {
+        idummy = val<1>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+        idummy = val<2>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+        idummy = val<3>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+        idummy = val<4>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+        idummy = val<5>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+        idummy = val<6>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+        idummy = val<7>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+        idummy = val<8>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+    }
+
+    // coords
+    // x1-coords
+    for (int n = 0; n < nofNodes; n++) {
+        fdummy = (float)(val<1>(nodes[n]));
+        out.write((char *)&fdummy, sizeof(float));
+    }
+    // x2-coords
+    for (int n = 0; n < nofNodes; n++) {
+        fdummy = (float)(val<2>(nodes[n]));
+        out.write((char *)&fdummy, sizeof(float));
+    }
+    // x3-coords
+    for (int n = 0; n < nofNodes; n++) {
+        fdummy = (float)(val<3>(nodes[n]));
+        out.write((char *)&fdummy, sizeof(float));
+    }
+    // out<<"\n";
+
+    // CELL DATA
     char labels[1024];
     char units[1024];
     strcpy(labels, "");
     strcpy(units, "");
 
-    for(int d=0; d<nofCellData-1; ++d) { strcat(labels, datanames[d].c_str() ); strcat(labels,"."); }
-    strcat(labels, datanames[nofCellData-1].c_str()); 
+    for (int d = 0; d < nofCellData - 1; ++d) {
+        strcat(labels, datanames[d].c_str());
+        strcat(labels, ".");
+    }
+    strcat(labels, datanames[nofCellData - 1].c_str());
 
-    for(int d=0; d<nofCellData-1; ++d) strcat(units, "no_unit.");
+    for (int d = 0; d < nofCellData - 1; ++d)
+        strcat(units, "no_unit.");
     strcat(units, "no_unit");
 
-    out.write((char*)&labels,sizeof(labels));
-    out.write((char*)&units,sizeof(units));
+    out.write((char *)&labels, sizeof(labels));
+    out.write((char *)&units, sizeof(units));
 
-    //nof and type of data
+    // nof and type of data
     idummy = nofCellData;
-    out.write((char*)&idummy,sizeof(int)); //Datentypen pro knoten (hier = nof_node_data, da NUR skalare)
+    out.write((char *)&idummy, sizeof(int)); // Datentypen pro knoten (hier = nof_node_data, da NUR skalare)
 
     idummy = 1;
-    for(int i=0;i<nofCellData;i++) out.write((char*)&idummy,sizeof(int)); //jeder Datentyp ist ein skalarer Wert
+    for (int i = 0; i < nofCellData; i++)
+        out.write((char *)&idummy, sizeof(int)); // jeder Datentyp ist ein skalarer Wert
 
-    //min and max of data
+    // min and max of data
     fdummy = 0.0;
-    for(int i=0;i<nofCellData;i++) out.write((char*)&fdummy,sizeof(float)); //min Wert pro Datentyp
+    for (int i = 0; i < nofCellData; i++)
+        out.write((char *)&fdummy, sizeof(float)); // min Wert pro Datentyp
     fdummy = 1.0;
-    for(int i=0;i<nofCellData;i++) out.write((char*)&fdummy,sizeof(float)); //max Wert pro Datentyp
+    for (int i = 0; i < nofCellData; i++)
+        out.write((char *)&fdummy, sizeof(float)); // max Wert pro Datentyp
 
-    //daten ins file schreiben
-    for(int d=0; d<nofCellData; ++d)
-    for(int n=0; n<(int)celldata[d].size(); n++)
-    { fdummy=(float)celldata[d][n]; out.write((char*)&fdummy,sizeof(float)); }
+    // daten ins file schreiben
+    for (int d = 0; d < nofCellData; ++d)
+        for (int n = 0; n < (int)celldata[d].size(); n++) {
+            fdummy = (float)celldata[d][n];
+            out.write((char *)&fdummy, sizeof(float));
+        }
 
     fdummy = 1.;
-    for(int i=0;i<nofCellData;i++) out.write((char*)&fdummy,sizeof(float)); //max Wert pro Datentyp
+    for (int i = 0; i < nofCellData; i++)
+        out.write((char *)&fdummy, sizeof(float)); // max Wert pro Datentyp
 
-    out.close(); 
-    UBLOG(logDEBUG1,"WbWriterAvsBinary::writeOctsWithCellData to "<<avsfilename<<" - end");
+    out.close();
+    UBLOG(logDEBUG1, "WbWriterAvsBinary::writeOctsWithCellData to " << avsfilename << " - end");
 
     return avsfilename;
- }
+}
 /*===============================================================================*/
-std::string WbWriterAvsBinary::writeOctsWithNodeData(const string& filename,vector<UbTupleFloat3 >& nodes, vector<UbTupleUInt8 >& cells, vector<string >& datanames, vector<vector<double > >& nodedata)
+std::string WbWriterAvsBinary::writeOctsWithNodeData(const string &filename, vector<UbTupleFloat3> &nodes,
+                                                     vector<UbTupleUInt8> &cells, vector<string> &datanames,
+                                                     vector<vector<double>> &nodedata)
 {
-    string avsfilename = filename+getFileExtension();
-    UBLOG(logDEBUG1,"WbWriterAvsBinary::writeOctsWithNodeData to "<<avsfilename<<" - start");
-
-    ofstream out(avsfilename.c_str(),ios::out|ios::binary);
-    if(!out)
-    { 
-       out.clear(); //flags ruecksetzen (ansonsten liefert utern if(!outfile) weiterhin true!!!
-       string path = UbSystem::getPathFromString(avsfilename);
-       if(path.size()>0){UbSystem::makeDirectory(path);out.open(avsfilename.c_str(),ios::out|ios::binary);}
-       if(!out) throw UbException(UB_EXARGS,"file konnte nicht geschrieben werden");
+    string avsfilename = filename + getFileExtension();
+    UBLOG(logDEBUG1, "WbWriterAvsBinary::writeOctsWithNodeData to " << avsfilename << " - start");
+
+    ofstream out(avsfilename.c_str(), ios::out | ios::binary);
+    if (!out) {
+        out.clear(); // flags ruecksetzen (ansonsten liefert utern if(!outfile) weiterhin true!!!
+        string path = UbSystem::getPathFromString(avsfilename);
+        if (path.size() > 0) {
+            UbSystem::makeDirectory(path);
+            out.open(avsfilename.c_str(), ios::out | ios::binary);
+        }
+        if (!out)
+            throw UbException(UB_EXARGS, "file konnte nicht geschrieben werden");
     }
 
-    if((int)nodedata.size()==0) throw UbException(UB_EXARGS,"no nodedata!!!");
-    if(nodes.size()!=nodedata[0].size()) throw UbException(UB_EXARGS,"nodedata != nofNodes!!!");
+    if ((int)nodedata.size() == 0)
+        throw UbException(UB_EXARGS, "no nodedata!!!");
+    if (nodes.size() != nodedata[0].size())
+        throw UbException(UB_EXARGS, "nodedata != nofNodes!!!");
 
     char magic = (char)7;
-    int   idummy;
+    int idummy;
     float fdummy;
 
     int nofNodes = (int)nodes.size();
@@ -891,87 +1111,112 @@ std::string WbWriterAvsBinary::writeOctsWithNodeData(const string& filename,vect
     int nofCellData     = 0;
     int nofModelData    = 0;
     int cellType        = 7; //=hex
-    int nofNodesPerCell = 8; 
-
-    out.write((char*)&magic,sizeof(char));      
-    out.write((char*)&nofNodes,sizeof(int));    
-    out.write((char*)&nofCells,sizeof(int));    
-    out.write((char*)&nofNodeData,sizeof(int)); 
-    out.write((char*)&nofCellData,sizeof(int)); 
-    out.write((char*)&nofModelData,sizeof(int));
-
-    idummy = (int)nofCells*nofNodesPerCell;
-    out.write((char*)&idummy,sizeof(int)); //(nof nodes) * (nodes per cell)
-    for(int c=0; c<nofCells; c++)
-    {
-       idummy=c+1;             out.write((char*)&idummy,sizeof(int)); //cell id
-       idummy=1;               out.write((char*)&idummy,sizeof(int)); //mat
-       idummy=nofNodesPerCell; out.write((char*)&idummy,sizeof(int)); //nodes per cell
-       idummy=cellType;        out.write((char*)&idummy,sizeof(int)); //cell type 
-    }
-    //knotennummern der einzelnen zellen
-    for(int c=0; c<nofCells; c++)
-    {
-       idummy = val<1>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-       idummy = val<2>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-       idummy = val<3>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-       idummy = val<4>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-       idummy = val<5>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-       idummy = val<6>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-       idummy = val<7>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-       idummy = val<8>(cells[c])+1; out.write((char*)&idummy,sizeof(int)); 
-    }
-
-    //coords
-    //x1-coords
-    for(int n=0; n<nofNodes; n++)
-      { fdummy = (float)( val<1>(nodes[n]) ); out.write((char*)&fdummy ,sizeof(float)); }
-    //x2-coords
-    for(int n=0; n<nofNodes; n++)
-       { fdummy = (float)( val<2>(nodes[n]) ); out.write((char*)&fdummy ,sizeof(float)); }
-    //x3-coords
-    for(int n=0; n<nofNodes; n++)
-       { fdummy = (float)( val<3>(nodes[n]) ); out.write((char*)&fdummy ,sizeof(float)); }
-
-    //NODE DATA
+    int nofNodesPerCell = 8;
+
+    out.write((char *)&magic, sizeof(char));
+    out.write((char *)&nofNodes, sizeof(int));
+    out.write((char *)&nofCells, sizeof(int));
+    out.write((char *)&nofNodeData, sizeof(int));
+    out.write((char *)&nofCellData, sizeof(int));
+    out.write((char *)&nofModelData, sizeof(int));
+
+    idummy = (int)nofCells * nofNodesPerCell;
+    out.write((char *)&idummy, sizeof(int)); //(nof nodes) * (nodes per cell)
+    for (int c = 0; c < nofCells; c++) {
+        idummy = c + 1;
+        out.write((char *)&idummy, sizeof(int)); // cell id
+        idummy = 1;
+        out.write((char *)&idummy, sizeof(int)); // mat
+        idummy = nofNodesPerCell;
+        out.write((char *)&idummy, sizeof(int)); // nodes per cell
+        idummy = cellType;
+        out.write((char *)&idummy, sizeof(int)); // cell type
+    }
+    // knotennummern der einzelnen zellen
+    for (int c = 0; c < nofCells; c++) {
+        idummy = val<1>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+        idummy = val<2>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+        idummy = val<3>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+        idummy = val<4>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+        idummy = val<5>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+        idummy = val<6>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+        idummy = val<7>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+        idummy = val<8>(cells[c]) + 1;
+        out.write((char *)&idummy, sizeof(int));
+    }
+
+    // coords
+    // x1-coords
+    for (int n = 0; n < nofNodes; n++) {
+        fdummy = (float)(val<1>(nodes[n]));
+        out.write((char *)&fdummy, sizeof(float));
+    }
+    // x2-coords
+    for (int n = 0; n < nofNodes; n++) {
+        fdummy = (float)(val<2>(nodes[n]));
+        out.write((char *)&fdummy, sizeof(float));
+    }
+    // x3-coords
+    for (int n = 0; n < nofNodes; n++) {
+        fdummy = (float)(val<3>(nodes[n]));
+        out.write((char *)&fdummy, sizeof(float));
+    }
+
+    // NODE DATA
     char labels[1024];
     char units[1024];
     strcpy(labels, "");
     strcpy(units, "");
 
-    for(int d=0; d<nofNodeData-1; ++d) 
-    { strcat(labels, datanames[d].c_str() ); strcat(labels,"."); }
-    strcat(labels, datanames[nofNodeData-1].c_str()); 
+    for (int d = 0; d < nofNodeData - 1; ++d) {
+        strcat(labels, datanames[d].c_str());
+        strcat(labels, ".");
+    }
+    strcat(labels, datanames[nofNodeData - 1].c_str());
 
-    for(int i=0;i<(nofNodeData-1);i++) strcat(units, "no_unit.");
+    for (int i = 0; i < (nofNodeData - 1); i++)
+        strcat(units, "no_unit.");
     strcat(units, "no_unit");
 
-    out.write((char*)&labels,sizeof(labels));
-    out.write((char*)&units,sizeof(units));
+    out.write((char *)&labels, sizeof(labels));
+    out.write((char *)&units, sizeof(units));
 
-    //nof and type of data
+    // nof and type of data
     idummy = nofNodeData;
-    out.write((char*)&idummy,sizeof(int)); //Datentypen pro knoten (hier = nof_node_data, da NUR skalare)
+    out.write((char *)&idummy, sizeof(int)); // Datentypen pro knoten (hier = nof_node_data, da NUR skalare)
 
     idummy = 1;
-    for(int i=0;i<nofNodeData;i++) out.write((char*)&idummy,sizeof(int)); //jeder Datentyp ist ein skalarer Wert
+    for (int i = 0; i < nofNodeData; i++)
+        out.write((char *)&idummy, sizeof(int)); // jeder Datentyp ist ein skalarer Wert
 
-    //min and max of data
+    // min and max of data
     fdummy = 0.0;
-    for(int i=0;i<nofNodeData;i++) out.write((char*)&fdummy,sizeof(float)); //min Wert pro Datentyp
+    for (int i = 0; i < nofNodeData; i++)
+        out.write((char *)&fdummy, sizeof(float)); // min Wert pro Datentyp
     fdummy = 1.0;
-    for(int i=0;i<nofNodeData;i++) out.write((char*)&fdummy,sizeof(float)); //max Wert pro Datentyp
+    for (int i = 0; i < nofNodeData; i++)
+        out.write((char *)&fdummy, sizeof(float)); // max Wert pro Datentyp
 
-    //daten ins file schreiben
-    for(int d=0; d<nofNodeData; ++d)
-       for(int n=0; n<(int)nodedata[d].size(); n++)
-       { fdummy=(float)nodedata[d][n]; out.write((char*)&fdummy,sizeof(float)); }
+    // daten ins file schreiben
+    for (int d = 0; d < nofNodeData; ++d)
+        for (int n = 0; n < (int)nodedata[d].size(); n++) {
+            fdummy = (float)nodedata[d][n];
+            out.write((char *)&fdummy, sizeof(float));
+        }
 
     fdummy = 1.;
-    for(int i=0;i<nofNodeData;i++) out.write((char*)&fdummy,sizeof(float)); //max Wert pro Datentyp
+    for (int i = 0; i < nofNodeData; i++)
+        out.write((char *)&fdummy, sizeof(float)); // max Wert pro Datentyp
 
-    out.close(); 
-    UBLOG(logDEBUG1,"WbWriterAvsBinary::writeOctsWithNodeData to "<<avsfilename<<" - end");
+    out.close();
+    UBLOG(logDEBUG1, "WbWriterAvsBinary::writeOctsWithNodeData to " << avsfilename << " - end");
 
     return avsfilename;
- }
+}
diff --git a/src/basics/basics/writer/WbWriterAvsBinary.h b/src/basics/basics/writer/WbWriterAvsBinary.h
index 17b44adaa4f19993c8b50b32bf707290308b8803..42e50debd8b63f877fc132d652088dfaefb1271e 100644
--- a/src/basics/basics/writer/WbWriterAvsBinary.h
+++ b/src/basics/basics/writer/WbWriterAvsBinary.h
@@ -12,60 +12,79 @@
 class WbWriterAvsBinary : public WbWriter
 {
 public:
-   static WbWriterAvsBinary* getInstance()
-   {
-      static WbWriterAvsBinary instance;
-      return &instance;
-   }
+    static WbWriterAvsBinary *getInstance()
+    {
+        static WbWriterAvsBinary instance;
+        return &instance;
+    }
+
+    WbWriterAvsBinary(const WbWriterAvsBinary &) = delete;
+    const WbWriterAvsBinary &operator=(const WbWriterAvsBinary &) = delete;
 
-    WbWriterAvsBinary( const WbWriterAvsBinary& ) = delete;
-    const WbWriterAvsBinary& operator=( const WbWriterAvsBinary& ) = delete;
 private:
-   WbWriterAvsBinary() = default;
+    WbWriterAvsBinary() = default;
 
 public:
-   std::string getFileExtension() override { return ".bin.inp"; }
+    std::string getFileExtension() override { return ".bin.inp"; }
+
+    //////////////////////////////////////////////////////////////////////////
+    // lines
+    //     0 ---- 1
+    // nodenumbering must start with 0!
+    std::string writeLines(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                           std::vector<UbTupleInt2> &lines) override;
 
-   //////////////////////////////////////////////////////////////////////////
-   //lines
-   //     0 ---- 1
-   //nodenumbering must start with 0!
-   std::string writeLines(const std::string& filename,std::vector<UbTupleFloat3 >& nodes, std::vector<UbTupleInt2 >& lines) override;
+    //////////////////////////////////////////////////////////////////////////
+    // triangles
+    // cell numbering:
+    //                    2
+    //
+    //                  0---1
+    // nodenumbering must start with 0!
+    std::string writeTriangles(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                               std::vector<UbTuple<int, int, int>> &triangles) override;
+    std::string writeTrianglesWithNodeData(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                                           std::vector<UbTupleInt3> &cells, std::vector<std::string> &datanames,
+                                           std::vector<std::vector<double>> &nodedata) override;
 
-   //////////////////////////////////////////////////////////////////////////
-   //triangles
-   //cell numbering:
-   //                    2
-   //                      
-   //                  0---1
-   //nodenumbering must start with 0!
-   std::string writeTriangles(const std::string& filename,std::vector<UbTupleFloat3 >& nodes, std::vector<UbTuple<int,int,int> >& triangles) override;
-   std::string writeTrianglesWithNodeData(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt3 >& cells, std::vector< std::string >& datanames, std::vector< std::vector< double > >& nodedata) override;
-   
-   //////////////////////////////////////////////////////////////////////////
-   //quads
-   //cell numbering:
-   //                  3---2
-   //                  |   |
-   //                  0---1
-   //nodenumbering must start with 0!
-   std::string writeQuads(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt4 >& cells) override;
-   std::string writeQuadsWithNodeData(const std::string& filename, std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt4 >& cells, std::vector< std::string >& datanames, std::vector< std::vector< double > >& nodedata) override;
-   std::string writeQuadsWithCellData(const std::string& filename, std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt4 >& cells, std::vector< std::string >& datanames, std::vector< std::vector< double > >& celldata) override;
-   std::string writeQuadsWithNodeAndCellData(const std::string& filename, std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt4 >& cells, std::vector< std::string >& nodedatanames, std::vector< std::vector< double > >& nodedata, std::vector< std::string >& celldatanames, std::vector< std::vector< double > >& celldata) override;
+    //////////////////////////////////////////////////////////////////////////
+    // quads
+    // cell numbering:
+    //                  3---2
+    //                  |   |
+    //                  0---1
+    // nodenumbering must start with 0!
+    std::string writeQuads(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                           std::vector<UbTupleInt4> &cells) override;
+    std::string writeQuadsWithNodeData(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                                       std::vector<UbTupleInt4> &cells, std::vector<std::string> &datanames,
+                                       std::vector<std::vector<double>> &nodedata) override;
+    std::string writeQuadsWithCellData(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                                       std::vector<UbTupleInt4> &cells, std::vector<std::string> &datanames,
+                                       std::vector<std::vector<double>> &celldata) override;
+    std::string writeQuadsWithNodeAndCellData(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                                              std::vector<UbTupleInt4> &cells, std::vector<std::string> &nodedatanames,
+                                              std::vector<std::vector<double>> &nodedata,
+                                              std::vector<std::string> &celldatanames,
+                                              std::vector<std::vector<double>> &celldata) override;
 
-   //////////////////////////////////////////////////////////////////////////
-   //octs
-   //     7 ---- 6
-   //    /|     /|
-   //   4 +--- 5 |
-   //   | |    | |
-   //   | 3 ---+ 2
-   //   |/     |/
-   //   0 ---- 1
-   std::string writeOcts(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt8 >& cells) override;
-   std::string writeOctsWithCellData(const std::string& filename, std::vector<UbTupleFloat3 >& nodes, std::vector<UbTupleInt8 >& cells, std::vector<std::string >& datanames, std::vector< std::vector<double > >& celldata) override;
-   std::string writeOctsWithNodeData(const std::string& filename, std::vector<UbTupleFloat3 >& nodes, std::vector<UbTupleUInt8 >& cells, std::vector<std::string >& datanames, std::vector< std::vector<double > >& nodedata) override;
+    //////////////////////////////////////////////////////////////////////////
+    // octs
+    //     7 ---- 6
+    //    /|     /|
+    //   4 +--- 5 |
+    //   | |    | |
+    //   | 3 ---+ 2
+    //   |/     |/
+    //   0 ---- 1
+    std::string writeOcts(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                          std::vector<UbTupleInt8> &cells) override;
+    std::string writeOctsWithCellData(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                                      std::vector<UbTupleInt8> &cells, std::vector<std::string> &datanames,
+                                      std::vector<std::vector<double>> &celldata) override;
+    std::string writeOctsWithNodeData(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                                      std::vector<UbTupleUInt8> &cells, std::vector<std::string> &datanames,
+                                      std::vector<std::vector<double>> &nodedata) override;
 };
 
-#endif //WBWRITERAVSBINARY_H
+#endif // WBWRITERAVSBINARY_H
diff --git a/src/basics/basics/writer/WbWriterBOBJ.cpp b/src/basics/basics/writer/WbWriterBOBJ.cpp
index fa88708b2de715471fb3f04c69ab6c3c2d2d45e1..4401f25b0bd2dc0a9ac8161b901a9d53683ad941 100644
--- a/src/basics/basics/writer/WbWriterBOBJ.cpp
+++ b/src/basics/basics/writer/WbWriterBOBJ.cpp
@@ -1,79 +1,81 @@
 #ifdef CAB_ZLIB
-   #include <basics/writer/WbWriterBOBJ.h>
-   #include <basics/utilities/UbLogger.h>
-   #include <cstring>
+#include <basics/utilities/UbLogger.h>
+#include <basics/writer/WbWriterBOBJ.h>
+#include <cstring>
 
-   #include <zlib.h>
+#include <zlib.h>
 
+using namespace std;
+/*===============================================================================*/
+std::string WbWriterBOBJ::writeTriangles(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                                         std::vector<UbTupleInt3> &triangles)
+{
+    string bobjFilename = filename + getFileExtension();
+    UBLOG(logDEBUG1, "WbWriterBOBJ::writeTriangles to " << bobjFilename << " - start");
 
-   using namespace std;
-   /*===============================================================================*/
-   std::string WbWriterBOBJ::writeTriangles(const std::string& filename,std::vector<UbTupleFloat3 >& nodes, std::vector<UbTupleInt3 >& triangles)
-   {
-      string bobjFilename=filename+getFileExtension();
-      UBLOG(logDEBUG1,"WbWriterBOBJ::writeTriangles to "<<bobjFilename<<" - start");
+    gzFile gzf = gzopen(bobjFilename.c_str(), "wb1");
 
-      gzFile gzf = gzopen( bobjFilename.c_str(), "wb1" );
-      
-      size_t nofNodes     = nodes.size(); 
-      size_t nofTriangles = triangles.size(); 
+    size_t nofNodes     = nodes.size();
+    size_t nofTriangles = triangles.size();
 
-      //write to file
-      size_t numVerts;
-      //double v[3];
-      if(sizeof(numVerts)!=4) { throw UbException(UB_EXARGS,"danger..."); }
-      numVerts = nofNodes;
-      gzwrite(gzf, &numVerts, sizeof(numVerts));
+    // write to file
+    size_t numVerts;
+    // double v[3];
+    if (sizeof(numVerts) != 4) {
+        throw UbException(UB_EXARGS, "danger...");
+    }
+    numVerts = nofNodes;
+    gzwrite(gzf, &numVerts, sizeof(numVerts));
 
-      for(size_t k=0; k<nofNodes; k++) {
-         float vertp = val<1>(nodes[k]);
-         gzwrite(gzf, &vertp, sizeof(vertp));
-         vertp       = val<2>(nodes[k]);
-         gzwrite(gzf, &vertp, sizeof(vertp));
-         vertp       = val<3>(nodes[k]);
-         gzwrite(gzf, &vertp, sizeof(vertp));
-      }
+    for (size_t k = 0; k < nofNodes; k++) {
+        float vertp = val<1>(nodes[k]);
+        gzwrite(gzf, &vertp, sizeof(vertp));
+        vertp = val<2>(nodes[k]);
+        gzwrite(gzf, &vertp, sizeof(vertp));
+        vertp = val<3>(nodes[k]);
+        gzwrite(gzf, &vertp, sizeof(vertp));
+    }
 
-      //NORMAL VECTOR
-      //double n[3];
-      gzwrite(gzf, &numVerts, sizeof(numVerts));
-      for(size_t k=0; k<nofNodes; k++) {
-         //poly->GetPointData()->GetNormals()->GetTuple(k, n);
-         float normp = 0.0;//n[0];
-         gzwrite(gzf, &normp, sizeof(normp));
-         normp = 0.0;//n[1];
-         gzwrite(gzf, &normp, sizeof(normp));
-         normp = 0.0;//n[2];
-         gzwrite(gzf, &normp, sizeof(normp));
-      }
+    // NORMAL VECTOR
+    // double n[3];
+    gzwrite(gzf, &numVerts, sizeof(numVerts));
+    for (size_t k = 0; k < nofNodes; k++) {
+        // poly->GetPointData()->GetNormals()->GetTuple(k, n);
+        float normp = 0.0; // n[0];
+        gzwrite(gzf, &normp, sizeof(normp));
+        normp = 0.0; // n[1];
+        gzwrite(gzf, &normp, sizeof(normp));
+        normp = 0.0; // n[2];
+        gzwrite(gzf, &normp, sizeof(normp));
+    }
 
-      //vtkIdType npts = 3;
-      //vtkIdType* pts;
-      size_t numTris = nofTriangles;
-      gzwrite(gzf, &numTris, sizeof(numTris));
-      for(size_t k=0; k<nofTriangles/*(size_t)poly->GetNumberOfPolys()*/; k++) {
-         //poly->GetPolys()->GetNextCell(npts, pts);
-         //int triIndex = *pts;
-         //gzwrite(gzf, &triIndex, sizeof(triIndex)); 
-         //triIndex = *(pts+1);
-         //gzwrite(gzf, &triIndex, sizeof(triIndex)); 
-         //triIndex = *(pts+2);
-         //gzwrite(gzf, &triIndex, sizeof(triIndex));
-         //poly->GetPolys()->GetNextCell(npts, pts);
-         int triIndex = val<1>(triangles[k]);//*pts;
-         gzwrite(gzf, &triIndex, sizeof(triIndex)); 
-         triIndex     = val<2>(triangles[k]);//*(pts+1);
-         gzwrite(gzf, &triIndex, sizeof(triIndex)); 
-         triIndex     = val<3>(triangles[k]);//*(pts+2);
-         gzwrite(gzf, &triIndex, sizeof(triIndex));
-      }
+    // vtkIdType npts = 3;
+    // vtkIdType* pts;
+    size_t numTris = nofTriangles;
+    gzwrite(gzf, &numTris, sizeof(numTris));
+    for (size_t k = 0; k < nofTriangles /*(size_t)poly->GetNumberOfPolys()*/; k++) {
+        // poly->GetPolys()->GetNextCell(npts, pts);
+        // int triIndex = *pts;
+        // gzwrite(gzf, &triIndex, sizeof(triIndex));
+        // triIndex = *(pts+1);
+        // gzwrite(gzf, &triIndex, sizeof(triIndex));
+        // triIndex = *(pts+2);
+        // gzwrite(gzf, &triIndex, sizeof(triIndex));
+        // poly->GetPolys()->GetNextCell(npts, pts);
+        int triIndex = val<1>(triangles[k]); //*pts;
+        gzwrite(gzf, &triIndex, sizeof(triIndex));
+        triIndex = val<2>(triangles[k]); //*(pts+1);
+        gzwrite(gzf, &triIndex, sizeof(triIndex));
+        triIndex = val<3>(triangles[k]); //*(pts+2);
+        gzwrite(gzf, &triIndex, sizeof(triIndex));
+    }
 
-      gzclose( gzf );
+    gzclose(gzf);
 
-      UBLOG(logDEBUG1,"WbWriterBOBJ::writeTriangles to "<<bobjFilename<<" - end");
+    UBLOG(logDEBUG1, "WbWriterBOBJ::writeTriangles to " << bobjFilename << " - end");
 
-      return bobjFilename;
-   }
-   /*===============================================================================*/
+    return bobjFilename;
+}
+/*===============================================================================*/
 
-#endif //CAB_ZLIB
+#endif // CAB_ZLIB
diff --git a/src/basics/basics/writer/WbWriterBOBJ.h b/src/basics/basics/writer/WbWriterBOBJ.h
index 1d033c952ac2db021146a8e9ee20d9398ebae45e..f5872cc3a38eed227ebcefcdcedd13a78152b060 100644
--- a/src/basics/basics/writer/WbWriterBOBJ.h
+++ b/src/basics/basics/writer/WbWriterBOBJ.h
@@ -1,40 +1,47 @@
 #ifdef CAB_ZLIB
-   #ifndef WBWRITERBOBJ_H
-   #define WBWRITERBOBJ_H
-
-   #include <string>
-   #include <basics/writer/WbWriter.h>
-
-   class WbWriterBOBJ  : public WbWriter
-   {
-   public:
-      OBCREATOR_EXT( WbWriterBOBJ )
-
-         static WbWriterBOBJ* getInstance()
-      {
-         static WbWriterBOBJ instance;
-         return &instance;
-      }
-   private:
-      WbWriterBOBJ() : WbWriter() 
-      {
-         if(sizeof(unsigned char)!=1) throw UbException(UB_EXARGS,"error char  type mismatch");
-         if(sizeof(int)          !=4) throw UbException(UB_EXARGS,"error int   type mismatch");
-         if(sizeof(float)        !=4) throw UbException(UB_EXARGS,"error float type mismatch");
-      }
-      WbWriterBOBJ( const WbWriterBOBJ& );                  //no copy allowed 
-      const WbWriterBOBJ& operator=( const WbWriterBOBJ& ); //no copy allowed
-
-      static std::string  pvdEndTag;
-
-   public:
-      std::string getFileExtension()  { return "BOBJ.gz"; }
-
-      std::string writeTriangles(const std::string& filename,std::vector<UbTupleFloat3 >& nodes, std::vector<UbTupleInt3 >& triangles);
-   };
-
-   UB_AUTO_RUN_NAMED(ObFactory<WbWriter>::getInstance()->addObCreator(ObSingletonCreatorImpl<WbWriterBOBJ ,WbWriter>::getInstance()), CAB_WbWriterVtkXmlASCII);
-
-   #endif //WBWRITERBOBJ_H
-
-#endif //CAB_ZLIB
+#ifndef WBWRITERBOBJ_H
+#define WBWRITERBOBJ_H
+
+#include <basics/writer/WbWriter.h>
+#include <string>
+
+class WbWriterBOBJ : public WbWriter
+{
+public:
+    OBCREATOR_EXT(WbWriterBOBJ)
+
+    static WbWriterBOBJ *getInstance()
+    {
+        static WbWriterBOBJ instance;
+        return &instance;
+    }
+
+private:
+    WbWriterBOBJ() : WbWriter()
+    {
+        if (sizeof(unsigned char) != 1)
+            throw UbException(UB_EXARGS, "error char  type mismatch");
+        if (sizeof(int) != 4)
+            throw UbException(UB_EXARGS, "error int   type mismatch");
+        if (sizeof(float) != 4)
+            throw UbException(UB_EXARGS, "error float type mismatch");
+    }
+    WbWriterBOBJ(const WbWriterBOBJ &);                  // no copy allowed
+    const WbWriterBOBJ &operator=(const WbWriterBOBJ &); // no copy allowed
+
+    static std::string pvdEndTag;
+
+public:
+    std::string getFileExtension() { return "BOBJ.gz"; }
+
+    std::string writeTriangles(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                               std::vector<UbTupleInt3> &triangles);
+};
+
+UB_AUTO_RUN_NAMED(
+    ObFactory<WbWriter>::getInstance()->addObCreator(ObSingletonCreatorImpl<WbWriterBOBJ, WbWriter>::getInstance()),
+    CAB_WbWriterVtkXmlASCII);
+
+#endif // WBWRITERBOBJ_H
+
+#endif // CAB_ZLIB
diff --git a/src/basics/basics/writer/WbWriterSunflow.cpp b/src/basics/basics/writer/WbWriterSunflow.cpp
index 6adbc274aec46f351b0d2cfc0f42340fcc6368ab..6c60fe9d0e685dd49bad71a1452b3392e4bb0938 100644
--- a/src/basics/basics/writer/WbWriterSunflow.cpp
+++ b/src/basics/basics/writer/WbWriterSunflow.cpp
@@ -1,112 +1,115 @@
-#include <basics/writer/WbWriterSunflow.h>
 #include <basics/utilities/UbLogger.h>
+#include <basics/writer/WbWriterSunflow.h>
 #include <cstring>
 
 using namespace std;
 
 /*===============================================================================*/
-std::string WbWriterSunflow::writeTriangles(const string& filename,vector<UbTupleFloat3 >& nodes, vector<UbTupleInt3 >& triangles)
+std::string WbWriterSunflow::writeTriangles(const string &filename, vector<UbTupleFloat3> &nodes,
+                                            vector<UbTupleInt3> &triangles)
 {
-   string sunflowFilename=filename+getFileExtension();
-   UBLOG(logDEBUG1,"WbWriterSunflow::writeTriangles to "<<sunflowFilename<<" - start");
-
-   std::ofstream out(sunflowFilename.c_str());
-   if(!out)
-   { 
-      out.clear(); //flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
-      string path = UbSystem::getPathFromString(sunflowFilename);
-      if(path.size()>0){UbSystem::makeDirectory(path);out.open(sunflowFilename.c_str());}
-      if(!out) throw UbException(UB_EXARGS,"couldn't open file "+sunflowFilename);
-   }
-
-   // General part
-
-   // Image details
-   out<<"image {"              <<endl;
-   out<<"   resolution 640 480"<<endl;
-   out<<"   aa 0 1"            <<endl;
-   out<<"   filter mitchell"   <<endl;
-   out<<"}"                    <<endl<<endl;
-
-   // Camera position
-   out<<"camera {"                 <<endl;
-   out<<"   type pinhole"          <<endl;
-   out<<"   eye    -0.25 -0.3 0.13"<<endl;
-   out<<"   target -0.1 0.1 0.13"  <<endl;
-   out<<"   up     0 0 1"          <<endl;
-   out<<"   fov    60"             <<endl;
-   out<<"   aspect 1.333333"       <<endl;
-   out<<"}"                        <<endl<<endl;
-
-   // Light
-   out<<"light {"                  <<endl;
-   out<<"   type ibl"              <<endl;
-   out<<"   image sky_small.hdr"   <<endl;
-   out<<"   center 0 -1 0"         <<endl;
-   out<<"   up 0 0 1"              <<endl;
-   out<<"   lock true"             <<endl;
-   out<<"   samples 200"           <<endl;
-   out<<"}"                        <<endl<<endl;
-
-   // Shaders
-   out<<"shader {"                 <<endl;
-   out<<"   name default-shader"   <<endl;
-   out<<"   type diffuse"          <<endl;
-   out<<"   diff 0.25 0.25 0.25"   <<endl;
-   out<<"}"                        <<endl<<endl;
-
-   out<<"shader {"                 <<endl;
-   out<<"   name Glass"            <<endl;
-   out<<"   type glass"            <<endl;
-   out<<"   eta 1.333"             <<endl;
-   out<<"   color 0.1 0.3 0.8"     <<endl;
-   out<<"}"                        <<endl<<endl;
-                                   
-   out<<"shader {"                 <<endl;
-   out<<"   name Mirror"           <<endl;
-   out<<"   type mirror"           <<endl;
-   out<<"   refl 0.7 0.7 0.7"      <<endl;
-   out<<"}"                        <<endl<<endl;
-
-   // Objects
-   // a) Ground plane
-   out<<"object {"                 <<endl;
-   out<<"   shader default-shader" <<endl;
-   out<<"   type plane"            <<endl;
-   out<<"   p 0 0 0"               <<endl;
-   out<<"   n 0 0 1"               <<endl;
-   out<<"}"                        <<endl<<endl;
-
-   // b) Mesh
-   out<<"object {"                 <<endl;
-   out<<"   shader Glass"          <<endl;
-   out<<"   transform {"           <<endl;
-   out<<"      rotatey 270.0"      <<endl;
-   out<<"   }"                     <<endl;
-   out<<"   type generic-mesh"     <<endl;
-   out<<"      name polySurfac"    <<endl<<endl;
-
-
-   // POINTS SECTION
-   int nofNodes = (int)nodes.size(); 
-   out<<"   points "<<nofNodes<<endl;
-   for(int n=0; n<nofNodes; n++)
-      out<<"      "<< val<1>(nodes[n]) <<" "<< val<2>(nodes[n]) <<" "<< val<3>(nodes[n]) <<endl;
-
-   // TRIANGLES SECTION
-   int nofTriangles= (int)triangles.size(); 
-   out<<"   triangles "<<nofTriangles<<endl;
-   for(int c=0; c<nofTriangles; c++)
-      out<<"      "<<val<1>(triangles[c]) <<" "<< val<2>(triangles[c])<<" "<< val<3>(triangles[c])<<endl;
-
-   // FOOTER
-   out<<"   normals none" << endl;
-   out<<"   uvs none"     << endl;
-   out<<"}"               << endl;
-
-   out.close();
-   UBLOG(logDEBUG1,"WbWriterSunflow::writeTriangles to "<<sunflowFilename<<" - end");
-
-   return sunflowFilename;
+    string sunflowFilename = filename + getFileExtension();
+    UBLOG(logDEBUG1, "WbWriterSunflow::writeTriangles to " << sunflowFilename << " - start");
+
+    std::ofstream out(sunflowFilename.c_str());
+    if (!out) {
+        out.clear(); // flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
+        string path = UbSystem::getPathFromString(sunflowFilename);
+        if (path.size() > 0) {
+            UbSystem::makeDirectory(path);
+            out.open(sunflowFilename.c_str());
+        }
+        if (!out)
+            throw UbException(UB_EXARGS, "couldn't open file " + sunflowFilename);
+    }
+
+    // General part
+
+    // Image details
+    out << "image {" << endl;
+    out << "   resolution 640 480" << endl;
+    out << "   aa 0 1" << endl;
+    out << "   filter mitchell" << endl;
+    out << "}" << endl << endl;
+
+    // Camera position
+    out << "camera {" << endl;
+    out << "   type pinhole" << endl;
+    out << "   eye    -0.25 -0.3 0.13" << endl;
+    out << "   target -0.1 0.1 0.13" << endl;
+    out << "   up     0 0 1" << endl;
+    out << "   fov    60" << endl;
+    out << "   aspect 1.333333" << endl;
+    out << "}" << endl << endl;
+
+    // Light
+    out << "light {" << endl;
+    out << "   type ibl" << endl;
+    out << "   image sky_small.hdr" << endl;
+    out << "   center 0 -1 0" << endl;
+    out << "   up 0 0 1" << endl;
+    out << "   lock true" << endl;
+    out << "   samples 200" << endl;
+    out << "}" << endl << endl;
+
+    // Shaders
+    out << "shader {" << endl;
+    out << "   name default-shader" << endl;
+    out << "   type diffuse" << endl;
+    out << "   diff 0.25 0.25 0.25" << endl;
+    out << "}" << endl << endl;
+
+    out << "shader {" << endl;
+    out << "   name Glass" << endl;
+    out << "   type glass" << endl;
+    out << "   eta 1.333" << endl;
+    out << "   color 0.1 0.3 0.8" << endl;
+    out << "}" << endl << endl;
+
+    out << "shader {" << endl;
+    out << "   name Mirror" << endl;
+    out << "   type mirror" << endl;
+    out << "   refl 0.7 0.7 0.7" << endl;
+    out << "}" << endl << endl;
+
+    // Objects
+    // a) Ground plane
+    out << "object {" << endl;
+    out << "   shader default-shader" << endl;
+    out << "   type plane" << endl;
+    out << "   p 0 0 0" << endl;
+    out << "   n 0 0 1" << endl;
+    out << "}" << endl << endl;
+
+    // b) Mesh
+    out << "object {" << endl;
+    out << "   shader Glass" << endl;
+    out << "   transform {" << endl;
+    out << "      rotatey 270.0" << endl;
+    out << "   }" << endl;
+    out << "   type generic-mesh" << endl;
+    out << "      name polySurfac" << endl << endl;
+
+    // POINTS SECTION
+    int nofNodes = (int)nodes.size();
+    out << "   points " << nofNodes << endl;
+    for (int n = 0; n < nofNodes; n++)
+        out << "      " << val<1>(nodes[n]) << " " << val<2>(nodes[n]) << " " << val<3>(nodes[n]) << endl;
+
+    // TRIANGLES SECTION
+    int nofTriangles = (int)triangles.size();
+    out << "   triangles " << nofTriangles << endl;
+    for (int c = 0; c < nofTriangles; c++)
+        out << "      " << val<1>(triangles[c]) << " " << val<2>(triangles[c]) << " " << val<3>(triangles[c]) << endl;
+
+    // FOOTER
+    out << "   normals none" << endl;
+    out << "   uvs none" << endl;
+    out << "}" << endl;
+
+    out.close();
+    UBLOG(logDEBUG1, "WbWriterSunflow::writeTriangles to " << sunflowFilename << " - end");
+
+    return sunflowFilename;
 }
 /*===============================================================================*/
diff --git a/src/basics/basics/writer/WbWriterSunflow.h b/src/basics/basics/writer/WbWriterSunflow.h
index 39f71070ee6f41b7084ba902175331b257ebd030..328f9c31014dd14977e06125a1c55c6a96898529 100644
--- a/src/basics/basics/writer/WbWriterSunflow.h
+++ b/src/basics/basics/writer/WbWriterSunflow.h
@@ -5,31 +5,36 @@
 
 #include <basics/writer/WbWriter.h>
 
-class WbWriterSunflow  : public WbWriter
+class WbWriterSunflow : public WbWriter
 {
 public:
-   static WbWriterSunflow* getInstance()
-   {
-      static WbWriterSunflow instance;
-      return &instance;
-   }
-
-    WbWriterSunflow( const WbWriterSunflow& ) = delete;
-    const WbWriterSunflow& operator=( const WbWriterSunflow& ) = delete;
-private:
-   WbWriterSunflow() : WbWriter() 
-   {
-      if(sizeof(unsigned char)!=1) throw UbException(UB_EXARGS,"error char  type mismatch");
-      if(sizeof(int)          !=4) throw UbException(UB_EXARGS,"error int   type mismatch");
-      if(sizeof(float)        !=4) throw UbException(UB_EXARGS,"error float type mismatch");
-   }
+    static WbWriterSunflow *getInstance()
+    {
+        static WbWriterSunflow instance;
+        return &instance;
+    }
+
+    WbWriterSunflow(const WbWriterSunflow &) = delete;
+    const WbWriterSunflow &operator=(const WbWriterSunflow &) = delete;
 
-   static std::string  pvdEndTag;
+private:
+    WbWriterSunflow() : WbWriter()
+    {
+        if (sizeof(unsigned char) != 1)
+            throw UbException(UB_EXARGS, "error char  type mismatch");
+        if (sizeof(int) != 4)
+            throw UbException(UB_EXARGS, "error int   type mismatch");
+        if (sizeof(float) != 4)
+            throw UbException(UB_EXARGS, "error float type mismatch");
+    }
+
+    static std::string pvdEndTag;
 
 public:
-   std::string getFileExtension() override  { return "ascii.sunflow"; }
+    std::string getFileExtension() override { return "ascii.sunflow"; }
 
-   std::string writeTriangles(const std::string& filename,std::vector<UbTupleFloat3 >& nodes, std::vector<UbTupleInt3 >& triangles) override;
+    std::string writeTriangles(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                               std::vector<UbTupleInt3> &triangles) override;
 };
 
-#endif //WbWriterSunflow_H
+#endif // WbWriterSunflow_H
diff --git a/src/basics/basics/writer/WbWriterTecPlotASCII.cpp b/src/basics/basics/writer/WbWriterTecPlotASCII.cpp
index 6074b805bc25e9548d690ed49670f40102e1af79..895853eb29ea8b364a1f914655cc4a5b0c7d093c 100644
--- a/src/basics/basics/writer/WbWriterTecPlotASCII.cpp
+++ b/src/basics/basics/writer/WbWriterTecPlotASCII.cpp
@@ -1,68 +1,64 @@
-#include <basics/writer/WbWriterTecPlotASCII.h>
 #include <basics/utilities/UbLogger.h>
+#include <basics/writer/WbWriterTecPlotASCII.h>
 
 using namespace std;
 
 /*===============================================================================*/
-string WbWriterTecPlotASCII::writeOctsWithNodeData(const string& filename,vector<UbTupleFloat3 >& nodes, vector<UbTupleUInt8 >& cells, vector<string >& datanames, vector<vector<double > >& nodedata)
+string WbWriterTecPlotASCII::writeOctsWithNodeData(const string &filename, vector<UbTupleFloat3> &nodes,
+                                                   vector<UbTupleUInt8> &cells, vector<string> &datanames,
+                                                   vector<vector<double>> &nodedata)
 {
-   string tecplotfilename = filename+getFileExtension();
-   UBLOG(logDEBUG1,"WbWriterTecPlotASCII::writeOctsWithNodeData to "<<tecplotfilename<<" - start");
+    string tecplotfilename = filename + getFileExtension();
+    UBLOG(logDEBUG1, "WbWriterTecPlotASCII::writeOctsWithNodeData to " << tecplotfilename << " - start");
 
-   ofstream out(tecplotfilename.c_str());
-   if(!out)
-   { 
-      out.clear(); //flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
-      string path = UbSystem::getPathFromString(tecplotfilename);
-      if(path.size()>0){ UbSystem::makeDirectory(path); out.open(tecplotfilename.c_str());}
-      if(!out) throw UbException(UB_EXARGS,"couldn't open file "+tecplotfilename);
-   }
+    ofstream out(tecplotfilename.c_str());
+    if (!out) {
+        out.clear(); // flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
+        string path = UbSystem::getPathFromString(tecplotfilename);
+        if (path.size() > 0) {
+            UbSystem::makeDirectory(path);
+            out.open(tecplotfilename.c_str());
+        }
+        if (!out)
+            throw UbException(UB_EXARGS, "couldn't open file " + tecplotfilename);
+    }
 
-   int nofNodes = (int)nodes.size(); 
-   int nofCells = (int)cells.size(); 
+    int nofNodes = (int)nodes.size();
+    int nofCells = (int)cells.size();
 
-   out<<"TITLE = VirtualFluids OctGrid from "<<UbSystem::getTimeStamp()<<endl;
+    out << "TITLE = VirtualFluids OctGrid from " << UbSystem::getTimeStamp() << endl;
 
-   out<<"VARIABLES = \"X\", \"Y\", \"Z\"";
-   for(size_t d=0; d<datanames.size(); d++)   
-      out<<", \""<<datanames[d]<<"\"";
-   out<<endl;
+    out << "VARIABLES = \"X\", \"Y\", \"Z\"";
+    for (size_t d = 0; d < datanames.size(); d++)
+        out << ", \"" << datanames[d] << "\"";
+    out << endl;
 
-   out<<"ZONE NODES="<<nofNodes<<", ELEMENTS="<<nofCells<<", DATAPACKING=POINT, ZONETYPE=FEBRICK"<<endl;
-   for(size_t n=0; n<nodes.size(); n++)   
-   {
-      UbTupleFloat3& coords = nodes[n];
-      out<<val<1>(coords)<<" "
-         <<val<2>(coords)<<" "
-         <<val<3>(coords);
-      for(size_t d=0; d<datanames.size(); d++)   
-         out<<" "<<nodedata[d][n];
-      out<<endl;
-   }
+    out << "ZONE NODES=" << nofNodes << ", ELEMENTS=" << nofCells << ", DATAPACKING=POINT, ZONETYPE=FEBRICK" << endl;
+    for (size_t n = 0; n < nodes.size(); n++) {
+        UbTupleFloat3 &coords = nodes[n];
+        out << val<1>(coords) << " " << val<2>(coords) << " " << val<3>(coords);
+        for (size_t d = 0; d < datanames.size(); d++)
+            out << " " << nodedata[d][n];
+        out << endl;
+    }
 
-   for(size_t c=0; c<cells.size(); c++)   
-   {
-      UbTupleUInt8& cell = cells[c];
-      out<<val<1>(cell)<<" "
-         <<val<2>(cell)<<" "
-         <<val<3>(cell)<<" "
-         <<val<4>(cell)<<" "
-         <<val<5>(cell)<<" "
-         <<val<6>(cell)<<" "
-         <<val<7>(cell)<<" "
-         <<val<8>(cell)<<endl;
-   }
+    for (size_t c = 0; c < cells.size(); c++) {
+        UbTupleUInt8 &cell = cells[c];
+        out << val<1>(cell) << " " << val<2>(cell) << " " << val<3>(cell) << " " << val<4>(cell) << " " << val<5>(cell)
+            << " " << val<6>(cell) << " " << val<7>(cell) << " " << val<8>(cell) << endl;
+    }
 
-   out.close();
-   UBLOG(logDEBUG1,"WbWriterTecPlotASCII::writeOctsWithNodeData to "<<tecplotfilename<<" - end");
+    out.close();
+    UBLOG(logDEBUG1, "WbWriterTecPlotASCII::writeOctsWithNodeData to " << tecplotfilename << " - end");
 
-   return tecplotfilename;
+    return tecplotfilename;
 }
 /*===============================================================================*/
-string WbWriterTecPlotASCII::writeOctsU(const string& filename,vector< UbTupleFloat3 >& nodes, vector< UbTupleUInt8 >& cells)
+string WbWriterTecPlotASCII::writeOctsU(const string &filename, vector<UbTupleFloat3> &nodes,
+                                        vector<UbTupleUInt8> &cells)
 {
-   vector<string > datanames;
-   vector<vector<double > > nodedata;
-   return writeOctsWithNodeData(filename,nodes,cells,datanames,nodedata);
+    vector<string> datanames;
+    vector<vector<double>> nodedata;
+    return writeOctsWithNodeData(filename, nodes, cells, datanames, nodedata);
 }
 /*===============================================================================*/
diff --git a/src/basics/basics/writer/WbWriterTecPlotASCII.h b/src/basics/basics/writer/WbWriterTecPlotASCII.h
index df0256765996ce6c553609eadf46bea94219dede..8869b59dedea70d7ed634244d44f9be10372c23e 100644
--- a/src/basics/basics/writer/WbWriterTecPlotASCII.h
+++ b/src/basics/basics/writer/WbWriterTecPlotASCII.h
@@ -5,84 +5,103 @@
 
 #include <basics/writer/WbWriter.h>
 
-class WbWriterTecPlotASCII  : public WbWriter
+class WbWriterTecPlotASCII : public WbWriter
 {
 public:
-   static WbWriterTecPlotASCII* getInstance()
-   {
-      static WbWriterTecPlotASCII instance;
-      return &instance;
-   }
+    static WbWriterTecPlotASCII *getInstance()
+    {
+        static WbWriterTecPlotASCII instance;
+        return &instance;
+    }
 
-    WbWriterTecPlotASCII( const WbWriterTecPlotASCII& ) = delete;
-    const WbWriterTecPlotASCII& operator=( const WbWriterTecPlotASCII& ) = delete;
+    WbWriterTecPlotASCII(const WbWriterTecPlotASCII &) = delete;
+    const WbWriterTecPlotASCII &operator=(const WbWriterTecPlotASCII &) = delete;
 
 private:
-   WbWriterTecPlotASCII() : WbWriter() 
-   {
-      if(sizeof(unsigned char)!=1) throw UbException(UB_EXARGS,"machine error char  type mismatch");
-      if(sizeof(int)          !=4) throw UbException(UB_EXARGS,"machine error int   type mismatch");
-      if(sizeof(float)        !=4) throw UbException(UB_EXARGS,"machine error float type mismatch");
-   }
+    WbWriterTecPlotASCII() : WbWriter()
+    {
+        if (sizeof(unsigned char) != 1)
+            throw UbException(UB_EXARGS, "machine error char  type mismatch");
+        if (sizeof(int) != 4)
+            throw UbException(UB_EXARGS, "machine error int   type mismatch");
+        if (sizeof(float) != 4)
+            throw UbException(UB_EXARGS, "machine error float type mismatch");
+    }
+
+    static std::string pvdEndTag;
 
-   static std::string  pvdEndTag;
 public:
-   std::string getFileExtension() override { return ".ascii.dat";   }
+    std::string getFileExtension() override { return ".ascii.dat"; }
+
+    // write a metafile
+    //    std::string writeCollection(const std::string& filename, const std::vector<std::string>& filenames, const
+    //    double& timestep, const bool& sepGroups); std::string addFilesToCollection(const std::string& filename, const
+    //    std::vector<std::string>& filenames, const double& timestep, const bool& sepGroups); std::string
+    //    writeParallelFile(const std::string& filename,std::vector<std::string>& pieceSources,
+    //    std::vector<std::string>& pointDataNames, std::vector<std::string>& cellDataNames);
 
-   //write a metafile 
-//    std::string writeCollection(const std::string& filename, const std::vector<std::string>& filenames, const double& timestep, const bool& sepGroups);
-//    std::string addFilesToCollection(const std::string& filename, const std::vector<std::string>& filenames, const double& timestep, const bool& sepGroups);
-//    std::string writeParallelFile(const std::string& filename,std::vector<std::string>& pieceSources, std::vector<std::string>& pointDataNames, std::vector<std::string>& cellDataNames);
+    //////////////////////////////////////////////////////////////////////////
+    // nodes
+    //    std::string writeNodes(const std::string& filename,std::vector< UbTupleFloat3 >& nodes);
+    //    std::string writeNodesWithNodeData(const std::string& filename,std::vector< UbTupleFloat3 >& nodes,
+    //    std::vector<std::string >& datanames, std::vector<std::vector<double > >& nodedata);
 
-   //////////////////////////////////////////////////////////////////////////
-   //nodes
-//    std::string writeNodes(const std::string& filename,std::vector< UbTupleFloat3 >& nodes);
-//    std::string writeNodesWithNodeData(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector<std::string >& datanames, std::vector<std::vector<double > >& nodedata);
+    //////////////////////////////////////////////////////////////////////////
+    // lines
+    //     0 ---- 1
+    // nodenumbering must start with 0!
+    //    std::string writeLines(const std::string& filename,std::vector<UbTupleFloat3 >& nodes, std::vector<UbTupleInt2
+    //    >& lines); std::string writeLinesWithNodeData(const std::string& filename,std::vector<UbTupleFloat3 >& nodes,
+    //    std::vector<UbTupleInt2 >& lines, std::vector< std::string >& datanames, std::vector< std::vector< double > >&
+    //    nodedata);
+    //
+    //////////////////////////////////////////////////////////////////////////
+    // triangles
+    //                    2
+    //
+    //                  0---1
+    // nodenumbering must start with 0!
+    //    std::string writeTriangles(const std::string& filename,std::vector<UbTupleFloat3 >& nodes,
+    //    std::vector<UbTupleInt3 >& triangles); std::string writeTrianglesWithNodeData(const std::string&
+    //    filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt3 >& cells, std::vector<std::string >&
+    //    datanames, std::vector<std::vector<double > >& nodedata);
 
-   //////////////////////////////////////////////////////////////////////////
-   //lines
-   //     0 ---- 1
-   //nodenumbering must start with 0!
-//    std::string writeLines(const std::string& filename,std::vector<UbTupleFloat3 >& nodes, std::vector<UbTupleInt2 >& lines);
-//    std::string writeLinesWithNodeData(const std::string& filename,std::vector<UbTupleFloat3 >& nodes, std::vector<UbTupleInt2 >& lines, std::vector< std::string >& datanames, std::vector< std::vector< double > >& nodedata);
-// 
-   //////////////////////////////////////////////////////////////////////////
-   //triangles
-   //                    2
-   //                     
-   //                  0---1
-   //nodenumbering must start with 0!
-//    std::string writeTriangles(const std::string& filename,std::vector<UbTupleFloat3 >& nodes, std::vector<UbTupleInt3 >& triangles);
-//    std::string writeTrianglesWithNodeData(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt3 >& cells, std::vector<std::string >& datanames, std::vector<std::vector<double > >& nodedata);
+    //////////////////////////////////////////////////////////////////////////
+    // 2D
+    // cell numbering:
+    //                  3---2
+    //                  |   |
+    //                  0---1
+    // nodenumbering must start with 0!
 
-   //////////////////////////////////////////////////////////////////////////
-   //2D
-   //cell numbering:
-   //                  3---2
-   //                  |   |
-   //                  0---1
-   //nodenumbering must start with 0!
+    //    std::string writeQuads(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector<
+    //    UbTupleInt4 >& cells); std::string writeQuadsWithNodeData(const std::string& filename,std::vector<
+    //    UbTupleFloat3 >& nodes, std::vector< UbTupleInt4 >& cells, std::vector< std::string >& datanames, std::vector<
+    //    std::vector< double > >& nodedata); std::string writeQuadsWithCellData(const std::string&
+    //    filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt4 >& cells, std::vector< std::string >&
+    //    datanames, std::vector< std::vector< double > >& celldata); std::string writeQuadsWithNodeAndCellData(const
+    //    std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt4 >& cells,
+    //                                              std::vector< std::string >& nodedatanames, std::vector< std::vector<
+    //                                              double > >& nodedata, std::vector< std::string >& celldatanames,
+    //                                              std::vector< std::vector< double > >& celldata );
 
-//    std::string writeQuads(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt4 >& cells);
-//    std::string writeQuadsWithNodeData(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt4 >& cells, std::vector< std::string >& datanames, std::vector< std::vector< double > >& nodedata);
-//    std::string writeQuadsWithCellData(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt4 >& cells, std::vector< std::string >& datanames, std::vector< std::vector< double > >& celldata);
-//    std::string writeQuadsWithNodeAndCellData(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt4 >& cells, 
-//                                              std::vector< std::string >& nodedatanames, std::vector< std::vector< double > >& nodedata, std::vector< std::string >& celldatanames,
-//                                              std::vector< std::vector< double > >& celldata                                                                    );
-   
-   //////////////////////////////////////////////////////////////////////////
-   //octs
-   //     7 ---- 6
-   //    /|     /|
-   //   4 +--- 5 |
-   //   | |    | |
-   //   | 3 ---+ 2
-   //   |/     |/
-   //   0 ---- 1
-   std::string writeOctsU(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleUInt8 >& cells);
-   //std::string writeOctsWithCellData(const std::string& filename,std::vector<UbTupleFloat3 >& nodes, std::vector<UbTupleInt8 >& cells, std::vector<std::string >& datanames, std::vector<std::vector<double > >& celldata);
-   std::string writeOctsWithNodeData(const std::string& filename,std::vector<UbTupleFloat3 >& nodes, std::vector<UbTupleUInt8 >& cells, std::vector<std::string >& datanames, std::vector<std::vector<double > >& nodedata) override;
-   
+    //////////////////////////////////////////////////////////////////////////
+    // octs
+    //     7 ---- 6
+    //    /|     /|
+    //   4 +--- 5 |
+    //   | |    | |
+    //   | 3 ---+ 2
+    //   |/     |/
+    //   0 ---- 1
+    std::string writeOctsU(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                           std::vector<UbTupleUInt8> &cells);
+    // std::string writeOctsWithCellData(const std::string& filename,std::vector<UbTupleFloat3 >& nodes,
+    // std::vector<UbTupleInt8 >& cells, std::vector<std::string >& datanames, std::vector<std::vector<double > >&
+    // celldata);
+    std::string writeOctsWithNodeData(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                                      std::vector<UbTupleUInt8> &cells, std::vector<std::string> &datanames,
+                                      std::vector<std::vector<double>> &nodedata) override;
 };
 
-#endif //WBWRITERTECPLOTASCII_H
+#endif // WBWRITERTECPLOTASCII_H
diff --git a/src/basics/basics/writer/WbWriterVtkASCII.cpp b/src/basics/basics/writer/WbWriterVtkASCII.cpp
index 2d55989328d34cb96e9120aa64fedbeaadcb7ffe..754d6d006b80249af5495f24b5fcdbd9d637fc5a 100644
--- a/src/basics/basics/writer/WbWriterVtkASCII.cpp
+++ b/src/basics/basics/writer/WbWriterVtkASCII.cpp
@@ -1,601 +1,667 @@
-#include <basics/writer/WbWriterVtkASCII.h>
 #include <basics/utilities/UbLogger.h>
+#include <basics/writer/WbWriterVtkASCII.h>
 #include <cstring>
 
 using namespace std;
 
-std::string WbWriterVtkASCII::writeQuads(const string& filename,vector< UbTupleFloat3 >& nodes, vector< UbTupleInt4 >& cells)
+std::string WbWriterVtkASCII::writeQuads(const string &filename, vector<UbTupleFloat3> &nodes,
+                                         vector<UbTupleInt4> &cells)
 {
-   string vtkfilename=filename+getFileExtension();
-   UBLOG(logDEBUG1,"WbWriterVtkASCII::writeQuads to "<<vtkfilename<<" - start");
-
-   std::ofstream out(vtkfilename.c_str());
-   if(!out)
-   { 
-      out.clear(); //flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
-      string path = UbSystem::getPathFromString(vtkfilename);
-      if(path.size()>0){UbSystem::makeDirectory(path);out.open(vtkfilename.c_str());}
-      if(!out) throw UbException(UB_EXARGS,"couldn't open file "+vtkfilename);
-   }
-
-   int nofNodes = (int)nodes.size(); 
-   int nofCells = (int)cells.size(); 
-
-   //VtkASCII FILE
-   out<<"# vtk DataFile Version 4.0"<<"\n";
-   out<<"GeoFile"<<"\n";
-   out<<"ASCII"<<"\n";
-
-   //POINTS SECTION
-   out<<"DATASET UNSTRUCTURED_GRID"<<"\n";
-   out<<"POINTS "<<nofNodes<<" float"<<"\n";
-   for(int n=0; n<nofNodes; n++)
-      out<< val<1>(nodes[n]) <<" "<< val<2>(nodes[n]) <<" "<< val<3>(nodes[n]) <<" \n";
-   
-   out<<"\n";
-
-   //CELLS SECTION
-   out<<"CELLS "<<nofCells<<" "<<5*nofCells<<"\n";
-   for(int c=0; c<(int)cells.size(); c++)
-      out<<"4 "
-         << val<1>(cells[c]) <<" "
-         << val<2>(cells[c]) <<" "
-         << val<4>(cells[c]) <<" "
-         << val<3>(cells[c]) <<" \n";
-   out<<"\n";
-
-   out<<"CELL_TYPES "<<nofCells<<"\n";
-   for(int i=0; i<nofCells; i++) out<<"8"<<endl;
-   out<<endl;
-
-   out.close();
-
-   UBLOG(logDEBUG1,"WbWriterVtkASCII::writeQuads to "<<vtkfilename<<" - end");
-
-   return vtkfilename;
+    string vtkfilename = filename + getFileExtension();
+    UBLOG(logDEBUG1, "WbWriterVtkASCII::writeQuads to " << vtkfilename << " - start");
+
+    std::ofstream out(vtkfilename.c_str());
+    if (!out) {
+        out.clear(); // flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
+        string path = UbSystem::getPathFromString(vtkfilename);
+        if (path.size() > 0) {
+            UbSystem::makeDirectory(path);
+            out.open(vtkfilename.c_str());
+        }
+        if (!out)
+            throw UbException(UB_EXARGS, "couldn't open file " + vtkfilename);
+    }
+
+    int nofNodes = (int)nodes.size();
+    int nofCells = (int)cells.size();
+
+    // VtkASCII FILE
+    out << "# vtk DataFile Version 4.0"
+        << "\n";
+    out << "GeoFile"
+        << "\n";
+    out << "ASCII"
+        << "\n";
+
+    // POINTS SECTION
+    out << "DATASET UNSTRUCTURED_GRID"
+        << "\n";
+    out << "POINTS " << nofNodes << " float"
+        << "\n";
+    for (int n = 0; n < nofNodes; n++)
+        out << val<1>(nodes[n]) << " " << val<2>(nodes[n]) << " " << val<3>(nodes[n]) << " \n";
+
+    out << "\n";
+
+    // CELLS SECTION
+    out << "CELLS " << nofCells << " " << 5 * nofCells << "\n";
+    for (int c = 0; c < (int)cells.size(); c++)
+        out << "4 " << val<1>(cells[c]) << " " << val<2>(cells[c]) << " " << val<4>(cells[c]) << " " << val<3>(cells[c])
+            << " \n";
+    out << "\n";
+
+    out << "CELL_TYPES " << nofCells << "\n";
+    for (int i = 0; i < nofCells; i++)
+        out << "8" << endl;
+    out << endl;
+
+    out.close();
+
+    UBLOG(logDEBUG1, "WbWriterVtkASCII::writeQuads to " << vtkfilename << " - end");
+
+    return vtkfilename;
 }
 /*===============================================================================*/
-std::string WbWriterVtkASCII::writeQuadsWithNodeData(const string& filename,vector< UbTupleFloat3 >& nodes, vector< UbTupleInt4 >& cells, vector< string >& datanames, vector< vector< double > >& nodedata)
+std::string WbWriterVtkASCII::writeQuadsWithNodeData(const string &filename, vector<UbTupleFloat3> &nodes,
+                                                     vector<UbTupleInt4> &cells, vector<string> &datanames,
+                                                     vector<vector<double>> &nodedata)
 {
-   string vtkfilename=filename+getFileExtension();
-   UBLOG(logDEBUG1,"WbWriterVtkASCII::writeQuadsWithNodeData to "<<vtkfilename<<" - start");
-
-   std::ofstream out(vtkfilename.c_str());
-   if(!out)
-   { 
-      out.clear(); //flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
-      string path = UbSystem::getPathFromString(vtkfilename);
-      if(path.size()>0){UbSystem::makeDirectory(path);out.open(vtkfilename.c_str());}
-      if(!out) throw UbException(UB_EXARGS,"couldn't open file "+vtkfilename);
-   }
- 
-   //write geo
-   int nofNodes = (int)nodes.size(); 
-   int nofCells = (int)cells.size(); 
-
-   //VtkASCII FILE
-   out<<"# vtk DataFile Version 4.0"<<"\n";
-   out<<"GeoFile"<<"\n";
-   out<<"ASCII"<<"\n";
-
-   //POINTS SECTION
-   out<<"DATASET UNSTRUCTURED_GRID"<<"\n";
-   out<<"POINTS "<<nofNodes<<" float"<<"\n";
-   for(int n=0; n<nofNodes; n++)
-      out<< val<1>(nodes[n]) <<" "<< val<2>(nodes[n]) <<" "<< val<3>(nodes[n]) <<" \n";
-
-   out<<"\n";
-
-   //CELLS SECTION
-   out<<"CELLS "<<nofCells<<" "<<5*nofCells<<"\n";
-   for(int c=0; c<(int)cells.size(); c++)
-      out<<"4 "
-      << val<1>(cells[c]) <<" "
-      << val<2>(cells[c]) <<" "
-      << val<4>(cells[c]) <<" "
-      << val<3>(cells[c]) <<" \n";
-   out<<"\n";
-
-   out<<"CELL_TYPES "<<nofCells<<"\n";
-   for(int i=0; i<nofCells; i++) out<<"8"<<endl;
-   out<<endl;
-
-   //write data section
-   out<<"POINT_DATA "<<nofNodes<<"\n";
-   for(int s=0; s<(int)datanames.size(); ++s)
-   {
-      out<<"SCALARS "<<datanames[s]<<" float 1 \n LOOKUP_TABLE default \n";
-      for(int d=0; d<(int)nodedata[s].size(); d++)
-         out<<nodedata[s][d]<<"\n";
-      
-      out<<endl;
-   }
-
-   out.close();
-   UBLOG(logDEBUG1,"WbWriterVtkASCII::writeQuadsWithNodeData to "<<vtkfilename<<" - end");
-   return vtkfilename;
+    string vtkfilename = filename + getFileExtension();
+    UBLOG(logDEBUG1, "WbWriterVtkASCII::writeQuadsWithNodeData to " << vtkfilename << " - start");
+
+    std::ofstream out(vtkfilename.c_str());
+    if (!out) {
+        out.clear(); // flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
+        string path = UbSystem::getPathFromString(vtkfilename);
+        if (path.size() > 0) {
+            UbSystem::makeDirectory(path);
+            out.open(vtkfilename.c_str());
+        }
+        if (!out)
+            throw UbException(UB_EXARGS, "couldn't open file " + vtkfilename);
+    }
+
+    // write geo
+    int nofNodes = (int)nodes.size();
+    int nofCells = (int)cells.size();
+
+    // VtkASCII FILE
+    out << "# vtk DataFile Version 4.0"
+        << "\n";
+    out << "GeoFile"
+        << "\n";
+    out << "ASCII"
+        << "\n";
+
+    // POINTS SECTION
+    out << "DATASET UNSTRUCTURED_GRID"
+        << "\n";
+    out << "POINTS " << nofNodes << " float"
+        << "\n";
+    for (int n = 0; n < nofNodes; n++)
+        out << val<1>(nodes[n]) << " " << val<2>(nodes[n]) << " " << val<3>(nodes[n]) << " \n";
+
+    out << "\n";
+
+    // CELLS SECTION
+    out << "CELLS " << nofCells << " " << 5 * nofCells << "\n";
+    for (int c = 0; c < (int)cells.size(); c++)
+        out << "4 " << val<1>(cells[c]) << " " << val<2>(cells[c]) << " " << val<4>(cells[c]) << " " << val<3>(cells[c])
+            << " \n";
+    out << "\n";
+
+    out << "CELL_TYPES " << nofCells << "\n";
+    for (int i = 0; i < nofCells; i++)
+        out << "8" << endl;
+    out << endl;
+
+    // write data section
+    out << "POINT_DATA " << nofNodes << "\n";
+    for (int s = 0; s < (int)datanames.size(); ++s) {
+        out << "SCALARS " << datanames[s] << " float 1 \n LOOKUP_TABLE default \n";
+        for (int d = 0; d < (int)nodedata[s].size(); d++)
+            out << nodedata[s][d] << "\n";
+
+        out << endl;
+    }
+
+    out.close();
+    UBLOG(logDEBUG1, "WbWriterVtkASCII::writeQuadsWithNodeData to " << vtkfilename << " - end");
+    return vtkfilename;
 }
 /*===============================================================================*/
-std::string WbWriterVtkASCII::writeQuadsWithCellData(const string& filename,vector< UbTupleFloat3 >& nodes, vector< UbTupleInt4 >& cells, vector< string >& datanames, vector< vector< double > >& celldata)
+std::string WbWriterVtkASCII::writeQuadsWithCellData(const string &filename, vector<UbTupleFloat3> &nodes,
+                                                     vector<UbTupleInt4> &cells, vector<string> &datanames,
+                                                     vector<vector<double>> &celldata)
 {
-   string vtkfilename=filename+getFileExtension();
-   UBLOG(logDEBUG1,"WbWriterVtkASCII::writeQuadsWithCellData to "<<vtkfilename<<" - start");
-
-   std::ofstream out(vtkfilename.c_str());
-   if(!out)
-   { 
-      out.clear(); //flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
-      string path = UbSystem::getPathFromString(vtkfilename);
-      if(path.size()>0){UbSystem::makeDirectory(path);out.open(vtkfilename.c_str());}
-      if(!out) throw UbException(UB_EXARGS,"couldn't open file "+vtkfilename);
-   }
-
-   //write geo
-   int nofNodes = (int)nodes.size(); 
-   int nofCells = (int)cells.size(); 
-
-   //VtkASCII FILE
-   out<<"# vtk DataFile Version 4.0"<<"\n";
-   out<<"GeoFile"<<"\n";
-   out<<"ASCII"<<"\n";
-
-   //POINTS SECTION
-   out<<"DATASET UNSTRUCTURED_GRID"<<"\n";
-   out<<"POINTS "<<nofNodes<<" float"<<"\n";
-   for(int n=0; n<nofNodes; n++)
-      out<< val<1>(nodes[n]) <<" "<< val<2>(nodes[n]) <<" "<< val<3>(nodes[n]) <<" \n";
-
-   out<<"\n";
-
-   //CELLS SECTION
-   out<<"CELLS "<<nofCells<<" "<<5*nofCells<<"\n";
-   for(int c=0; c<(int)cells.size(); c++)
-      out<<"4 "
-      << val<1>(cells[c]) <<" "
-      << val<2>(cells[c]) <<" "
-      << val<4>(cells[c]) <<" "
-      << val<3>(cells[c]) <<" \n";
-   out<<"\n";
-
-   out<<"CELL_TYPES "<<nofCells<<"\n";
-   for(int i=0; i<nofCells; i++) out<<"8"<<endl;
-   out<<endl;
-
-   //write data section
-   out<<"CELL_DATA "<<nofCells<<"\n";
-   for(int s=0; s<(int)datanames.size(); ++s)
-   {
-      out<<"SCALARS "<<datanames[s]<<" float 1 \n LOOKUP_TABLE default \n";
-      for(int d=0; d<(int)celldata[s].size(); d++)
-         out<<celldata[s][d]<<"\n";
-
-      out<<endl;
-   }
-
-   out.close();
-   UBLOG(logDEBUG1,"WbWriterVtkASCII::writeQuadsWithCellData to "<<vtkfilename<<" - end");
-   return vtkfilename;
+    string vtkfilename = filename + getFileExtension();
+    UBLOG(logDEBUG1, "WbWriterVtkASCII::writeQuadsWithCellData to " << vtkfilename << " - start");
+
+    std::ofstream out(vtkfilename.c_str());
+    if (!out) {
+        out.clear(); // flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
+        string path = UbSystem::getPathFromString(vtkfilename);
+        if (path.size() > 0) {
+            UbSystem::makeDirectory(path);
+            out.open(vtkfilename.c_str());
+        }
+        if (!out)
+            throw UbException(UB_EXARGS, "couldn't open file " + vtkfilename);
+    }
+
+    // write geo
+    int nofNodes = (int)nodes.size();
+    int nofCells = (int)cells.size();
+
+    // VtkASCII FILE
+    out << "# vtk DataFile Version 4.0"
+        << "\n";
+    out << "GeoFile"
+        << "\n";
+    out << "ASCII"
+        << "\n";
+
+    // POINTS SECTION
+    out << "DATASET UNSTRUCTURED_GRID"
+        << "\n";
+    out << "POINTS " << nofNodes << " float"
+        << "\n";
+    for (int n = 0; n < nofNodes; n++)
+        out << val<1>(nodes[n]) << " " << val<2>(nodes[n]) << " " << val<3>(nodes[n]) << " \n";
+
+    out << "\n";
+
+    // CELLS SECTION
+    out << "CELLS " << nofCells << " " << 5 * nofCells << "\n";
+    for (int c = 0; c < (int)cells.size(); c++)
+        out << "4 " << val<1>(cells[c]) << " " << val<2>(cells[c]) << " " << val<4>(cells[c]) << " " << val<3>(cells[c])
+            << " \n";
+    out << "\n";
+
+    out << "CELL_TYPES " << nofCells << "\n";
+    for (int i = 0; i < nofCells; i++)
+        out << "8" << endl;
+    out << endl;
+
+    // write data section
+    out << "CELL_DATA " << nofCells << "\n";
+    for (int s = 0; s < (int)datanames.size(); ++s) {
+        out << "SCALARS " << datanames[s] << " float 1 \n LOOKUP_TABLE default \n";
+        for (int d = 0; d < (int)celldata[s].size(); d++)
+            out << celldata[s][d] << "\n";
+
+        out << endl;
+    }
+
+    out.close();
+    UBLOG(logDEBUG1, "WbWriterVtkASCII::writeQuadsWithCellData to " << vtkfilename << " - end");
+    return vtkfilename;
 }
 /*===============================================================================*/
-std::string WbWriterVtkASCII::writeQuadsWithNodeAndCellData(const string& filename,vector< UbTupleFloat3 >& nodes, vector< UbTupleInt4 >& cells, 
-                                                            vector< string >& nodedatanames, vector< vector< double > >& nodedata, vector< string >& celldatanames,
-                                                            vector< vector< double > >& celldata                                                                       )
+std::string WbWriterVtkASCII::writeQuadsWithNodeAndCellData(const string &filename, vector<UbTupleFloat3> &nodes,
+                                                            vector<UbTupleInt4> &cells, vector<string> &nodedatanames,
+                                                            vector<vector<double>> &nodedata,
+                                                            vector<string> &celldatanames,
+                                                            vector<vector<double>> &celldata)
 {
-   string vtkfilename=filename+getFileExtension();
-   UBLOG(logDEBUG1,"WbWriterVtkASCII::writeQuadsWithNodeAndCellData to "<<vtkfilename<<" - start");
-
-   std::ofstream out(vtkfilename.c_str());
-   if(!out)
-   { 
-      out.clear(); //flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
-      string path = UbSystem::getPathFromString(vtkfilename);
-      if(path.size()>0){UbSystem::makeDirectory(path);out.open(vtkfilename.c_str());}
-      if(!out) throw UbException(UB_EXARGS,"couldn't open file "+vtkfilename);
-   }
-
-   //write geo
-   int nofNodes = (int)nodes.size(); 
-   int nofCells = (int)cells.size(); 
-
-   //VtkASCII FILE
-   out<<"# vtk DataFile Version 4.0"<<"\n";
-   out<<"GeoFile"<<"\n";
-   out<<"ASCII"<<"\n";
-
-   //POINTS SECTION
-   out<<"DATASET UNSTRUCTURED_GRID"<<"\n";
-   out<<"POINTS "<<nofNodes<<" float"<<"\n";
-   for(int n=0; n<nofNodes; n++)
-      out<< val<1>(nodes[n]) <<" "<< val<2>(nodes[n]) <<" "<< val<3>(nodes[n]) <<" \n";
-
-   out<<"\n";
-
-   //CELLS SECTION
-   out<<"CELLS "<<nofCells<<" "<<5*nofCells<<"\n";
-   for(int c=0; c<(int)cells.size(); c++)
-      out<<"4 "
-         << val<1>(cells[c]) <<" "
-         << val<2>(cells[c]) <<" "
-         << val<4>(cells[c]) <<" "
-         << val<3>(cells[c]) <<" \n";
-   out<<"\n";
-
-   out<<"CELL_TYPES "<<nofCells<<"\n";
-   for(int i=0; i<nofCells; i++) out<<"8"<<endl;
-   out<<endl;
-
-   //write node data section
-   out<<"POINT_DATA "<<nofNodes<<"\n";
-   for(int s=0; s<(int)nodedatanames.size(); ++s)
-   {
-      out<<"SCALARS "<<nodedatanames[s]<<" float 1 \n LOOKUP_TABLE default \n";
-      for(int d=0; d<(int)nodedata[s].size(); d++)
-         out<<nodedata[s][d]<<"\n";
-
-      out<<endl;
-   }
-
-   //write cell data section
-   out<<"CELL_DATA "<<nofCells<<"\n";
-   for(int s=0; s<(int)celldatanames.size(); ++s)
-   {
-      out<<"SCALARS "<<celldatanames[s]<<" float 1 \n LOOKUP_TABLE default \n";
-      for(int d=0; d<(int)celldata[s].size(); d++)
-         out<<celldata[s][d]<<"\n";
-
-      out<<endl;
-   }
-
-   out.close();
-   UBLOG(logDEBUG1,"WbWriterVtkASCII::writeQuadsWithNodeAndCellData to "<<vtkfilename<<" - end");
-   return vtkfilename;
+    string vtkfilename = filename + getFileExtension();
+    UBLOG(logDEBUG1, "WbWriterVtkASCII::writeQuadsWithNodeAndCellData to " << vtkfilename << " - start");
+
+    std::ofstream out(vtkfilename.c_str());
+    if (!out) {
+        out.clear(); // flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
+        string path = UbSystem::getPathFromString(vtkfilename);
+        if (path.size() > 0) {
+            UbSystem::makeDirectory(path);
+            out.open(vtkfilename.c_str());
+        }
+        if (!out)
+            throw UbException(UB_EXARGS, "couldn't open file " + vtkfilename);
+    }
+
+    // write geo
+    int nofNodes = (int)nodes.size();
+    int nofCells = (int)cells.size();
+
+    // VtkASCII FILE
+    out << "# vtk DataFile Version 4.0"
+        << "\n";
+    out << "GeoFile"
+        << "\n";
+    out << "ASCII"
+        << "\n";
+
+    // POINTS SECTION
+    out << "DATASET UNSTRUCTURED_GRID"
+        << "\n";
+    out << "POINTS " << nofNodes << " float"
+        << "\n";
+    for (int n = 0; n < nofNodes; n++)
+        out << val<1>(nodes[n]) << " " << val<2>(nodes[n]) << " " << val<3>(nodes[n]) << " \n";
+
+    out << "\n";
+
+    // CELLS SECTION
+    out << "CELLS " << nofCells << " " << 5 * nofCells << "\n";
+    for (int c = 0; c < (int)cells.size(); c++)
+        out << "4 " << val<1>(cells[c]) << " " << val<2>(cells[c]) << " " << val<4>(cells[c]) << " " << val<3>(cells[c])
+            << " \n";
+    out << "\n";
+
+    out << "CELL_TYPES " << nofCells << "\n";
+    for (int i = 0; i < nofCells; i++)
+        out << "8" << endl;
+    out << endl;
+
+    // write node data section
+    out << "POINT_DATA " << nofNodes << "\n";
+    for (int s = 0; s < (int)nodedatanames.size(); ++s) {
+        out << "SCALARS " << nodedatanames[s] << " float 1 \n LOOKUP_TABLE default \n";
+        for (int d = 0; d < (int)nodedata[s].size(); d++)
+            out << nodedata[s][d] << "\n";
+
+        out << endl;
+    }
+
+    // write cell data section
+    out << "CELL_DATA " << nofCells << "\n";
+    for (int s = 0; s < (int)celldatanames.size(); ++s) {
+        out << "SCALARS " << celldatanames[s] << " float 1 \n LOOKUP_TABLE default \n";
+        for (int d = 0; d < (int)celldata[s].size(); d++)
+            out << celldata[s][d] << "\n";
+
+        out << endl;
+    }
+
+    out.close();
+    UBLOG(logDEBUG1, "WbWriterVtkASCII::writeQuadsWithNodeAndCellData to " << vtkfilename << " - end");
+    return vtkfilename;
 }
 /*===============================================================================*/
-std::string WbWriterVtkASCII::writeLines(const string& filename,vector<UbTupleFloat3 >& nodes, vector<UbTupleInt2 >& lines) 
+std::string WbWriterVtkASCII::writeLines(const string &filename, vector<UbTupleFloat3> &nodes,
+                                         vector<UbTupleInt2> &lines)
 {
-   string vtkfilename=filename+getFileExtension();
-   UBLOG(logDEBUG1,"WbWriterVtkASCII::writeLines to "<<vtkfilename<<" - start");
-   
-   std::ofstream out(vtkfilename.c_str());
-   if(!out)
-   { 
-      out.clear(); //flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
-      string path = UbSystem::getPathFromString(vtkfilename);
-      if(path.size()>0){UbSystem::makeDirectory(path);out.open(vtkfilename.c_str());}
-      if(!out) throw UbException(UB_EXARGS,"couldn't open file "+vtkfilename);
-   }
-
-   int nofNodes = (int)nodes.size(); 
-   int nofLines = (int)lines.size(); 
-   
-   //VtkASCII FILE
-   out<<"# vtk DataFile Version 4.0"<<"\n";
-   out<<"GeoFile"<<"\n";
-   out<<"ASCII"<<"\n";
-
-   //POINTS SECTION
-   out<<"DATASET UNSTRUCTURED_GRID"<<"\n";
-   out<<"POINTS "<<nofNodes<<" float"<<"\n";
-   for(int n=0; n<nofNodes; n++)
-   {
-      out<< val<1>(nodes[n]) <<" "<< val<2>(nodes[n]) <<" "<< val<3>(nodes[n])<<" \n";
-   }
-   out<<"\n";
-
-   //CELLS SECTION
-   out<<"CELLS "<<nofLines<<" "<<3*nofLines<<"\n";
-   int nr = 0;
-   for(int l=0; l<nofLines; l++)
-   {
-      int el = nr+1;	
-      out<<"2 "<< val<1>(lines[l]) <<" "<< val<2>(lines[l]) <<" "<<endl;
-      nr=el+1;
-   }
-   out<<"\n";
-
-   out<<"CELL_TYPES "<<nofLines<<"\n";
-   for(int l=0; l<nofLines; l++) out<<"3"<<endl;
-   out<<endl;
-
-   out.close();
-   
-   UBLOG(logDEBUG1,"WbWriterVtkASCII::writeLines to "<<vtkfilename<<" - end");
-   return vtkfilename;
+    string vtkfilename = filename + getFileExtension();
+    UBLOG(logDEBUG1, "WbWriterVtkASCII::writeLines to " << vtkfilename << " - start");
+
+    std::ofstream out(vtkfilename.c_str());
+    if (!out) {
+        out.clear(); // flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
+        string path = UbSystem::getPathFromString(vtkfilename);
+        if (path.size() > 0) {
+            UbSystem::makeDirectory(path);
+            out.open(vtkfilename.c_str());
+        }
+        if (!out)
+            throw UbException(UB_EXARGS, "couldn't open file " + vtkfilename);
+    }
+
+    int nofNodes = (int)nodes.size();
+    int nofLines = (int)lines.size();
+
+    // VtkASCII FILE
+    out << "# vtk DataFile Version 4.0"
+        << "\n";
+    out << "GeoFile"
+        << "\n";
+    out << "ASCII"
+        << "\n";
+
+    // POINTS SECTION
+    out << "DATASET UNSTRUCTURED_GRID"
+        << "\n";
+    out << "POINTS " << nofNodes << " float"
+        << "\n";
+    for (int n = 0; n < nofNodes; n++) {
+        out << val<1>(nodes[n]) << " " << val<2>(nodes[n]) << " " << val<3>(nodes[n]) << " \n";
+    }
+    out << "\n";
+
+    // CELLS SECTION
+    out << "CELLS " << nofLines << " " << 3 * nofLines << "\n";
+    int nr = 0;
+    for (int l = 0; l < nofLines; l++) {
+        int el = nr + 1;
+        out << "2 " << val<1>(lines[l]) << " " << val<2>(lines[l]) << " " << endl;
+        nr = el + 1;
+    }
+    out << "\n";
+
+    out << "CELL_TYPES " << nofLines << "\n";
+    for (int l = 0; l < nofLines; l++)
+        out << "3" << endl;
+    out << endl;
+
+    out.close();
+
+    UBLOG(logDEBUG1, "WbWriterVtkASCII::writeLines to " << vtkfilename << " - end");
+    return vtkfilename;
 }
 /*===============================================================================*/
-std::string WbWriterVtkASCII::writeTriangles(const string& filename,vector<UbTupleFloat3 >& nodes, vector<UbTupleInt3 >& triangles)
+std::string WbWriterVtkASCII::writeTriangles(const string &filename, vector<UbTupleFloat3> &nodes,
+                                             vector<UbTupleInt3> &triangles)
 {
-   string vtkfilename=filename+getFileExtension();
-   UBLOG(logDEBUG1,"WbWriterVtkASCII::writeTriangles to "<<vtkfilename<<" - start");
-   
-   std::ofstream out(vtkfilename.c_str());
-   if(!out)
-   { 
-      out.clear(); //flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
-      string path = UbSystem::getPathFromString(vtkfilename);
-      if(path.size()>0){UbSystem::makeDirectory(path);out.open(vtkfilename.c_str());}
-      if(!out) throw UbException(UB_EXARGS,"couldn't open file "+vtkfilename);
-   }
-
-   int nofNodes     = (int)nodes.size(); 
-   int nofTriangles = (int)triangles.size(); 
-
-   //VtkASCII FILE
-   out<<"# vtk DataFile Version 4.0"<<"\n";
-   out<<"GeoFile"<<"\n";
-   out<<"ASCII"<<"\n";
-
-   //POINTS SECTION
-   out<<"DATASET UNSTRUCTURED_GRID"<<"\n";
-   out<<"POINTS "<<nofNodes<<" float"<<"\n";
-   for(int n=0; n<nofNodes; n++)
-   {
-      out<< val<1>(nodes[n]) <<" "<< val<2>(nodes[n]) <<" "<< val<3>(nodes[n])<<" \n";
-   }
-   out<<"\n";
-
-   //CELLS SECTION
-   out<<"CELLS "<<nofTriangles<<" "<<4*nofTriangles<<"\n";
-   int nr = 0;
-   for(int t=0; t<nofTriangles; t++)
-   {
-      int el = nr+1;	
-      out<<"3 "<< val<1>(triangles[t]) <<" "<< val<2>(triangles[t]) <<" "<< val<3>(triangles[t]) <<" "<<endl;
-      nr=el+1;
-   }
-   out<<"\n";
-
-   out<<"CELL_TYPES "<<nofTriangles<<"\n";
-   for(int l=0; l<nofTriangles; l++) out<<"5"<<endl;
-   out<<endl;
-
-   out.close();
-
-   UBLOG(logDEBUG1,"WbWriterVtkASCII::writeTriangles to "<<vtkfilename<<" - end");
-   return vtkfilename;
+    string vtkfilename = filename + getFileExtension();
+    UBLOG(logDEBUG1, "WbWriterVtkASCII::writeTriangles to " << vtkfilename << " - start");
+
+    std::ofstream out(vtkfilename.c_str());
+    if (!out) {
+        out.clear(); // flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
+        string path = UbSystem::getPathFromString(vtkfilename);
+        if (path.size() > 0) {
+            UbSystem::makeDirectory(path);
+            out.open(vtkfilename.c_str());
+        }
+        if (!out)
+            throw UbException(UB_EXARGS, "couldn't open file " + vtkfilename);
+    }
+
+    int nofNodes     = (int)nodes.size();
+    int nofTriangles = (int)triangles.size();
+
+    // VtkASCII FILE
+    out << "# vtk DataFile Version 4.0"
+        << "\n";
+    out << "GeoFile"
+        << "\n";
+    out << "ASCII"
+        << "\n";
+
+    // POINTS SECTION
+    out << "DATASET UNSTRUCTURED_GRID"
+        << "\n";
+    out << "POINTS " << nofNodes << " float"
+        << "\n";
+    for (int n = 0; n < nofNodes; n++) {
+        out << val<1>(nodes[n]) << " " << val<2>(nodes[n]) << " " << val<3>(nodes[n]) << " \n";
+    }
+    out << "\n";
+
+    // CELLS SECTION
+    out << "CELLS " << nofTriangles << " " << 4 * nofTriangles << "\n";
+    int nr = 0;
+    for (int t = 0; t < nofTriangles; t++) {
+        int el = nr + 1;
+        out << "3 " << val<1>(triangles[t]) << " " << val<2>(triangles[t]) << " " << val<3>(triangles[t]) << " "
+            << endl;
+        nr = el + 1;
+    }
+    out << "\n";
+
+    out << "CELL_TYPES " << nofTriangles << "\n";
+    for (int l = 0; l < nofTriangles; l++)
+        out << "5" << endl;
+    out << endl;
+
+    out.close();
+
+    UBLOG(logDEBUG1, "WbWriterVtkASCII::writeTriangles to " << vtkfilename << " - end");
+    return vtkfilename;
 }
 /*===============================================================================*/
-std::string WbWriterVtkASCII::writeTrianglesWithNodeData(const string& filename,vector< UbTupleFloat3 >& nodes, vector< UbTupleInt3 >& cells, vector< string >& datanames, vector< vector< double > >& nodedata)
+std::string WbWriterVtkASCII::writeTrianglesWithNodeData(const string &filename, vector<UbTupleFloat3> &nodes,
+                                                         vector<UbTupleInt3> &cells, vector<string> &datanames,
+                                                         vector<vector<double>> &nodedata)
 {
-   string vtkfilename=filename+getFileExtension();
-   UBLOG(logDEBUG1,"WbWriterVtkASCII::writeTrianglesWithNodeData to "<<vtkfilename<<" - start");
-   
-   std::ofstream out(vtkfilename.c_str());
-   if(!out)
-   { 
-      out.clear(); //flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
-      string path = UbSystem::getPathFromString(vtkfilename);
-      if(path.size()>0){UbSystem::makeDirectory(path);out.open(vtkfilename.c_str());}
-      if(!out) throw UbException(UB_EXARGS,"couldn't open file "+vtkfilename);
-   }
-
-   //write geo
-   int nofNodes = (int)nodes.size(); 
-   int nofCells = (int)cells.size(); 
-
-   //VtkASCII FILE
-   out<<"# vtk DataFile Version 4.0"<<"\n";
-   out<<"GeoFile"<<"\n";
-   out<<"ASCII"<<"\n";
-
-   //POINTS SECTION
-   out<<"DATASET UNSTRUCTURED_GRID"<<"\n";
-   out<<"POINTS "<<nofNodes<<" float"<<"\n";
-   for(int n=0; n<nofNodes; n++)
-      out<< val<1>(nodes[n]) <<" "<< val<2>(nodes[n]) <<" "<< val<3>(nodes[n]) <<" \n";
-
-   out<<"\n";
-
-   //CELLS SECTION
-   out<<"CELLS "<<nofCells<<" "<<4*nofCells<<"\n";
-   for(int c=0; c<(int)cells.size(); c++)
-      out<<"3 "<< val<1>(cells[c]) <<" "<< val<2>(cells[c]) <<" "<< val<3>(cells[c]) <<" \n";
-   out<<"\n";
-
-   out<<"CELL_TYPES "<<nofCells<<"\n";
-   for(int i=0; i<nofCells; i++) out<<"5"<<endl;
-   out<<endl;
-
-   //write data section
-   out<<"POINT_DATA "<<nofNodes<<"\n";
-   for(int s=0; s<(int)datanames.size(); ++s)
-   {
-      out<<"SCALARS "<<datanames[s]<<" float 1 \n LOOKUP_TABLE default \n";
-      for(int d=0; d<(int)nodedata[s].size(); d++)
-         out<<nodedata[s][d]<<"\n";
-
-      out<<endl;
-   }
-
-   out.close();
-   UBLOG(logDEBUG1,"WbWriterVtkASCII::writeTrianglesWithNodeData to "<<vtkfilename<<" - end");
-   return vtkfilename;
+    string vtkfilename = filename + getFileExtension();
+    UBLOG(logDEBUG1, "WbWriterVtkASCII::writeTrianglesWithNodeData to " << vtkfilename << " - start");
+
+    std::ofstream out(vtkfilename.c_str());
+    if (!out) {
+        out.clear(); // flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
+        string path = UbSystem::getPathFromString(vtkfilename);
+        if (path.size() > 0) {
+            UbSystem::makeDirectory(path);
+            out.open(vtkfilename.c_str());
+        }
+        if (!out)
+            throw UbException(UB_EXARGS, "couldn't open file " + vtkfilename);
+    }
+
+    // write geo
+    int nofNodes = (int)nodes.size();
+    int nofCells = (int)cells.size();
+
+    // VtkASCII FILE
+    out << "# vtk DataFile Version 4.0"
+        << "\n";
+    out << "GeoFile"
+        << "\n";
+    out << "ASCII"
+        << "\n";
+
+    // POINTS SECTION
+    out << "DATASET UNSTRUCTURED_GRID"
+        << "\n";
+    out << "POINTS " << nofNodes << " float"
+        << "\n";
+    for (int n = 0; n < nofNodes; n++)
+        out << val<1>(nodes[n]) << " " << val<2>(nodes[n]) << " " << val<3>(nodes[n]) << " \n";
+
+    out << "\n";
+
+    // CELLS SECTION
+    out << "CELLS " << nofCells << " " << 4 * nofCells << "\n";
+    for (int c = 0; c < (int)cells.size(); c++)
+        out << "3 " << val<1>(cells[c]) << " " << val<2>(cells[c]) << " " << val<3>(cells[c]) << " \n";
+    out << "\n";
+
+    out << "CELL_TYPES " << nofCells << "\n";
+    for (int i = 0; i < nofCells; i++)
+        out << "5" << endl;
+    out << endl;
+
+    // write data section
+    out << "POINT_DATA " << nofNodes << "\n";
+    for (int s = 0; s < (int)datanames.size(); ++s) {
+        out << "SCALARS " << datanames[s] << " float 1 \n LOOKUP_TABLE default \n";
+        for (int d = 0; d < (int)nodedata[s].size(); d++)
+            out << nodedata[s][d] << "\n";
+
+        out << endl;
+    }
+
+    out.close();
+    UBLOG(logDEBUG1, "WbWriterVtkASCII::writeTrianglesWithNodeData to " << vtkfilename << " - end");
+    return vtkfilename;
 }
 /*===============================================================================*/
-std::string WbWriterVtkASCII::writeOctsWithCellData(const string& filename,vector< UbTupleFloat3 >& nodes, vector< UbTupleInt8 >& cells, vector< string >& datanames, vector< vector< double > >& celldata)
+std::string WbWriterVtkASCII::writeOctsWithCellData(const string &filename, vector<UbTupleFloat3> &nodes,
+                                                    vector<UbTupleInt8> &cells, vector<string> &datanames,
+                                                    vector<vector<double>> &celldata)
 {
-   string vtkfilename=filename+getFileExtension();
-   UBLOG(logDEBUG1,"WbWriterVtkASCII::writeOctsWithCellData to "<<vtkfilename<<" - start");
-   
-   std::ofstream out(vtkfilename.c_str());
-   if(!out)
-   { 
-      out.clear(); //flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
-      string path = UbSystem::getPathFromString(vtkfilename);
-      if(path.size()>0){UbSystem::makeDirectory(path);out.open(vtkfilename.c_str());}
-      if(!out) throw UbException(UB_EXARGS,"couldn't open file "+vtkfilename);
-   }
-
-   //write geo
-   int nofNodes = (int)nodes.size(); 
-   int nofCells = (int)cells.size(); 
-
-   //VtkASCII FILE
-   out<<"# vtk DataFile Version 4.0"<<"\n";
-   out<<"GeoFile"<<"\n";
-   out<<"ASCII"<<"\n";
-
-   //POINTS SECTION
-   out<<"DATASET UNSTRUCTURED_GRID"<<"\n";
-   out<<"POINTS "<<nofNodes<<" float"<<"\n";
-   for(int n=0; n<nofNodes; n++)
-      out<< val<1>(nodes[n]) <<" "<< val<2>(nodes[n]) <<" "<< val<3>(nodes[n]) <<" \n";
-
-   out<<"\n";
-
-   //CELLS SECTION
-   out<<"CELLS "<<nofCells<<" "<<9*nofCells<<"\n";
-   for(int c=0; c<(int)cells.size(); c++)
-   {   out<<"8 "
-         << val<1>(cells[c]) <<" "
-         << val<2>(cells[c]) <<" "
-         << val<4>(cells[c]) <<" "
-         << val<3>(cells[c]) <<" "
-         << val<5>(cells[c]) <<" "
-         << val<6>(cells[c]) <<" "
-         << val<8>(cells[c]) <<" "
-         << val<7>(cells[c]) <<" \n";
-   }
-
-   out<<"\n";
-
-   out<<"CELL_TYPES "<<nofCells<<"\n";
-   for(int i=0; i<nofCells; i++) out<<"11 "<<endl;
-   out<<endl;
-
-   //write data section
-   out<<"CELL_DATA "<<nofCells<<"\n";
-   for(int s=0; s<(int)datanames.size(); ++s)
-   {
-      out<<"SCALARS "<<datanames[s]<<" float 1 \n LOOKUP_TABLE default \n";
-      for(int d=0; d<(int)celldata[s].size(); d++)
-         out<<celldata[s][d]<<"\n";
-
-      out<<endl;
-   }
-
-   out.close();
-   UBLOG(logDEBUG1,"WbWriterVtkASCII::writeOctsWithCellData to "<<vtkfilename<<" - end");
-
-   return vtkfilename;
+    string vtkfilename = filename + getFileExtension();
+    UBLOG(logDEBUG1, "WbWriterVtkASCII::writeOctsWithCellData to " << vtkfilename << " - start");
+
+    std::ofstream out(vtkfilename.c_str());
+    if (!out) {
+        out.clear(); // flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
+        string path = UbSystem::getPathFromString(vtkfilename);
+        if (path.size() > 0) {
+            UbSystem::makeDirectory(path);
+            out.open(vtkfilename.c_str());
+        }
+        if (!out)
+            throw UbException(UB_EXARGS, "couldn't open file " + vtkfilename);
+    }
+
+    // write geo
+    int nofNodes = (int)nodes.size();
+    int nofCells = (int)cells.size();
+
+    // VtkASCII FILE
+    out << "# vtk DataFile Version 4.0"
+        << "\n";
+    out << "GeoFile"
+        << "\n";
+    out << "ASCII"
+        << "\n";
+
+    // POINTS SECTION
+    out << "DATASET UNSTRUCTURED_GRID"
+        << "\n";
+    out << "POINTS " << nofNodes << " float"
+        << "\n";
+    for (int n = 0; n < nofNodes; n++)
+        out << val<1>(nodes[n]) << " " << val<2>(nodes[n]) << " " << val<3>(nodes[n]) << " \n";
+
+    out << "\n";
+
+    // CELLS SECTION
+    out << "CELLS " << nofCells << " " << 9 * nofCells << "\n";
+    for (int c = 0; c < (int)cells.size(); c++) {
+        out << "8 " << val<1>(cells[c]) << " " << val<2>(cells[c]) << " " << val<4>(cells[c]) << " " << val<3>(cells[c])
+            << " " << val<5>(cells[c]) << " " << val<6>(cells[c]) << " " << val<8>(cells[c]) << " " << val<7>(cells[c])
+            << " \n";
+    }
+
+    out << "\n";
+
+    out << "CELL_TYPES " << nofCells << "\n";
+    for (int i = 0; i < nofCells; i++)
+        out << "11 " << endl;
+    out << endl;
+
+    // write data section
+    out << "CELL_DATA " << nofCells << "\n";
+    for (int s = 0; s < (int)datanames.size(); ++s) {
+        out << "SCALARS " << datanames[s] << " float 1 \n LOOKUP_TABLE default \n";
+        for (int d = 0; d < (int)celldata[s].size(); d++)
+            out << celldata[s][d] << "\n";
+
+        out << endl;
+    }
+
+    out.close();
+    UBLOG(logDEBUG1, "WbWriterVtkASCII::writeOctsWithCellData to " << vtkfilename << " - end");
+
+    return vtkfilename;
 }
 /*===============================================================================*/
-std::string WbWriterVtkASCII::writeOctsWithNodeData(const string& filename,vector< UbTupleFloat3 >& nodes, vector< UbTupleUInt8 >& cells, vector< string >& datanames, vector< vector< double > >& nodedata)
+std::string WbWriterVtkASCII::writeOctsWithNodeData(const string &filename, vector<UbTupleFloat3> &nodes,
+                                                    vector<UbTupleUInt8> &cells, vector<string> &datanames,
+                                                    vector<vector<double>> &nodedata)
 {
-   string vtkfilename=filename+getFileExtension();
-   UBLOG(logDEBUG1,"WbWriterVtkASCII::writeOctsWithNodeData to "<<vtkfilename<<" - start");
-
-   std::ofstream out(vtkfilename.c_str());
-   if(!out)
-   { 
-      out.clear(); //flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
-      string path = UbSystem::getPathFromString(vtkfilename);
-      if(path.size()>0){UbSystem::makeDirectory(path);out.open(vtkfilename.c_str());}
-      if(!out) throw UbException(UB_EXARGS,"couldn't open file "+vtkfilename);
-   }
-
-   //write geo
-   int nofNodes = (int)nodes.size(); 
-   int nofCells = (int)cells.size(); 
-
-   //VtkASCII FILE
-   out<<"# vtk DataFile Version 4.0"<<"\n";
-   out<<"GeoFile"<<"\n";
-   out<<"ASCII"<<"\n";
-
-   //POINTS SECTION
-   out<<"DATASET UNSTRUCTURED_GRID"<<"\n";
-   out<<"POINTS "<<nofNodes<<" float"<<"\n";
-   for(int n=0; n<nofNodes; n++)
-      out<< val<1>(nodes[n]) <<" "<< val<2>(nodes[n]) <<" "<< val<3>(nodes[n]) <<" \n";
-
-   out<<"\n";
-
-   //CELLS SECTION
-   out<<"CELLS "<<nofCells<<" "<<9*nofCells<<"\n";
-   for(int c=0; c<(int)cells.size(); c++)
-   {   out<<"8 "
-         << val<1>(cells[c]) <<" "
-         << val<2>(cells[c]) <<" "
-         << val<4>(cells[c]) <<" "
-         << val<3>(cells[c]) <<" "
-         << val<5>(cells[c]) <<" "
-         << val<6>(cells[c]) <<" "
-         << val<8>(cells[c]) <<" "
-         << val<7>(cells[c]) <<" \n";
-   }
-   out<<"\n";
-
-   out<<"CELL_TYPES "<<nofCells<<"\n";
-   for(int i=0; i<nofCells; i++) out<<"11"<<endl;
-   out<<endl;
-
-   //write data section
-   out<<"POINT_DATA "<<nofNodes<<"\n";
-   for(int s=0; s<(int)datanames.size(); ++s)
-   {
-      out<<"SCALARS "<<datanames[s]<<" float 1 \n LOOKUP_TABLE default \n";
-      for(int d=0; d<(int)nodedata[s].size(); d++)
-         out<<nodedata[s][d]<<"\n";
-
-      out<<endl;
-   }
-
-   out.close();
-   UBLOG(logDEBUG1,"WbWriterVtkASCII::writeOctsWithNodeData to "<<vtkfilename<<" - end");
-   return vtkfilename;
+    string vtkfilename = filename + getFileExtension();
+    UBLOG(logDEBUG1, "WbWriterVtkASCII::writeOctsWithNodeData to " << vtkfilename << " - start");
+
+    std::ofstream out(vtkfilename.c_str());
+    if (!out) {
+        out.clear(); // flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
+        string path = UbSystem::getPathFromString(vtkfilename);
+        if (path.size() > 0) {
+            UbSystem::makeDirectory(path);
+            out.open(vtkfilename.c_str());
+        }
+        if (!out)
+            throw UbException(UB_EXARGS, "couldn't open file " + vtkfilename);
+    }
+
+    // write geo
+    int nofNodes = (int)nodes.size();
+    int nofCells = (int)cells.size();
+
+    // VtkASCII FILE
+    out << "# vtk DataFile Version 4.0"
+        << "\n";
+    out << "GeoFile"
+        << "\n";
+    out << "ASCII"
+        << "\n";
+
+    // POINTS SECTION
+    out << "DATASET UNSTRUCTURED_GRID"
+        << "\n";
+    out << "POINTS " << nofNodes << " float"
+        << "\n";
+    for (int n = 0; n < nofNodes; n++)
+        out << val<1>(nodes[n]) << " " << val<2>(nodes[n]) << " " << val<3>(nodes[n]) << " \n";
+
+    out << "\n";
+
+    // CELLS SECTION
+    out << "CELLS " << nofCells << " " << 9 * nofCells << "\n";
+    for (int c = 0; c < (int)cells.size(); c++) {
+        out << "8 " << val<1>(cells[c]) << " " << val<2>(cells[c]) << " " << val<4>(cells[c]) << " " << val<3>(cells[c])
+            << " " << val<5>(cells[c]) << " " << val<6>(cells[c]) << " " << val<8>(cells[c]) << " " << val<7>(cells[c])
+            << " \n";
+    }
+    out << "\n";
+
+    out << "CELL_TYPES " << nofCells << "\n";
+    for (int i = 0; i < nofCells; i++)
+        out << "11" << endl;
+    out << endl;
+
+    // write data section
+    out << "POINT_DATA " << nofNodes << "\n";
+    for (int s = 0; s < (int)datanames.size(); ++s) {
+        out << "SCALARS " << datanames[s] << " float 1 \n LOOKUP_TABLE default \n";
+        for (int d = 0; d < (int)nodedata[s].size(); d++)
+            out << nodedata[s][d] << "\n";
+
+        out << endl;
+    }
+
+    out.close();
+    UBLOG(logDEBUG1, "WbWriterVtkASCII::writeOctsWithNodeData to " << vtkfilename << " - end");
+    return vtkfilename;
 }
 /*===============================================================================*/
-std::string WbWriterVtkASCII::writeOcts(const string& filename,vector< UbTupleFloat3 >& nodes, vector< UbTupleInt8 >& cells)
+std::string WbWriterVtkASCII::writeOcts(const string &filename, vector<UbTupleFloat3> &nodes,
+                                        vector<UbTupleInt8> &cells)
 {
-   string vtkfilename=filename+getFileExtension();
-   UBLOG(logDEBUG1,"WbWriterVtkASCII::writeOcts to "<<vtkfilename<<" - start");
-   
-   std::ofstream out(vtkfilename.c_str());
-   if(!out)
-   { 
-      out.clear(); //flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
-      string path = UbSystem::getPathFromString(vtkfilename);
-      if(path.size()>0){UbSystem::makeDirectory(path);out.open(vtkfilename.c_str());}
-      if(!out) throw UbException(UB_EXARGS,"couldn't open file "+vtkfilename);
-   }
-
-   int nofNodes = (int)nodes.size(); 
-   int nofCells = (int)cells.size(); 
-
-   //VtkASCII FILE
-   out<<"# vtk DataFile Version 4.0"<<"\n";
-   out<<"GeoFile"<<"\n";
-   out<<"ASCII"<<"\n";
-
-   //POINTS SECTION
-   out<<"DATASET UNSTRUCTURED_GRID"<<"\n";
-   out<<"POINTS "<<nofNodes<<" float"<<"\n";
-   for(int n=0; n<nofNodes; n++)
-      out<< val<1>(nodes[n]) <<" "<< val<2>(nodes[n]) <<" "<< val<3>(nodes[n]) <<" \n";
-
-   out<<"\n";
-
-   //CELLS SECTION
-   out<<"CELLS "<<nofCells<<" "<<9*nofCells<<"\n";
-   for(int c=0; c<(int)cells.size(); c++)
-      out<<"8 "
-      << val<1>(cells[c]) <<" "
-      << val<2>(cells[c]) <<" "
-      << val<4>(cells[c]) <<" "
-      << val<3>(cells[c]) <<" "
-      << val<5>(cells[c]) <<" "
-      << val<6>(cells[c]) <<" "
-      << val<8>(cells[c]) <<" "
-      << val<7>(cells[c]) <<" \n";
-   out<<"\n";
-
-   out<<"CELL_TYPES "<<nofCells<<"\n";
-   for(int i=0; i<nofCells; i++) out<<"11"<<endl;
-   out<<endl;
-
-   out.close();
-
-   UBLOG(logDEBUG1,"WbWriterVtkASCII::writeOcts to "<<vtkfilename<<" - end");
-   return vtkfilename;
+    string vtkfilename = filename + getFileExtension();
+    UBLOG(logDEBUG1, "WbWriterVtkASCII::writeOcts to " << vtkfilename << " - start");
+
+    std::ofstream out(vtkfilename.c_str());
+    if (!out) {
+        out.clear(); // flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
+        string path = UbSystem::getPathFromString(vtkfilename);
+        if (path.size() > 0) {
+            UbSystem::makeDirectory(path);
+            out.open(vtkfilename.c_str());
+        }
+        if (!out)
+            throw UbException(UB_EXARGS, "couldn't open file " + vtkfilename);
+    }
+
+    int nofNodes = (int)nodes.size();
+    int nofCells = (int)cells.size();
+
+    // VtkASCII FILE
+    out << "# vtk DataFile Version 4.0"
+        << "\n";
+    out << "GeoFile"
+        << "\n";
+    out << "ASCII"
+        << "\n";
+
+    // POINTS SECTION
+    out << "DATASET UNSTRUCTURED_GRID"
+        << "\n";
+    out << "POINTS " << nofNodes << " float"
+        << "\n";
+    for (int n = 0; n < nofNodes; n++)
+        out << val<1>(nodes[n]) << " " << val<2>(nodes[n]) << " " << val<3>(nodes[n]) << " \n";
+
+    out << "\n";
+
+    // CELLS SECTION
+    out << "CELLS " << nofCells << " " << 9 * nofCells << "\n";
+    for (int c = 0; c < (int)cells.size(); c++)
+        out << "8 " << val<1>(cells[c]) << " " << val<2>(cells[c]) << " " << val<4>(cells[c]) << " " << val<3>(cells[c])
+            << " " << val<5>(cells[c]) << " " << val<6>(cells[c]) << " " << val<8>(cells[c]) << " " << val<7>(cells[c])
+            << " \n";
+    out << "\n";
+
+    out << "CELL_TYPES " << nofCells << "\n";
+    for (int i = 0; i < nofCells; i++)
+        out << "11" << endl;
+    out << endl;
+
+    out.close();
+
+    UBLOG(logDEBUG1, "WbWriterVtkASCII::writeOcts to " << vtkfilename << " - end");
+    return vtkfilename;
 }
diff --git a/src/basics/basics/writer/WbWriterVtkASCII.h b/src/basics/basics/writer/WbWriterVtkASCII.h
index 6d422ebd1d243a3df6e4b112bbc8788a486890a2..cce49c5fdf6a8b16724006022828854383abdb51 100644
--- a/src/basics/basics/writer/WbWriterVtkASCII.h
+++ b/src/basics/basics/writer/WbWriterVtkASCII.h
@@ -12,63 +12,80 @@
 class WbWriterVtkASCII : public WbWriter
 {
 public:
-   static WbWriterVtkASCII* getInstance()
-   {
-      static WbWriterVtkASCII instance;
-      return &instance;
-   }
+    static WbWriterVtkASCII *getInstance()
+    {
+        static WbWriterVtkASCII instance;
+        return &instance;
+    }
+
 private:
-   WbWriterVtkASCII() : WbWriter() {}                            
-   WbWriterVtkASCII( const WbWriterVtkASCII& );                  //no copy allowed 
-   const WbWriterVtkASCII& operator=( const WbWriterVtkASCII& ); //no copy allowed
+    WbWriterVtkASCII() : WbWriter() {}
+    WbWriterVtkASCII(const WbWriterVtkASCII &);                  // no copy allowed
+    const WbWriterVtkASCII &operator=(const WbWriterVtkASCII &); // no copy allowed
 
 public:
-   std::string getFileExtension() override  { return ".ascii.vtk"; }
+    std::string getFileExtension() override { return ".ascii.vtk"; }
 
-   //////////////////////////////////////////////////////////////////////////
-   //lines
-   //     0 ---- 1
-   //nodenumbering must start with 0!
-   std::string writeLines(const std::string& filename, std::vector<UbTupleFloat3 >& nodes, std::vector<UbTupleInt2 >& lines) override;
+    //////////////////////////////////////////////////////////////////////////
+    // lines
+    //     0 ---- 1
+    // nodenumbering must start with 0!
+    std::string writeLines(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                           std::vector<UbTupleInt2> &lines) override;
 
-   //////////////////////////////////////////////////////////////////////////
-   //triangles
-   //cell numbering:
-   //                    2
-   //                     
-   //                  0---1
-   //nodenumbering must start with 0!
-   std::string writeTriangles(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt3 >& cells) override;
-   std::string writeTrianglesWithNodeData(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt3 >& cells, std::vector< std::string >& datanames, std::vector< std::vector< double > >& nodedata) override;
+    //////////////////////////////////////////////////////////////////////////
+    // triangles
+    // cell numbering:
+    //                    2
+    //
+    //                  0---1
+    // nodenumbering must start with 0!
+    std::string writeTriangles(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                               std::vector<UbTupleInt3> &cells) override;
+    std::string writeTrianglesWithNodeData(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                                           std::vector<UbTupleInt3> &cells, std::vector<std::string> &datanames,
+                                           std::vector<std::vector<double>> &nodedata) override;
 
-   //////////////////////////////////////////////////////////////////////////
-   //2D
-   //cell numbering:
-   //                  3---2
-   //                  |   |
-   //                  0---1
-   //nodenumbering must start with 0!
-   std::string writeQuads(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt4 >& cells) override;
-   std::string writeQuadsWithNodeData(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt4 >& cells, std::vector< std::string >& datanames, std::vector< std::vector< double > >& nodedata) override;
-   std::string writeQuadsWithCellData(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt4 >& cells, std::vector< std::string >& datanames, std::vector< std::vector< double > >& celldata) override;
-   std::string writeQuadsWithNodeAndCellData(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt4 >& cells, 
-                                             std::vector< std::string >& nodedatanames, std::vector< std::vector< double > >& nodedata, std::vector< std::string >& celldatanames,
-                                             std::vector< std::vector< double > >& celldata                                                                       ) override;
-   
-   //////////////////////////////////////////////////////////////////////////
-   //octs
-   //     7 ---- 6
-   //    /|     /|
-   //   4 +--- 5 |
-   //   | |    | |
-   //   | 3 ---+ 2
-   //   |/     |/
-   //   0 ---- 1
-   std::string writeOcts(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt8 >& cells) override;
-   std::string writeOctsBinary(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt8 >& cells);
-   std::string writeOctsWithCellData(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt8 >& cells, std::vector<std::string >& datanames, std::vector<std::vector<double > >& celldata) override;
-   std::string writeOctsWithNodeData(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleUInt8 >& cells, std::vector<std::string >& datanames, std::vector<std::vector<double > >& nodedata) override;
+    //////////////////////////////////////////////////////////////////////////
+    // 2D
+    // cell numbering:
+    //                  3---2
+    //                  |   |
+    //                  0---1
+    // nodenumbering must start with 0!
+    std::string writeQuads(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                           std::vector<UbTupleInt4> &cells) override;
+    std::string writeQuadsWithNodeData(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                                       std::vector<UbTupleInt4> &cells, std::vector<std::string> &datanames,
+                                       std::vector<std::vector<double>> &nodedata) override;
+    std::string writeQuadsWithCellData(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                                       std::vector<UbTupleInt4> &cells, std::vector<std::string> &datanames,
+                                       std::vector<std::vector<double>> &celldata) override;
+    std::string writeQuadsWithNodeAndCellData(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                                              std::vector<UbTupleInt4> &cells, std::vector<std::string> &nodedatanames,
+                                              std::vector<std::vector<double>> &nodedata,
+                                              std::vector<std::string> &celldatanames,
+                                              std::vector<std::vector<double>> &celldata) override;
 
+    //////////////////////////////////////////////////////////////////////////
+    // octs
+    //     7 ---- 6
+    //    /|     /|
+    //   4 +--- 5 |
+    //   | |    | |
+    //   | 3 ---+ 2
+    //   |/     |/
+    //   0 ---- 1
+    std::string writeOcts(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                          std::vector<UbTupleInt8> &cells) override;
+    std::string writeOctsBinary(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                                std::vector<UbTupleInt8> &cells);
+    std::string writeOctsWithCellData(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                                      std::vector<UbTupleInt8> &cells, std::vector<std::string> &datanames,
+                                      std::vector<std::vector<double>> &celldata) override;
+    std::string writeOctsWithNodeData(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                                      std::vector<UbTupleUInt8> &cells, std::vector<std::string> &datanames,
+                                      std::vector<std::vector<double>> &nodedata) override;
 };
 
-#endif //WBWRITERVTKASCII_H
+#endif // WBWRITERVTKASCII_H
diff --git a/src/basics/basics/writer/WbWriterVtkBinary.cpp b/src/basics/basics/writer/WbWriterVtkBinary.cpp
index b440986f492ad8875a84524b18b3885f05a89299..2f0a203dacb1b335ede29564f3386a0cf3b8acc8 100644
--- a/src/basics/basics/writer/WbWriterVtkBinary.cpp
+++ b/src/basics/basics/writer/WbWriterVtkBinary.cpp
@@ -1,747 +1,818 @@
-#include <basics/writer/WbWriterVtkBinary.h>
-#include <basics/writer/WbWriterVtkASCII.h>
 #include <basics/utilities/UbLogger.h>
+#include <basics/writer/WbWriterVtkASCII.h>
+#include <basics/writer/WbWriterVtkBinary.h>
 #include <cstring>
 
 using namespace std;
 
-std::string WbWriterVtkBinary::writeLines(const std::string& filename, std::vector<UbTupleFloat3 >& nodes, std::vector<UbTupleInt2 >& lines)
+std::string WbWriterVtkBinary::writeLines(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                                          std::vector<UbTupleInt2> &lines)
 {
-   return WbWriterVtkASCII::getInstance()->writeLines(filename,nodes,lines);
+    return WbWriterVtkASCII::getInstance()->writeLines(filename, nodes, lines);
 }
 /*===============================================================================*/
-std::string WbWriterVtkBinary::writeTriangles(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt3 >& cells)
+std::string WbWriterVtkBinary::writeTriangles(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                                              std::vector<UbTupleInt3> &cells)
 {
-   return WbWriterVtkASCII::getInstance()->writeTriangles(filename,nodes,cells);
+    return WbWriterVtkASCII::getInstance()->writeTriangles(filename, nodes, cells);
 }
 /*===============================================================================*/
-std::string WbWriterVtkBinary::writeTrianglesWithNodeData(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt3 >& cells, std::vector< std::string >& datanames, std::vector< std::vector< double > >& nodedata)
+std::string WbWriterVtkBinary::writeTrianglesWithNodeData(const std::string &filename,
+                                                          std::vector<UbTupleFloat3> &nodes,
+                                                          std::vector<UbTupleInt3> &cells,
+                                                          std::vector<std::string> &datanames,
+                                                          std::vector<std::vector<double>> &nodedata)
 {
-   return WbWriterVtkASCII::getInstance()->writeTrianglesWithNodeData(filename,nodes,cells,datanames,nodedata);
+    return WbWriterVtkASCII::getInstance()->writeTrianglesWithNodeData(filename, nodes, cells, datanames, nodedata);
 }
 /*===============================================================================*/
-std::string WbWriterVtkBinary::writeQuads(const string& filename,vector< UbTupleFloat3 >& nodes, vector< UbTupleInt4 >& cells)
+std::string WbWriterVtkBinary::writeQuads(const string &filename, vector<UbTupleFloat3> &nodes,
+                                          vector<UbTupleInt4> &cells)
 {
-   string vtkfilename = filename + getFileExtension();
-   UBLOG(logDEBUG1,"WbWriterVtkBinary::writeQuads to "<<vtkfilename<<" - start");
-
-   ofstream out(vtkfilename.c_str(),ofstream::out | ofstream::binary);
-   if(!out)
-   { 
-      out.clear(); //flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
-      string path = UbSystem::getPathFromString(vtkfilename);
-      if(path.size()>0){ UbSystem::makeDirectory(path); out.open(vtkfilename.c_str(),ios::out | ios::binary);}
-      if(!out) throw UbException(UB_EXARGS,"couldn't open file "+vtkfilename);
-   }
-
-   //HEADER-SECTION
-   //WRITE BIGENDIAN VtkBinary FILE
-   bool swapByte = UbSystem::isLittleEndian();
-   int nofNodes = (int)nodes.size(); 
-   int nofCells = (int)cells.size(); 
-
-   out<<"# vtk DataFile Version 4.0"<<"\n";
-   out<<"D3Q19MasterNodeGrid"<<"\n";
-   out<<""<<"\n";
-
-   //POINTS SECTION
-   out<<"DATASET UNSTRUCTURED_GRID"<<"\n";
-   out<<"POINTS "<<nofNodes<<" float"<<"\n";
-   for(int n=0; n<nofNodes; n++)
-   {
-      float x1 = (float)val<1>(nodes[n]); 
-      float x2 = (float)val<2>(nodes[n]); 
-      float x3 = (float)val<3>(nodes[n]); 
-
-      if(swapByte)
-      {
-         UbSystem::swapByteOrder((unsigned char*)&x1,sizeof(float));
-         UbSystem::swapByteOrder((unsigned char*)&x2,sizeof(float));
-         UbSystem::swapByteOrder((unsigned char*)&x3,sizeof(float));
-      }
-
-      out.write((char*)&x1,sizeof(float));
-      out.write((char*)&x2,sizeof(float));
-      out.write((char*)&x3,sizeof(float));
-   }
-   out<<"\n";
-
-   //CELLS SECTION
-   out<<"CELLS "<<nofCells<<" "<<nofCells*5<<"\n";
-
-   int nodesPerCellDummy = 4;  //nofNodesPerCell         
-   if(swapByte) UbSystem::swapByteOrder((unsigned char*)&nodesPerCellDummy,sizeof(int));
-   for(int c=0; c<(int)cells.size(); c++)
-   {
-      int SW = val<1>(cells[c]); 
-      int SE = val<2>(cells[c]); 
-      int NE = val<3>(cells[c]);
-      int NW = val<4>(cells[c]);
-      if(swapByte)
-      {
-         UbSystem::swapByteOrder((unsigned char*)&SW,sizeof(int));
-         UbSystem::swapByteOrder((unsigned char*)&SE,sizeof(int));
-         UbSystem::swapByteOrder((unsigned char*)&NW,sizeof(int));
-         UbSystem::swapByteOrder((unsigned char*)&NE,sizeof(int));
-      }
-
-      out.write((char*)&nodesPerCellDummy,sizeof(int));
-      out.write((char*)&SW,sizeof(int));
-      out.write((char*)&SE,sizeof(int));
-      out.write((char*)&NW,sizeof(int));
-      out.write((char*)&NE,sizeof(int));
-   }
-   out<<"\n";
-
-   out<<"CELL_TYPES "<<(int)cells.size()<<"\n";
-   int celltype = 8;
-   if(swapByte) UbSystem::swapByteOrder((unsigned char*)&celltype,sizeof(int));
-   for(int c=0; c<nofCells; c++)
-      out.write((char*)&celltype,sizeof(int));
-
-   out<<endl;
-   out.close();
-
-   UBLOG(logDEBUG1,"WbWriterVtkBinary::writeQuads to "<<vtkfilename<<" - end");
-   return vtkfilename;
+    string vtkfilename = filename + getFileExtension();
+    UBLOG(logDEBUG1, "WbWriterVtkBinary::writeQuads to " << vtkfilename << " - start");
+
+    ofstream out(vtkfilename.c_str(), ofstream::out | ofstream::binary);
+    if (!out) {
+        out.clear(); // flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
+        string path = UbSystem::getPathFromString(vtkfilename);
+        if (path.size() > 0) {
+            UbSystem::makeDirectory(path);
+            out.open(vtkfilename.c_str(), ios::out | ios::binary);
+        }
+        if (!out)
+            throw UbException(UB_EXARGS, "couldn't open file " + vtkfilename);
+    }
+
+    // HEADER-SECTION
+    // WRITE BIGENDIAN VtkBinary FILE
+    bool swapByte = UbSystem::isLittleEndian();
+    int nofNodes  = (int)nodes.size();
+    int nofCells  = (int)cells.size();
+
+    out << "# vtk DataFile Version 4.0"
+        << "\n";
+    out << "D3Q19MasterNodeGrid"
+        << "\n";
+    out << ""
+        << "\n";
+
+    // POINTS SECTION
+    out << "DATASET UNSTRUCTURED_GRID"
+        << "\n";
+    out << "POINTS " << nofNodes << " float"
+        << "\n";
+    for (int n = 0; n < nofNodes; n++) {
+        float x1 = (float)val<1>(nodes[n]);
+        float x2 = (float)val<2>(nodes[n]);
+        float x3 = (float)val<3>(nodes[n]);
+
+        if (swapByte) {
+            UbSystem::swapByteOrder((unsigned char *)&x1, sizeof(float));
+            UbSystem::swapByteOrder((unsigned char *)&x2, sizeof(float));
+            UbSystem::swapByteOrder((unsigned char *)&x3, sizeof(float));
+        }
+
+        out.write((char *)&x1, sizeof(float));
+        out.write((char *)&x2, sizeof(float));
+        out.write((char *)&x3, sizeof(float));
+    }
+    out << "\n";
+
+    // CELLS SECTION
+    out << "CELLS " << nofCells << " " << nofCells * 5 << "\n";
+
+    int nodesPerCellDummy = 4; // nofNodesPerCell
+    if (swapByte)
+        UbSystem::swapByteOrder((unsigned char *)&nodesPerCellDummy, sizeof(int));
+    for (int c = 0; c < (int)cells.size(); c++) {
+        int SW = val<1>(cells[c]);
+        int SE = val<2>(cells[c]);
+        int NE = val<3>(cells[c]);
+        int NW = val<4>(cells[c]);
+        if (swapByte) {
+            UbSystem::swapByteOrder((unsigned char *)&SW, sizeof(int));
+            UbSystem::swapByteOrder((unsigned char *)&SE, sizeof(int));
+            UbSystem::swapByteOrder((unsigned char *)&NW, sizeof(int));
+            UbSystem::swapByteOrder((unsigned char *)&NE, sizeof(int));
+        }
+
+        out.write((char *)&nodesPerCellDummy, sizeof(int));
+        out.write((char *)&SW, sizeof(int));
+        out.write((char *)&SE, sizeof(int));
+        out.write((char *)&NW, sizeof(int));
+        out.write((char *)&NE, sizeof(int));
+    }
+    out << "\n";
+
+    out << "CELL_TYPES " << (int)cells.size() << "\n";
+    int celltype = 8;
+    if (swapByte)
+        UbSystem::swapByteOrder((unsigned char *)&celltype, sizeof(int));
+    for (int c = 0; c < nofCells; c++)
+        out.write((char *)&celltype, sizeof(int));
+
+    out << endl;
+    out.close();
+
+    UBLOG(logDEBUG1, "WbWriterVtkBinary::writeQuads to " << vtkfilename << " - end");
+    return vtkfilename;
 }
 /*===============================================================================*/
-std::string WbWriterVtkBinary::writeQuadsWithNodeData(const string& filename,vector< UbTupleFloat3 >& nodes, vector< UbTupleInt4 >& cells, vector< string >& datanames, vector< vector< double > >& nodedata)
+std::string WbWriterVtkBinary::writeQuadsWithNodeData(const string &filename, vector<UbTupleFloat3> &nodes,
+                                                      vector<UbTupleInt4> &cells, vector<string> &datanames,
+                                                      vector<vector<double>> &nodedata)
 {
-   string vtkfilename = filename + getFileExtension();
-   UBLOG(logDEBUG1,"WbWriterVtkBinary::writeQuadsWithNodeData to "<<vtkfilename<<" - start");
-
-   ofstream out(vtkfilename.c_str(),ofstream::out | ofstream::binary);
-   if(!out)
-   { 
-      out.clear(); //flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
-      string path = UbSystem::getPathFromString(vtkfilename);
-      if(path.size()>0){ UbSystem::makeDirectory(path); out.open(vtkfilename.c_str(),ios::out | ios::binary);}
-      if(!out) throw UbException(UB_EXARGS,"couldn't open file "+vtkfilename);
-   }
-
-   //WRITE BIGENDIAN VtkBinary FILE
-   bool swapByte = UbSystem::isLittleEndian();
-   int nofNodes = (int)nodes.size(); 
-   int nofCells = (int)cells.size(); 
-
-   out<<"# vtk DataFile Version 4.0"<<"\n";
-   out<<"D3Q19MasterNodeGrid"<<"\n";
-   out<<""<<"\n";
-
-   //POINTS SECTION
-   out<<"DATASET UNSTRUCTURED_GRID"<<"\n";
-   out<<"POINTS "<<nofNodes<<" float"<<"\n";
-   for(int n=0; n<nofNodes; n++)
-   {
-      float x1 = (float)val<1>(nodes[n]); 
-      float x2 = (float)val<2>(nodes[n]); 
-      float x3 = (float)val<3>(nodes[n]); 
-
-      if(swapByte)
-      {
-         UbSystem::swapByteOrder((unsigned char*)&x1,sizeof(float));
-         UbSystem::swapByteOrder((unsigned char*)&x2,sizeof(float));
-         UbSystem::swapByteOrder((unsigned char*)&x3,sizeof(float));
-      }
-
-      out.write((char*)&x1,sizeof(float));
-      out.write((char*)&x2,sizeof(float));
-      out.write((char*)&x3,sizeof(float));
-   }
-   out<<"\n";
-
-   //CELLS SECTION
-   out<<"CELLS "<<nofCells<<" "<<nofCells*5<<"\n";
-
-   int nodesPerCellDummy = 4;  //nofNodesPerCell         
-   if(swapByte) UbSystem::swapByteOrder((unsigned char*)&nodesPerCellDummy,sizeof(int));
-   for(int c=0; c<(int)cells.size(); c++)
-   {
-      int SW = val<1>(cells[c]); 
-      int SE = val<2>(cells[c]); 
-      int NE = val<3>(cells[c]);
-      int NW = val<4>(cells[c]);
-      if(swapByte)
-      {
-         UbSystem::swapByteOrder((unsigned char*)&SW,sizeof(int));
-         UbSystem::swapByteOrder((unsigned char*)&SE,sizeof(int));
-         UbSystem::swapByteOrder((unsigned char*)&NW,sizeof(int));
-         UbSystem::swapByteOrder((unsigned char*)&NE,sizeof(int));
-      }
-
-      out.write((char*)&nodesPerCellDummy,sizeof(int));
-      out.write((char*)&SW,sizeof(int));
-      out.write((char*)&SE,sizeof(int));
-      out.write((char*)&NW,sizeof(int));
-      out.write((char*)&NE,sizeof(int));
-   }
-   out<<"\n";
-
-   out<<"CELL_TYPES "<<(int)cells.size()<<"\n";
-   int celltype = 8;
-   if(swapByte) UbSystem::swapByteOrder((unsigned char*)&celltype,sizeof(int));
-   for(int c=0; c<nofCells; c++)
-      out.write((char*)&celltype,sizeof(int));
-
-   out<<endl;
-
-   //DATA SECTION
-   //write data section
-   out<<"POINT_DATA "<<nofNodes<<"\n";
-   for(int s=0; s<(int)datanames.size(); ++s)
-   {
-      if((int)nodedata[s].size() != nofNodes) throw UbException(UB_EXARGS,"datasetsize must be equal to nofNodes");
-      out<<"SCALARS "<<datanames[s]<<" float 1 \n LOOKUP_TABLE default \n";
-      for(int d=0; d<(int)nodedata[s].size(); d++)
-      { 
-         float dummy = (float)nodedata[s][d]; 
-         if(swapByte) UbSystem::swapByteOrder((unsigned char*)&dummy,sizeof(float)); 
-         out.write((const char*)&dummy,sizeof(float));
-      }
-      out<<endl;
-   }
-   out.close();
-
-   UBLOG(logDEBUG1,"WbWriterVtkBinary::writeQuadsWithNodeData to "<<vtkfilename<<" - end");
-   return vtkfilename;
+    string vtkfilename = filename + getFileExtension();
+    UBLOG(logDEBUG1, "WbWriterVtkBinary::writeQuadsWithNodeData to " << vtkfilename << " - start");
+
+    ofstream out(vtkfilename.c_str(), ofstream::out | ofstream::binary);
+    if (!out) {
+        out.clear(); // flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
+        string path = UbSystem::getPathFromString(vtkfilename);
+        if (path.size() > 0) {
+            UbSystem::makeDirectory(path);
+            out.open(vtkfilename.c_str(), ios::out | ios::binary);
+        }
+        if (!out)
+            throw UbException(UB_EXARGS, "couldn't open file " + vtkfilename);
+    }
+
+    // WRITE BIGENDIAN VtkBinary FILE
+    bool swapByte = UbSystem::isLittleEndian();
+    int nofNodes  = (int)nodes.size();
+    int nofCells  = (int)cells.size();
+
+    out << "# vtk DataFile Version 4.0"
+        << "\n";
+    out << "D3Q19MasterNodeGrid"
+        << "\n";
+    out << ""
+        << "\n";
+
+    // POINTS SECTION
+    out << "DATASET UNSTRUCTURED_GRID"
+        << "\n";
+    out << "POINTS " << nofNodes << " float"
+        << "\n";
+    for (int n = 0; n < nofNodes; n++) {
+        float x1 = (float)val<1>(nodes[n]);
+        float x2 = (float)val<2>(nodes[n]);
+        float x3 = (float)val<3>(nodes[n]);
+
+        if (swapByte) {
+            UbSystem::swapByteOrder((unsigned char *)&x1, sizeof(float));
+            UbSystem::swapByteOrder((unsigned char *)&x2, sizeof(float));
+            UbSystem::swapByteOrder((unsigned char *)&x3, sizeof(float));
+        }
+
+        out.write((char *)&x1, sizeof(float));
+        out.write((char *)&x2, sizeof(float));
+        out.write((char *)&x3, sizeof(float));
+    }
+    out << "\n";
+
+    // CELLS SECTION
+    out << "CELLS " << nofCells << " " << nofCells * 5 << "\n";
+
+    int nodesPerCellDummy = 4; // nofNodesPerCell
+    if (swapByte)
+        UbSystem::swapByteOrder((unsigned char *)&nodesPerCellDummy, sizeof(int));
+    for (int c = 0; c < (int)cells.size(); c++) {
+        int SW = val<1>(cells[c]);
+        int SE = val<2>(cells[c]);
+        int NE = val<3>(cells[c]);
+        int NW = val<4>(cells[c]);
+        if (swapByte) {
+            UbSystem::swapByteOrder((unsigned char *)&SW, sizeof(int));
+            UbSystem::swapByteOrder((unsigned char *)&SE, sizeof(int));
+            UbSystem::swapByteOrder((unsigned char *)&NW, sizeof(int));
+            UbSystem::swapByteOrder((unsigned char *)&NE, sizeof(int));
+        }
+
+        out.write((char *)&nodesPerCellDummy, sizeof(int));
+        out.write((char *)&SW, sizeof(int));
+        out.write((char *)&SE, sizeof(int));
+        out.write((char *)&NW, sizeof(int));
+        out.write((char *)&NE, sizeof(int));
+    }
+    out << "\n";
+
+    out << "CELL_TYPES " << (int)cells.size() << "\n";
+    int celltype = 8;
+    if (swapByte)
+        UbSystem::swapByteOrder((unsigned char *)&celltype, sizeof(int));
+    for (int c = 0; c < nofCells; c++)
+        out.write((char *)&celltype, sizeof(int));
+
+    out << endl;
+
+    // DATA SECTION
+    // write data section
+    out << "POINT_DATA " << nofNodes << "\n";
+    for (int s = 0; s < (int)datanames.size(); ++s) {
+        if ((int)nodedata[s].size() != nofNodes)
+            throw UbException(UB_EXARGS, "datasetsize must be equal to nofNodes");
+        out << "SCALARS " << datanames[s] << " float 1 \n LOOKUP_TABLE default \n";
+        for (int d = 0; d < (int)nodedata[s].size(); d++) {
+            float dummy = (float)nodedata[s][d];
+            if (swapByte)
+                UbSystem::swapByteOrder((unsigned char *)&dummy, sizeof(float));
+            out.write((const char *)&dummy, sizeof(float));
+        }
+        out << endl;
+    }
+    out.close();
+
+    UBLOG(logDEBUG1, "WbWriterVtkBinary::writeQuadsWithNodeData to " << vtkfilename << " - end");
+    return vtkfilename;
 }
 /*===============================================================================*/
-std::string WbWriterVtkBinary::writeQuadsWithCellData(const string& filename,vector< UbTupleFloat3 >& nodes, vector< UbTupleInt4 >& cells, vector< string >& datanames, vector< vector< double > >& celldata)
+std::string WbWriterVtkBinary::writeQuadsWithCellData(const string &filename, vector<UbTupleFloat3> &nodes,
+                                                      vector<UbTupleInt4> &cells, vector<string> &datanames,
+                                                      vector<vector<double>> &celldata)
 {
-   //HEADER-SECTION
-   string vtkfilename = filename + getFileExtension();
-   UBLOG(logDEBUG1,"WbWriterVtkBinary::writeQuadsWithCellData to "<<vtkfilename<<" - start");
-
-   ofstream out(vtkfilename.c_str(),ofstream::out | ofstream::binary);
-   if(!out)
-   { 
-      out.clear(); //flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
-      string path = UbSystem::getPathFromString(vtkfilename);
-      if(path.size()>0){ UbSystem::makeDirectory(path); out.open(vtkfilename.c_str(),ios::out | ios::binary);}
-      if(!out) throw UbException(UB_EXARGS,"couldn't open file "+vtkfilename);
-   }
-
-   //WRITE BIGENDIAN VtkBinary FILE
-   bool swapByte = UbSystem::isLittleEndian();
-   int nofNodes = (int)nodes.size(); 
-   int nofCells = (int)cells.size(); 
-
-   out<<"# vtk DataFile Version 4.0"<<"\n";
-   out<<"D3Q19MasterNodeGrid"<<"\n";
-   out<<""<<"\n";
-
-   //POINTS SECTION
-   out<<"DATASET UNSTRUCTURED_GRID"<<"\n";
-   out<<"POINTS "<<nofNodes<<" float"<<"\n";
-   for(int n=0; n<nofNodes; n++)
-   {
-      float x1 = (float)val<1>(nodes[n]); 
-      float x2 = (float)val<2>(nodes[n]); 
-      float x3 = (float)val<3>(nodes[n]); 
-
-      if(swapByte)
-      {
-         UbSystem::swapByteOrder((unsigned char*)&x1,sizeof(float));
-         UbSystem::swapByteOrder((unsigned char*)&x2,sizeof(float));
-         UbSystem::swapByteOrder((unsigned char*)&x3,sizeof(float));
-      }
-
-      out.write((char*)&x1,sizeof(float));
-      out.write((char*)&x2,sizeof(float));
-      out.write((char*)&x3,sizeof(float));
-   }
-   out<<"\n";
-
-   //CELLS SECTION
-   out<<"CELLS "<<nofCells<<" "<<nofCells*5<<"\n";
-
-   int nodesPerCellDummy = 4;  //nofNodesPerCell         
-   if(swapByte) UbSystem::swapByteOrder((unsigned char*)&nodesPerCellDummy,sizeof(int));
-   for(int c=0; c<(int)cells.size(); c++)
-   {
-      int SW = val<1>(cells[c]); 
-      int SE = val<2>(cells[c]); 
-      int NE = val<3>(cells[c]);
-      int NW = val<4>(cells[c]);
-      if(swapByte)
-      {
-         UbSystem::swapByteOrder((unsigned char*)&SW,sizeof(int));
-         UbSystem::swapByteOrder((unsigned char*)&SE,sizeof(int));
-         UbSystem::swapByteOrder((unsigned char*)&NW,sizeof(int));
-         UbSystem::swapByteOrder((unsigned char*)&NE,sizeof(int));
-      }
-
-      out.write((char*)&nodesPerCellDummy,sizeof(int));
-      out.write((char*)&SW,sizeof(int));
-      out.write((char*)&SE,sizeof(int));
-      out.write((char*)&NW,sizeof(int));
-      out.write((char*)&NE,sizeof(int));
-   }
-   out<<"\n";
-
-   out<<"CELL_TYPES "<<(int)cells.size()<<"\n";
-   int celltype = 8;
-   if(swapByte) UbSystem::swapByteOrder((unsigned char*)&celltype,sizeof(int));
-   for(int c=0; c<nofCells; c++)
-      out.write((char*)&celltype,sizeof(int));
-
-   out<<endl;
-
-   //DATA SECTION
-   //write data section
-   out<<"CELL_DATA "<<nofCells<<"\n";
-   for(int s=0; s<(int)datanames.size(); ++s)
-   {
-      if((int)celldata[s].size() != nofCells) throw UbException(UB_EXARGS,"datasetsize must be equal to nofNodes");
-      out<<"SCALARS "<<datanames[s]<<" float 1 \n LOOKUP_TABLE default \n";
-      for(int d=0; d<(int)celldata[s].size(); d++)
-      { 
-         float dummy = (float)celldata[s][d]; 
-         if(swapByte) UbSystem::swapByteOrder((unsigned char*)&dummy,sizeof(float)); 
-         out.write((const char*)&dummy,sizeof(float));
-      }
-      out<<endl;
-   }
-   out.close();
-
-   UBLOG(logDEBUG1,"WbWriterVtkBinary::writeQuadsWithCellData to "<<vtkfilename<<" - end");
-   return vtkfilename;
+    // HEADER-SECTION
+    string vtkfilename = filename + getFileExtension();
+    UBLOG(logDEBUG1, "WbWriterVtkBinary::writeQuadsWithCellData to " << vtkfilename << " - start");
+
+    ofstream out(vtkfilename.c_str(), ofstream::out | ofstream::binary);
+    if (!out) {
+        out.clear(); // flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
+        string path = UbSystem::getPathFromString(vtkfilename);
+        if (path.size() > 0) {
+            UbSystem::makeDirectory(path);
+            out.open(vtkfilename.c_str(), ios::out | ios::binary);
+        }
+        if (!out)
+            throw UbException(UB_EXARGS, "couldn't open file " + vtkfilename);
+    }
+
+    // WRITE BIGENDIAN VtkBinary FILE
+    bool swapByte = UbSystem::isLittleEndian();
+    int nofNodes  = (int)nodes.size();
+    int nofCells  = (int)cells.size();
+
+    out << "# vtk DataFile Version 4.0"
+        << "\n";
+    out << "D3Q19MasterNodeGrid"
+        << "\n";
+    out << ""
+        << "\n";
+
+    // POINTS SECTION
+    out << "DATASET UNSTRUCTURED_GRID"
+        << "\n";
+    out << "POINTS " << nofNodes << " float"
+        << "\n";
+    for (int n = 0; n < nofNodes; n++) {
+        float x1 = (float)val<1>(nodes[n]);
+        float x2 = (float)val<2>(nodes[n]);
+        float x3 = (float)val<3>(nodes[n]);
+
+        if (swapByte) {
+            UbSystem::swapByteOrder((unsigned char *)&x1, sizeof(float));
+            UbSystem::swapByteOrder((unsigned char *)&x2, sizeof(float));
+            UbSystem::swapByteOrder((unsigned char *)&x3, sizeof(float));
+        }
+
+        out.write((char *)&x1, sizeof(float));
+        out.write((char *)&x2, sizeof(float));
+        out.write((char *)&x3, sizeof(float));
+    }
+    out << "\n";
+
+    // CELLS SECTION
+    out << "CELLS " << nofCells << " " << nofCells * 5 << "\n";
+
+    int nodesPerCellDummy = 4; // nofNodesPerCell
+    if (swapByte)
+        UbSystem::swapByteOrder((unsigned char *)&nodesPerCellDummy, sizeof(int));
+    for (int c = 0; c < (int)cells.size(); c++) {
+        int SW = val<1>(cells[c]);
+        int SE = val<2>(cells[c]);
+        int NE = val<3>(cells[c]);
+        int NW = val<4>(cells[c]);
+        if (swapByte) {
+            UbSystem::swapByteOrder((unsigned char *)&SW, sizeof(int));
+            UbSystem::swapByteOrder((unsigned char *)&SE, sizeof(int));
+            UbSystem::swapByteOrder((unsigned char *)&NW, sizeof(int));
+            UbSystem::swapByteOrder((unsigned char *)&NE, sizeof(int));
+        }
+
+        out.write((char *)&nodesPerCellDummy, sizeof(int));
+        out.write((char *)&SW, sizeof(int));
+        out.write((char *)&SE, sizeof(int));
+        out.write((char *)&NW, sizeof(int));
+        out.write((char *)&NE, sizeof(int));
+    }
+    out << "\n";
+
+    out << "CELL_TYPES " << (int)cells.size() << "\n";
+    int celltype = 8;
+    if (swapByte)
+        UbSystem::swapByteOrder((unsigned char *)&celltype, sizeof(int));
+    for (int c = 0; c < nofCells; c++)
+        out.write((char *)&celltype, sizeof(int));
+
+    out << endl;
+
+    // DATA SECTION
+    // write data section
+    out << "CELL_DATA " << nofCells << "\n";
+    for (int s = 0; s < (int)datanames.size(); ++s) {
+        if ((int)celldata[s].size() != nofCells)
+            throw UbException(UB_EXARGS, "datasetsize must be equal to nofNodes");
+        out << "SCALARS " << datanames[s] << " float 1 \n LOOKUP_TABLE default \n";
+        for (int d = 0; d < (int)celldata[s].size(); d++) {
+            float dummy = (float)celldata[s][d];
+            if (swapByte)
+                UbSystem::swapByteOrder((unsigned char *)&dummy, sizeof(float));
+            out.write((const char *)&dummy, sizeof(float));
+        }
+        out << endl;
+    }
+    out.close();
+
+    UBLOG(logDEBUG1, "WbWriterVtkBinary::writeQuadsWithCellData to " << vtkfilename << " - end");
+    return vtkfilename;
 }
 /*===============================================================================*/
-std::string WbWriterVtkBinary::writeQuadsWithNodeAndCellData(const string& filename,vector< UbTupleFloat3 >& nodes, vector< UbTupleInt4 >& cells, 
-                                                             vector< string >& nodedatanames, vector< vector< double > >& nodedata, vector< string >& celldatanames,
-                                                             vector< vector< double > >& celldata                                                                    )
+std::string WbWriterVtkBinary::writeQuadsWithNodeAndCellData(const string &filename, vector<UbTupleFloat3> &nodes,
+                                                             vector<UbTupleInt4> &cells, vector<string> &nodedatanames,
+                                                             vector<vector<double>> &nodedata,
+                                                             vector<string> &celldatanames,
+                                                             vector<vector<double>> &celldata)
 {
-   string vtkfilename = filename + getFileExtension();
-   UBLOG(logDEBUG1,"WbWriterVtkBinary::writeQuadsWithNodeAndCellData to "<<vtkfilename<<" - start");
-
-   ofstream out(vtkfilename.c_str(),ofstream::out | ofstream::binary);
-   if(!out)
-   { 
-      out.clear(); //flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
-      string path = UbSystem::getPathFromString(vtkfilename);
-      if(path.size()>0){ UbSystem::makeDirectory(path); out.open(vtkfilename.c_str(),ios::out | ios::binary);}
-      if(!out) throw UbException(UB_EXARGS,"couldn't open file "+vtkfilename);
-   }
-
-   //HEADER-SECTION
-   //WRITE BIGENDIAN VtkBinary FILE
-   bool swapByte = UbSystem::isLittleEndian();
-   int nofNodes = (int)nodes.size(); 
-   int nofCells = (int)cells.size(); 
-
-   out<<"# vtk DataFile Version 4.0"<<"\n";
-   out<<"D3Q19MasterNodeGrid"<<"\n";
-   out<<""<<"\n";
-
-   //POINTS SECTION
-   out<<"DATASET UNSTRUCTURED_GRID"<<"\n";
-   out<<"POINTS "<<nofNodes<<" float"<<"\n";
-   for(int n=0; n<nofNodes; n++)
-   {
-      float x1 = (float)val<1>(nodes[n]); 
-      float x2 = (float)val<2>(nodes[n]); 
-      float x3 = (float)val<3>(nodes[n]);  
-
-      if(swapByte)
-      {
-         UbSystem::swapByteOrder((unsigned char*)&x1,sizeof(float));
-         UbSystem::swapByteOrder((unsigned char*)&x2,sizeof(float));
-         UbSystem::swapByteOrder((unsigned char*)&x3,sizeof(float));
-      }
-
-      out.write((char*)&x1,sizeof(float));
-      out.write((char*)&x2,sizeof(float));
-      out.write((char*)&x3,sizeof(float));
-   }
-   out<<"\n";
-
-   //CELLS SECTION
-   out<<"CELLS "<<nofCells<<" "<<nofCells*5<<"\n";
-
-   int nodesPerCellDummy = 4;  //nofNodesPerCell         
-   if(swapByte) UbSystem::swapByteOrder((unsigned char*)&nodesPerCellDummy,sizeof(int));
-   for(int c=0; c<(int)cells.size(); c++)
-   {
-      int SW = val<1>(cells[c]); 
-      int SE = val<2>(cells[c]); 
-      int NE = val<3>(cells[c]);
-      int NW = val<4>(cells[c]);
-      if(swapByte)
-      {
-         UbSystem::swapByteOrder((unsigned char*)&SW,sizeof(int));
-         UbSystem::swapByteOrder((unsigned char*)&SE,sizeof(int));
-         UbSystem::swapByteOrder((unsigned char*)&NW,sizeof(int));
-         UbSystem::swapByteOrder((unsigned char*)&NE,sizeof(int));
-      }
-
-      out.write((char*)&nodesPerCellDummy,sizeof(int));
-      out.write((char*)&SW,sizeof(int));
-      out.write((char*)&SE,sizeof(int));
-      out.write((char*)&NW,sizeof(int));
-      out.write((char*)&NE,sizeof(int));
-   }
-   out<<"\n";
-
-   out<<"CELL_TYPES "<<(int)cells.size()<<"\n";
-   int celltype = 8;
-   if(swapByte) UbSystem::swapByteOrder((unsigned char*)&celltype,sizeof(int));
-   for(int c=0; c<nofCells; c++)
-      out.write((char*)&celltype,sizeof(int));
-
-   out<<endl;
-
-   //NODE DATA SECTION
-   //write data section
-   out<<"POINT_DATA "<<nofNodes<<"\n";
-   for(int s=0; s<(int)nodedatanames.size(); ++s)
-   {
-      if((int)nodedata[s].size() != nofNodes) throw UbException(UB_EXARGS,"datasetsize must be equal to nofNodes");
-      out<<"SCALARS "<<nodedatanames[s]<<" float 1 \n LOOKUP_TABLE default \n";
-      for(int d=0; d<(int)nodedata[s].size(); d++)
-      { 
-         float dummy = (float)nodedata[s][d]; 
-         if(swapByte) UbSystem::swapByteOrder((unsigned char*)&dummy,sizeof(float)); 
-         out.write((const char*)&dummy,sizeof(float));
-      }
-      out<<endl;
-   }
-   
-   //CELL DATA SECTION
-   //write data section
-   out<<"CELL_DATA "<<nofCells<<"\n";
-   for(int s=0; s<(int)celldatanames.size(); ++s)
-   {
-      if((int)celldata[s].size() != nofCells) throw UbException(UB_EXARGS,"datasetsize must be equal to nofNodes");
-      out<<"SCALARS "<<celldatanames[s]<<" float 1 \n LOOKUP_TABLE default \n";
-      for(int d=0; d<(int)celldata[s].size(); d++)
-      { 
-         float dummy = (float)celldata[s][d]; 
-         if(swapByte) UbSystem::swapByteOrder((unsigned char*)&dummy,sizeof(float)); 
-         out.write((const char*)&dummy,sizeof(float));
-      }
-      out<<endl;
-   }
-
-   out.close();
-
-   UBLOG(logDEBUG1,"WbWriterVtkBinary::writeQuadsWithNodeAndCellData to "<<vtkfilename<<" - end");
-   return vtkfilename;
+    string vtkfilename = filename + getFileExtension();
+    UBLOG(logDEBUG1, "WbWriterVtkBinary::writeQuadsWithNodeAndCellData to " << vtkfilename << " - start");
+
+    ofstream out(vtkfilename.c_str(), ofstream::out | ofstream::binary);
+    if (!out) {
+        out.clear(); // flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
+        string path = UbSystem::getPathFromString(vtkfilename);
+        if (path.size() > 0) {
+            UbSystem::makeDirectory(path);
+            out.open(vtkfilename.c_str(), ios::out | ios::binary);
+        }
+        if (!out)
+            throw UbException(UB_EXARGS, "couldn't open file " + vtkfilename);
+    }
+
+    // HEADER-SECTION
+    // WRITE BIGENDIAN VtkBinary FILE
+    bool swapByte = UbSystem::isLittleEndian();
+    int nofNodes  = (int)nodes.size();
+    int nofCells  = (int)cells.size();
+
+    out << "# vtk DataFile Version 4.0"
+        << "\n";
+    out << "D3Q19MasterNodeGrid"
+        << "\n";
+    out << ""
+        << "\n";
+
+    // POINTS SECTION
+    out << "DATASET UNSTRUCTURED_GRID"
+        << "\n";
+    out << "POINTS " << nofNodes << " float"
+        << "\n";
+    for (int n = 0; n < nofNodes; n++) {
+        float x1 = (float)val<1>(nodes[n]);
+        float x2 = (float)val<2>(nodes[n]);
+        float x3 = (float)val<3>(nodes[n]);
+
+        if (swapByte) {
+            UbSystem::swapByteOrder((unsigned char *)&x1, sizeof(float));
+            UbSystem::swapByteOrder((unsigned char *)&x2, sizeof(float));
+            UbSystem::swapByteOrder((unsigned char *)&x3, sizeof(float));
+        }
+
+        out.write((char *)&x1, sizeof(float));
+        out.write((char *)&x2, sizeof(float));
+        out.write((char *)&x3, sizeof(float));
+    }
+    out << "\n";
+
+    // CELLS SECTION
+    out << "CELLS " << nofCells << " " << nofCells * 5 << "\n";
+
+    int nodesPerCellDummy = 4; // nofNodesPerCell
+    if (swapByte)
+        UbSystem::swapByteOrder((unsigned char *)&nodesPerCellDummy, sizeof(int));
+    for (int c = 0; c < (int)cells.size(); c++) {
+        int SW = val<1>(cells[c]);
+        int SE = val<2>(cells[c]);
+        int NE = val<3>(cells[c]);
+        int NW = val<4>(cells[c]);
+        if (swapByte) {
+            UbSystem::swapByteOrder((unsigned char *)&SW, sizeof(int));
+            UbSystem::swapByteOrder((unsigned char *)&SE, sizeof(int));
+            UbSystem::swapByteOrder((unsigned char *)&NW, sizeof(int));
+            UbSystem::swapByteOrder((unsigned char *)&NE, sizeof(int));
+        }
+
+        out.write((char *)&nodesPerCellDummy, sizeof(int));
+        out.write((char *)&SW, sizeof(int));
+        out.write((char *)&SE, sizeof(int));
+        out.write((char *)&NW, sizeof(int));
+        out.write((char *)&NE, sizeof(int));
+    }
+    out << "\n";
+
+    out << "CELL_TYPES " << (int)cells.size() << "\n";
+    int celltype = 8;
+    if (swapByte)
+        UbSystem::swapByteOrder((unsigned char *)&celltype, sizeof(int));
+    for (int c = 0; c < nofCells; c++)
+        out.write((char *)&celltype, sizeof(int));
+
+    out << endl;
+
+    // NODE DATA SECTION
+    // write data section
+    out << "POINT_DATA " << nofNodes << "\n";
+    for (int s = 0; s < (int)nodedatanames.size(); ++s) {
+        if ((int)nodedata[s].size() != nofNodes)
+            throw UbException(UB_EXARGS, "datasetsize must be equal to nofNodes");
+        out << "SCALARS " << nodedatanames[s] << " float 1 \n LOOKUP_TABLE default \n";
+        for (int d = 0; d < (int)nodedata[s].size(); d++) {
+            float dummy = (float)nodedata[s][d];
+            if (swapByte)
+                UbSystem::swapByteOrder((unsigned char *)&dummy, sizeof(float));
+            out.write((const char *)&dummy, sizeof(float));
+        }
+        out << endl;
+    }
+
+    // CELL DATA SECTION
+    // write data section
+    out << "CELL_DATA " << nofCells << "\n";
+    for (int s = 0; s < (int)celldatanames.size(); ++s) {
+        if ((int)celldata[s].size() != nofCells)
+            throw UbException(UB_EXARGS, "datasetsize must be equal to nofNodes");
+        out << "SCALARS " << celldatanames[s] << " float 1 \n LOOKUP_TABLE default \n";
+        for (int d = 0; d < (int)celldata[s].size(); d++) {
+            float dummy = (float)celldata[s][d];
+            if (swapByte)
+                UbSystem::swapByteOrder((unsigned char *)&dummy, sizeof(float));
+            out.write((const char *)&dummy, sizeof(float));
+        }
+        out << endl;
+    }
+
+    out.close();
+
+    UBLOG(logDEBUG1, "WbWriterVtkBinary::writeQuadsWithNodeAndCellData to " << vtkfilename << " - end");
+    return vtkfilename;
 }
 /*===============================================================================*/
-std::string WbWriterVtkBinary::writeOctsWithCellData(const string& filename,vector<UbTupleFloat3 >& nodes, vector<UbTupleInt8 >& cells, vector<string >& datanames, vector<vector<double > >& celldata)
+std::string WbWriterVtkBinary::writeOctsWithCellData(const string &filename, vector<UbTupleFloat3> &nodes,
+                                                     vector<UbTupleInt8> &cells, vector<string> &datanames,
+                                                     vector<vector<double>> &celldata)
 {
-   string vtkfilename = filename + getFileExtension();
-   UBLOG(logDEBUG1,"WbWriterVtkBinary::writeOctsWithCellData to "<<vtkfilename<<" - start");
-
-   ofstream out(vtkfilename.c_str(),ofstream::out | ofstream::binary);
-   if(!out)
-   { 
-      out.clear(); //flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
-      string path = UbSystem::getPathFromString(vtkfilename);
-      if(path.size()>0){ UbSystem::makeDirectory(path); out.open(vtkfilename.c_str(),ios::out | ios::binary);}
-      if(!out) throw UbException(UB_EXARGS,"couldn't open file "+vtkfilename);
-   }
-
-   //HEADER-SECTION
-   //WRITE BIGENDIAN VtkBinary FILE
-   bool swapByte = UbSystem::isLittleEndian();
-   int nofNodes = (int)nodes.size(); 
-   int nofCells = (int)cells.size(); 
-
-   out<<"# vtk DataFile Version 4.0"<<"\n";
-   out<<"D3Q19MasterNodeGrid"<<"\n";
-   out<<""<<"\n";
-
-   //POINTS SECTION
-   out<<"DATASET UNSTRUCTURED_GRID"<<"\n";
-   out<<"POINTS "<<nofNodes<<" float"<<"\n";
-   for(int n=0; n<nofNodes; n++)
-   {
-      float x1 = (float)val<1>(nodes[n]); 
-      float x2 = (float)val<2>(nodes[n]); 
-      float x3 = (float)val<3>(nodes[n]);
-
-      if(swapByte)
-      {
-         UbSystem::swapByteOrder((unsigned char*)&x1,sizeof(float));
-         UbSystem::swapByteOrder((unsigned char*)&x2,sizeof(float));
-         UbSystem::swapByteOrder((unsigned char*)&x3,sizeof(float));
-      }
-
-      out.write((char*)&x1,sizeof(float));
-      out.write((char*)&x2,sizeof(float));
-      out.write((char*)&x3,sizeof(float));
-   }
-   out<<"\n";
-
-   //CELLS SECTION
-   out<<"CELLS "<<nofCells<<" "<<nofCells*9<<"\n";
-
-   int nodesPerCellDummy = 8;  //nofNodesPerCell         
-   if(swapByte) UbSystem::swapByteOrder((unsigned char*)&nodesPerCellDummy,sizeof(int));
-   for(int c=0; c<(int)cells.size(); c++)
-   {
-      int BSW = val<1>(cells[c]);  int TSW = val<5>(cells[c]);
-      int BSE = val<2>(cells[c]);  int TSE = val<6>(cells[c]);
-      int BNW = val<3>(cells[c]);  int TNW = val<7>(cells[c]);
-      int BNE = val<4>(cells[c]);  int TNE = val<8>(cells[c]);
-      if(swapByte)
-      {
-         UbSystem::swapByteOrder((unsigned char*)&BSW,sizeof(int));
-         UbSystem::swapByteOrder((unsigned char*)&BSE,sizeof(int));
-         UbSystem::swapByteOrder((unsigned char*)&BNW,sizeof(int));
-         UbSystem::swapByteOrder((unsigned char*)&BNE,sizeof(int));
-         UbSystem::swapByteOrder((unsigned char*)&TSW,sizeof(int));
-         UbSystem::swapByteOrder((unsigned char*)&TSE,sizeof(int));
-         UbSystem::swapByteOrder((unsigned char*)&TNW,sizeof(int));
-         UbSystem::swapByteOrder((unsigned char*)&TNE,sizeof(int));
-      }
-
-      out.write((char*)&nodesPerCellDummy,sizeof(int));
-      out.write((char*)&BSW,sizeof(int));
-      out.write((char*)&BSE,sizeof(int));
-      out.write((char*)&BNE,sizeof(int));
-      out.write((char*)&BNW,sizeof(int));
-      out.write((char*)&TSW,sizeof(int));
-      out.write((char*)&TSE,sizeof(int));
-      out.write((char*)&TNE,sizeof(int));
-      out.write((char*)&TNW,sizeof(int));
-   }
-   out<<"\n";
-
-   out<<"CELL_TYPES "<<(int)cells.size()<<"\n";
-   int celltype = 11;
-   if(swapByte) UbSystem::swapByteOrder((unsigned char*)&celltype,sizeof(int));
-   for(int c=0; c<nofCells; c++)
-      out.write((char*)&celltype,sizeof(int));
-
-   out<<endl;
-
-   //CELL DATA SECTION
-   //write data section
-   out<<"CELL_DATA "<<nofCells<<"\n";
-   for(int s=0; s<(int)datanames.size(); ++s)
-   {
-      if((int)celldata[s].size() != nofCells) throw UbException(UB_EXARGS,"datasetsize must be equal to nofNodes");
-      out<<"SCALARS "<<datanames[s]<<" float 1 \n LOOKUP_TABLE default \n";
-      for(int d=0; d<(int)celldata[s].size(); d++)
-      { 
-         float dummy = (float)celldata[s][d]; 
-         if(swapByte) UbSystem::swapByteOrder((unsigned char*)&dummy,sizeof(float)); 
-         out.write((const char*)&dummy,sizeof(float));
-      }
-      out<<endl;
-   }
-   out.close();
-
-   UBLOG(logDEBUG1,"WbWriterVtkBinary::writeOctsWithCellData to "<<vtkfilename<<" - end");
-   return vtkfilename;
+    string vtkfilename = filename + getFileExtension();
+    UBLOG(logDEBUG1, "WbWriterVtkBinary::writeOctsWithCellData to " << vtkfilename << " - start");
+
+    ofstream out(vtkfilename.c_str(), ofstream::out | ofstream::binary);
+    if (!out) {
+        out.clear(); // flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
+        string path = UbSystem::getPathFromString(vtkfilename);
+        if (path.size() > 0) {
+            UbSystem::makeDirectory(path);
+            out.open(vtkfilename.c_str(), ios::out | ios::binary);
+        }
+        if (!out)
+            throw UbException(UB_EXARGS, "couldn't open file " + vtkfilename);
+    }
+
+    // HEADER-SECTION
+    // WRITE BIGENDIAN VtkBinary FILE
+    bool swapByte = UbSystem::isLittleEndian();
+    int nofNodes  = (int)nodes.size();
+    int nofCells  = (int)cells.size();
+
+    out << "# vtk DataFile Version 4.0"
+        << "\n";
+    out << "D3Q19MasterNodeGrid"
+        << "\n";
+    out << ""
+        << "\n";
+
+    // POINTS SECTION
+    out << "DATASET UNSTRUCTURED_GRID"
+        << "\n";
+    out << "POINTS " << nofNodes << " float"
+        << "\n";
+    for (int n = 0; n < nofNodes; n++) {
+        float x1 = (float)val<1>(nodes[n]);
+        float x2 = (float)val<2>(nodes[n]);
+        float x3 = (float)val<3>(nodes[n]);
+
+        if (swapByte) {
+            UbSystem::swapByteOrder((unsigned char *)&x1, sizeof(float));
+            UbSystem::swapByteOrder((unsigned char *)&x2, sizeof(float));
+            UbSystem::swapByteOrder((unsigned char *)&x3, sizeof(float));
+        }
+
+        out.write((char *)&x1, sizeof(float));
+        out.write((char *)&x2, sizeof(float));
+        out.write((char *)&x3, sizeof(float));
+    }
+    out << "\n";
+
+    // CELLS SECTION
+    out << "CELLS " << nofCells << " " << nofCells * 9 << "\n";
+
+    int nodesPerCellDummy = 8; // nofNodesPerCell
+    if (swapByte)
+        UbSystem::swapByteOrder((unsigned char *)&nodesPerCellDummy, sizeof(int));
+    for (int c = 0; c < (int)cells.size(); c++) {
+        int BSW = val<1>(cells[c]);
+        int TSW = val<5>(cells[c]);
+        int BSE = val<2>(cells[c]);
+        int TSE = val<6>(cells[c]);
+        int BNW = val<3>(cells[c]);
+        int TNW = val<7>(cells[c]);
+        int BNE = val<4>(cells[c]);
+        int TNE = val<8>(cells[c]);
+        if (swapByte) {
+            UbSystem::swapByteOrder((unsigned char *)&BSW, sizeof(int));
+            UbSystem::swapByteOrder((unsigned char *)&BSE, sizeof(int));
+            UbSystem::swapByteOrder((unsigned char *)&BNW, sizeof(int));
+            UbSystem::swapByteOrder((unsigned char *)&BNE, sizeof(int));
+            UbSystem::swapByteOrder((unsigned char *)&TSW, sizeof(int));
+            UbSystem::swapByteOrder((unsigned char *)&TSE, sizeof(int));
+            UbSystem::swapByteOrder((unsigned char *)&TNW, sizeof(int));
+            UbSystem::swapByteOrder((unsigned char *)&TNE, sizeof(int));
+        }
+
+        out.write((char *)&nodesPerCellDummy, sizeof(int));
+        out.write((char *)&BSW, sizeof(int));
+        out.write((char *)&BSE, sizeof(int));
+        out.write((char *)&BNE, sizeof(int));
+        out.write((char *)&BNW, sizeof(int));
+        out.write((char *)&TSW, sizeof(int));
+        out.write((char *)&TSE, sizeof(int));
+        out.write((char *)&TNE, sizeof(int));
+        out.write((char *)&TNW, sizeof(int));
+    }
+    out << "\n";
+
+    out << "CELL_TYPES " << (int)cells.size() << "\n";
+    int celltype = 11;
+    if (swapByte)
+        UbSystem::swapByteOrder((unsigned char *)&celltype, sizeof(int));
+    for (int c = 0; c < nofCells; c++)
+        out.write((char *)&celltype, sizeof(int));
+
+    out << endl;
+
+    // CELL DATA SECTION
+    // write data section
+    out << "CELL_DATA " << nofCells << "\n";
+    for (int s = 0; s < (int)datanames.size(); ++s) {
+        if ((int)celldata[s].size() != nofCells)
+            throw UbException(UB_EXARGS, "datasetsize must be equal to nofNodes");
+        out << "SCALARS " << datanames[s] << " float 1 \n LOOKUP_TABLE default \n";
+        for (int d = 0; d < (int)celldata[s].size(); d++) {
+            float dummy = (float)celldata[s][d];
+            if (swapByte)
+                UbSystem::swapByteOrder((unsigned char *)&dummy, sizeof(float));
+            out.write((const char *)&dummy, sizeof(float));
+        }
+        out << endl;
+    }
+    out.close();
+
+    UBLOG(logDEBUG1, "WbWriterVtkBinary::writeOctsWithCellData to " << vtkfilename << " - end");
+    return vtkfilename;
 }
 /*===============================================================================*/
-std::string WbWriterVtkBinary::writeOctsWithNodeData(const string& filename,vector<UbTupleFloat3 >& nodes, vector<UbTupleUInt8 >& cells, vector<string >& datanames, vector<vector<double > >& nodedata)
+std::string WbWriterVtkBinary::writeOctsWithNodeData(const string &filename, vector<UbTupleFloat3> &nodes,
+                                                     vector<UbTupleUInt8> &cells, vector<string> &datanames,
+                                                     vector<vector<double>> &nodedata)
 {
-   //HEADER-SECTION
-   string vtkfilename = filename + getFileExtension();
-   UBLOG(logDEBUG1,"WbWriterVtkBinary::writeOctsWithNodeData to "<<vtkfilename<<" - start");
-
-   ofstream out(vtkfilename.c_str(),ofstream::out | ofstream::binary);
-   if(!out)
-   { 
-      out.clear(); //flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
-      string path = UbSystem::getPathFromString(vtkfilename);
-      if(path.size()>0){ UbSystem::makeDirectory(path); out.open(vtkfilename.c_str(),ios::out | ios::binary);}
-      if(!out) throw UbException(UB_EXARGS,"couldn't open file "+vtkfilename);
-   }
-
-   //WRITE BIGENDIAN VtkBinary FILE
-   bool swapByte = UbSystem::isLittleEndian();
-   int nofNodes = (int)nodes.size(); 
-   int nofCells = (int)cells.size(); 
-
-   out<<"# vtk DataFile Version 4.0"<<"\n";
-   out<<"D3Q19MasterNodeGrid"<<"\n";
-   out<<""<<"\n";
-
-   //POINTS SECTION
-   out<<"DATASET UNSTRUCTURED_GRID"<<"\n";
-   out<<"POINTS "<<nofNodes<<" float"<<"\n";
-   for(int n=0; n<nofNodes; n++)
-   {
-      float x1 = val<1>(nodes[n]); 
-      float x2 = val<2>(nodes[n]); 
-      float x3 = val<3>(nodes[n]); 
-
-      if(swapByte)
-      {
-         UbSystem::swapByteOrder((unsigned char*)&x1,sizeof(float));
-         UbSystem::swapByteOrder((unsigned char*)&x2,sizeof(float));
-         UbSystem::swapByteOrder((unsigned char*)&x3,sizeof(float));
-      }
-
-      out.write((char*)&x1,sizeof(float));
-      out.write((char*)&x2,sizeof(float));
-      out.write((char*)&x3,sizeof(float));
-   }
-   out<<"\n";
-
-   //CELLS SECTION
-   out<<"CELLS "<<nofCells<<" "<<nofCells*9<<"\n";
-
-   int nodesPerCellDummy = 8;  //nofNodesPerCell         
-   if(swapByte) UbSystem::swapByteOrder((unsigned char*)&nodesPerCellDummy,sizeof(int));
-   for(int c=0; c<(int)cells.size(); c++)
-   {
-      int BSW = val<1>(cells[c]);  int TSW = val<5>(cells[c]);
-      int BSE = val<2>(cells[c]);  int TSE = val<6>(cells[c]);
-      int BNW = val<3>(cells[c]);  int TNW = val<7>(cells[c]);
-      int BNE = val<4>(cells[c]);  int TNE = val<8>(cells[c]);
-      if(swapByte)
-      {
-         UbSystem::swapByteOrder((unsigned char*)&BSW,sizeof(int));
-         UbSystem::swapByteOrder((unsigned char*)&BSE,sizeof(int));
-         UbSystem::swapByteOrder((unsigned char*)&BNW,sizeof(int));
-         UbSystem::swapByteOrder((unsigned char*)&BNE,sizeof(int));
-         UbSystem::swapByteOrder((unsigned char*)&TSW,sizeof(int));
-         UbSystem::swapByteOrder((unsigned char*)&TSE,sizeof(int));
-         UbSystem::swapByteOrder((unsigned char*)&TNW,sizeof(int));
-         UbSystem::swapByteOrder((unsigned char*)&TNE,sizeof(int));
-      }
-
-      out.write((char*)&nodesPerCellDummy,sizeof(int));
-      out.write((char*)&BSW,sizeof(int));
-      out.write((char*)&BSE,sizeof(int));
-      out.write((char*)&BNE,sizeof(int));
-      out.write((char*)&BNW,sizeof(int));
-      out.write((char*)&TSW,sizeof(int));
-      out.write((char*)&TSE,sizeof(int));
-      out.write((char*)&TNE,sizeof(int));
-      out.write((char*)&TNW,sizeof(int));
-   }
-   out<<"\n";
-
-   out<<"CELL_TYPES "<<(int)cells.size()<<"\n";
-   int celltype = 11;
-   if(swapByte) UbSystem::swapByteOrder((unsigned char*)&celltype,sizeof(int));
-   for(int c=0; c<nofCells; c++)
-      out.write((char*)&celltype,sizeof(int));
-
-   out<<endl;
-
-   //NODE DATA SECTION
-   //write data section
-   out<<"POINT_DATA "<<nofNodes<<"\n";
-   for(int s=0; s<(int)datanames.size(); ++s)
-   {
-      if((int)nodedata[s].size() != nofNodes) throw UbException(UB_EXARGS,"datasetsize must be equal to nofNodes");
-      out<<"SCALARS "<<datanames[s]<<" float 1 \n LOOKUP_TABLE default \n";
-      for(int d=0; d<(int)nodedata[s].size(); d++)
-      { 
-         float dummy = (float)nodedata[s][d]; 
-         if(swapByte) UbSystem::swapByteOrder((unsigned char*)&dummy,sizeof(float)); 
-         out.write((const char*)&dummy,sizeof(float));
-      }
-      out<<endl;
-   }
-
-   out.close();
-
-   UBLOG(logDEBUG1,"WbWriterVtkBinary::writeOctsWithNodeData to "<<vtkfilename<<" - end");
-   return vtkfilename;
+    // HEADER-SECTION
+    string vtkfilename = filename + getFileExtension();
+    UBLOG(logDEBUG1, "WbWriterVtkBinary::writeOctsWithNodeData to " << vtkfilename << " - start");
+
+    ofstream out(vtkfilename.c_str(), ofstream::out | ofstream::binary);
+    if (!out) {
+        out.clear(); // flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
+        string path = UbSystem::getPathFromString(vtkfilename);
+        if (path.size() > 0) {
+            UbSystem::makeDirectory(path);
+            out.open(vtkfilename.c_str(), ios::out | ios::binary);
+        }
+        if (!out)
+            throw UbException(UB_EXARGS, "couldn't open file " + vtkfilename);
+    }
+
+    // WRITE BIGENDIAN VtkBinary FILE
+    bool swapByte = UbSystem::isLittleEndian();
+    int nofNodes  = (int)nodes.size();
+    int nofCells  = (int)cells.size();
+
+    out << "# vtk DataFile Version 4.0"
+        << "\n";
+    out << "D3Q19MasterNodeGrid"
+        << "\n";
+    out << ""
+        << "\n";
+
+    // POINTS SECTION
+    out << "DATASET UNSTRUCTURED_GRID"
+        << "\n";
+    out << "POINTS " << nofNodes << " float"
+        << "\n";
+    for (int n = 0; n < nofNodes; n++) {
+        float x1 = val<1>(nodes[n]);
+        float x2 = val<2>(nodes[n]);
+        float x3 = val<3>(nodes[n]);
+
+        if (swapByte) {
+            UbSystem::swapByteOrder((unsigned char *)&x1, sizeof(float));
+            UbSystem::swapByteOrder((unsigned char *)&x2, sizeof(float));
+            UbSystem::swapByteOrder((unsigned char *)&x3, sizeof(float));
+        }
+
+        out.write((char *)&x1, sizeof(float));
+        out.write((char *)&x2, sizeof(float));
+        out.write((char *)&x3, sizeof(float));
+    }
+    out << "\n";
+
+    // CELLS SECTION
+    out << "CELLS " << nofCells << " " << nofCells * 9 << "\n";
+
+    int nodesPerCellDummy = 8; // nofNodesPerCell
+    if (swapByte)
+        UbSystem::swapByteOrder((unsigned char *)&nodesPerCellDummy, sizeof(int));
+    for (int c = 0; c < (int)cells.size(); c++) {
+        int BSW = val<1>(cells[c]);
+        int TSW = val<5>(cells[c]);
+        int BSE = val<2>(cells[c]);
+        int TSE = val<6>(cells[c]);
+        int BNW = val<3>(cells[c]);
+        int TNW = val<7>(cells[c]);
+        int BNE = val<4>(cells[c]);
+        int TNE = val<8>(cells[c]);
+        if (swapByte) {
+            UbSystem::swapByteOrder((unsigned char *)&BSW, sizeof(int));
+            UbSystem::swapByteOrder((unsigned char *)&BSE, sizeof(int));
+            UbSystem::swapByteOrder((unsigned char *)&BNW, sizeof(int));
+            UbSystem::swapByteOrder((unsigned char *)&BNE, sizeof(int));
+            UbSystem::swapByteOrder((unsigned char *)&TSW, sizeof(int));
+            UbSystem::swapByteOrder((unsigned char *)&TSE, sizeof(int));
+            UbSystem::swapByteOrder((unsigned char *)&TNW, sizeof(int));
+            UbSystem::swapByteOrder((unsigned char *)&TNE, sizeof(int));
+        }
+
+        out.write((char *)&nodesPerCellDummy, sizeof(int));
+        out.write((char *)&BSW, sizeof(int));
+        out.write((char *)&BSE, sizeof(int));
+        out.write((char *)&BNE, sizeof(int));
+        out.write((char *)&BNW, sizeof(int));
+        out.write((char *)&TSW, sizeof(int));
+        out.write((char *)&TSE, sizeof(int));
+        out.write((char *)&TNE, sizeof(int));
+        out.write((char *)&TNW, sizeof(int));
+    }
+    out << "\n";
+
+    out << "CELL_TYPES " << (int)cells.size() << "\n";
+    int celltype = 11;
+    if (swapByte)
+        UbSystem::swapByteOrder((unsigned char *)&celltype, sizeof(int));
+    for (int c = 0; c < nofCells; c++)
+        out.write((char *)&celltype, sizeof(int));
+
+    out << endl;
+
+    // NODE DATA SECTION
+    // write data section
+    out << "POINT_DATA " << nofNodes << "\n";
+    for (int s = 0; s < (int)datanames.size(); ++s) {
+        if ((int)nodedata[s].size() != nofNodes)
+            throw UbException(UB_EXARGS, "datasetsize must be equal to nofNodes");
+        out << "SCALARS " << datanames[s] << " float 1 \n LOOKUP_TABLE default \n";
+        for (int d = 0; d < (int)nodedata[s].size(); d++) {
+            float dummy = (float)nodedata[s][d];
+            if (swapByte)
+                UbSystem::swapByteOrder((unsigned char *)&dummy, sizeof(float));
+            out.write((const char *)&dummy, sizeof(float));
+        }
+        out << endl;
+    }
+
+    out.close();
+
+    UBLOG(logDEBUG1, "WbWriterVtkBinary::writeOctsWithNodeData to " << vtkfilename << " - end");
+    return vtkfilename;
 }
 /*===============================================================================*/
-std::string WbWriterVtkBinary::writeOcts(const string& filename,vector< UbTupleFloat3 >& nodes, vector< UbTupleInt8 >& cells)
+std::string WbWriterVtkBinary::writeOcts(const string &filename, vector<UbTupleFloat3> &nodes,
+                                         vector<UbTupleInt8> &cells)
 {
-   string vtkfilename = filename + getFileExtension();
-   UBLOG(logDEBUG1,"WbWriterVtkBinary::writeOcts to "<<vtkfilename<<" - start");
-
-   ofstream out(vtkfilename.c_str(),ofstream::out | ofstream::binary);
-   if(!out)
-   { 
-      out.clear(); //flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
-      string path = UbSystem::getPathFromString(vtkfilename);
-      if(path.size()>0){ UbSystem::makeDirectory(path); out.open(vtkfilename.c_str(),ios::out | ios::binary);}
-      if(!out) throw UbException(UB_EXARGS,"couldn't open file "+vtkfilename);
-   }
-
-   //HEADER-SECTION
-   //WRITE BIGENDIAN VtkBinary FILE
-   bool swapByte = UbSystem::isLittleEndian();
-   int nofNodes = (int)nodes.size(); 
-   int nofCells = (int)cells.size(); 
-
-   out<<"# vtk DataFile Version 4.0"<<"\n";
-   out<<"D3Q19MasterNodeGrid"<<"\n";
-   out<<""<<"\n";
-
-   //POINTS SECTION
-   out<<"DATASET UNSTRUCTURED_GRID"<<"\n";
-   out<<"POINTS "<<nofNodes<<" float"<<"\n";
-   for(int n=0; n<nofNodes; n++)
-   {
-      float x1 = val<1>(nodes[n]); 
-      float x2 = val<2>(nodes[n]); 
-      float x3 = val<3>(nodes[n]); 
-
-      if(swapByte)
-      {
-         UbSystem::swapByteOrder((unsigned char*)&x1,sizeof(float));
-         UbSystem::swapByteOrder((unsigned char*)&x2,sizeof(float));
-         UbSystem::swapByteOrder((unsigned char*)&x3,sizeof(float));
-      }
-
-      out.write((char*)&x1,sizeof(float));
-      out.write((char*)&x2,sizeof(float));
-      out.write((char*)&x3,sizeof(float));
-   }
-   out<<"\n";
-
-   //CELLS SECTION
-   out<<"CELLS "<<nofCells<<" "<<nofCells*9<<"\n";
-
-   int nodesPerCellDummy = 8;  //nofNodesPerCell         
-   if(swapByte) UbSystem::swapByteOrder((unsigned char*)&nodesPerCellDummy,sizeof(int));
-   for(int c=0; c<(int)cells.size(); c++)
-   {
-      int BSW = val<1>(cells[c]);  int TSW = val<5>(cells[c]);
-      int BSE = val<2>(cells[c]);  int TSE = val<6>(cells[c]);
-      int BNW = val<3>(cells[c]);  int TNW = val<7>(cells[c]);
-      int BNE = val<4>(cells[c]);  int TNE = val<8>(cells[c]);
-      if(swapByte)
-      {
-         UbSystem::swapByteOrder((unsigned char*)&BSW,sizeof(int));
-         UbSystem::swapByteOrder((unsigned char*)&BSE,sizeof(int));
-         UbSystem::swapByteOrder((unsigned char*)&BNW,sizeof(int));
-         UbSystem::swapByteOrder((unsigned char*)&BNE,sizeof(int));
-         UbSystem::swapByteOrder((unsigned char*)&TSW,sizeof(int));
-         UbSystem::swapByteOrder((unsigned char*)&TSE,sizeof(int));
-         UbSystem::swapByteOrder((unsigned char*)&TNW,sizeof(int));
-         UbSystem::swapByteOrder((unsigned char*)&TNE,sizeof(int));
-      }
-
-       out.write((char*)&nodesPerCellDummy,sizeof(int));
-       out.write((char*)&BSW,sizeof(int));
-       out.write((char*)&BSE,sizeof(int));
-       out.write((char*)&BNE,sizeof(int));
-       out.write((char*)&BNW,sizeof(int));
-       out.write((char*)&TSW,sizeof(int));
-       out.write((char*)&TSE,sizeof(int));
-       out.write((char*)&TNE,sizeof(int));
-       out.write((char*)&TNW,sizeof(int));
-   }
-   out<<"\n";
-
-   out<<"CELL_TYPES "<<(int)cells.size()<<"\n";
-   int celltype = 11;
-   if(swapByte) UbSystem::swapByteOrder((unsigned char*)&celltype,sizeof(int));
-   for(int c=0; c<nofCells; c++)
-      out.write((char*)&celltype,sizeof(int));
-
-   out<<endl;
-   out.close();
-
-   UBLOG(logDEBUG1,"WbWriterVtkBinary::writeOcts to "<<vtkfilename<<" - end");
-   return vtkfilename;
+    string vtkfilename = filename + getFileExtension();
+    UBLOG(logDEBUG1, "WbWriterVtkBinary::writeOcts to " << vtkfilename << " - start");
+
+    ofstream out(vtkfilename.c_str(), ofstream::out | ofstream::binary);
+    if (!out) {
+        out.clear(); // flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
+        string path = UbSystem::getPathFromString(vtkfilename);
+        if (path.size() > 0) {
+            UbSystem::makeDirectory(path);
+            out.open(vtkfilename.c_str(), ios::out | ios::binary);
+        }
+        if (!out)
+            throw UbException(UB_EXARGS, "couldn't open file " + vtkfilename);
+    }
+
+    // HEADER-SECTION
+    // WRITE BIGENDIAN VtkBinary FILE
+    bool swapByte = UbSystem::isLittleEndian();
+    int nofNodes  = (int)nodes.size();
+    int nofCells  = (int)cells.size();
+
+    out << "# vtk DataFile Version 4.0"
+        << "\n";
+    out << "D3Q19MasterNodeGrid"
+        << "\n";
+    out << ""
+        << "\n";
+
+    // POINTS SECTION
+    out << "DATASET UNSTRUCTURED_GRID"
+        << "\n";
+    out << "POINTS " << nofNodes << " float"
+        << "\n";
+    for (int n = 0; n < nofNodes; n++) {
+        float x1 = val<1>(nodes[n]);
+        float x2 = val<2>(nodes[n]);
+        float x3 = val<3>(nodes[n]);
+
+        if (swapByte) {
+            UbSystem::swapByteOrder((unsigned char *)&x1, sizeof(float));
+            UbSystem::swapByteOrder((unsigned char *)&x2, sizeof(float));
+            UbSystem::swapByteOrder((unsigned char *)&x3, sizeof(float));
+        }
+
+        out.write((char *)&x1, sizeof(float));
+        out.write((char *)&x2, sizeof(float));
+        out.write((char *)&x3, sizeof(float));
+    }
+    out << "\n";
+
+    // CELLS SECTION
+    out << "CELLS " << nofCells << " " << nofCells * 9 << "\n";
+
+    int nodesPerCellDummy = 8; // nofNodesPerCell
+    if (swapByte)
+        UbSystem::swapByteOrder((unsigned char *)&nodesPerCellDummy, sizeof(int));
+    for (int c = 0; c < (int)cells.size(); c++) {
+        int BSW = val<1>(cells[c]);
+        int TSW = val<5>(cells[c]);
+        int BSE = val<2>(cells[c]);
+        int TSE = val<6>(cells[c]);
+        int BNW = val<3>(cells[c]);
+        int TNW = val<7>(cells[c]);
+        int BNE = val<4>(cells[c]);
+        int TNE = val<8>(cells[c]);
+        if (swapByte) {
+            UbSystem::swapByteOrder((unsigned char *)&BSW, sizeof(int));
+            UbSystem::swapByteOrder((unsigned char *)&BSE, sizeof(int));
+            UbSystem::swapByteOrder((unsigned char *)&BNW, sizeof(int));
+            UbSystem::swapByteOrder((unsigned char *)&BNE, sizeof(int));
+            UbSystem::swapByteOrder((unsigned char *)&TSW, sizeof(int));
+            UbSystem::swapByteOrder((unsigned char *)&TSE, sizeof(int));
+            UbSystem::swapByteOrder((unsigned char *)&TNW, sizeof(int));
+            UbSystem::swapByteOrder((unsigned char *)&TNE, sizeof(int));
+        }
+
+        out.write((char *)&nodesPerCellDummy, sizeof(int));
+        out.write((char *)&BSW, sizeof(int));
+        out.write((char *)&BSE, sizeof(int));
+        out.write((char *)&BNE, sizeof(int));
+        out.write((char *)&BNW, sizeof(int));
+        out.write((char *)&TSW, sizeof(int));
+        out.write((char *)&TSE, sizeof(int));
+        out.write((char *)&TNE, sizeof(int));
+        out.write((char *)&TNW, sizeof(int));
+    }
+    out << "\n";
+
+    out << "CELL_TYPES " << (int)cells.size() << "\n";
+    int celltype = 11;
+    if (swapByte)
+        UbSystem::swapByteOrder((unsigned char *)&celltype, sizeof(int));
+    for (int c = 0; c < nofCells; c++)
+        out.write((char *)&celltype, sizeof(int));
+
+    out << endl;
+    out.close();
+
+    UBLOG(logDEBUG1, "WbWriterVtkBinary::writeOcts to " << vtkfilename << " - end");
+    return vtkfilename;
 }
-
diff --git a/src/basics/basics/writer/WbWriterVtkBinary.h b/src/basics/basics/writer/WbWriterVtkBinary.h
index d7dd65e6e072d79b740469a53fc21fb671495bbc..aa39a3daacb6a4bd51794cc1bc72fc5818d473c8 100644
--- a/src/basics/basics/writer/WbWriterVtkBinary.h
+++ b/src/basics/basics/writer/WbWriterVtkBinary.h
@@ -12,63 +12,79 @@
 class WbWriterVtkBinary : public WbWriter
 {
 public:
-   static WbWriterVtkBinary* getInstance()
-   {
-      static WbWriterVtkBinary instance;
-      return &instance;
-   }
+    static WbWriterVtkBinary *getInstance()
+    {
+        static WbWriterVtkBinary instance;
+        return &instance;
+    }
+
+    WbWriterVtkBinary(const WbWriterVtkBinary &) = delete;
+    const WbWriterVtkBinary &operator=(const WbWriterVtkBinary &) = delete;
 
-    WbWriterVtkBinary( const WbWriterVtkBinary& ) = delete;
-    const WbWriterVtkBinary& operator=( const WbWriterVtkBinary& ) = delete;
 private:
-   WbWriterVtkBinary() = default;
+    WbWriterVtkBinary() = default;
 
 public:
-   std::string getFileExtension() override { return ".bin.vtk"; }
+    std::string getFileExtension() override { return ".bin.vtk"; }
 
-   //////////////////////////////////////////////////////////////////////////
-   //lines
-   //     0 ---- 1
-   //nodenumbering must start with 0!
-   std::string writeLines(const std::string& filename, std::vector<UbTupleFloat3 >& nodes, std::vector<UbTupleInt2 >& lines) override;
+    //////////////////////////////////////////////////////////////////////////
+    // lines
+    //     0 ---- 1
+    // nodenumbering must start with 0!
+    std::string writeLines(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                           std::vector<UbTupleInt2> &lines) override;
 
-   //////////////////////////////////////////////////////////////////////////
-   //triangles
-   //cell numbering:
-   //                    2
-   //                     
-   //                  0---1
-   //nodenumbering must start with 0!
-   std::string writeTriangles(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt3 >& cells) override;
-   std::string writeTrianglesWithNodeData(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt3 >& cells, std::vector< std::string >& datanames, std::vector< std::vector< double > >& nodedata) override;
+    //////////////////////////////////////////////////////////////////////////
+    // triangles
+    // cell numbering:
+    //                    2
+    //
+    //                  0---1
+    // nodenumbering must start with 0!
+    std::string writeTriangles(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                               std::vector<UbTupleInt3> &cells) override;
+    std::string writeTrianglesWithNodeData(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                                           std::vector<UbTupleInt3> &cells, std::vector<std::string> &datanames,
+                                           std::vector<std::vector<double>> &nodedata) override;
 
-   //////////////////////////////////////////////////////////////////////////
-   //2D
-   //cell numbering:
-   //                  3---2
-   //                  |   |
-   //                  0---1
-   //nodenumbering must start with 0!
-   std::string writeQuads(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt4 >& cells) override;
-   std::string writeQuadsWithNodeData(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt4 >& cells, std::vector< std::string >& datanames, std::vector< std::vector< double > >& nodedata) override;
-   std::string writeQuadsWithCellData(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt4 >& cells, std::vector< std::string >& datanames, std::vector< std::vector< double > >& celldata) override;
-   std::string writeQuadsWithNodeAndCellData(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt4 >& cells, 
-                                             std::vector< std::string >& nodedatanames, std::vector< std::vector< double > >& nodedata, std::vector< std::string >& celldatanames,
-                                             std::vector< std::vector< double > >& celldata                                                                    ) override;
-   
-   //////////////////////////////////////////////////////////////////////////
-   //octs
-   //     7 ---- 6
-   //    /|     /|
-   //   4 +--- 5 |
-   //   | |    | |
-   //   | 3 ---+ 2
-   //   |/     |/
-   //   0 ---- 1
-   std::string writeOcts(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt8 >& cells) override;
-   std::string writeOctsWithCellData(const std::string& filename,std::vector<UbTupleFloat3 >& nodes, std::vector<UbTupleInt8 >& cells, std::vector<std::string >& datanames, std::vector<std::vector<double > >& celldata) override;
-   std::string writeOctsWithNodeData(const std::string& filename,std::vector<UbTupleFloat3 >& nodes, std::vector<UbTupleUInt8 >& cells, std::vector<std::string >& datanames, std::vector<std::vector<double > >& nodedata) override;
+    //////////////////////////////////////////////////////////////////////////
+    // 2D
+    // cell numbering:
+    //                  3---2
+    //                  |   |
+    //                  0---1
+    // nodenumbering must start with 0!
+    std::string writeQuads(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                           std::vector<UbTupleInt4> &cells) override;
+    std::string writeQuadsWithNodeData(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                                       std::vector<UbTupleInt4> &cells, std::vector<std::string> &datanames,
+                                       std::vector<std::vector<double>> &nodedata) override;
+    std::string writeQuadsWithCellData(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                                       std::vector<UbTupleInt4> &cells, std::vector<std::string> &datanames,
+                                       std::vector<std::vector<double>> &celldata) override;
+    std::string writeQuadsWithNodeAndCellData(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                                              std::vector<UbTupleInt4> &cells, std::vector<std::string> &nodedatanames,
+                                              std::vector<std::vector<double>> &nodedata,
+                                              std::vector<std::string> &celldatanames,
+                                              std::vector<std::vector<double>> &celldata) override;
 
+    //////////////////////////////////////////////////////////////////////////
+    // octs
+    //     7 ---- 6
+    //    /|     /|
+    //   4 +--- 5 |
+    //   | |    | |
+    //   | 3 ---+ 2
+    //   |/     |/
+    //   0 ---- 1
+    std::string writeOcts(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                          std::vector<UbTupleInt8> &cells) override;
+    std::string writeOctsWithCellData(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                                      std::vector<UbTupleInt8> &cells, std::vector<std::string> &datanames,
+                                      std::vector<std::vector<double>> &celldata) override;
+    std::string writeOctsWithNodeData(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                                      std::vector<UbTupleUInt8> &cells, std::vector<std::string> &datanames,
+                                      std::vector<std::vector<double>> &nodedata) override;
 };
 
-#endif //WBWRITERVTKBINARY_H
+#endif // WBWRITERVTKBINARY_H
diff --git a/src/basics/basics/writer/WbWriterVtkXmlASCII.cpp b/src/basics/basics/writer/WbWriterVtkXmlASCII.cpp
index d4ad420ffcae457c74fbcc0b759b7be2098ab4f1..e217b5e24c328e32fb2e3110986f3bb895b98485 100644
--- a/src/basics/basics/writer/WbWriterVtkXmlASCII.cpp
+++ b/src/basics/basics/writer/WbWriterVtkXmlASCII.cpp
@@ -1,28 +1,28 @@
 //=======================================================================================
-// ____          ____    __    ______     __________   __      __       __        __         
-// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |        
-//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |        
-//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |        
-//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____    
-//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|   
-//      \    \  |    |   ________________________________________________________________    
-//       \    \ |    |  |  ______________________________________________________________|   
-//        \    \|    |  |  |         __          __     __     __     ______      _______    
-//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)   
-//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______    
+// ____          ____    __    ______     __________   __      __       __        __
+// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |
+//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |
+//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |
+//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____
+//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|
+//      \    \  |    |   ________________________________________________________________
+//       \    \ |    |  |  ______________________________________________________________|
+//        \    \|    |  |  |         __          __     __     __     ______      _______
+//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)
+//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______
 //           \       |  |  |        |  |_____   |   \_/   |   |  |   |  |_/  /    _____  |
-//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/   
+//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/
 //
-//  This file is part of VirtualFluids. VirtualFluids is free software: you can 
+//  This file is part of VirtualFluids. VirtualFluids is free software: you can
 //  redistribute it and/or modify it under the terms of the GNU General Public
-//  License as published by the Free Software Foundation, either version 3 of 
+//  License as published by the Free Software Foundation, either version 3 of
 //  the License, or (at your option) any later version.
-//  
-//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT 
-//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
-//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License 
+//
+//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT
+//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 //  for more details.
-//  
+//
 //  You should have received a copy of the GNU General Public License along
 //  with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>.
 //
@@ -30,509 +30,543 @@
 //! \ingroup writer
 //! \author Soeren Freudiger, Sebastian Geller
 //=======================================================================================
-#include <basics/writer/WbWriterVtkXmlASCII.h>
 #include <basics/utilities/UbLogger.h>
+#include <basics/writer/WbWriterVtkXmlASCII.h>
 #include <cstring>
 #include <limits>
 
 using namespace std;
 
 /*===============================================================================*/
-std::string WbWriterVtkXmlASCII::pvdEndTag ="   </Collection>\n</VTKFile>";
+std::string WbWriterVtkXmlASCII::pvdEndTag = "   </Collection>\n</VTKFile>";
 /*===============================================================================*/
-std::string WbWriterVtkXmlASCII::writeCollection(const std::string& filename, const std::vector<std::string>& filenames, const double& timeStep, const bool& sepGroups)
+std::string WbWriterVtkXmlASCII::writeCollection(const std::string &filename, const std::vector<std::string> &filenames,
+                                                 const double &timeStep, const bool &sepGroups)
 {
-   std::string vtkfilename=filename+".pvd";
-   std::ofstream out(vtkfilename.c_str());
-   if(!out)
-   { 
-      out.clear(); //flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
-      string path = UbSystem::getPathFromString(vtkfilename);
-      if(path.size()>0){UbSystem::makeDirectory(path);out.open(vtkfilename.c_str());}
-      if(!out) throw UbException(UB_EXARGS,"couldn't open file "+vtkfilename);
-   }
-
-   std::string endian;
-   if(UbSystem::isLittleEndian()) endian = "LittleEndian";
-   else                           endian = "BigEndian";
-   out<<"<VTKFile type=\"Collection\" version=\"0.1\" byte_order=\""<<endian<<"\" >\n";
-   out<<"   <Collection>"<<endl;
-   
-   int group = 0, part=0;
-   for(std::size_t i=0; i<filenames.size(); i++)
-   {
-      out<<"       <DataSet timestep=\""<<timeStep<<"\" group=\""<<group<<"\" part=\""<<part<<"\" file=\""<<filenames[i]<<"\"/>\n";
-      if(sepGroups) group++;
-      else          part++;
-   }
-   out<<pvdEndTag;
-   out.close();
-
-   return vtkfilename;
+    std::string vtkfilename = filename + ".pvd";
+    std::ofstream out(vtkfilename.c_str());
+    if (!out) {
+        out.clear(); // flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
+        string path = UbSystem::getPathFromString(vtkfilename);
+        if (path.size() > 0) {
+            UbSystem::makeDirectory(path);
+            out.open(vtkfilename.c_str());
+        }
+        if (!out)
+            throw UbException(UB_EXARGS, "couldn't open file " + vtkfilename);
+    }
+
+    std::string endian;
+    if (UbSystem::isLittleEndian())
+        endian = "LittleEndian";
+    else
+        endian = "BigEndian";
+    out << "<VTKFile type=\"Collection\" version=\"0.1\" byte_order=\"" << endian << "\" >\n";
+    out << "   <Collection>" << endl;
+
+    int group = 0, part = 0;
+    for (std::size_t i = 0; i < filenames.size(); i++) {
+        out << "       <DataSet timestep=\"" << timeStep << "\" group=\"" << group << "\" part=\"" << part
+            << "\" file=\"" << filenames[i] << "\"/>\n";
+        if (sepGroups)
+            group++;
+        else
+            part++;
+    }
+    out << pvdEndTag;
+    out.close();
+
+    return vtkfilename;
 }
 /*===============================================================================*/
-std::string WbWriterVtkXmlASCII::addFilesToCollection(const std::string& filename, const std::vector<std::string>& filenames, const double& timeStep, const bool& sepGroups)
+std::string WbWriterVtkXmlASCII::addFilesToCollection(const std::string &filename,
+                                                      const std::vector<std::string> &filenames, const double &timeStep,
+                                                      const bool &sepGroups)
 {
-   std::string vtkfilename=filename;
-   std::fstream test(vtkfilename.c_str(), ios::in);
-   if(!test)
-   {
-      test.clear();
-      vtkfilename += ".pvd";
-      test.open(vtkfilename.c_str(), ios::in);
-      if(!test) return this->writeCollection(filename,filenames,timeStep,sepGroups);
-   }
-
-   std::fstream out(vtkfilename.c_str(), ios::in | ios::out);
-   out.seekp(-(int)pvdEndTag.size()-1, ios_base::end);
-
-   int group = 0;
-   for(std::size_t i=0; i<filenames.size(); i++)
-   {
-      out<<"       <DataSet timestep=\""<<timeStep<<"\" group=\""<<group<<"\" part=\""<<i<<"\" file=\""<<filenames[i]<<"\"/>\n";
-      if(sepGroups) group++;
-   }
-   out<<pvdEndTag;
-
-   return vtkfilename;
+    std::string vtkfilename = filename;
+    std::fstream test(vtkfilename.c_str(), ios::in);
+    if (!test) {
+        test.clear();
+        vtkfilename += ".pvd";
+        test.open(vtkfilename.c_str(), ios::in);
+        if (!test)
+            return this->writeCollection(filename, filenames, timeStep, sepGroups);
+    }
+
+    std::fstream out(vtkfilename.c_str(), ios::in | ios::out);
+    out.seekp(-(int)pvdEndTag.size() - 1, ios_base::end);
+
+    int group = 0;
+    for (std::size_t i = 0; i < filenames.size(); i++) {
+        out << "       <DataSet timestep=\"" << timeStep << "\" group=\"" << group << "\" part=\"" << i << "\" file=\""
+            << filenames[i] << "\"/>\n";
+        if (sepGroups)
+            group++;
+    }
+    out << pvdEndTag;
+
+    return vtkfilename;
 }
 /*===============================================================================*/
-std::string WbWriterVtkXmlASCII::writeParallelFile(const string& filename,vector<string>& pieceSources, vector<string>& pointDataNames, vector<string>& cellDataNames)
+std::string WbWriterVtkXmlASCII::writeParallelFile(const string &filename, vector<string> &pieceSources,
+                                                   vector<string> &pointDataNames, vector<string> &cellDataNames)
 {
-   string vtkfilename=filename+".pvtu";
-   UBLOG(logDEBUG1,"WbWriterVtkXmlASCII::writeParallelFile to "<<vtkfilename<<" - start");
-
-   std::ofstream out(vtkfilename.c_str());
-   if(!out)
-   { 
-      out.clear(); //flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
-      string path = UbSystem::getPathFromString(vtkfilename);
-      if(path.size()>0){UbSystem::makeDirectory(path);out.open(vtkfilename.c_str());}
-      if(!out) throw UbException(UB_EXARGS,"couldn't open file "+vtkfilename);
-   }
-
-   //VTK FILE
-   out<<"<VTKFile type=\"PUnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\">\n";
-   out<<"  <PUnstructuredGrid GhostLevel=\"0\">\n";
-   out<<"    <PPoints>\n"; 
-   out<<"      <PDataArray type=\"Float32\" NumberOfComponents=\"3\"/>\n";
-   out<<"    </PPoints>\n";
-   out<<"    <PPointData>\n";
-   for(size_t s=0; s<pointDataNames.size(); s++)
-      out<< "      <PDataArray type=\"Float64\" Name=\""<< pointDataNames[s] <<"\"/>\n";
-   out<<"    </PPointData>\n";
-   if (cellDataNames.size() > 0)
-   {
-      out<<"    <PCellData>\n";
-      for(size_t s=0; s<cellDataNames.size(); s++)
-         out<< "      <PDataArray type=\"Float32\" Name=\""<< cellDataNames[s] <<"\"/>\n";
-      out<<"    </PCellData>\n";
-   }
-
-   for(size_t s=0; s<pieceSources.size(); s++)
-      out<<"    <Piece Source=\""<<pieceSources[s]<<"\"/>\n";
-   out<<"  </PUnstructuredGrid>\n";
-   out<<"</VTKFile>";
-   out<<endl;
-   out.close();
-   UBLOG(logDEBUG1,"WbWriterVtkXmlASCII::writeParallelFile to "<<vtkfilename<<" - end");
-
-   return vtkfilename;
+    string vtkfilename = filename + ".pvtu";
+    UBLOG(logDEBUG1, "WbWriterVtkXmlASCII::writeParallelFile to " << vtkfilename << " - start");
+
+    std::ofstream out(vtkfilename.c_str());
+    if (!out) {
+        out.clear(); // flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
+        string path = UbSystem::getPathFromString(vtkfilename);
+        if (path.size() > 0) {
+            UbSystem::makeDirectory(path);
+            out.open(vtkfilename.c_str());
+        }
+        if (!out)
+            throw UbException(UB_EXARGS, "couldn't open file " + vtkfilename);
+    }
+
+    // VTK FILE
+    out << "<VTKFile type=\"PUnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\">\n";
+    out << "  <PUnstructuredGrid GhostLevel=\"0\">\n";
+    out << "    <PPoints>\n";
+    out << "      <PDataArray type=\"Float32\" NumberOfComponents=\"3\"/>\n";
+    out << "    </PPoints>\n";
+    out << "    <PPointData>\n";
+    for (size_t s = 0; s < pointDataNames.size(); s++)
+        out << "      <PDataArray type=\"Float64\" Name=\"" << pointDataNames[s] << "\"/>\n";
+    out << "    </PPointData>\n";
+    if (cellDataNames.size() > 0) {
+        out << "    <PCellData>\n";
+        for (size_t s = 0; s < cellDataNames.size(); s++)
+            out << "      <PDataArray type=\"Float32\" Name=\"" << cellDataNames[s] << "\"/>\n";
+        out << "    </PCellData>\n";
+    }
+
+    for (size_t s = 0; s < pieceSources.size(); s++)
+        out << "    <Piece Source=\"" << pieceSources[s] << "\"/>\n";
+    out << "  </PUnstructuredGrid>\n";
+    out << "</VTKFile>";
+    out << endl;
+    out.close();
+    UBLOG(logDEBUG1, "WbWriterVtkXmlASCII::writeParallelFile to " << vtkfilename << " - end");
+
+    return vtkfilename;
 }
 /*===============================================================================*/
-std::string WbWriterVtkXmlASCII::writeQuads(const string& filename,vector< UbTupleFloat3 >& nodes, vector< UbTupleInt4 >& cells)
+std::string WbWriterVtkXmlASCII::writeQuads(const string &filename, vector<UbTupleFloat3> &nodes,
+                                            vector<UbTupleInt4> &cells)
 {
-   string vtkfilename=filename+getFileExtension();
-   UBLOG(logDEBUG1,"WbWriterVtkXmlASCII::writeQuads to "<<vtkfilename<<" - start");
-
-   std::ofstream out(vtkfilename.c_str());
-   if(!out)
-   { 
-      out.clear(); //flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
-      string path = UbSystem::getPathFromString(vtkfilename);
-      if(path.size()>0){UbSystem::makeDirectory(path);out.open(vtkfilename.c_str());}
-      if(!out) throw UbException(UB_EXARGS,"couldn't open file "+vtkfilename);
-   }
-
-   int nofNodes = (int)nodes.size(); 
-   int nofCells = (int)cells.size(); 
-
-   //VTK FILE
-   out<<"<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\" >"<<"\n";
-   out<<"   <UnstructuredGrid>"<<"\n";
-   out<<"      <Piece NumberOfPoints=\""<<nofNodes<<"\"	NumberOfCells=\""<<nofCells<<"\">   \n";
-
-   //POINTS SECTION
-   out<<"      <Points>\n"; 
-   out<<"         <DataArray type=\"Float32\" NumberOfComponents=\"3\" format=\"ascii\">\n";
-   for(int n=0; n<nofNodes; n++)
-      out<< val<1>(nodes[n]) <<" "<< val<2>(nodes[n]) <<" "<< val<3>(nodes[n]) <<"   ";
-
-   out<<"\n";
-   out<<"         </DataArray>\n";
-   out<<"      </Points>\n";
-
-   //CELLS SECTION
-   out<<"      <Cells>\n";
-   out<<"         <DataArray type=\"Int32\" Name=\"connectivity\" format=\"ascii\">\n";
-
-   for(int c=0; c<nofCells; c++)
-      out<< val<1>(cells[c]) <<" "
-         << val<2>(cells[c]) <<" "
-         << val<4>(cells[c]) <<" "
-         << val<3>(cells[c]) <<"   ";
-   out<<"\n";
-   out<<"      </DataArray>\n";
-   out<<"         <DataArray type=\"Int32\" Name=\"offsets\" format=\"ascii\">\n";
-   for(int c=1; c<nofCells+1; c++)
-      out<<c*4<<" " ;
-
-   out<<"\n";
-   out<<"         </DataArray>\n";
-
-   out<<"      <DataArray type=\"UInt8\" Name=\"types\" format=\"ascii\">\n";
-
-   for(int c=0; c<nofCells; c++)
-      out<<"8 ";
-   out<<"\n";
-   out<<"      </DataArray>\n";
-   out<<"      </Cells>\n";
-   out<<"      </Piece>\n";
-   out<<"   </UnstructuredGrid>\n";
-   out<<"</VTKFile>";
-   out<<endl;
-   out.close();
-   UBLOG(logDEBUG1,"WbWriterVtkXmlASCII::writeQuads to "<<vtkfilename<<" - end");
-
-   return vtkfilename;
+    string vtkfilename = filename + getFileExtension();
+    UBLOG(logDEBUG1, "WbWriterVtkXmlASCII::writeQuads to " << vtkfilename << " - start");
+
+    std::ofstream out(vtkfilename.c_str());
+    if (!out) {
+        out.clear(); // flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
+        string path = UbSystem::getPathFromString(vtkfilename);
+        if (path.size() > 0) {
+            UbSystem::makeDirectory(path);
+            out.open(vtkfilename.c_str());
+        }
+        if (!out)
+            throw UbException(UB_EXARGS, "couldn't open file " + vtkfilename);
+    }
+
+    int nofNodes = (int)nodes.size();
+    int nofCells = (int)cells.size();
+
+    // VTK FILE
+    out << "<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\" >"
+        << "\n";
+    out << "   <UnstructuredGrid>"
+        << "\n";
+    out << "      <Piece NumberOfPoints=\"" << nofNodes << "\"	NumberOfCells=\"" << nofCells << "\">   \n";
+
+    // POINTS SECTION
+    out << "      <Points>\n";
+    out << "         <DataArray type=\"Float32\" NumberOfComponents=\"3\" format=\"ascii\">\n";
+    for (int n = 0; n < nofNodes; n++)
+        out << val<1>(nodes[n]) << " " << val<2>(nodes[n]) << " " << val<3>(nodes[n]) << "   ";
+
+    out << "\n";
+    out << "         </DataArray>\n";
+    out << "      </Points>\n";
+
+    // CELLS SECTION
+    out << "      <Cells>\n";
+    out << "         <DataArray type=\"Int32\" Name=\"connectivity\" format=\"ascii\">\n";
+
+    for (int c = 0; c < nofCells; c++)
+        out << val<1>(cells[c]) << " " << val<2>(cells[c]) << " " << val<4>(cells[c]) << " " << val<3>(cells[c])
+            << "   ";
+    out << "\n";
+    out << "      </DataArray>\n";
+    out << "         <DataArray type=\"Int32\" Name=\"offsets\" format=\"ascii\">\n";
+    for (int c = 1; c < nofCells + 1; c++)
+        out << c * 4 << " ";
+
+    out << "\n";
+    out << "         </DataArray>\n";
+
+    out << "      <DataArray type=\"UInt8\" Name=\"types\" format=\"ascii\">\n";
+
+    for (int c = 0; c < nofCells; c++)
+        out << "8 ";
+    out << "\n";
+    out << "      </DataArray>\n";
+    out << "      </Cells>\n";
+    out << "      </Piece>\n";
+    out << "   </UnstructuredGrid>\n";
+    out << "</VTKFile>";
+    out << endl;
+    out.close();
+    UBLOG(logDEBUG1, "WbWriterVtkXmlASCII::writeQuads to " << vtkfilename << " - end");
+
+    return vtkfilename;
 }
 /*===============================================================================*/
-std::string WbWriterVtkXmlASCII::writeQuadsWithNodeData(const string& filename,vector< UbTupleFloat3 >& nodes, vector< UbTupleInt4 >& cells, vector< string >& datanames, vector< vector< double > >& nodedata)
+std::string WbWriterVtkXmlASCII::writeQuadsWithNodeData(const string &filename, vector<UbTupleFloat3> &nodes,
+                                                        vector<UbTupleInt4> &cells, vector<string> &datanames,
+                                                        vector<vector<double>> &nodedata)
 {
-   string vtkfilename=filename+getFileExtension();
-   UBLOG(logDEBUG1,"WbWriterVtkXmlASCII::writeQuadsWithNodeData to "<<vtkfilename<<" - start");
-
-   std::ofstream out(vtkfilename.c_str());
-   if(!out)
-   { 
-      out.clear(); //flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
-      string path = UbSystem::getPathFromString(vtkfilename);
-      if(path.size()>0){UbSystem::makeDirectory(path);out.open(vtkfilename.c_str());}
-      if(!out) throw UbException(UB_EXARGS,"couldn't open file "+vtkfilename);
-   }
-
-   int nofNodes = (int)nodes.size(); 
-   int nofCells = (int)cells.size(); 
-
-   //VTK FILE
-   out<<"<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\" >"<<"\n";
-   out<<"   <UnstructuredGrid>"<<"\n";
-   out<<"      <Piece NumberOfPoints=\""<<nofNodes<<"\"	NumberOfCells=\""<<nofCells<<"\">   \n";
-
-   //POINTS SECTION
-   out<<"         <Points>\n"; 
-   out<<"            <DataArray type=\"Float32\" NumberOfComponents=\"3\" format=\"ascii\">\n               ";
-   for(int n=0; n<nofNodes; n++)
-      out<< val<1>(nodes[n]) <<" "<< val<2>(nodes[n]) <<" "<< val<3>(nodes[n]) <<"   ";
-
-   out<<"\n";
-   out<<"            </DataArray>\n";
-   out<<"         </Points>\n";
-
-   //CELLS SECTION
-   out<<"         <Cells>\n";
-   out<<"            <DataArray type=\"Int32\" Name=\"connectivity\" format=\"ascii\">\n              ";
-
-   for(int c=0; c<nofCells; c++)
-      out<< val<1>(cells[c]) <<" "
-         << val<2>(cells[c]) <<" "
-         << val<4>(cells[c]) <<" "
-         << val<3>(cells[c]) <<"   ";
-   out<<"\n";
-   out<<"            </DataArray>\n";
-   out<<"            <DataArray type=\"Int32\" Name=\"offsets\" format=\"ascii\">\n              ";
-   for(int c=1; c<nofCells+1; c++)
-      out<<c*4<<" " ;
-
-   out<<"\n";
-   out<<"            </DataArray>\n";
-
-   out<<"            <DataArray type=\"UInt8\" Name=\"types\" format=\"ascii\">\n              ";
-
-   for(int c=0; c<nofCells; c++)
-      out<<"8 ";
-   out<<"\n";
-   out<<"            </DataArray>\n";
-
-   out<<"         </Cells>\n";
-
-   //write data section
-   out<<"         <PointData Scalars=\"Scalars\"> \n";
-   for(int s=0; s<(int)datanames.size(); ++s)
-   {
-      out<< "           <DataArray type=\"Float32\" Name=\""<< datanames[s] <<"\" format=\"ascii\"> \n";
-
-      for(int d=0; d<(int)nodedata[s].size(); d++)
-         out<<nodedata[s][d]<<" ";
-
-      out<<"\n          </DataArray>\n";
+    string vtkfilename = filename + getFileExtension();
+    UBLOG(logDEBUG1, "WbWriterVtkXmlASCII::writeQuadsWithNodeData to " << vtkfilename << " - start");
+
+    std::ofstream out(vtkfilename.c_str());
+    if (!out) {
+        out.clear(); // flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
+        string path = UbSystem::getPathFromString(vtkfilename);
+        if (path.size() > 0) {
+            UbSystem::makeDirectory(path);
+            out.open(vtkfilename.c_str());
+        }
+        if (!out)
+            throw UbException(UB_EXARGS, "couldn't open file " + vtkfilename);
+    }
+
+    int nofNodes = (int)nodes.size();
+    int nofCells = (int)cells.size();
+
+    // VTK FILE
+    out << "<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\" >"
+        << "\n";
+    out << "   <UnstructuredGrid>"
+        << "\n";
+    out << "      <Piece NumberOfPoints=\"" << nofNodes << "\"	NumberOfCells=\"" << nofCells << "\">   \n";
+
+    // POINTS SECTION
+    out << "         <Points>\n";
+    out << "            <DataArray type=\"Float32\" NumberOfComponents=\"3\" format=\"ascii\">\n               ";
+    for (int n = 0; n < nofNodes; n++)
+        out << val<1>(nodes[n]) << " " << val<2>(nodes[n]) << " " << val<3>(nodes[n]) << "   ";
+
+    out << "\n";
+    out << "            </DataArray>\n";
+    out << "         </Points>\n";
+
+    // CELLS SECTION
+    out << "         <Cells>\n";
+    out << "            <DataArray type=\"Int32\" Name=\"connectivity\" format=\"ascii\">\n              ";
+
+    for (int c = 0; c < nofCells; c++)
+        out << val<1>(cells[c]) << " " << val<2>(cells[c]) << " " << val<4>(cells[c]) << " " << val<3>(cells[c])
+            << "   ";
+    out << "\n";
+    out << "            </DataArray>\n";
+    out << "            <DataArray type=\"Int32\" Name=\"offsets\" format=\"ascii\">\n              ";
+    for (int c = 1; c < nofCells + 1; c++)
+        out << c * 4 << " ";
+
+    out << "\n";
+    out << "            </DataArray>\n";
+
+    out << "            <DataArray type=\"UInt8\" Name=\"types\" format=\"ascii\">\n              ";
+
+    for (int c = 0; c < nofCells; c++)
+        out << "8 ";
+    out << "\n";
+    out << "            </DataArray>\n";
+
+    out << "         </Cells>\n";
+
+    // write data section
+    out << "         <PointData Scalars=\"Scalars\"> \n";
+    for (int s = 0; s < (int)datanames.size(); ++s) {
+        out << "           <DataArray type=\"Float32\" Name=\"" << datanames[s] << "\" format=\"ascii\"> \n";
+
+        for (int d = 0; d < (int)nodedata[s].size(); d++)
+            out << nodedata[s][d] << " ";
+
+        out << "\n          </DataArray>\n";
     }
-   out<<"         </PointData>\n";
-   out<<"      </Piece>\n";
-   out<<"   </UnstructuredGrid>\n";
-   out<<"</VTKFile>";
-   out<<endl;
-   out.close();
-   UBLOG(logDEBUG1,"WbWriterVtkXmlASCII::writeQuadsWithNodeData to "<<vtkfilename<<" - end");
-   return vtkfilename;
+    out << "         </PointData>\n";
+    out << "      </Piece>\n";
+    out << "   </UnstructuredGrid>\n";
+    out << "</VTKFile>";
+    out << endl;
+    out.close();
+    UBLOG(logDEBUG1, "WbWriterVtkXmlASCII::writeQuadsWithNodeData to " << vtkfilename << " - end");
+    return vtkfilename;
 }
 /*===============================================================================*/
-std::string WbWriterVtkXmlASCII::writeQuadsWithCellData(const string& filename,vector< UbTupleFloat3 >& nodes, vector< UbTupleInt4 >& cells, vector< string >& datanames, vector< vector< double > >& celldata)
+std::string WbWriterVtkXmlASCII::writeQuadsWithCellData(const string &filename, vector<UbTupleFloat3> &nodes,
+                                                        vector<UbTupleInt4> &cells, vector<string> &datanames,
+                                                        vector<vector<double>> &celldata)
 {
-   string vtkfilename=filename+getFileExtension();
-   UBLOG(logDEBUG1,"WbWriterVtkXmlASCII::writeQuadsWithCellData to "<<vtkfilename<<" - start");
-
-   std::ofstream out(vtkfilename.c_str());
-   if(!out)
-   { 
-      out.clear(); //flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
-      string path = UbSystem::getPathFromString(vtkfilename);
-      if(path.size()>0){UbSystem::makeDirectory(path);out.open(vtkfilename.c_str());}
-      if(!out) throw UbException(UB_EXARGS,"couldn't open file "+vtkfilename);
-   }
-
-   int nofNodes = (int)nodes.size(); 
-   int nofCells = (int)cells.size(); 
-
-   //VTK FILE
-   out<<"<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\" >"<<"\n";
-   out<<"   <UnstructuredGrid>"<<"\n";
-   out<<"      <Piece NumberOfPoints=\""<<nofNodes<<"\"	NumberOfCells=\""<<nofCells<<"\">   \n";
-
-   //POINTS SECTION
-   out<<"         <Points>\n"; 
-   out<<"            <DataArray type=\"Float32\" NumberOfComponents=\"3\" format=\"ascii\">\n               ";
-   for(int n=0; n<nofNodes; n++)
-      out<< val<1>(nodes[n]) <<" "<< val<2>(nodes[n]) <<" "<< val<3>(nodes[n]) <<"   ";
-
-   out<<"\n";
-   out<<"            </DataArray>\n";
-   out<<"         </Points>\n";
-
-   //CELLS SECTION
-   out<<"         <Cells>\n";
-   out<<"            <DataArray type=\"Int32\" Name=\"connectivity\" format=\"ascii\">\n              ";
-
-   for(int c=0; c<nofCells; c++)
-      out<< val<1>(cells[c]) <<" "
-         << val<2>(cells[c]) <<" "
-         << val<4>(cells[c]) <<" "
-         << val<3>(cells[c]) <<"   ";
-   out<<"\n";
-   out<<"            </DataArray>\n";
-   out<<"            <DataArray type=\"Int32\" Name=\"offsets\" format=\"ascii\">\n              ";
-   for(int c=1; c<nofCells+1; c++)
-      out<<c*4<<" " ;
-
-
-   out<<"\n";
-   out<<"            </DataArray>\n";
-
-   out<<"            <DataArray type=\"UInt8\" Name=\"types\" format=\"ascii\">\n              ";
-
-   for(int c=0; c<nofCells; c++)
-      out<<"8 ";
-   out<<"\n";
-   out<<"            </DataArray>\n";
-
-   out<<"         </Cells>\n";
-
-   //write data section
-   out<<"         <CellData Scalars=\"Scalars\"> \n";
-   for(int s=0; s<(int)datanames.size(); ++s)
-   {
-      out<< "           <DataArray type=\"Float32\" Name=\""<< datanames[s] <<"\" format=\"ascii\"> \n";
-
-      for(int d=0; d<(int)celldata[s].size(); d++)
-         out<<celldata[s][d]<<" ";
-
-      out<<"\n          </DataArray>\n";
-   }
-   out<<"         </CellData>\n";
-   out<<"      </Piece>\n";
-   out<<"   </UnstructuredGrid>\n";
-   out<<"</VTKFile>";
-   out<<endl;
-
-   out.close();
-
-   UBLOG(logDEBUG1,"WbWriterVtkXmlASCII::writeQuadsWithCellData to "<<vtkfilename<<" - end");
-
-   return vtkfilename;
+    string vtkfilename = filename + getFileExtension();
+    UBLOG(logDEBUG1, "WbWriterVtkXmlASCII::writeQuadsWithCellData to " << vtkfilename << " - start");
+
+    std::ofstream out(vtkfilename.c_str());
+    if (!out) {
+        out.clear(); // flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
+        string path = UbSystem::getPathFromString(vtkfilename);
+        if (path.size() > 0) {
+            UbSystem::makeDirectory(path);
+            out.open(vtkfilename.c_str());
+        }
+        if (!out)
+            throw UbException(UB_EXARGS, "couldn't open file " + vtkfilename);
+    }
+
+    int nofNodes = (int)nodes.size();
+    int nofCells = (int)cells.size();
+
+    // VTK FILE
+    out << "<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\" >"
+        << "\n";
+    out << "   <UnstructuredGrid>"
+        << "\n";
+    out << "      <Piece NumberOfPoints=\"" << nofNodes << "\"	NumberOfCells=\"" << nofCells << "\">   \n";
+
+    // POINTS SECTION
+    out << "         <Points>\n";
+    out << "            <DataArray type=\"Float32\" NumberOfComponents=\"3\" format=\"ascii\">\n               ";
+    for (int n = 0; n < nofNodes; n++)
+        out << val<1>(nodes[n]) << " " << val<2>(nodes[n]) << " " << val<3>(nodes[n]) << "   ";
+
+    out << "\n";
+    out << "            </DataArray>\n";
+    out << "         </Points>\n";
+
+    // CELLS SECTION
+    out << "         <Cells>\n";
+    out << "            <DataArray type=\"Int32\" Name=\"connectivity\" format=\"ascii\">\n              ";
+
+    for (int c = 0; c < nofCells; c++)
+        out << val<1>(cells[c]) << " " << val<2>(cells[c]) << " " << val<4>(cells[c]) << " " << val<3>(cells[c])
+            << "   ";
+    out << "\n";
+    out << "            </DataArray>\n";
+    out << "            <DataArray type=\"Int32\" Name=\"offsets\" format=\"ascii\">\n              ";
+    for (int c = 1; c < nofCells + 1; c++)
+        out << c * 4 << " ";
+
+    out << "\n";
+    out << "            </DataArray>\n";
+
+    out << "            <DataArray type=\"UInt8\" Name=\"types\" format=\"ascii\">\n              ";
+
+    for (int c = 0; c < nofCells; c++)
+        out << "8 ";
+    out << "\n";
+    out << "            </DataArray>\n";
+
+    out << "         </Cells>\n";
+
+    // write data section
+    out << "         <CellData Scalars=\"Scalars\"> \n";
+    for (int s = 0; s < (int)datanames.size(); ++s) {
+        out << "           <DataArray type=\"Float32\" Name=\"" << datanames[s] << "\" format=\"ascii\"> \n";
+
+        for (int d = 0; d < (int)celldata[s].size(); d++)
+            out << celldata[s][d] << " ";
+
+        out << "\n          </DataArray>\n";
+    }
+    out << "         </CellData>\n";
+    out << "      </Piece>\n";
+    out << "   </UnstructuredGrid>\n";
+    out << "</VTKFile>";
+    out << endl;
+
+    out.close();
+
+    UBLOG(logDEBUG1, "WbWriterVtkXmlASCII::writeQuadsWithCellData to " << vtkfilename << " - end");
+
+    return vtkfilename;
 }
 /*===============================================================================*/
-string WbWriterVtkXmlASCII::writeQuadsWithNodeAndCellData(const string& filename,vector< UbTupleFloat3 >& nodes, vector< UbTupleInt4 >& cells, 
-                                                          vector< string >& nodedatanames, vector< vector< double > >& nodedata, vector< string >& celldatanames,
-                                                          vector< vector< double > >& celldata                                                                       )
+string WbWriterVtkXmlASCII::writeQuadsWithNodeAndCellData(const string &filename, vector<UbTupleFloat3> &nodes,
+                                                          vector<UbTupleInt4> &cells, vector<string> &nodedatanames,
+                                                          vector<vector<double>> &nodedata,
+                                                          vector<string> &celldatanames,
+                                                          vector<vector<double>> &celldata)
 {
-   string vtkfilename=filename+getFileExtension();
-   UBLOG(logDEBUG1,"WbWriterVtkXmlASCII::writeQuadsWithNodeAndCellData to "<<vtkfilename<<" - start");
-
-   std::ofstream out(vtkfilename.c_str());
-   if(!out)
-   { 
-      out.clear(); //flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
-      string path = UbSystem::getPathFromString(vtkfilename);
-      if(path.size()>0){UbSystem::makeDirectory(path);out.open(vtkfilename.c_str());}
-      if(!out) throw UbException(UB_EXARGS,"couldn't open file "+vtkfilename);
-   }
-
-   int nofNodes = (int)nodes.size(); 
-   int nofCells = (int)cells.size(); 
-
-   //VTK FILE
-   out<<"<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\" >"<<"\n";
-   out<<"   <UnstructuredGrid>"<<"\n";
-   out<<"      <Piece NumberOfPoints=\""<<nofNodes<<"\"	NumberOfCells=\""<<nofCells<<"\">   \n";
-
-   //POINTS SECTION
-   out<<"         <Points>\n"; 
-   out<<"            <DataArray type=\"Float32\" NumberOfComponents=\"3\" format=\"ascii\">\n               ";
-   for(int n=0; n<nofNodes; n++)
-      out<< val<1>(nodes[n]) <<" "<< val<2>(nodes[n]) <<" "<< val<3>(nodes[n]) <<"   ";
-
-   out<<"\n";
-   out<<"            </DataArray>\n";
-   out<<"         </Points>\n";
-
-   //CELLS SECTION
-   out<<"         <Cells>\n";
-   out<<"            <DataArray type=\"Int32\" Name=\"connectivity\" format=\"ascii\">\n              ";
-
-   for(int c=0; c<nofCells; c++)
-      out<< val<1>(cells[c]) <<" "
-         << val<2>(cells[c]) <<" "
-         << val<4>(cells[c]) <<" "
-         << val<3>(cells[c]) <<"   ";
-   out<<"\n";
-   out<<"            </DataArray>\n";
-   out<<"            <DataArray type=\"Int32\" Name=\"offsets\" format=\"ascii\">\n              ";
-   for(int c=1; c<nofCells+1; c++)
-      out<<c*4<<" " ;
-
-
-   out<<"\n";
-   out<<"            </DataArray>\n";
-
-   out<<"            <DataArray type=\"UInt8\" Name=\"types\" format=\"ascii\">\n              ";
-
-   for(int c=0; c<nofCells; c++)
-      out<<"8 ";
-   out<<"\n";
-   out<<"            </DataArray>\n";
-
-   out<<"         </Cells>\n";
-   
-   //write PointData section
-   out<<"         <PointData Scalars=\"PScalars\"> \n";
-   for(int s=0; s<(int)nodedatanames.size(); ++s)
-   {
-      out<< "           <DataArray type=\"Float32\" Name=\""<< nodedatanames[s] <<"\" format=\"ascii\"> \n";
-
-      for(int d=0; d<(int)nodedata[s].size(); d++)
-         out<<nodedata[s][d]<<" ";
-
-      out<<"\n          </DataArray>\n";
-   }
-   out<<"         </PointData>\n";
-
-   //write celldata section
-   out<<"         <CellData Scalars=\"CScalars\"> \n";
-   for(int s=0; s<(int)celldatanames.size(); ++s)
-   {
-      out<< "           <DataArray type=\"Float32\" Name=\""<< celldatanames[s] <<"\" format=\"ascii\"> \n";
-
-      for(int d=0; d<(int)celldata[s].size(); d++)
-         out<<celldata[s][d]<<" ";
-
-      out<<"\n          </DataArray>\n";
-   }
-   out<<"         </CellData>\n";
-   out<<"      </Piece>\n";
-   out<<"   </UnstructuredGrid>\n";
-   out<<"</VTKFile>";
-   out<<endl;
-   out.close();
-   UBLOG(logDEBUG1,"WbWriterVtkXmlASCII::writeQuadsWithNodeAndCellData to "<<vtkfilename<<" - end");
-
-   return vtkfilename;
+    string vtkfilename = filename + getFileExtension();
+    UBLOG(logDEBUG1, "WbWriterVtkXmlASCII::writeQuadsWithNodeAndCellData to " << vtkfilename << " - start");
+
+    std::ofstream out(vtkfilename.c_str());
+    if (!out) {
+        out.clear(); // flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
+        string path = UbSystem::getPathFromString(vtkfilename);
+        if (path.size() > 0) {
+            UbSystem::makeDirectory(path);
+            out.open(vtkfilename.c_str());
+        }
+        if (!out)
+            throw UbException(UB_EXARGS, "couldn't open file " + vtkfilename);
+    }
+
+    int nofNodes = (int)nodes.size();
+    int nofCells = (int)cells.size();
+
+    // VTK FILE
+    out << "<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\" >"
+        << "\n";
+    out << "   <UnstructuredGrid>"
+        << "\n";
+    out << "      <Piece NumberOfPoints=\"" << nofNodes << "\"	NumberOfCells=\"" << nofCells << "\">   \n";
+
+    // POINTS SECTION
+    out << "         <Points>\n";
+    out << "            <DataArray type=\"Float32\" NumberOfComponents=\"3\" format=\"ascii\">\n               ";
+    for (int n = 0; n < nofNodes; n++)
+        out << val<1>(nodes[n]) << " " << val<2>(nodes[n]) << " " << val<3>(nodes[n]) << "   ";
+
+    out << "\n";
+    out << "            </DataArray>\n";
+    out << "         </Points>\n";
+
+    // CELLS SECTION
+    out << "         <Cells>\n";
+    out << "            <DataArray type=\"Int32\" Name=\"connectivity\" format=\"ascii\">\n              ";
+
+    for (int c = 0; c < nofCells; c++)
+        out << val<1>(cells[c]) << " " << val<2>(cells[c]) << " " << val<4>(cells[c]) << " " << val<3>(cells[c])
+            << "   ";
+    out << "\n";
+    out << "            </DataArray>\n";
+    out << "            <DataArray type=\"Int32\" Name=\"offsets\" format=\"ascii\">\n              ";
+    for (int c = 1; c < nofCells + 1; c++)
+        out << c * 4 << " ";
+
+    out << "\n";
+    out << "            </DataArray>\n";
+
+    out << "            <DataArray type=\"UInt8\" Name=\"types\" format=\"ascii\">\n              ";
+
+    for (int c = 0; c < nofCells; c++)
+        out << "8 ";
+    out << "\n";
+    out << "            </DataArray>\n";
+
+    out << "         </Cells>\n";
+
+    // write PointData section
+    out << "         <PointData Scalars=\"PScalars\"> \n";
+    for (int s = 0; s < (int)nodedatanames.size(); ++s) {
+        out << "           <DataArray type=\"Float32\" Name=\"" << nodedatanames[s] << "\" format=\"ascii\"> \n";
+
+        for (int d = 0; d < (int)nodedata[s].size(); d++)
+            out << nodedata[s][d] << " ";
+
+        out << "\n          </DataArray>\n";
+    }
+    out << "         </PointData>\n";
+
+    // write celldata section
+    out << "         <CellData Scalars=\"CScalars\"> \n";
+    for (int s = 0; s < (int)celldatanames.size(); ++s) {
+        out << "           <DataArray type=\"Float32\" Name=\"" << celldatanames[s] << "\" format=\"ascii\"> \n";
+
+        for (int d = 0; d < (int)celldata[s].size(); d++)
+            out << celldata[s][d] << " ";
+
+        out << "\n          </DataArray>\n";
+    }
+    out << "         </CellData>\n";
+    out << "      </Piece>\n";
+    out << "   </UnstructuredGrid>\n";
+    out << "</VTKFile>";
+    out << endl;
+    out.close();
+    UBLOG(logDEBUG1, "WbWriterVtkXmlASCII::writeQuadsWithNodeAndCellData to " << vtkfilename << " - end");
+
+    return vtkfilename;
 }
 /*===============================================================================*/
-std::string WbWriterVtkXmlASCII::writeLines(const string& filename,vector<UbTupleFloat3 >& nodes, vector<UbTupleInt2 >& lines) 
+std::string WbWriterVtkXmlASCII::writeLines(const string &filename, vector<UbTupleFloat3> &nodes,
+                                            vector<UbTupleInt2> &lines)
 {
-   string vtkfilename=filename+getFileExtension();
-   UBLOG(logDEBUG1,"WbWriterVtkXmlASCII::writeLines to "<<vtkfilename<<" - start");
-
-   std::ofstream out(vtkfilename.c_str());
-   if(!out)
-   { 
-      out.clear(); //flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
-      string path = UbSystem::getPathFromString(vtkfilename);
-      if(path.size()>0){UbSystem::makeDirectory(path);out.open(vtkfilename.c_str());}
-      if(!out) throw UbException(UB_EXARGS,"couldn't open file "+vtkfilename);
-   }
-
-   int nofNodes = (int)nodes.size(); 
-   int nofLines = (int)lines.size(); 
-
-   //VTK FILE
-   out<<"<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\" >"<<"\n";
-   out<<"   <UnstructuredGrid>"<<"\n";
-   out<<"      <Piece NumberOfPoints=\""<<nofNodes<<"\"	NumberOfCells=\""<<nofLines<<"\">   \n";
-
-   //POINTS SECTION
-   out<<"      <Points>\n"; 
-   out<<"         <DataArray type=\"Float32\" NumberOfComponents=\"3\" format=\"ascii\">\n";
-   for(int n=0; n<nofNodes; n++)
-      out<< val<1>(nodes[n]) <<" "<< val<2>(nodes[n]) <<" "<< val<3>(nodes[n]) <<"   ";
-
-   out<<"\n";
-   out<<"         </DataArray>\n";
-   out<<"      </Points>\n";
-
-   //CELLS SECTION
-   out<<"      <Cells>\n";
-   out<<"         <DataArray type=\"Int32\" Name=\"connectivity\" format=\"ascii\">\n";
-
-   for(int c=0; c<nofLines; c++)
-      out<< val<1>(lines[c]) <<" "<< val<2>(lines[c])<<"  ";
-   out<<"\n";
-   out<<"      </DataArray>\n";
-   out<<"         <DataArray type=\"Int32\" Name=\"offsets\" format=\"ascii\">\n";
-   for(int c=1; c<=nofLines; c++)
-      out<<c*2<<" " ;
-
-   out<<"\n";
-   out<<"         </DataArray>\n";
-
-   out<<"      <DataArray type=\"UInt8\" Name=\"types\" format=\"ascii\">\n";
-
-   for(int c=0; c<nofLines; c++)
-      out<<"3 ";
-   out<<"\n";
-   out<<"      </DataArray>\n";
-   out<<"      </Cells>\n";
-   out<<"      </Piece>\n";
-   out<<"   </UnstructuredGrid>\n";
-   out<<"</VTKFile>";
-   out<<endl;
-   out.close();
-   UBLOG(logDEBUG1,"WbWriterVtkXmlASCII::writeLines to "<<vtkfilename<<" - end");
-
-   return vtkfilename;
+    string vtkfilename = filename + getFileExtension();
+    UBLOG(logDEBUG1, "WbWriterVtkXmlASCII::writeLines to " << vtkfilename << " - start");
+
+    std::ofstream out(vtkfilename.c_str());
+    if (!out) {
+        out.clear(); // flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
+        string path = UbSystem::getPathFromString(vtkfilename);
+        if (path.size() > 0) {
+            UbSystem::makeDirectory(path);
+            out.open(vtkfilename.c_str());
+        }
+        if (!out)
+            throw UbException(UB_EXARGS, "couldn't open file " + vtkfilename);
+    }
+
+    int nofNodes = (int)nodes.size();
+    int nofLines = (int)lines.size();
+
+    // VTK FILE
+    out << "<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\" >"
+        << "\n";
+    out << "   <UnstructuredGrid>"
+        << "\n";
+    out << "      <Piece NumberOfPoints=\"" << nofNodes << "\"	NumberOfCells=\"" << nofLines << "\">   \n";
+
+    // POINTS SECTION
+    out << "      <Points>\n";
+    out << "         <DataArray type=\"Float32\" NumberOfComponents=\"3\" format=\"ascii\">\n";
+    for (int n = 0; n < nofNodes; n++)
+        out << val<1>(nodes[n]) << " " << val<2>(nodes[n]) << " " << val<3>(nodes[n]) << "   ";
+
+    out << "\n";
+    out << "         </DataArray>\n";
+    out << "      </Points>\n";
+
+    // CELLS SECTION
+    out << "      <Cells>\n";
+    out << "         <DataArray type=\"Int32\" Name=\"connectivity\" format=\"ascii\">\n";
+
+    for (int c = 0; c < nofLines; c++)
+        out << val<1>(lines[c]) << " " << val<2>(lines[c]) << "  ";
+    out << "\n";
+    out << "      </DataArray>\n";
+    out << "         <DataArray type=\"Int32\" Name=\"offsets\" format=\"ascii\">\n";
+    for (int c = 1; c <= nofLines; c++)
+        out << c * 2 << " ";
+
+    out << "\n";
+    out << "         </DataArray>\n";
+
+    out << "      <DataArray type=\"UInt8\" Name=\"types\" format=\"ascii\">\n";
+
+    for (int c = 0; c < nofLines; c++)
+        out << "3 ";
+    out << "\n";
+    out << "      </DataArray>\n";
+    out << "      </Cells>\n";
+    out << "      </Piece>\n";
+    out << "   </UnstructuredGrid>\n";
+    out << "</VTKFile>";
+    out << endl;
+    out.close();
+    UBLOG(logDEBUG1, "WbWriterVtkXmlASCII::writeLines to " << vtkfilename << " - end");
+
+    return vtkfilename;
 }
 /*===============================================================================*/
-//std::string WbWriterVtkXmlASCII::writeLinesWithNodeData(const string& filename,vector<UbTupleFloat3 >& nodes, vector<UbTupleInt2 >& lines, std::vector< std::string >& datanames, std::vector< std::vector< double > >& nodedata)
+// std::string WbWriterVtkXmlASCII::writeLinesWithNodeData(const string& filename,vector<UbTupleFloat3 >& nodes,
+// vector<UbTupleInt2 >& lines, std::vector< std::string >& datanames, std::vector< std::vector< double > >& nodedata)
 //{
 //   string vtkfilename=filename+getFileExtension();
 //   UBLOG(logDEBUG1,"WbWriterVtkXmlASCII::writeLinesWithNodeData to "<<vtkfilename<<" - start");
@@ -609,613 +643,645 @@ std::string WbWriterVtkXmlASCII::writeLines(const string& filename,vector<UbTupl
 //   return vtkfilename;
 //}
 /*===============================================================================*/
-std::string WbWriterVtkXmlASCII::writeTriangles(const string& filename,vector<UbTupleFloat3 >& nodes, vector<UbTupleInt3 >& triangles)
+std::string WbWriterVtkXmlASCII::writeTriangles(const string &filename, vector<UbTupleFloat3> &nodes,
+                                                vector<UbTupleInt3> &triangles)
 {
-   string vtkfilename=filename+getFileExtension();
-   UBLOG(logDEBUG1,"WbWriterVtkXmlASCII::writeTriangles to "<<vtkfilename<<" - start");
-
-   std::ofstream out(vtkfilename.c_str());
-   if(!out)
-   { 
-      out.clear(); //flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
-      string path = UbSystem::getPathFromString(vtkfilename);
-      if(path.size()>0){UbSystem::makeDirectory(path);out.open(vtkfilename.c_str());}
-      if(!out) throw UbException(UB_EXARGS,"couldn't open file "+vtkfilename);
-   }
-
-   int nofNodes = (int)nodes.size(); 
-   int nofTriangles= (int)triangles.size(); 
-
-   //VTK FILE
-   out<<"<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\" >"<<"\n";
-   out<<"   <UnstructuredGrid>"<<"\n";
-   out<<"      <Piece NumberOfPoints=\""<<nofNodes<<"\"	NumberOfCells=\""<<nofTriangles<<"\">   \n";
-
-   //POINTS SECTION
-   out<<"      <Points>\n"; 
-   out<<"         <DataArray type=\"Float32\" NumberOfComponents=\"3\" format=\"ascii\">\n";
-   for(int n=0; n<nofNodes; n++)
-      out<< val<1>(nodes[n]) <<" "<< val<2>(nodes[n]) <<" "<< val<3>(nodes[n]) <<"   ";
-
-   out<<"\n";
-   out<<"         </DataArray>\n";
-   out<<"      </Points>\n";
-
-   //CELLS SECTION
-   out<<"      <Cells>\n";
-   out<<"         <DataArray type=\"Int32\" Name=\"connectivity\" format=\"ascii\">\n";
-
-   for(int c=0; c<nofTriangles; c++)
-      out<< val<1>(triangles[c]) <<" "<< val<2>(triangles[c])<<" "<< val<3>(triangles[c])<<"  ";
-   out<<"\n";
-   out<<"      </DataArray>\n";
-   out<<"         <DataArray type=\"Int32\" Name=\"offsets\" format=\"ascii\">\n";
-   for(int c=1; c<nofTriangles+1; c++)
-      out<<c*3<<" " ;
-
-   out<<"\n";
-   out<<"         </DataArray>\n";
-
-   out<<"      <DataArray type=\"UInt8\" Name=\"types\" format=\"ascii\">\n";
-
-   for(int c=0; c<nofTriangles; c++)
-      out<<"5 ";
-   out<<"\n";
-   out<<"      </DataArray>\n";
-   out<<"      </Cells>\n";
-   out<<"      </Piece>\n";
-   out<<"   </UnstructuredGrid>\n";
-   out<<"</VTKFile>";
-   out<<endl;
-   out.close();
-   UBLOG(logDEBUG1,"WbWriterVtkXmlASCII::writeTriangles to "<<vtkfilename<<" - end");
-
-   return vtkfilename;
+    string vtkfilename = filename + getFileExtension();
+    UBLOG(logDEBUG1, "WbWriterVtkXmlASCII::writeTriangles to " << vtkfilename << " - start");
+
+    std::ofstream out(vtkfilename.c_str());
+    if (!out) {
+        out.clear(); // flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
+        string path = UbSystem::getPathFromString(vtkfilename);
+        if (path.size() > 0) {
+            UbSystem::makeDirectory(path);
+            out.open(vtkfilename.c_str());
+        }
+        if (!out)
+            throw UbException(UB_EXARGS, "couldn't open file " + vtkfilename);
+    }
+
+    int nofNodes     = (int)nodes.size();
+    int nofTriangles = (int)triangles.size();
+
+    // VTK FILE
+    out << "<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\" >"
+        << "\n";
+    out << "   <UnstructuredGrid>"
+        << "\n";
+    out << "      <Piece NumberOfPoints=\"" << nofNodes << "\"	NumberOfCells=\"" << nofTriangles << "\">   \n";
+
+    // POINTS SECTION
+    out << "      <Points>\n";
+    out << "         <DataArray type=\"Float32\" NumberOfComponents=\"3\" format=\"ascii\">\n";
+    for (int n = 0; n < nofNodes; n++)
+        out << val<1>(nodes[n]) << " " << val<2>(nodes[n]) << " " << val<3>(nodes[n]) << "   ";
+
+    out << "\n";
+    out << "         </DataArray>\n";
+    out << "      </Points>\n";
+
+    // CELLS SECTION
+    out << "      <Cells>\n";
+    out << "         <DataArray type=\"Int32\" Name=\"connectivity\" format=\"ascii\">\n";
+
+    for (int c = 0; c < nofTriangles; c++)
+        out << val<1>(triangles[c]) << " " << val<2>(triangles[c]) << " " << val<3>(triangles[c]) << "  ";
+    out << "\n";
+    out << "      </DataArray>\n";
+    out << "         <DataArray type=\"Int32\" Name=\"offsets\" format=\"ascii\">\n";
+    for (int c = 1; c < nofTriangles + 1; c++)
+        out << c * 3 << " ";
+
+    out << "\n";
+    out << "         </DataArray>\n";
+
+    out << "      <DataArray type=\"UInt8\" Name=\"types\" format=\"ascii\">\n";
+
+    for (int c = 0; c < nofTriangles; c++)
+        out << "5 ";
+    out << "\n";
+    out << "      </DataArray>\n";
+    out << "      </Cells>\n";
+    out << "      </Piece>\n";
+    out << "   </UnstructuredGrid>\n";
+    out << "</VTKFile>";
+    out << endl;
+    out.close();
+    UBLOG(logDEBUG1, "WbWriterVtkXmlASCII::writeTriangles to " << vtkfilename << " - end");
+
+    return vtkfilename;
 }
 /*===============================================================================*/
-std::string WbWriterVtkXmlASCII::writeTrianglesWithNodeData(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt3 >& cells, std::vector< std::string >& datanames, std::vector< std::vector< double > >& nodedata)
+std::string WbWriterVtkXmlASCII::writeTrianglesWithNodeData(const std::string &filename,
+                                                            std::vector<UbTupleFloat3> &nodes,
+                                                            std::vector<UbTupleInt3> &cells,
+                                                            std::vector<std::string> &datanames,
+                                                            std::vector<std::vector<double>> &nodedata)
 {
-   string vtkfilename=filename+getFileExtension();
-   UBLOG(logDEBUG1,"WbWriterVtkXmlASCII::writeTrianglesWithNodeData to "<<vtkfilename<<" - start");
-
-   std::ofstream out(vtkfilename.c_str());
-   if(!out)
-   { 
-      out.clear(); //flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
-      string path = UbSystem::getPathFromString(vtkfilename);
-      if(path.size()>0){UbSystem::makeDirectory(path);out.open(vtkfilename.c_str());}
-      if(!out) throw UbException(UB_EXARGS,"couldn't open file "+vtkfilename);
-   }
-
-   int nofNodes = (int)nodes.size(); 
-   int nofCells = (int)cells.size(); 
-
-   //VTK FILE
-   out<<"<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\" >"<<"\n";
-   out<<"   <UnstructuredGrid>"<<"\n";
-   out<<"      <Piece NumberOfPoints=\""<<nofNodes<<"\"	NumberOfCells=\""<<nofCells<<"\">   \n";
-
-   //POINTS SECTION
-   out<<"         <Points>\n"; 
-   out<<"            <DataArray type=\"Float32\" NumberOfComponents=\"3\" format=\"ascii\">\n               ";
-   for(int n=0; n<nofNodes; n++)
-      out<< val<1>(nodes[n]) <<" "<< val<2>(nodes[n]) <<" "<< val<3>(nodes[n]) <<"   ";
-
-   out<<"\n";
-   out<<"            </DataArray>\n";
-   out<<"         </Points>\n";
-
-   //CELLS SECTION
-   out<<"         <Cells>\n";
-   out<<"            <DataArray type=\"Int32\" Name=\"connectivity\" format=\"ascii\">\n              ";
-
-   for(int c=0; c<nofCells; c++)
-      out<< val<1>(cells[c]) <<" "<< val<2>(cells[c]) <<" "<< val<3>(cells[c]) <<"   ";
-   out<<"\n";
-   out<<"            </DataArray>\n";
-   out<<"            <DataArray type=\"Int32\" Name=\"offsets\" format=\"ascii\">\n              ";
-   for(int c=1; c<nofCells+1; c++)
-      out<<c*3<<" " ;
-
-   out<<"\n";
-   out<<"            </DataArray>\n";
-
-   out<<"            <DataArray type=\"UInt8\" Name=\"types\" format=\"ascii\">\n              ";
-
-   for(int c=0; c<nofCells; c++)
-      out<<"5 ";
-   out<<"\n";
-   out<<"            </DataArray>\n";
-
-   out<<"         </Cells>\n";
-
-   //write data section
-   out<<"         <PointData Scalars=\"Scalars\"> \n";
-   for(int s=0; s<(int)datanames.size(); ++s)
-   {
-      out<< "           <DataArray type=\"Float32\" Name=\""<< datanames[s] <<"\" format=\"ascii\"> \n";
-
-      for(int d=0; d<(int)nodedata[s].size(); d++)
-         out<<nodedata[s][d]<<" ";
-
-      out<<"\n          </DataArray>\n";
-   }
-   out<<"         </PointData>\n";
-   out<<"      </Piece>\n";
-   out<<"   </UnstructuredGrid>\n";
-   out<<"</VTKFile>";
-   out<<endl;
-   out.close();
-   UBLOG(logDEBUG1,"WbWriterVtkXmlASCII::writeTrianglesWithNodeData to "<<vtkfilename<<" - end");
-
-   return vtkfilename;
+    string vtkfilename = filename + getFileExtension();
+    UBLOG(logDEBUG1, "WbWriterVtkXmlASCII::writeTrianglesWithNodeData to " << vtkfilename << " - start");
+
+    std::ofstream out(vtkfilename.c_str());
+    if (!out) {
+        out.clear(); // flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
+        string path = UbSystem::getPathFromString(vtkfilename);
+        if (path.size() > 0) {
+            UbSystem::makeDirectory(path);
+            out.open(vtkfilename.c_str());
+        }
+        if (!out)
+            throw UbException(UB_EXARGS, "couldn't open file " + vtkfilename);
+    }
+
+    int nofNodes = (int)nodes.size();
+    int nofCells = (int)cells.size();
+
+    // VTK FILE
+    out << "<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\" >"
+        << "\n";
+    out << "   <UnstructuredGrid>"
+        << "\n";
+    out << "      <Piece NumberOfPoints=\"" << nofNodes << "\"	NumberOfCells=\"" << nofCells << "\">   \n";
+
+    // POINTS SECTION
+    out << "         <Points>\n";
+    out << "            <DataArray type=\"Float32\" NumberOfComponents=\"3\" format=\"ascii\">\n               ";
+    for (int n = 0; n < nofNodes; n++)
+        out << val<1>(nodes[n]) << " " << val<2>(nodes[n]) << " " << val<3>(nodes[n]) << "   ";
+
+    out << "\n";
+    out << "            </DataArray>\n";
+    out << "         </Points>\n";
+
+    // CELLS SECTION
+    out << "         <Cells>\n";
+    out << "            <DataArray type=\"Int32\" Name=\"connectivity\" format=\"ascii\">\n              ";
+
+    for (int c = 0; c < nofCells; c++)
+        out << val<1>(cells[c]) << " " << val<2>(cells[c]) << " " << val<3>(cells[c]) << "   ";
+    out << "\n";
+    out << "            </DataArray>\n";
+    out << "            <DataArray type=\"Int32\" Name=\"offsets\" format=\"ascii\">\n              ";
+    for (int c = 1; c < nofCells + 1; c++)
+        out << c * 3 << " ";
+
+    out << "\n";
+    out << "            </DataArray>\n";
+
+    out << "            <DataArray type=\"UInt8\" Name=\"types\" format=\"ascii\">\n              ";
+
+    for (int c = 0; c < nofCells; c++)
+        out << "5 ";
+    out << "\n";
+    out << "            </DataArray>\n";
+
+    out << "         </Cells>\n";
+
+    // write data section
+    out << "         <PointData Scalars=\"Scalars\"> \n";
+    for (int s = 0; s < (int)datanames.size(); ++s) {
+        out << "           <DataArray type=\"Float32\" Name=\"" << datanames[s] << "\" format=\"ascii\"> \n";
+
+        for (int d = 0; d < (int)nodedata[s].size(); d++)
+            out << nodedata[s][d] << " ";
+
+        out << "\n          </DataArray>\n";
+    }
+    out << "         </PointData>\n";
+    out << "      </Piece>\n";
+    out << "   </UnstructuredGrid>\n";
+    out << "</VTKFile>";
+    out << endl;
+    out.close();
+    UBLOG(logDEBUG1, "WbWriterVtkXmlASCII::writeTrianglesWithNodeData to " << vtkfilename << " - end");
+
+    return vtkfilename;
 }
 /*===============================================================================*/
-std::string WbWriterVtkXmlASCII::writeOctsWithCellData(const string& filename,vector< UbTupleFloat3 >& nodes, vector< UbTupleInt8 >& cells, vector< string >& datanames, vector< vector< double > >& celldata)
+std::string WbWriterVtkXmlASCII::writeOctsWithCellData(const string &filename, vector<UbTupleFloat3> &nodes,
+                                                       vector<UbTupleInt8> &cells, vector<string> &datanames,
+                                                       vector<vector<double>> &celldata)
 {
-   string vtkfilename=filename+getFileExtension();
-   UBLOG(logDEBUG1,"WbWriterVtkXmlASCII::writeOctsWithCellData to "<<vtkfilename<<" - start");
-
-   std::ofstream out(vtkfilename.c_str());
-   if(!out)
-   { 
-      out.clear(); //flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
-      string path = UbSystem::getPathFromString(vtkfilename);
-      if(path.size()>0){UbSystem::makeDirectory(path);out.open(vtkfilename.c_str());}
-      if(!out) throw UbException(UB_EXARGS,"couldn't open file "+vtkfilename);
-   }
-
-   int nofNodes = (int)nodes.size(); 
-   int nofCells = (int)cells.size(); 
-
-   //VTK FILE
-   out<<"<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\" >"<<"\n";
-   out<<"   <UnstructuredGrid>"<<"\n";
-   out<<"      <Piece NumberOfPoints=\""<<nofNodes<<"\"	NumberOfCells=\""<<nofCells<<"\">   \n";
-
-   //POINTS SECTION
-   out<<"         <Points>\n"; 
-   out<<"            <DataArray type=\"Float32\" NumberOfComponents=\"3\" format=\"ascii\">\n               ";
-   for(int n=0; n<nofNodes; n++)
-      out<< val<1>(nodes[n]) <<" "<< val<2>(nodes[n]) <<" "<< val<3>(nodes[n]) <<"   ";
-
-   out<<"\n";
-   out<<"            </DataArray>\n";
-   out<<"         </Points>\n";
-
-   //CELLS SECTION
-   out<<"         <Cells>\n";
-   out<<"            <DataArray type=\"Int32\" Name=\"connectivity\" format=\"ascii\">\n              ";
-
-   for(int c=0; c<nofCells; c++)
-      out<< val<1>(cells[c]) <<" "
-         << val<2>(cells[c]) <<" "
-         << val<4>(cells[c]) <<" "
-         << val<3>(cells[c]) <<" "
-         << val<5>(cells[c]) <<" "
-         << val<6>(cells[c]) <<" "
-         << val<8>(cells[c]) <<" "
-         << val<7>(cells[c]) <<"  ";
-   out<<"\n";
-   out<<"            </DataArray>\n";
-   out<<"            <DataArray type=\"Int32\" Name=\"offsets\" format=\"ascii\">\n              ";
-   for(int c=1; c<nofCells+1; c++)
-      out<<c*8<<" " ;
-
-
-   out<<"\n";
-   out<<"            </DataArray>\n";
-
-   out<<"            <DataArray type=\"UInt8\" Name=\"types\" format=\"ascii\">\n              ";
-
-   for(int c=0; c<nofCells; c++)
-      out<<"11 ";
-   out<<"\n";
-   out<<"            </DataArray>\n";
-
-   out<<"         </Cells>\n";
-   
-
-   //write data section
-   out<<"         <CellData Scalars=\"Scalars\"> \n";
-   for(int s=0; s<(int)datanames.size(); ++s)
-   {
-      out<< "           <DataArray type=\"Float32\" Name=\""<< datanames[s] <<"\" format=\"ascii\"> \n";
-
-      for(int d=0; d<(int)celldata[s].size(); d++)
-         out<<celldata[s][d]<<" ";
-
-      out<<"\n          </DataArray>\n";
-   }
-   out<<"         </CellData>\n";
-
-   out<<"      </Piece>\n";
-   out<<"   </UnstructuredGrid>\n";
-   out<<"</VTKFile>";
-   out<<endl;
-   out.close();
-   UBLOG(logDEBUG1,"WbWriterVtkXmlASCII::writeOctsWithCellData to "<<vtkfilename<<" - end");
-
-   return vtkfilename;
+    string vtkfilename = filename + getFileExtension();
+    UBLOG(logDEBUG1, "WbWriterVtkXmlASCII::writeOctsWithCellData to " << vtkfilename << " - start");
+
+    std::ofstream out(vtkfilename.c_str());
+    if (!out) {
+        out.clear(); // flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
+        string path = UbSystem::getPathFromString(vtkfilename);
+        if (path.size() > 0) {
+            UbSystem::makeDirectory(path);
+            out.open(vtkfilename.c_str());
+        }
+        if (!out)
+            throw UbException(UB_EXARGS, "couldn't open file " + vtkfilename);
+    }
+
+    int nofNodes = (int)nodes.size();
+    int nofCells = (int)cells.size();
+
+    // VTK FILE
+    out << "<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\" >"
+        << "\n";
+    out << "   <UnstructuredGrid>"
+        << "\n";
+    out << "      <Piece NumberOfPoints=\"" << nofNodes << "\"	NumberOfCells=\"" << nofCells << "\">   \n";
+
+    // POINTS SECTION
+    out << "         <Points>\n";
+    out << "            <DataArray type=\"Float32\" NumberOfComponents=\"3\" format=\"ascii\">\n               ";
+    for (int n = 0; n < nofNodes; n++)
+        out << val<1>(nodes[n]) << " " << val<2>(nodes[n]) << " " << val<3>(nodes[n]) << "   ";
+
+    out << "\n";
+    out << "            </DataArray>\n";
+    out << "         </Points>\n";
+
+    // CELLS SECTION
+    out << "         <Cells>\n";
+    out << "            <DataArray type=\"Int32\" Name=\"connectivity\" format=\"ascii\">\n              ";
+
+    for (int c = 0; c < nofCells; c++)
+        out << val<1>(cells[c]) << " " << val<2>(cells[c]) << " " << val<4>(cells[c]) << " " << val<3>(cells[c]) << " "
+            << val<5>(cells[c]) << " " << val<6>(cells[c]) << " " << val<8>(cells[c]) << " " << val<7>(cells[c])
+            << "  ";
+    out << "\n";
+    out << "            </DataArray>\n";
+    out << "            <DataArray type=\"Int32\" Name=\"offsets\" format=\"ascii\">\n              ";
+    for (int c = 1; c < nofCells + 1; c++)
+        out << c * 8 << " ";
+
+    out << "\n";
+    out << "            </DataArray>\n";
+
+    out << "            <DataArray type=\"UInt8\" Name=\"types\" format=\"ascii\">\n              ";
+
+    for (int c = 0; c < nofCells; c++)
+        out << "11 ";
+    out << "\n";
+    out << "            </DataArray>\n";
+
+    out << "         </Cells>\n";
+
+    // write data section
+    out << "         <CellData Scalars=\"Scalars\"> \n";
+    for (int s = 0; s < (int)datanames.size(); ++s) {
+        out << "           <DataArray type=\"Float32\" Name=\"" << datanames[s] << "\" format=\"ascii\"> \n";
+
+        for (int d = 0; d < (int)celldata[s].size(); d++)
+            out << celldata[s][d] << " ";
+
+        out << "\n          </DataArray>\n";
+    }
+    out << "         </CellData>\n";
+
+    out << "      </Piece>\n";
+    out << "   </UnstructuredGrid>\n";
+    out << "</VTKFile>";
+    out << endl;
+    out.close();
+    UBLOG(logDEBUG1, "WbWriterVtkXmlASCII::writeOctsWithCellData to " << vtkfilename << " - end");
+
+    return vtkfilename;
 }
 /*===============================================================================*/
-std::string WbWriterVtkXmlASCII::writeOctsWithNodeData(const string& filename,vector< UbTupleFloat3 >& nodes, vector< UbTupleUInt8 >& cells, vector< string >& datanames, vector< vector< double > >& nodedata)
+std::string WbWriterVtkXmlASCII::writeOctsWithNodeData(const string &filename, vector<UbTupleFloat3> &nodes,
+                                                       vector<UbTupleUInt8> &cells, vector<string> &datanames,
+                                                       vector<vector<double>> &nodedata)
 {
-   string vtkfilename=filename+getFileExtension();
-   UBLOG(logDEBUG1,"WbWriterVtkXmlASCII::writeOctsWithNodeData to "<<vtkfilename<<" - start");
-
-   std::ofstream out(vtkfilename.c_str());
-   if(!out)
-   { 
-      out.clear(); //flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
-      string path = UbSystem::getPathFromString(vtkfilename);
-      if(path.size()>0){UbSystem::makeDirectory(path);out.open(vtkfilename.c_str());}
-      if(!out) throw UbException(UB_EXARGS,"couldn't open file "+vtkfilename);
-   }
-
-   int nofNodes = (int)nodes.size(); 
-   int nofCells = (int)cells.size(); 
-
-   //VTK FILE
-   out<<"<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\" >"<<"\n";
-   out<<"   <UnstructuredGrid>"<<"\n";
-   out<<"      <Piece NumberOfPoints=\""<<nofNodes<<"\"	NumberOfCells=\""<<nofCells<<"\">   \n";
-
-   //POINTS SECTION
-   out<<"         <Points>\n"; 
-   out<<"            <DataArray type=\"Float32\" NumberOfComponents=\"3\" format=\"ascii\">\n               ";
-   for(int n=0; n<nofNodes; n++)
-      out<<val<1>(nodes[n])<<" "<<val<2>(nodes[n])<<" "<<val<3>(nodes[n])<<" ";
-
-   out<<"\n";
-   out<<"            </DataArray>\n";
-   out<<"         </Points>\n";
-
-   //CELLS SECTION
-   out<<"         <Cells>\n";
-   out<<"            <DataArray type=\"Int32\" Name=\"connectivity\" format=\"ascii\">\n              ";
-
-   for(int c=0; c<nofCells; c++)
-      out<< val<1>(cells[c]) <<" "
-         << val<2>(cells[c]) <<" "
-         << val<4>(cells[c]) <<" "
-         << val<3>(cells[c]) <<" "
-         << val<5>(cells[c]) <<" "
-         << val<6>(cells[c]) <<" "
-         << val<8>(cells[c]) <<" "
-         << val<7>(cells[c]) <<"  ";
-
-   out<<"\n";
-   out<<"            </DataArray>\n";
-   out<<"            <DataArray type=\"Int32\" Name=\"offsets\" format=\"ascii\">\n              ";
-   for(int c=1; c<nofCells+1; c++)
-      out<<c*8<<" " ;
-
-   out<<"\n";
-   out<<"            </DataArray>\n";
-
-   out<<"            <DataArray type=\"UInt8\" Name=\"types\" format=\"ascii\">\n              ";
-
-   for(int c=0; c<nofCells; c++)
-      out<<"11 ";
-   out<<"\n";
-   out<<"            </DataArray>\n";
-
-   out<<"         </Cells>\n";
-
-   //write PointData section
-   out<<"         <PointData Scalars=\"PScalars\"> \n";
-   for(int s=0; s<(int)datanames.size(); ++s)
-   {
-      out<< "           <DataArray type=\"Float64\" Name=\""<< datanames[s] <<"\" format=\"ascii\">";
-
-      for(int d=0; d<(int)nodedata[s].size(); d++)
-      {
-         //out<<base64_encode((unsigned char*)(&nodedata[s][d]),sizeof(float));
-         //out.write((char*)&nodedata[s][d],sizeof(float));
-         out<<nodedata[s][d]<<" ";
-      }
-      out<<"</DataArray>\n";
-   }
-   out<<"         </PointData>\n";
-   out<<"      </Piece>\n";
-   out<<"   </UnstructuredGrid>\n";
-   out<<"</VTKFile>";
-   out<<endl;
-   out.close();
-   UBLOG(logDEBUG1,"WbWriterVtkXmlASCII::writeOctsWithNodeData to "<<vtkfilename<<" - end");
-
-   return vtkfilename;
+    string vtkfilename = filename + getFileExtension();
+    UBLOG(logDEBUG1, "WbWriterVtkXmlASCII::writeOctsWithNodeData to " << vtkfilename << " - start");
+
+    std::ofstream out(vtkfilename.c_str());
+    if (!out) {
+        out.clear(); // flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
+        string path = UbSystem::getPathFromString(vtkfilename);
+        if (path.size() > 0) {
+            UbSystem::makeDirectory(path);
+            out.open(vtkfilename.c_str());
+        }
+        if (!out)
+            throw UbException(UB_EXARGS, "couldn't open file " + vtkfilename);
+    }
+
+    int nofNodes = (int)nodes.size();
+    int nofCells = (int)cells.size();
+
+    // VTK FILE
+    out << "<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\" >"
+        << "\n";
+    out << "   <UnstructuredGrid>"
+        << "\n";
+    out << "      <Piece NumberOfPoints=\"" << nofNodes << "\"	NumberOfCells=\"" << nofCells << "\">   \n";
+
+    // POINTS SECTION
+    out << "         <Points>\n";
+    out << "            <DataArray type=\"Float32\" NumberOfComponents=\"3\" format=\"ascii\">\n               ";
+    for (int n = 0; n < nofNodes; n++)
+        out << val<1>(nodes[n]) << " " << val<2>(nodes[n]) << " " << val<3>(nodes[n]) << " ";
+
+    out << "\n";
+    out << "            </DataArray>\n";
+    out << "         </Points>\n";
+
+    // CELLS SECTION
+    out << "         <Cells>\n";
+    out << "            <DataArray type=\"Int32\" Name=\"connectivity\" format=\"ascii\">\n              ";
+
+    for (int c = 0; c < nofCells; c++)
+        out << val<1>(cells[c]) << " " << val<2>(cells[c]) << " " << val<4>(cells[c]) << " " << val<3>(cells[c]) << " "
+            << val<5>(cells[c]) << " " << val<6>(cells[c]) << " " << val<8>(cells[c]) << " " << val<7>(cells[c])
+            << "  ";
+
+    out << "\n";
+    out << "            </DataArray>\n";
+    out << "            <DataArray type=\"Int32\" Name=\"offsets\" format=\"ascii\">\n              ";
+    for (int c = 1; c < nofCells + 1; c++)
+        out << c * 8 << " ";
+
+    out << "\n";
+    out << "            </DataArray>\n";
+
+    out << "            <DataArray type=\"UInt8\" Name=\"types\" format=\"ascii\">\n              ";
+
+    for (int c = 0; c < nofCells; c++)
+        out << "11 ";
+    out << "\n";
+    out << "            </DataArray>\n";
+
+    out << "         </Cells>\n";
+
+    // write PointData section
+    out << "         <PointData Scalars=\"PScalars\"> \n";
+    for (int s = 0; s < (int)datanames.size(); ++s) {
+        out << "           <DataArray type=\"Float64\" Name=\"" << datanames[s] << "\" format=\"ascii\">";
+
+        for (int d = 0; d < (int)nodedata[s].size(); d++) {
+            // out<<base64_encode((unsigned char*)(&nodedata[s][d]),sizeof(float));
+            // out.write((char*)&nodedata[s][d],sizeof(float));
+            out << nodedata[s][d] << " ";
+        }
+        out << "</DataArray>\n";
+    }
+    out << "         </PointData>\n";
+    out << "      </Piece>\n";
+    out << "   </UnstructuredGrid>\n";
+    out << "</VTKFile>";
+    out << endl;
+    out.close();
+    UBLOG(logDEBUG1, "WbWriterVtkXmlASCII::writeOctsWithNodeData to " << vtkfilename << " - end");
+
+    return vtkfilename;
 }
 /*===============================================================================*/
-std::string WbWriterVtkXmlASCII::writeOcts(const string& filename,vector< UbTupleFloat3 >& nodes, vector< UbTupleInt8 >& cells)
+std::string WbWriterVtkXmlASCII::writeOcts(const string &filename, vector<UbTupleFloat3> &nodes,
+                                           vector<UbTupleInt8> &cells)
 {
-   string vtkfilename=filename+getFileExtension();
-   UBLOG(logDEBUG1,"WbWriterVtkXmlASCII::writeOcts to "<<vtkfilename<<" - start");
-
-   std::ofstream out(vtkfilename.c_str());
-   if(!out)
-   { 
-      out.clear(); //flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
-      string path = UbSystem::getPathFromString(vtkfilename);
-      if(path.size()>0){UbSystem::makeDirectory(path);out.open(vtkfilename.c_str());}
-      if(!out) throw UbException(UB_EXARGS,"couldn't open file "+vtkfilename);
-   }
-
-   int nofNodes = (int)nodes.size(); 
-   int nofCells = (int)cells.size(); 
-
-   //VTK FILE
-   out<<"<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\" >"<<"\n";
-   out<<"   <UnstructuredGrid>"<<"\n";
-   out<<"      <Piece NumberOfPoints=\""<<nofNodes<<"\"	NumberOfCells=\""<<nofCells<<"\">   \n";
-
-   //POINTS SECTION
-   out<<"         <Points>\n"; 
-   out<<"            <DataArray type=\"Float32\" NumberOfComponents=\"3\" format=\"ascii\">\n               ";
-   for(int n=0; n<nofNodes; n++)
-      out<< val<1>(nodes[n]) <<" "<< val<2>(nodes[n]) <<" "<< val<3>(nodes[n]) <<"   ";
-
-   out<<"\n";
-   out<<"            </DataArray>\n";
-   out<<"         </Points>\n";
-
-   //CELLS SECTION
-   out<<"         <Cells>\n";
-   out<<"            <DataArray type=\"Int32\" Name=\"connectivity\" format=\"ascii\">\n              ";
-
-   for(int c=0; c<nofCells; c++)
-      out<< val<1>(cells[c]) <<" "
-         << val<2>(cells[c]) <<" "
-         << val<4>(cells[c]) <<" "
-         << val<3>(cells[c]) <<" "
-         << val<5>(cells[c]) <<" "
-         << val<6>(cells[c]) <<" "
-         << val<8>(cells[c]) <<" "
-         << val<7>(cells[c]) <<"   ";
-   out<<"\n";
-   out<<"            </DataArray>\n";
-   out<<"            <DataArray type=\"Int32\" Name=\"offsets\" format=\"ascii\">\n              ";
-   for(int c=1; c<nofCells+1; c++)
-      out<<c*8<<" " ;
-
-   out<<"\n";
-   out<<"            </DataArray>\n";
-
-   out<<"            <DataArray type=\"UInt8\" Name=\"types\" format=\"ascii\">\n              ";
-
-   for(int c=0; c<nofCells; c++)
-      out<<"11 ";
-   out<<"\n";
-   out<<"            </DataArray>\n";
-   out<<"         </Cells>\n";
-   out<<"      </Piece>\n";
-   out<<"   </UnstructuredGrid>\n";
-   out<<"</VTKFile>";
-   out<<endl;
-   out.close();
-   UBLOG(logDEBUG1,"WbWriterVtkXmlASCII::writeOcts to "<<vtkfilename<<" - end");
-
-   return vtkfilename;
+    string vtkfilename = filename + getFileExtension();
+    UBLOG(logDEBUG1, "WbWriterVtkXmlASCII::writeOcts to " << vtkfilename << " - start");
+
+    std::ofstream out(vtkfilename.c_str());
+    if (!out) {
+        out.clear(); // flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
+        string path = UbSystem::getPathFromString(vtkfilename);
+        if (path.size() > 0) {
+            UbSystem::makeDirectory(path);
+            out.open(vtkfilename.c_str());
+        }
+        if (!out)
+            throw UbException(UB_EXARGS, "couldn't open file " + vtkfilename);
+    }
+
+    int nofNodes = (int)nodes.size();
+    int nofCells = (int)cells.size();
+
+    // VTK FILE
+    out << "<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\" >"
+        << "\n";
+    out << "   <UnstructuredGrid>"
+        << "\n";
+    out << "      <Piece NumberOfPoints=\"" << nofNodes << "\"	NumberOfCells=\"" << nofCells << "\">   \n";
+
+    // POINTS SECTION
+    out << "         <Points>\n";
+    out << "            <DataArray type=\"Float32\" NumberOfComponents=\"3\" format=\"ascii\">\n               ";
+    for (int n = 0; n < nofNodes; n++)
+        out << val<1>(nodes[n]) << " " << val<2>(nodes[n]) << " " << val<3>(nodes[n]) << "   ";
+
+    out << "\n";
+    out << "            </DataArray>\n";
+    out << "         </Points>\n";
+
+    // CELLS SECTION
+    out << "         <Cells>\n";
+    out << "            <DataArray type=\"Int32\" Name=\"connectivity\" format=\"ascii\">\n              ";
+
+    for (int c = 0; c < nofCells; c++)
+        out << val<1>(cells[c]) << " " << val<2>(cells[c]) << " " << val<4>(cells[c]) << " " << val<3>(cells[c]) << " "
+            << val<5>(cells[c]) << " " << val<6>(cells[c]) << " " << val<8>(cells[c]) << " " << val<7>(cells[c])
+            << "   ";
+    out << "\n";
+    out << "            </DataArray>\n";
+    out << "            <DataArray type=\"Int32\" Name=\"offsets\" format=\"ascii\">\n              ";
+    for (int c = 1; c < nofCells + 1; c++)
+        out << c * 8 << " ";
+
+    out << "\n";
+    out << "            </DataArray>\n";
+
+    out << "            <DataArray type=\"UInt8\" Name=\"types\" format=\"ascii\">\n              ";
+
+    for (int c = 0; c < nofCells; c++)
+        out << "11 ";
+    out << "\n";
+    out << "            </DataArray>\n";
+    out << "         </Cells>\n";
+    out << "      </Piece>\n";
+    out << "   </UnstructuredGrid>\n";
+    out << "</VTKFile>";
+    out << endl;
+    out.close();
+    UBLOG(logDEBUG1, "WbWriterVtkXmlASCII::writeOcts to " << vtkfilename << " - end");
+
+    return vtkfilename;
 }
-std::string WbWriterVtkXmlASCII::writeNodes(const std::string& filename,std::vector< UbTupleFloat3 >& nodes)
+std::string WbWriterVtkXmlASCII::writeNodes(const std::string &filename, std::vector<UbTupleFloat3> &nodes)
 {
-   string vtkfilename=filename+getFileExtension();
-   UBLOG(logDEBUG1,"WbWriterVtkXmlASCII::writeLines to "<<vtkfilename<<" - start");
-
-   std::ofstream out(vtkfilename.c_str());
-   if(!out)
-   { 
-      out.clear(); //flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
-      string path = UbSystem::getPathFromString(vtkfilename);
-      if(path.size()>0){UbSystem::makeDirectory(path);out.open(vtkfilename.c_str());}
-      if(!out) throw UbException(UB_EXARGS,"couldn't open file "+vtkfilename);
-   }
-
-   int nofNodes = (int)nodes.size(); 
-
-   //VTK FILE
-   out<<"<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\" >"<<"\n";
-   out<<"   <UnstructuredGrid>"<<"\n";
-   out<<"      <Piece NumberOfPoints=\""<<nofNodes<<"\"	NumberOfCells=\""<<nofNodes<<"\">   \n";
-
-   //POINTS SECTION
-   out<<"      <Points>\n"; 
-   out<<"         <DataArray type=\"Float32\" NumberOfComponents=\"3\" format=\"ascii\">\n";
-   for(int n=0; n<nofNodes; n++)
-      out<< val<1>(nodes[n]) <<" "<< val<2>(nodes[n]) <<" "<< val<3>(nodes[n]) <<"   ";
-
-   out<<"\n";
-   out<<"         </DataArray>\n";
-   out<<"      </Points>\n";
-
-   //CELLS SECTION
-   out<<"      <Cells>\n";
-   out<<"         <DataArray type=\"Int32\" Name=\"connectivity\" format=\"ascii\">\n";
-   for(int n=0; n<nofNodes; n++)
-      out<< n << "  ";
-   out<<"\n";
-
-   out<<"      </DataArray>\n";
-   out<<"         <DataArray type=\"Int32\" Name=\"offsets\" format=\"ascii\">\n";
-   for(int n=1; n<=nofNodes; n++)
-      out << n << " ";
-
-   out<<"\n";
-   out<<"         </DataArray>\n";
-
-   out<<"      <DataArray type=\"UInt8\" Name=\"types\" format=\"ascii\">\n";
-
-   for(int n=0; n<nofNodes; n++)
-      out<<"1 ";
-   out<<"\n";
-   out<<"      </DataArray>\n";
-   out<<"      </Cells>\n";
-   out<<"      </Piece>\n";
-   out<<"   </UnstructuredGrid>\n";
-   out<<"</VTKFile>";
-   out<<endl;
-   out.close();
-   UBLOG(logDEBUG1,"WbWriterVtkXmlASCII::writeLines to "<<vtkfilename<<" - end");
-
-   return vtkfilename;
+    string vtkfilename = filename + getFileExtension();
+    UBLOG(logDEBUG1, "WbWriterVtkXmlASCII::writeLines to " << vtkfilename << " - start");
+
+    std::ofstream out(vtkfilename.c_str());
+    if (!out) {
+        out.clear(); // flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
+        string path = UbSystem::getPathFromString(vtkfilename);
+        if (path.size() > 0) {
+            UbSystem::makeDirectory(path);
+            out.open(vtkfilename.c_str());
+        }
+        if (!out)
+            throw UbException(UB_EXARGS, "couldn't open file " + vtkfilename);
+    }
+
+    int nofNodes = (int)nodes.size();
+
+    // VTK FILE
+    out << "<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\" >"
+        << "\n";
+    out << "   <UnstructuredGrid>"
+        << "\n";
+    out << "      <Piece NumberOfPoints=\"" << nofNodes << "\"	NumberOfCells=\"" << nofNodes << "\">   \n";
+
+    // POINTS SECTION
+    out << "      <Points>\n";
+    out << "         <DataArray type=\"Float32\" NumberOfComponents=\"3\" format=\"ascii\">\n";
+    for (int n = 0; n < nofNodes; n++)
+        out << val<1>(nodes[n]) << " " << val<2>(nodes[n]) << " " << val<3>(nodes[n]) << "   ";
+
+    out << "\n";
+    out << "         </DataArray>\n";
+    out << "      </Points>\n";
+
+    // CELLS SECTION
+    out << "      <Cells>\n";
+    out << "         <DataArray type=\"Int32\" Name=\"connectivity\" format=\"ascii\">\n";
+    for (int n = 0; n < nofNodes; n++)
+        out << n << "  ";
+    out << "\n";
+
+    out << "      </DataArray>\n";
+    out << "         <DataArray type=\"Int32\" Name=\"offsets\" format=\"ascii\">\n";
+    for (int n = 1; n <= nofNodes; n++)
+        out << n << " ";
+
+    out << "\n";
+    out << "         </DataArray>\n";
+
+    out << "      <DataArray type=\"UInt8\" Name=\"types\" format=\"ascii\">\n";
+
+    for (int n = 0; n < nofNodes; n++)
+        out << "1 ";
+    out << "\n";
+    out << "      </DataArray>\n";
+    out << "      </Cells>\n";
+    out << "      </Piece>\n";
+    out << "   </UnstructuredGrid>\n";
+    out << "</VTKFile>";
+    out << endl;
+    out.close();
+    UBLOG(logDEBUG1, "WbWriterVtkXmlASCII::writeLines to " << vtkfilename << " - end");
+
+    return vtkfilename;
 }
-std::string WbWriterVtkXmlASCII::writeNodesWithNodeData(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector<std::string >& datanames, std::vector<std::vector<double > >& nodedata)
+std::string WbWriterVtkXmlASCII::writeNodesWithNodeData(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                                                        std::vector<std::string> &datanames,
+                                                        std::vector<std::vector<double>> &nodedata)
 {
-   string vtkfilename=filename+getFileExtension();
-   UBLOG(logDEBUG1,"WbWriterVtkXmlASCII::writeNodesWithNodeData to "<<vtkfilename<<" - start");
-
-   std::ofstream out(vtkfilename.c_str());
-   if(!out)
-   { 
-      out.clear(); //flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
-      string path = UbSystem::getPathFromString(vtkfilename);
-      if(path.size()>0){UbSystem::makeDirectory(path);out.open(vtkfilename.c_str());}
-      if(!out) throw UbException(UB_EXARGS,"couldn't open file "+vtkfilename);
-   }
-
-   int nofNodes = (int)nodes.size(); 
-
-   //VTK FILE
-   out<<"<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\" >"<<"\n";
-   out<<"   <UnstructuredGrid>"<<"\n";
-   out<<"      <Piece NumberOfPoints=\""<<nofNodes<<"\"	NumberOfCells=\""<<nofNodes<<"\">   \n";
-
-   //POINTS SECTION
-   out<<"         <Points>\n"; 
-   out<<"            <DataArray type=\"Float32\" NumberOfComponents=\"3\" format=\"ascii\">\n               ";
-   for(int n=0; n<nofNodes; n++)
-      out<< val<1>(nodes[n]) <<" "<< val<2>(nodes[n]) <<" "<< val<3>(nodes[n]) <<"   ";
-
-   out<<"\n";
-   out<<"            </DataArray>\n";
-   out<<"         </Points>\n";
-
-   //CELLS SECTION
-   out<<"         <Cells>\n";
-   out<<"            <DataArray type=\"Int32\" Name=\"connectivity\" format=\"ascii\">\n              ";
-
-   for(int c=0; c<nofNodes; c++)
-      out << c <<"   ";
-   out<<"\n";
-
-   out<<"            </DataArray>\n";
-   out<<"            <DataArray type=\"Int32\" Name=\"offsets\" format=\"ascii\">\n              ";
-   for(int c=1; c<nofNodes+1; c++)
-      out<<c<<" " ;
-
-   out<<"\n";
-   out<<"            </DataArray>\n";
-
-   out<<"            <DataArray type=\"UInt8\" Name=\"types\" format=\"ascii\">\n              ";
-   for(int c=0; c<nofNodes; c++)
-      out<<"1 ";
-
-   out<<"\n";
-   out<<"            </DataArray>\n";
-
-   out<<"         </Cells>\n";
-
-   //write data section
-   out<<"         <PointData Scalars=\"Scalars\"> \n";
-   for(int s=0; s<(int)datanames.size(); ++s)
-   {
-      out<< "           <DataArray type=\"Float32\" Name=\""<< datanames[s] <<"\" format=\"ascii\"> \n";
-
-      for(int d=0; d<(int)nodedata[s].size(); d++)
-         out<<nodedata[s][d]<<" ";
-
-      out<<"\n          </DataArray>\n";
-   }
-   out<<"         </PointData>\n";
-   out<<"      </Piece>\n";
-   out<<"   </UnstructuredGrid>\n";
-   out<<"</VTKFile>";
-   out<<endl;
-   out.close();
-   out.close();
-   UBLOG(logDEBUG1,"WbWriterVtkXmlASCII::writeNodesWithNodeData to "<<vtkfilename<<" - end");
-
-   return vtkfilename;
+    string vtkfilename = filename + getFileExtension();
+    UBLOG(logDEBUG1, "WbWriterVtkXmlASCII::writeNodesWithNodeData to " << vtkfilename << " - start");
+
+    std::ofstream out(vtkfilename.c_str());
+    if (!out) {
+        out.clear(); // flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
+        string path = UbSystem::getPathFromString(vtkfilename);
+        if (path.size() > 0) {
+            UbSystem::makeDirectory(path);
+            out.open(vtkfilename.c_str());
+        }
+        if (!out)
+            throw UbException(UB_EXARGS, "couldn't open file " + vtkfilename);
+    }
+
+    int nofNodes = (int)nodes.size();
+
+    // VTK FILE
+    out << "<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\" >"
+        << "\n";
+    out << "   <UnstructuredGrid>"
+        << "\n";
+    out << "      <Piece NumberOfPoints=\"" << nofNodes << "\"	NumberOfCells=\"" << nofNodes << "\">   \n";
+
+    // POINTS SECTION
+    out << "         <Points>\n";
+    out << "            <DataArray type=\"Float32\" NumberOfComponents=\"3\" format=\"ascii\">\n               ";
+    for (int n = 0; n < nofNodes; n++)
+        out << val<1>(nodes[n]) << " " << val<2>(nodes[n]) << " " << val<3>(nodes[n]) << "   ";
+
+    out << "\n";
+    out << "            </DataArray>\n";
+    out << "         </Points>\n";
+
+    // CELLS SECTION
+    out << "         <Cells>\n";
+    out << "            <DataArray type=\"Int32\" Name=\"connectivity\" format=\"ascii\">\n              ";
+
+    for (int c = 0; c < nofNodes; c++)
+        out << c << "   ";
+    out << "\n";
+
+    out << "            </DataArray>\n";
+    out << "            <DataArray type=\"Int32\" Name=\"offsets\" format=\"ascii\">\n              ";
+    for (int c = 1; c < nofNodes + 1; c++)
+        out << c << " ";
+
+    out << "\n";
+    out << "            </DataArray>\n";
+
+    out << "            <DataArray type=\"UInt8\" Name=\"types\" format=\"ascii\">\n              ";
+    for (int c = 0; c < nofNodes; c++)
+        out << "1 ";
+
+    out << "\n";
+    out << "            </DataArray>\n";
+
+    out << "         </Cells>\n";
+
+    // write data section
+    out << "         <PointData Scalars=\"Scalars\"> \n";
+    for (int s = 0; s < (int)datanames.size(); ++s) {
+        out << "           <DataArray type=\"Float32\" Name=\"" << datanames[s] << "\" format=\"ascii\"> \n";
+
+        for (int d = 0; d < (int)nodedata[s].size(); d++)
+            out << nodedata[s][d] << " ";
+
+        out << "\n          </DataArray>\n";
+    }
+    out << "         </PointData>\n";
+    out << "      </Piece>\n";
+    out << "   </UnstructuredGrid>\n";
+    out << "</VTKFile>";
+    out << endl;
+    out.close();
+    out.close();
+    UBLOG(logDEBUG1, "WbWriterVtkXmlASCII::writeNodesWithNodeData to " << vtkfilename << " - end");
+
+    return vtkfilename;
 }
 
 //////////////////////////////////////////////////////////////////////////
-std::string WbWriterVtkXmlASCII::writeNodesWithNodeDataDouble(const std::string& filename,std::vector< UbTupleDouble3 >& nodes, std::vector<std::string >& datanames, std::vector<std::vector<double > >& nodedata)
+std::string WbWriterVtkXmlASCII::writeNodesWithNodeDataDouble(const std::string &filename,
+                                                              std::vector<UbTupleDouble3> &nodes,
+                                                              std::vector<std::string> &datanames,
+                                                              std::vector<std::vector<double>> &nodedata)
 {
-   string vtkfilename=filename+getFileExtension();
-   UBLOG(logDEBUG1,"WbWriterVtkXmlASCII::writeNodesWithNodeData to "<<vtkfilename<<" - start");
-
-   std::ofstream out(vtkfilename.c_str());
-   out.precision (std::numeric_limits<double>::digits10 + 1);
-   if(!out)
-   { 
-      out.clear(); //flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
-      string path = UbSystem::getPathFromString(vtkfilename);
-      if(path.size()>0){UbSystem::makeDirectory(path);out.open(vtkfilename.c_str());}
-      if(!out) throw UbException(UB_EXARGS,"couldn't open file "+vtkfilename);
-   }
-
-   int nofNodes = (int)nodes.size(); 
-
-   //VTK FILE
-   out<<"<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\" >"<<"\n";
-   out<<"   <UnstructuredGrid>"<<"\n";
-   out<<"      <Piece NumberOfPoints=\""<<nofNodes<<"\"	NumberOfCells=\""<<nofNodes<<"\">   \n";
-
-   //POINTS SECTION
-   out<<"         <Points>\n"; 
-   out<<"            <DataArray type=\"Float64\" NumberOfComponents=\"3\" format=\"ascii\">\n               ";
-   for(int n=0; n<nofNodes; n++)
-      out<< val<1>(nodes[n]) <<" "<< val<2>(nodes[n]) <<" "<< val<3>(nodes[n]) <<"   ";
-
-   out<<"\n";
-   out<<"            </DataArray>\n";
-   out<<"         </Points>\n";
-
-   //CELLS SECTION
-   out<<"         <Cells>\n";
-   out<<"            <DataArray type=\"Int32\" Name=\"connectivity\" format=\"ascii\">\n              ";
-
-   for(int c=0; c<nofNodes; c++)
-      out << c <<"   ";
-   out<<"\n";
-
-   out<<"            </DataArray>\n";
-   out<<"            <DataArray type=\"Int64\" Name=\"offsets\" format=\"ascii\">\n              ";
-   for(int c=1; c<nofNodes+1; c++)
-      out<<c<<" " ;
-
-   out<<"\n";
-   out<<"            </DataArray>\n";
-
-   out<<"            <DataArray type=\"UInt8\" Name=\"types\" format=\"ascii\">\n              ";
-   for(int c=0; c<nofNodes; c++)
-      out<<"1 ";
-
-   out<<"\n";
-   out<<"            </DataArray>\n";
-
-   out<<"         </Cells>\n";
-
-   //write data section
-   out<<"         <PointData Scalars=\"Scalars\"> \n";
-   for(int s=0; s<(int)datanames.size(); ++s)
-   {
-      out<< "           <DataArray type=\"Float64\" Name=\""<< datanames[s] <<"\" format=\"ascii\"> \n";
-
-      for(int d=0; d<(int)nodedata[s].size(); d++)
-         out<<nodedata[s][d]<<" ";
-
-      out<<"\n          </DataArray>\n";
-   }
-   out<<"         </PointData>\n";
-   out<<"      </Piece>\n";
-   out<<"   </UnstructuredGrid>\n";
-   out<<"</VTKFile>";
-   out<<endl;
-   out.close();
-   out.close();
-   UBLOG(logDEBUG1,"WbWriterVtkXmlASCII::writeNodesWithNodeData to "<<vtkfilename<<" - end");
-
-   return vtkfilename;
+    string vtkfilename = filename + getFileExtension();
+    UBLOG(logDEBUG1, "WbWriterVtkXmlASCII::writeNodesWithNodeData to " << vtkfilename << " - start");
+
+    std::ofstream out(vtkfilename.c_str());
+    out.precision(std::numeric_limits<double>::digits10 + 1);
+    if (!out) {
+        out.clear(); // flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
+        string path = UbSystem::getPathFromString(vtkfilename);
+        if (path.size() > 0) {
+            UbSystem::makeDirectory(path);
+            out.open(vtkfilename.c_str());
+        }
+        if (!out)
+            throw UbException(UB_EXARGS, "couldn't open file " + vtkfilename);
+    }
+
+    int nofNodes = (int)nodes.size();
+
+    // VTK FILE
+    out << "<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\" >"
+        << "\n";
+    out << "   <UnstructuredGrid>"
+        << "\n";
+    out << "      <Piece NumberOfPoints=\"" << nofNodes << "\"	NumberOfCells=\"" << nofNodes << "\">   \n";
+
+    // POINTS SECTION
+    out << "         <Points>\n";
+    out << "            <DataArray type=\"Float64\" NumberOfComponents=\"3\" format=\"ascii\">\n               ";
+    for (int n = 0; n < nofNodes; n++)
+        out << val<1>(nodes[n]) << " " << val<2>(nodes[n]) << " " << val<3>(nodes[n]) << "   ";
+
+    out << "\n";
+    out << "            </DataArray>\n";
+    out << "         </Points>\n";
+
+    // CELLS SECTION
+    out << "         <Cells>\n";
+    out << "            <DataArray type=\"Int32\" Name=\"connectivity\" format=\"ascii\">\n              ";
+
+    for (int c = 0; c < nofNodes; c++)
+        out << c << "   ";
+    out << "\n";
+
+    out << "            </DataArray>\n";
+    out << "            <DataArray type=\"Int64\" Name=\"offsets\" format=\"ascii\">\n              ";
+    for (int c = 1; c < nofNodes + 1; c++)
+        out << c << " ";
+
+    out << "\n";
+    out << "            </DataArray>\n";
+
+    out << "            <DataArray type=\"UInt8\" Name=\"types\" format=\"ascii\">\n              ";
+    for (int c = 0; c < nofNodes; c++)
+        out << "1 ";
+
+    out << "\n";
+    out << "            </DataArray>\n";
+
+    out << "         </Cells>\n";
+
+    // write data section
+    out << "         <PointData Scalars=\"Scalars\"> \n";
+    for (int s = 0; s < (int)datanames.size(); ++s) {
+        out << "           <DataArray type=\"Float64\" Name=\"" << datanames[s] << "\" format=\"ascii\"> \n";
+
+        for (int d = 0; d < (int)nodedata[s].size(); d++)
+            out << nodedata[s][d] << " ";
+
+        out << "\n          </DataArray>\n";
+    }
+    out << "         </PointData>\n";
+    out << "      </Piece>\n";
+    out << "   </UnstructuredGrid>\n";
+    out << "</VTKFile>";
+    out << endl;
+    out.close();
+    out.close();
+    UBLOG(logDEBUG1, "WbWriterVtkXmlASCII::writeNodesWithNodeData to " << vtkfilename << " - end");
+
+    return vtkfilename;
 }
diff --git a/src/basics/basics/writer/WbWriterVtkXmlASCII.h b/src/basics/basics/writer/WbWriterVtkXmlASCII.h
index 11b557287ba6f880c889c3a4082dfc6446cfeb66..ac031f2ff3b10a38af0c938edb3f971060b55f01 100644
--- a/src/basics/basics/writer/WbWriterVtkXmlASCII.h
+++ b/src/basics/basics/writer/WbWriterVtkXmlASCII.h
@@ -1,28 +1,28 @@
 //=======================================================================================
-// ____          ____    __    ______     __________   __      __       __        __         
-// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |        
-//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |        
-//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |        
-//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____    
-//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|   
-//      \    \  |    |   ________________________________________________________________    
-//       \    \ |    |  |  ______________________________________________________________|   
-//        \    \|    |  |  |         __          __     __     __     ______      _______    
-//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)   
-//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______    
+// ____          ____    __    ______     __________   __      __       __        __
+// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |
+//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |
+//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |
+//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____
+//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|
+//      \    \  |    |   ________________________________________________________________
+//       \    \ |    |  |  ______________________________________________________________|
+//        \    \|    |  |  |         __          __     __     __     ______      _______
+//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)
+//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______
 //           \       |  |  |        |  |_____   |   \_/   |   |  |   |  |_/  /    _____  |
-//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/   
+//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/
 //
-//  This file is part of VirtualFluids. VirtualFluids is free software: you can 
+//  This file is part of VirtualFluids. VirtualFluids is free software: you can
 //  redistribute it and/or modify it under the terms of the GNU General Public
-//  License as published by the Free Software Foundation, either version 3 of 
+//  License as published by the Free Software Foundation, either version 3 of
 //  the License, or (at your option) any later version.
-//  
-//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT 
-//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
-//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License 
+//
+//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT
+//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 //  for more details.
-//  
+//
 //  You should have received a copy of the GNU General Public License along
 //  with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>.
 //
@@ -37,89 +37,117 @@
 
 #include <basics/writer/WbWriter.h>
 
-class WbWriterVtkXmlASCII  : public WbWriter
+class WbWriterVtkXmlASCII : public WbWriter
 {
 public:
-   static WbWriterVtkXmlASCII* getInstance()
-   {
-      static WbWriterVtkXmlASCII instance;
-      return &instance;
-   }
+    static WbWriterVtkXmlASCII *getInstance()
+    {
+        static WbWriterVtkXmlASCII instance;
+        return &instance;
+    }
 
-   WbWriterVtkXmlASCII( const WbWriterVtkXmlASCII& ) = delete;
-   const WbWriterVtkXmlASCII& operator=( const WbWriterVtkXmlASCII& ) = delete;
+    WbWriterVtkXmlASCII(const WbWriterVtkXmlASCII &) = delete;
+    const WbWriterVtkXmlASCII &operator=(const WbWriterVtkXmlASCII &) = delete;
 
 private:
-   WbWriterVtkXmlASCII() : WbWriter() 
-   {
-      if(sizeof(unsigned char)!=1) throw UbException(UB_EXARGS,"error char  type mismatch");
-      if(sizeof(int)          !=4) throw UbException(UB_EXARGS,"error int   type mismatch");
-      if(sizeof(float)        !=4) throw UbException(UB_EXARGS,"error float type mismatch");
-   }
-
-   static std::string  pvdEndTag;
+    WbWriterVtkXmlASCII() : WbWriter()
+    {
+        if (sizeof(unsigned char) != 1)
+            throw UbException(UB_EXARGS, "error char  type mismatch");
+        if (sizeof(int) != 4)
+            throw UbException(UB_EXARGS, "error int   type mismatch");
+        if (sizeof(float) != 4)
+            throw UbException(UB_EXARGS, "error float type mismatch");
+    }
+
+    static std::string pvdEndTag;
 
 public:
-   std::string getFileExtension() override { return ".ascii.vtu"; }
-
-   //write a metafile 
-   std::string writeCollection(const std::string& filename, const std::vector<std::string>& filenames, const double& timesteps, const bool& sepGroups);//std::vector<double>& groups, std::vector<double>& parts);
-   std::string addFilesToCollection(const std::string& filename, const std::vector<std::string>& filenames, const double& timestep, const bool& sepGroups);
-   std::string writeParallelFile(const std::string& filename,std::vector<std::string>& pieceSources, std::vector<std::string>& pointDataNames, std::vector<std::string>& cellDataNames);
-
-   //////////////////////////////////////////////////////////////////////////
-   //nodes
-   std::string writeNodes(const std::string& filename,std::vector< UbTupleFloat3 >& nodes) override;
-   std::string writeNodesWithNodeData(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector<std::string >& datanames, std::vector<std::vector<double > >& nodedata) override;
-   std::string writeNodesWithNodeDataDouble(const std::string& filename,std::vector< UbTupleDouble3 >& nodes, std::vector<std::string >& datanames, std::vector<std::vector<double > >& nodedata) override;
-
-   //////////////////////////////////////////////////////////////////////////
-   //lines
-   //     0 ---- 1
-   //nodenumbering must start with 0!
-   std::string writeLines(const std::string& filename,std::vector<UbTupleFloat3 >& nodes, std::vector<UbTupleInt2 >& lines) override;
-   //std::string writeLinesWithNodeData(const std::string& filename,std::vector<UbTupleFloat3 >& nodes, std::vector<UbTupleInt2 >& lines, std::vector< std::string >& datanames, std::vector< std::vector< double > >& nodedata);
-   //FIXME: hides function in base class
-
-   //////////////////////////////////////////////////////////////////////////
-   //triangles
-   //                    2
-   //                     
-   //                  0---1
-   //nodenumbering must start with 0!
-   std::string writeTriangles(const std::string& filename,std::vector<UbTupleFloat3 >& nodes, std::vector<UbTupleInt3 >& triangles) override;
-   std::string writeTrianglesWithNodeData(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt3 >& cells, std::vector< std::string >& datanames, std::vector< std::vector< double > >& nodedata) override;
-
-   //////////////////////////////////////////////////////////////////////////
-   //2D
-   //cell numbering:
-   //                  3---2
-   //                  |   |
-   //                  0---1
-   //nodenumbering must start with 0!
-
-   std::string writeQuads(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt4 >& cells) override;
-   std::string writeQuadsWithNodeData(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt4 >& cells, std::vector< std::string >& datanames, std::vector< std::vector< double > >& nodedata) override;
-   std::string writeQuadsWithCellData(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt4 >& cells, std::vector< std::string >& datanames, std::vector< std::vector< double > >& celldata) override;
-   std::string writeQuadsWithNodeAndCellData(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt4 >& cells, 
-                                             std::vector< std::string >& nodedatanames, std::vector< std::vector< double > >& nodedata, std::vector< std::string >& celldatanames,
-                                             std::vector< std::vector< double > >& celldata) override;
-   
-   //////////////////////////////////////////////////////////////////////////
-   //octs
-   //     7 ---- 6
-   //    /|     /|
-   //   4 +--- 5 |
-   //   | |    | |
-   //   | 3 ---+ 2
-   //   |/     |/
-   //   0 ---- 1
-   std::string writeOcts(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt8 >& cells) override;
-   std::string writeOctsWithCellData(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt8 >& cells, std::vector< std::string >& datanames, std::vector< std::vector< double > >& celldata) override;
-   std::string writeOctsWithNodeData(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleUInt8 >& cells, std::vector< std::string >& datanames, std::vector< std::vector< double > >& nodedata) override;
+    std::string getFileExtension() override { return ".ascii.vtu"; }
+
+    // write a metafile
+    std::string writeCollection(const std::string &filename, const std::vector<std::string> &filenames,
+                                const double &timesteps,
+                                const bool &sepGroups); // std::vector<double>& groups, std::vector<double>& parts);
+    std::string addFilesToCollection(const std::string &filename, const std::vector<std::string> &filenames,
+                                     const double &timestep, const bool &sepGroups);
+    std::string writeParallelFile(const std::string &filename, std::vector<std::string> &pieceSources,
+                                  std::vector<std::string> &pointDataNames, std::vector<std::string> &cellDataNames);
+
+    //////////////////////////////////////////////////////////////////////////
+    // nodes
+    std::string writeNodes(const std::string &filename, std::vector<UbTupleFloat3> &nodes) override;
+    std::string writeNodesWithNodeData(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                                       std::vector<std::string> &datanames,
+                                       std::vector<std::vector<double>> &nodedata) override;
+    std::string writeNodesWithNodeDataDouble(const std::string &filename, std::vector<UbTupleDouble3> &nodes,
+                                             std::vector<std::string> &datanames,
+                                             std::vector<std::vector<double>> &nodedata) override;
+
+    //////////////////////////////////////////////////////////////////////////
+    // lines
+    //     0 ---- 1
+    // nodenumbering must start with 0!
+    std::string writeLines(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                           std::vector<UbTupleInt2> &lines) override;
+    // std::string writeLinesWithNodeData(const std::string& filename,std::vector<UbTupleFloat3 >& nodes,
+    // std::vector<UbTupleInt2 >& lines, std::vector< std::string >& datanames, std::vector< std::vector< double > >&
+    // nodedata);
+    // FIXME: hides function in base class
+
+    //////////////////////////////////////////////////////////////////////////
+    // triangles
+    //                    2
+    //
+    //                  0---1
+    // nodenumbering must start with 0!
+    std::string writeTriangles(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                               std::vector<UbTupleInt3> &triangles) override;
+    std::string writeTrianglesWithNodeData(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                                           std::vector<UbTupleInt3> &cells, std::vector<std::string> &datanames,
+                                           std::vector<std::vector<double>> &nodedata) override;
+
+    //////////////////////////////////////////////////////////////////////////
+    // 2D
+    // cell numbering:
+    //                  3---2
+    //                  |   |
+    //                  0---1
+    // nodenumbering must start with 0!
+
+    std::string writeQuads(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                           std::vector<UbTupleInt4> &cells) override;
+    std::string writeQuadsWithNodeData(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                                       std::vector<UbTupleInt4> &cells, std::vector<std::string> &datanames,
+                                       std::vector<std::vector<double>> &nodedata) override;
+    std::string writeQuadsWithCellData(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                                       std::vector<UbTupleInt4> &cells, std::vector<std::string> &datanames,
+                                       std::vector<std::vector<double>> &celldata) override;
+    std::string writeQuadsWithNodeAndCellData(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                                              std::vector<UbTupleInt4> &cells, std::vector<std::string> &nodedatanames,
+                                              std::vector<std::vector<double>> &nodedata,
+                                              std::vector<std::string> &celldatanames,
+                                              std::vector<std::vector<double>> &celldata) override;
+
+    //////////////////////////////////////////////////////////////////////////
+    // octs
+    //     7 ---- 6
+    //    /|     /|
+    //   4 +--- 5 |
+    //   | |    | |
+    //   | 3 ---+ 2
+    //   |/     |/
+    //   0 ---- 1
+    std::string writeOcts(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                          std::vector<UbTupleInt8> &cells) override;
+    std::string writeOctsWithCellData(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                                      std::vector<UbTupleInt8> &cells, std::vector<std::string> &datanames,
+                                      std::vector<std::vector<double>> &celldata) override;
+    std::string writeOctsWithNodeData(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                                      std::vector<UbTupleUInt8> &cells, std::vector<std::string> &datanames,
+                                      std::vector<std::vector<double>> &nodedata) override;
 
 private:
-
 };
 
-#endif //WBWRITERVTKXMLASCII_H
+#endif // WBWRITERVTKXMLASCII_H
diff --git a/src/basics/basics/writer/WbWriterVtkXmlBinary.cpp b/src/basics/basics/writer/WbWriterVtkXmlBinary.cpp
index d88459eb5ed8c0ec90348618a4834def954f965e..6731fa56026ca284ad671cb6ce59000a609bbb8c 100644
--- a/src/basics/basics/writer/WbWriterVtkXmlBinary.cpp
+++ b/src/basics/basics/writer/WbWriterVtkXmlBinary.cpp
@@ -1,28 +1,28 @@
 //=======================================================================================
-// ____          ____    __    ______     __________   __      __       __        __         
-// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |        
-//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |        
-//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |        
-//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____    
-//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|   
-//      \    \  |    |   ________________________________________________________________    
-//       \    \ |    |  |  ______________________________________________________________|   
-//        \    \|    |  |  |         __          __     __     __     ______      _______    
-//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)   
-//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______    
+// ____          ____    __    ______     __________   __      __       __        __
+// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |
+//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |
+//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |
+//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____
+//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|
+//      \    \  |    |   ________________________________________________________________
+//       \    \ |    |  |  ______________________________________________________________|
+//        \    \|    |  |  |         __          __     __     __     ______      _______
+//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)
+//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______
 //           \       |  |  |        |  |_____   |   \_/   |   |  |   |  |_/  /    _____  |
-//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/   
+//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/
 //
-//  This file is part of VirtualFluids. VirtualFluids is free software: you can 
+//  This file is part of VirtualFluids. VirtualFluids is free software: you can
 //  redistribute it and/or modify it under the terms of the GNU General Public
-//  License as published by the Free Software Foundation, either version 3 of 
+//  License as published by the Free Software Foundation, either version 3 of
 //  the License, or (at your option) any later version.
-//  
-//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT 
-//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
-//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License 
+//
+//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT
+//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 //  for more details.
-//  
+//
 //  You should have received a copy of the GNU General Public License along
 //  with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>.
 //
@@ -30,214 +30,234 @@
 //! \ingroup writer
 //! \author Soeren Freudiger, Sebastian Geller
 //=======================================================================================
-#include <basics/writer/WbWriterVtkXmlBinary.h>
-#include <basics/writer/WbWriterVtkXmlASCII.h>
 #include <basics/utilities/UbLogger.h>
+#include <basics/writer/WbWriterVtkXmlASCII.h>
+#include <basics/writer/WbWriterVtkXmlBinary.h>
 #include <cstring>
 
 using namespace std;
 
 /*===============================================================================*/
-const std::string WbWriterVtkXmlBinary::pvdEndTag ="   </Collection>\n</VTKFile>";
+const std::string WbWriterVtkXmlBinary::pvdEndTag = "   </Collection>\n</VTKFile>";
 /*===============================================================================*/
-string WbWriterVtkXmlBinary::writeCollection(const string& filename, const vector<string>& filenames, const double& timeStep, const bool& sepGroups)
+string WbWriterVtkXmlBinary::writeCollection(const string &filename, const vector<string> &filenames,
+                                             const double &timeStep, const bool &sepGroups)
 {
-   string vtkfilename=filename+".pvd";
-   ofstream out(vtkfilename.c_str());
-   if(!out)
-   { 
-      out.clear(); //flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
-      string path = UbSystem::getPathFromString(vtkfilename);
-      if(path.size()>0){ UbSystem::makeDirectory(path); out.open(vtkfilename.c_str());}
-      if(!out) throw UbException(UB_EXARGS,"couldn't open file "+vtkfilename);
-   }
-
-   string endian;
-   if(UbSystem::isLittleEndian()) endian = "LittleEndian";
-   else                           endian = "BigEndian";
-   out<<"<VTKFile type=\"Collection\" version=\"0.1\" byte_order=\""<<endian<<"\" >"<<endl;
-   out<<"   <Collection>"<<endl;
-   
-   int group = 0, part=0;
-   for(size_t i=0; i<filenames.size(); i++)
-   {
-      out<<"       <DataSet timestep=\""<<timeStep<<"\" group=\""<<group<<"\" part=\""<<part<<"\" file=\""<<filenames[i]<<"\"/>"<<endl;
-      if(sepGroups) group++;
-      else          part++;
-   }
-   out<<pvdEndTag;
-   out.close();
-
-   return vtkfilename;
+    string vtkfilename = filename + ".pvd";
+    ofstream out(vtkfilename.c_str());
+    if (!out) {
+        out.clear(); // flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
+        string path = UbSystem::getPathFromString(vtkfilename);
+        if (path.size() > 0) {
+            UbSystem::makeDirectory(path);
+            out.open(vtkfilename.c_str());
+        }
+        if (!out)
+            throw UbException(UB_EXARGS, "couldn't open file " + vtkfilename);
+    }
+
+    string endian;
+    if (UbSystem::isLittleEndian())
+        endian = "LittleEndian";
+    else
+        endian = "BigEndian";
+    out << "<VTKFile type=\"Collection\" version=\"0.1\" byte_order=\"" << endian << "\" >" << endl;
+    out << "   <Collection>" << endl;
+
+    int group = 0, part = 0;
+    for (size_t i = 0; i < filenames.size(); i++) {
+        out << "       <DataSet timestep=\"" << timeStep << "\" group=\"" << group << "\" part=\"" << part
+            << "\" file=\"" << filenames[i] << "\"/>" << endl;
+        if (sepGroups)
+            group++;
+        else
+            part++;
+    }
+    out << pvdEndTag;
+    out.close();
+
+    return vtkfilename;
 }
 /*===============================================================================*/
-string WbWriterVtkXmlBinary::addFilesToCollection(const string& filename, const vector<string>& filenames, const double& timeStep, const bool& sepGroups)
+string WbWriterVtkXmlBinary::addFilesToCollection(const string &filename, const vector<string> &filenames,
+                                                  const double &timeStep, const bool &sepGroups)
 {
-   string vtkfilename=filename;
-   fstream test(vtkfilename.c_str(), ios::in);
-   if(!test)
-   {
-      test.clear();
-      vtkfilename += ".pvd";
-      test.open(vtkfilename.c_str(), ios::in);
-      if(!test) return this->writeCollection(filename,filenames,timeStep,sepGroups);
-   }
- 
-   fstream out(vtkfilename.c_str(), ios::in | ios::out);
-   out.seekp(-(int)pvdEndTag.size()-1, ios_base::end);
-
-   int group = 0;
-   for(size_t i=0; i<filenames.size(); i++)
-   {
-      out<<"       <DataSet timestep=\""<<timeStep<<"\" group=\""<<group<<"\" part=\""<<i<<"\" file=\""<<filenames[i]<<"\"/>"<<endl;
-      if(sepGroups) group++;
-   }
-   out<<pvdEndTag;
-
-   return vtkfilename;
+    string vtkfilename = filename;
+    fstream test(vtkfilename.c_str(), ios::in);
+    if (!test) {
+        test.clear();
+        vtkfilename += ".pvd";
+        test.open(vtkfilename.c_str(), ios::in);
+        if (!test)
+            return this->writeCollection(filename, filenames, timeStep, sepGroups);
+    }
+
+    fstream out(vtkfilename.c_str(), ios::in | ios::out);
+    out.seekp(-(int)pvdEndTag.size() - 1, ios_base::end);
+
+    int group = 0;
+    for (size_t i = 0; i < filenames.size(); i++) {
+        out << "       <DataSet timestep=\"" << timeStep << "\" group=\"" << group << "\" part=\"" << i << "\" file=\""
+            << filenames[i] << "\"/>" << endl;
+        if (sepGroups)
+            group++;
+    }
+    out << pvdEndTag;
+
+    return vtkfilename;
 }
 /*===============================================================================*/
-string WbWriterVtkXmlBinary::writeParallelFile(const string& filename,vector<string>& pieceSources, vector<string>& pointDataNames, vector<string>& cellDataNames)
+string WbWriterVtkXmlBinary::writeParallelFile(const string &filename, vector<string> &pieceSources,
+                                               vector<string> &pointDataNames, vector<string> &cellDataNames)
 {
-   string vtkfilename=filename+".pvtu";
-   UBLOG(logDEBUG1,"WbWriterVtkXmlBinary::writeParallelFile to "<<vtkfilename<<" - start");
-
-   ofstream out(vtkfilename.c_str());
-   if(!out)
-   { 
-      out.clear(); //flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
-      string path = UbSystem::getPathFromString(vtkfilename);
-      if(path.size()>0){ UbSystem::makeDirectory(path); out.open(vtkfilename.c_str());}
-      if(!out) throw UbException(UB_EXARGS,"couldn't open file "+vtkfilename);
-   }
-
-   //VTK FILE
-   out<<"<VTKFile type=\"PUnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\">"<<"\n";
-   out<<"  <PUnstructuredGrid GhostLevel=\"0\">"<<"\n";
-   out<<"    <PPoints>\n"; 
-   out<<"      <PDataArray type=\"Float32\" NumberOfComponents=\"3\"/>\n";
-   out<<"    </PPoints>\n";
-   out<<"    <PPointData>\n";
-   for(size_t s=0; s<pointDataNames.size(); s++)
-      out<< "      <PDataArray type=\"Float32\" Name=\""<< pointDataNames[s] <<"\"/>\n";
-   out<<"    </PPointData>\n";
-   if (cellDataNames.size() > 0)
-   {
-      out<<"    <PCellData>\n";
-      for(size_t s=0; s<cellDataNames.size(); s++)
-         out<< "      <PDataArray type=\"Float32\" Name=\""<< cellDataNames[s] <<"\"/>\n";
-      out<<"    </PCellData>\n";
-   }
-
-   for(size_t s=0; s<pieceSources.size(); s++)
-      out<<"    <Piece Source=\""<<pieceSources[s]<<"\"/>\n";
-   out<<"  </PUnstructuredGrid>\n";
-   out<<"</VTKFile>";
-   out<<endl;
-   out.close();
-   UBLOG(logDEBUG1,"WbWriterVtkXmlBinary::writeParallelFile to "<<vtkfilename<<" - end");
-
-   return vtkfilename;
+    string vtkfilename = filename + ".pvtu";
+    UBLOG(logDEBUG1, "WbWriterVtkXmlBinary::writeParallelFile to " << vtkfilename << " - start");
+
+    ofstream out(vtkfilename.c_str());
+    if (!out) {
+        out.clear(); // flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
+        string path = UbSystem::getPathFromString(vtkfilename);
+        if (path.size() > 0) {
+            UbSystem::makeDirectory(path);
+            out.open(vtkfilename.c_str());
+        }
+        if (!out)
+            throw UbException(UB_EXARGS, "couldn't open file " + vtkfilename);
+    }
+
+    // VTK FILE
+    out << "<VTKFile type=\"PUnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\">"
+        << "\n";
+    out << "  <PUnstructuredGrid GhostLevel=\"0\">"
+        << "\n";
+    out << "    <PPoints>\n";
+    out << "      <PDataArray type=\"Float32\" NumberOfComponents=\"3\"/>\n";
+    out << "    </PPoints>\n";
+    out << "    <PPointData>\n";
+    for (size_t s = 0; s < pointDataNames.size(); s++)
+        out << "      <PDataArray type=\"Float32\" Name=\"" << pointDataNames[s] << "\"/>\n";
+    out << "    </PPointData>\n";
+    if (cellDataNames.size() > 0) {
+        out << "    <PCellData>\n";
+        for (size_t s = 0; s < cellDataNames.size(); s++)
+            out << "      <PDataArray type=\"Float32\" Name=\"" << cellDataNames[s] << "\"/>\n";
+        out << "    </PCellData>\n";
+    }
+
+    for (size_t s = 0; s < pieceSources.size(); s++)
+        out << "    <Piece Source=\"" << pieceSources[s] << "\"/>\n";
+    out << "  </PUnstructuredGrid>\n";
+    out << "</VTKFile>";
+    out << endl;
+    out.close();
+    UBLOG(logDEBUG1, "WbWriterVtkXmlBinary::writeParallelFile to " << vtkfilename << " - end");
+
+    return vtkfilename;
 }
 /*===============================================================================*/
-string WbWriterVtkXmlBinary::writeLines(const string& filename,vector<UbTupleFloat3 >& nodes, vector<UbTupleInt2 >& lines)
+string WbWriterVtkXmlBinary::writeLines(const string &filename, vector<UbTupleFloat3> &nodes,
+                                        vector<UbTupleInt2> &lines)
 {
-   string vtkfilename = filename+getFileExtension();
-   UBLOG(logDEBUG1,"WbWriterVtkXmlBinary::writeLines to "<<vtkfilename<<" - start");
-
-   ofstream out(vtkfilename.c_str(),ios::out | ios::binary);
-   if(!out)
-   { 
-      out.clear(); //flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
-      string path = UbSystem::getPathFromString(vtkfilename);
-      if(path.size()>0){ UbSystem::makeDirectory(path); out.open(vtkfilename.c_str(),ios::out | ios::binary);}
-      if(!out) throw UbException(UB_EXARGS,"couldn't open file "+vtkfilename);
-   }
-
-   int nofNodes = (int)nodes.size(); 
-   int nofCells = (int)lines.size(); 
-
-   int bytesPerByteVal      = 4; //==sizeof(int)
-   int bytesPoints          = 3 /*x1/x2/x3        */ * nofNodes * sizeof(float);
-   int bytesCellConnectivty = 2 /*nodes per line */ * nofCells * sizeof(int  );
-   int bytesCellOffsets     = 1 /*offset per line */ * nofCells * sizeof(int  );
-   int bytesCellTypes       = 1 /*type of line */ * nofCells * sizeof(unsigned char);
-
-   int offset = 0;
-   //VTK FILE
-   out<<"<?xml version=\"1.0\"?>\n";
-   out<<"<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\" >"<<"\n";
-   out<<"   <UnstructuredGrid>"<<"\n";
-   out<<"      <Piece NumberOfPoints=\""<<nofNodes<<"\" NumberOfCells=\""<<nofCells<<"\">\n";
-
-   //POINTS SECTION
-   out<<"         <Points>\n"; 
-   out<<"            <DataArray type=\"Float32\" NumberOfComponents=\"3\" format=\"appended\" offset=\""<< offset <<"\"  />\n";
-   out<<"         </Points>\n";
-   offset += (bytesPerByteVal + bytesPoints);
-
-   //CELLS SECTION
-   out<<"         <Cells>\n";
-   out<<"            <DataArray type=\"Int32\" Name=\"connectivity\" format=\"appended\" offset=\""<< offset <<"\" />\n";
-   offset += (bytesPerByteVal + bytesCellConnectivty); 
-   out<<"            <DataArray type=\"Int32\" Name=\"offsets\" format=\"appended\" offset=\""<< offset <<"\" />\n";
-   offset += (bytesPerByteVal + bytesCellOffsets);
-   out<<"            <DataArray type=\"UInt8\" Name=\"types\" format=\"appended\" offset=\""<< offset <<"\" />\n ";
-   offset += (bytesPerByteVal + bytesCellTypes);
-   out<<"         </Cells>\n";
-
-   out<<"      </Piece>\n";
-   out<<"   </UnstructuredGrid>\n";
-
-   // AppendedData SECTION
-   out<<"   <AppendedData encoding=\"raw\">\n";
-   out<<"_";
-
-   //POINTS SECTION
-   out.write((char*)&bytesPoints,bytesPerByteVal);
-   for(int n=0; n<nofNodes; n++)
-   {
-      out.write((char*)&val<1>(nodes[n]),sizeof(float));
-      out.write((char*)&val<2>(nodes[n]),sizeof(float));
-      out.write((char*)&val<3>(nodes[n]),sizeof(float));
-   }
-
-   //CELLS SECTION
-   //cellConnectivity
-   out.write( (char*)&bytesCellConnectivty, bytesPerByteVal );  
-   for(int c=0; c<nofCells; c++) 
-   {
-      out.write( (char*)&val<1>(lines[c]), sizeof(int) );
-      out.write( (char*)&val<2>(lines[c]), sizeof(int) );
-      
-   }
-
-   //cellOffsets
-   out.write( (char*)&bytesCellOffsets, bytesPerByteVal );
-   int itmp;
-   for(int c=1; c<=nofCells; c++)
-   {
-      itmp = 2 * c;    
-      out.write( (char*)&itmp, sizeof(int) );
-   }
-
-   //cellTypes
-   out.write( (char*)&bytesCellTypes, bytesPerByteVal );
-   unsigned char vtkCellType = 3;
-   for(int c=0; c<nofCells; c++)
-   {
-      out.write( (char*)&vtkCellType, sizeof(unsigned char) );
-   }
-   out<<"\n</AppendedData>\n";
-   out<<"</VTKFile>";
-   out<<endl;
-   out.close();
-   UBLOG(logDEBUG1,"WbWriterVtkXmlBinary::writeLines to "<<vtkfilename<<" - end");
-
-   return vtkfilename;
+    string vtkfilename = filename + getFileExtension();
+    UBLOG(logDEBUG1, "WbWriterVtkXmlBinary::writeLines to " << vtkfilename << " - start");
+
+    ofstream out(vtkfilename.c_str(), ios::out | ios::binary);
+    if (!out) {
+        out.clear(); // flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
+        string path = UbSystem::getPathFromString(vtkfilename);
+        if (path.size() > 0) {
+            UbSystem::makeDirectory(path);
+            out.open(vtkfilename.c_str(), ios::out | ios::binary);
+        }
+        if (!out)
+            throw UbException(UB_EXARGS, "couldn't open file " + vtkfilename);
+    }
+
+    int nofNodes = (int)nodes.size();
+    int nofCells = (int)lines.size();
+
+    int bytesPerByteVal      = 4; //==sizeof(int)
+    int bytesPoints          = 3 /*x1/x2/x3        */ * nofNodes * sizeof(float);
+    int bytesCellConnectivty = 2 /*nodes per line */ * nofCells * sizeof(int);
+    int bytesCellOffsets     = 1 /*offset per line */ * nofCells * sizeof(int);
+    int bytesCellTypes       = 1 /*type of line */ * nofCells * sizeof(unsigned char);
+
+    int offset = 0;
+    // VTK FILE
+    out << "<?xml version=\"1.0\"?>\n";
+    out << "<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\" >"
+        << "\n";
+    out << "   <UnstructuredGrid>"
+        << "\n";
+    out << "      <Piece NumberOfPoints=\"" << nofNodes << "\" NumberOfCells=\"" << nofCells << "\">\n";
+
+    // POINTS SECTION
+    out << "         <Points>\n";
+    out << "            <DataArray type=\"Float32\" NumberOfComponents=\"3\" format=\"appended\" offset=\"" << offset
+        << "\"  />\n";
+    out << "         </Points>\n";
+    offset += (bytesPerByteVal + bytesPoints);
+
+    // CELLS SECTION
+    out << "         <Cells>\n";
+    out << "            <DataArray type=\"Int32\" Name=\"connectivity\" format=\"appended\" offset=\"" << offset
+        << "\" />\n";
+    offset += (bytesPerByteVal + bytesCellConnectivty);
+    out << "            <DataArray type=\"Int32\" Name=\"offsets\" format=\"appended\" offset=\"" << offset
+        << "\" />\n";
+    offset += (bytesPerByteVal + bytesCellOffsets);
+    out << "            <DataArray type=\"UInt8\" Name=\"types\" format=\"appended\" offset=\"" << offset << "\" />\n ";
+    offset += (bytesPerByteVal + bytesCellTypes);
+    out << "         </Cells>\n";
+
+    out << "      </Piece>\n";
+    out << "   </UnstructuredGrid>\n";
+
+    // AppendedData SECTION
+    out << "   <AppendedData encoding=\"raw\">\n";
+    out << "_";
+
+    // POINTS SECTION
+    out.write((char *)&bytesPoints, bytesPerByteVal);
+    for (int n = 0; n < nofNodes; n++) {
+        out.write((char *)&val<1>(nodes[n]), sizeof(float));
+        out.write((char *)&val<2>(nodes[n]), sizeof(float));
+        out.write((char *)&val<3>(nodes[n]), sizeof(float));
+    }
+
+    // CELLS SECTION
+    // cellConnectivity
+    out.write((char *)&bytesCellConnectivty, bytesPerByteVal);
+    for (int c = 0; c < nofCells; c++) {
+        out.write((char *)&val<1>(lines[c]), sizeof(int));
+        out.write((char *)&val<2>(lines[c]), sizeof(int));
+    }
+
+    // cellOffsets
+    out.write((char *)&bytesCellOffsets, bytesPerByteVal);
+    int itmp;
+    for (int c = 1; c <= nofCells; c++) {
+        itmp = 2 * c;
+        out.write((char *)&itmp, sizeof(int));
+    }
+
+    // cellTypes
+    out.write((char *)&bytesCellTypes, bytesPerByteVal);
+    unsigned char vtkCellType = 3;
+    for (int c = 0; c < nofCells; c++) {
+        out.write((char *)&vtkCellType, sizeof(unsigned char));
+    }
+    out << "\n</AppendedData>\n";
+    out << "</VTKFile>";
+    out << endl;
+    out.close();
+    UBLOG(logDEBUG1, "WbWriterVtkXmlBinary::writeLines to " << vtkfilename << " - end");
+
+    return vtkfilename;
 }
 /*===============================================================================*/
-//std::string WbWriterVtkXmlBinary::writeLinesWithNodeData(const string& filename,vector<UbTupleFloat3 >& nodes, vector<UbTupleInt2 >& lines, std::vector< std::string >& datanames, std::vector< std::vector< double > >& nodedata)
+// std::string WbWriterVtkXmlBinary::writeLinesWithNodeData(const string& filename,vector<UbTupleFloat3 >& nodes,
+// vector<UbTupleInt2 >& lines, std::vector< std::string >& datanames, std::vector< std::vector< double > >& nodedata)
 //{
 //   string vtkfilename = filename+getFileExtension();
 //   UBLOG(logDEBUG1,"WbWriterVtkXmlBinary::writeLinesWithNodeData to "<<vtkfilename<<" - start");
@@ -270,26 +290,23 @@ string WbWriterVtkXmlBinary::writeLines(const string& filename,vector<UbTupleFlo
 //
 //   //POINTS SECTION
 //   out<<"         <Points>\n";
-//   out<<"            <DataArray type=\"Float32\" NumberOfComponents=\"3\" format=\"appended\" offset=\""<< offset <<"\"  />\n";
-//   out<<"         </Points>\n";
-//   offset += (bytesPerByteVal + bytesPoints);
+//   out<<"            <DataArray type=\"Float32\" NumberOfComponents=\"3\" format=\"appended\" offset=\""<< offset
+//   <<"\"  />\n"; out<<"         </Points>\n"; offset += (bytesPerByteVal + bytesPoints);
 //
 //   //CELLS SECTION
 //   out<<"         <Cells>\n";
-//   out<<"            <DataArray type=\"Int32\" Name=\"connectivity\" format=\"appended\" offset=\""<< offset <<"\" />\n";
-//   offset += (bytesPerByteVal + bytesCellConnectivty);
-//   out<<"            <DataArray type=\"Int32\" Name=\"offsets\" format=\"appended\" offset=\""<< offset <<"\" />\n";
-//   offset += (bytesPerByteVal + bytesCellOffsets);
-//   out<<"            <DataArray type=\"UInt8\" Name=\"types\" format=\"appended\" offset=\""<< offset <<"\" />\n ";
-//   offset += (bytesPerByteVal + bytesCellTypes);
-//   out<<"         </Cells>\n";
+//   out<<"            <DataArray type=\"Int32\" Name=\"connectivity\" format=\"appended\" offset=\""<< offset <<"\"
+//   />\n"; offset += (bytesPerByteVal + bytesCellConnectivty); out<<"            <DataArray type=\"Int32\"
+//   Name=\"offsets\" format=\"appended\" offset=\""<< offset <<"\" />\n"; offset += (bytesPerByteVal +
+//   bytesCellOffsets); out<<"            <DataArray type=\"UInt8\" Name=\"types\" format=\"appended\" offset=\""<<
+//   offset <<"\" />\n "; offset += (bytesPerByteVal + bytesCellTypes); out<<"         </Cells>\n";
 //
 //   //DATA SECTION
 //   out<<"         <PointData>\n";
 //   for(size_t s=0; s<datanames.size(); ++s)
 //   {
-//      out<< "            <DataArray type=\"Float32\" Name=\""<< datanames[s] <<"\" format=\"appended\" offset=\""<< offset <<"\" /> \n";
-//      offset += (bytesPerByteVal + bytesScalarData);
+//      out<< "            <DataArray type=\"Float32\" Name=\""<< datanames[s] <<"\" format=\"appended\" offset=\""<<
+//      offset <<"\" /> \n"; offset += (bytesPerByteVal + bytesScalarData);
 //   }
 //   out<<"         </PointData>\n";
 //
@@ -357,1262 +374,1309 @@ string WbWriterVtkXmlBinary::writeLines(const string& filename,vector<UbTupleFlo
 //
 //}
 /*===============================================================================*/
-string WbWriterVtkXmlBinary::writeTriangles(const string& filename,vector<UbTupleFloat3 >& nodes, vector<UbTupleInt3 >& triangles)
+string WbWriterVtkXmlBinary::writeTriangles(const string &filename, vector<UbTupleFloat3> &nodes,
+                                            vector<UbTupleInt3> &triangles)
 {
-   string vtkfilename = filename+getFileExtension();
-   UBLOG(logDEBUG1,"WbWriterVtkXmlBinary::writeTriangles to "<<vtkfilename<<" - start");
-
-   ofstream out(vtkfilename.c_str(),ios::out | ios::binary);
-   if(!out)
-   { 
-      out.clear(); //flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
-      string path = UbSystem::getPathFromString(vtkfilename);
-      if(path.size()>0){ UbSystem::makeDirectory(path); out.open(vtkfilename.c_str(),ios::out | ios::binary);}
-      if(!out) throw UbException(UB_EXARGS,"couldn't open file "+vtkfilename);
-   }
-
-
-   int nofNodes = (int)nodes.size(); 
-   int nofCells = (int)triangles.size(); 
-
-   int bytesPerByteVal      = 4; //==sizeof(int)
-   int bytesPoints          = 3 /*x1/x2/x3 - coord    */ * nofNodes * sizeof(float);
-   int bytesCellConnectivty = 3 /*nodes per triangle  */ * nofCells * sizeof(int  );
-   int bytesCellOffsets     = 1 /*offset per triangle */ * nofCells * sizeof(int  );
-   int bytesCellTypes       = 1 /*type of triangle    */ * nofCells * sizeof(unsigned char);
-
-   int offset = 0;
-   //VTK FILE
-   out<<"<?xml version=\"1.0\"?>\n";
-   out<<"<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\" >"<<"\n";
-   out<<"   <UnstructuredGrid>"<<"\n";
-   out<<"      <Piece NumberOfPoints=\""<<nofNodes<<"\" NumberOfCells=\""<<nofCells<<"\">\n";
-
-   //POINTS SECTION
-   out<<"         <Points>\n"; 
-   out<<"            <DataArray type=\"Float32\" NumberOfComponents=\"3\" format=\"appended\" offset=\""<< offset <<"\"  />\n";
-   out<<"         </Points>\n";
-   offset += (bytesPerByteVal + bytesPoints);
-
-   //CELLS SECTION
-   out<<"         <Cells>\n";
-   out<<"            <DataArray type=\"Int32\" Name=\"connectivity\" format=\"appended\" offset=\""<< offset <<"\" />\n";
-   offset += (bytesPerByteVal + bytesCellConnectivty); 
-   out<<"            <DataArray type=\"Int32\" Name=\"offsets\" format=\"appended\" offset=\""<< offset <<"\" />\n";
-   offset += (bytesPerByteVal + bytesCellOffsets);
-   out<<"            <DataArray type=\"UInt8\" Name=\"types\" format=\"appended\" offset=\""<< offset <<"\" />\n ";
-   offset += (bytesPerByteVal + bytesCellTypes);
-   out<<"         </Cells>\n";
-
-   out<<"      </Piece>\n";
-   out<<"   </UnstructuredGrid>\n";
-
-   // AppendedData SECTION
-   out<<"   <AppendedData encoding=\"raw\">\n";
-   out<<"_";
-
-   //POINTS SECTION
-   out.write((char*)&bytesPoints,bytesPerByteVal);
-   for(int n=0; n<nofNodes; n++)
-   {
-      out.write((char*)&val<1>(nodes[n]),sizeof(float));
-      out.write((char*)&val<2>(nodes[n]),sizeof(float));
-      out.write((char*)&val<3>(nodes[n]),sizeof(float));
-   }
-
-   //CELLS SECTION
-   //cellConnectivity
-   out.write( (char*)&bytesCellConnectivty, bytesPerByteVal );  
-   for(int c=0; c<nofCells; c++) 
-   {
-      out.write( (char*)&val<1>(triangles[c]), sizeof(int) );
-      out.write( (char*)&val<2>(triangles[c]), sizeof(int) );
-      out.write( (char*)&val<3>(triangles[c]), sizeof(int) );
-   }
-
-   //cellOffsets
-   out.write( (char*)&bytesCellOffsets, bytesPerByteVal );
-   int itmp;
-   for(int c=1; c<=nofCells; c++)
-   {
-      itmp = 3 * c;    
-      out.write( (char*)&itmp, sizeof(int) );
-   }
-
-   //cellTypes
-   out.write( (char*)&bytesCellTypes, bytesPerByteVal );
-   unsigned char vtkCellType = 5;
-   for(int c=0; c<nofCells; c++)
-   {
-      out.write( (char*)&vtkCellType, sizeof(unsigned char) );
-   }
-
-   out<<"\n</AppendedData>\n";
-   out<<"</VTKFile>";
-   out<<endl;
-   out<<flush;
-   out.close();
-   UBLOG(logDEBUG1,"WbWriterVtkXmlBinary::writeTriangles to "<<vtkfilename<<" - end");
-
-   return vtkfilename;
+    string vtkfilename = filename + getFileExtension();
+    UBLOG(logDEBUG1, "WbWriterVtkXmlBinary::writeTriangles to " << vtkfilename << " - start");
+
+    ofstream out(vtkfilename.c_str(), ios::out | ios::binary);
+    if (!out) {
+        out.clear(); // flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
+        string path = UbSystem::getPathFromString(vtkfilename);
+        if (path.size() > 0) {
+            UbSystem::makeDirectory(path);
+            out.open(vtkfilename.c_str(), ios::out | ios::binary);
+        }
+        if (!out)
+            throw UbException(UB_EXARGS, "couldn't open file " + vtkfilename);
+    }
+
+    int nofNodes = (int)nodes.size();
+    int nofCells = (int)triangles.size();
+
+    int bytesPerByteVal      = 4; //==sizeof(int)
+    int bytesPoints          = 3 /*x1/x2/x3 - coord    */ * nofNodes * sizeof(float);
+    int bytesCellConnectivty = 3 /*nodes per triangle  */ * nofCells * sizeof(int);
+    int bytesCellOffsets     = 1 /*offset per triangle */ * nofCells * sizeof(int);
+    int bytesCellTypes       = 1 /*type of triangle    */ * nofCells * sizeof(unsigned char);
+
+    int offset = 0;
+    // VTK FILE
+    out << "<?xml version=\"1.0\"?>\n";
+    out << "<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\" >"
+        << "\n";
+    out << "   <UnstructuredGrid>"
+        << "\n";
+    out << "      <Piece NumberOfPoints=\"" << nofNodes << "\" NumberOfCells=\"" << nofCells << "\">\n";
+
+    // POINTS SECTION
+    out << "         <Points>\n";
+    out << "            <DataArray type=\"Float32\" NumberOfComponents=\"3\" format=\"appended\" offset=\"" << offset
+        << "\"  />\n";
+    out << "         </Points>\n";
+    offset += (bytesPerByteVal + bytesPoints);
+
+    // CELLS SECTION
+    out << "         <Cells>\n";
+    out << "            <DataArray type=\"Int32\" Name=\"connectivity\" format=\"appended\" offset=\"" << offset
+        << "\" />\n";
+    offset += (bytesPerByteVal + bytesCellConnectivty);
+    out << "            <DataArray type=\"Int32\" Name=\"offsets\" format=\"appended\" offset=\"" << offset
+        << "\" />\n";
+    offset += (bytesPerByteVal + bytesCellOffsets);
+    out << "            <DataArray type=\"UInt8\" Name=\"types\" format=\"appended\" offset=\"" << offset << "\" />\n ";
+    offset += (bytesPerByteVal + bytesCellTypes);
+    out << "         </Cells>\n";
+
+    out << "      </Piece>\n";
+    out << "   </UnstructuredGrid>\n";
+
+    // AppendedData SECTION
+    out << "   <AppendedData encoding=\"raw\">\n";
+    out << "_";
+
+    // POINTS SECTION
+    out.write((char *)&bytesPoints, bytesPerByteVal);
+    for (int n = 0; n < nofNodes; n++) {
+        out.write((char *)&val<1>(nodes[n]), sizeof(float));
+        out.write((char *)&val<2>(nodes[n]), sizeof(float));
+        out.write((char *)&val<3>(nodes[n]), sizeof(float));
+    }
+
+    // CELLS SECTION
+    // cellConnectivity
+    out.write((char *)&bytesCellConnectivty, bytesPerByteVal);
+    for (int c = 0; c < nofCells; c++) {
+        out.write((char *)&val<1>(triangles[c]), sizeof(int));
+        out.write((char *)&val<2>(triangles[c]), sizeof(int));
+        out.write((char *)&val<3>(triangles[c]), sizeof(int));
+    }
+
+    // cellOffsets
+    out.write((char *)&bytesCellOffsets, bytesPerByteVal);
+    int itmp;
+    for (int c = 1; c <= nofCells; c++) {
+        itmp = 3 * c;
+        out.write((char *)&itmp, sizeof(int));
+    }
+
+    // cellTypes
+    out.write((char *)&bytesCellTypes, bytesPerByteVal);
+    unsigned char vtkCellType = 5;
+    for (int c = 0; c < nofCells; c++) {
+        out.write((char *)&vtkCellType, sizeof(unsigned char));
+    }
+
+    out << "\n</AppendedData>\n";
+    out << "</VTKFile>";
+    out << endl;
+    out << flush;
+    out.close();
+    UBLOG(logDEBUG1, "WbWriterVtkXmlBinary::writeTriangles to " << vtkfilename << " - end");
+
+    return vtkfilename;
 }
 /*===============================================================================*/
-string WbWriterVtkXmlBinary::writeTrianglesWithNodeData(const string& filename,vector< UbTupleFloat3 >& nodes, vector< UbTupleInt3 >& cells, vector< string >& datanames, vector< vector< double > >& nodedata)
+string WbWriterVtkXmlBinary::writeTrianglesWithNodeData(const string &filename, vector<UbTupleFloat3> &nodes,
+                                                        vector<UbTupleInt3> &cells, vector<string> &datanames,
+                                                        vector<vector<double>> &nodedata)
 {
-   string vtkfilename = filename+getFileExtension();
-   UBLOG(logDEBUG1,"WbWriterVtkXmlBinary::writeTrianglesWithNodeData to "<<vtkfilename<<" - start");
-
-   ofstream out(vtkfilename.c_str(),ios::out | ios::binary);
-   if(!out)
-   { 
-      out.clear(); //flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
-      string path = UbSystem::getPathFromString(vtkfilename);
-      if(path.size()>0){ UbSystem::makeDirectory(path); out.open(vtkfilename.c_str(),ios::out | ios::binary);}
-      if(!out) throw UbException(UB_EXARGS,"couldn't open file "+vtkfilename);
-   }
-
-   int nofNodes = (int)nodes.size(); 
-   int nofCells = (int)cells.size(); 
-
-   int bytesPerByteVal      = 4; //==sizeof(int)
-   int bytesPoints          = 3 /*x1/x2/x3        */ * nofNodes * sizeof(float);
-   int bytesCellConnectivty = 3 /*nodes per tri   */ * nofCells * sizeof(int  );
-   int bytesCellOffsets     = 1 /*offset per tri  */ * nofCells * sizeof(int  );
-   int bytesCellTypes       = 1 /*type of tri     */ * nofCells * sizeof(unsigned char);
-   int bytesScalarData      = 1 /*scalar          */ * nofNodes * sizeof(float); 
-   
-   int offset = 0;
-   //VTK FILE
-   out<<"<?xml version=\"1.0\"?>\n";
-   out<<"<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\" >"<<"\n";
-   out<<"   <UnstructuredGrid>"<<"\n";
-   out<<"      <Piece NumberOfPoints=\""<<nofNodes<<"\" NumberOfCells=\""<<nofCells<<"\">\n";
-
-   //POINTS SECTION
-   out<<"         <Points>\n"; 
-   out<<"            <DataArray type=\"Float32\" NumberOfComponents=\"3\" format=\"appended\" offset=\""<< offset <<"\"  />\n";
-   out<<"         </Points>\n";
-   offset += (bytesPerByteVal + bytesPoints);
-
-   //CELLS SECTION
-   out<<"         <Cells>\n";
-   out<<"            <DataArray type=\"Int32\" Name=\"connectivity\" format=\"appended\" offset=\""<< offset <<"\" />\n";
-   offset += (bytesPerByteVal + bytesCellConnectivty); 
-   out<<"            <DataArray type=\"Int32\" Name=\"offsets\" format=\"appended\" offset=\""<< offset <<"\" />\n";
-   offset += (bytesPerByteVal + bytesCellOffsets);
-   out<<"            <DataArray type=\"UInt8\" Name=\"types\" format=\"appended\" offset=\""<< offset <<"\" />\n ";
-   offset += (bytesPerByteVal + bytesCellTypes);
-   out<<"         </Cells>\n";
-
-   //DATA SECTION
-   out<<"         <PointData>\n";
-   for(size_t s=0; s<datanames.size(); ++s)
-   {
-      out<< "            <DataArray type=\"Float32\" Name=\""<< datanames[s] <<"\" format=\"appended\" offset=\""<< offset <<"\" /> \n";
-      offset += (bytesPerByteVal + bytesScalarData);
-   }
-   out<<"         </PointData>\n";
-
-   out<<"      </Piece>\n";
-   out<<"   </UnstructuredGrid>\n";
-
-   // AppendedData SECTION
-   out<<"   <AppendedData encoding=\"raw\">\n";
-   out<<"_";
-
-   //POINTS SECTION
-   out.write((char*)&bytesPoints,bytesPerByteVal);
-   for(int n=0; n<nofNodes; n++)
-   {
-      out.write((char*)&val<1>(nodes[n]),sizeof(float));
-      out.write((char*)&val<2>(nodes[n]),sizeof(float));
-      out.write((char*)&val<3>(nodes[n]),sizeof(float));
-   }
-
-   //CELLS SECTION
-   //cellConnectivity
-   out.write( (char*)&bytesCellConnectivty, bytesPerByteVal );  
-   for(int c=0; c<nofCells; c++) 
-   {
-      out.write( (char*)&val<1>(cells[c]), sizeof(int) );
-      out.write( (char*)&val<2>(cells[c]), sizeof(int) );
-      out.write( (char*)&val<3>(cells[c]), sizeof(int) );
-   }
-
-   //cellOffsets
-   out.write( (char*)&bytesCellOffsets, bytesPerByteVal );
-   int itmp;
-   for(int c=1; c<=nofCells; c++)
-   {
-      itmp = 3 * c;    
-      out.write( (char*)&itmp, sizeof(int) );
-   }
-
-   //cellTypes
-   out.write( (char*)&bytesCellTypes, bytesPerByteVal );
-   unsigned char vtkCellType = 5;
-   for(int c=0; c<nofCells; c++)
-   {
-      out.write( (char*)&vtkCellType, sizeof(unsigned char) );
-   }
-
-   //DATA SECTION
-   //scalarData
-   for(size_t s=0; s<datanames.size(); ++s)
-   {
-      out.write((char*)&bytesScalarData,bytesPerByteVal);
-      for(size_t d=0; d<nodedata[s].size(); ++d)
-      {
-         //loake kopie machen, da in nodedata "doubles" sind
-         float tmp = (float)nodedata[s][d];
-         out.write((char*)&tmp,sizeof(float));
-      }
-   }
-   out<<"\n</AppendedData>\n";
-   out<<"</VTKFile>";
-   out<<endl;
-   out.close();
-   UBLOG(logDEBUG1,"WbWriterVtkXmlBinary::writeTrianglesWithNodeData to "<<vtkfilename<<" - end");
-
-   return vtkfilename;
+    string vtkfilename = filename + getFileExtension();
+    UBLOG(logDEBUG1, "WbWriterVtkXmlBinary::writeTrianglesWithNodeData to " << vtkfilename << " - start");
+
+    ofstream out(vtkfilename.c_str(), ios::out | ios::binary);
+    if (!out) {
+        out.clear(); // flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
+        string path = UbSystem::getPathFromString(vtkfilename);
+        if (path.size() > 0) {
+            UbSystem::makeDirectory(path);
+            out.open(vtkfilename.c_str(), ios::out | ios::binary);
+        }
+        if (!out)
+            throw UbException(UB_EXARGS, "couldn't open file " + vtkfilename);
+    }
+
+    int nofNodes = (int)nodes.size();
+    int nofCells = (int)cells.size();
+
+    int bytesPerByteVal      = 4; //==sizeof(int)
+    int bytesPoints          = 3 /*x1/x2/x3        */ * nofNodes * sizeof(float);
+    int bytesCellConnectivty = 3 /*nodes per tri   */ * nofCells * sizeof(int);
+    int bytesCellOffsets     = 1 /*offset per tri  */ * nofCells * sizeof(int);
+    int bytesCellTypes       = 1 /*type of tri     */ * nofCells * sizeof(unsigned char);
+    int bytesScalarData      = 1 /*scalar          */ * nofNodes * sizeof(float);
+
+    int offset = 0;
+    // VTK FILE
+    out << "<?xml version=\"1.0\"?>\n";
+    out << "<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\" >"
+        << "\n";
+    out << "   <UnstructuredGrid>"
+        << "\n";
+    out << "      <Piece NumberOfPoints=\"" << nofNodes << "\" NumberOfCells=\"" << nofCells << "\">\n";
+
+    // POINTS SECTION
+    out << "         <Points>\n";
+    out << "            <DataArray type=\"Float32\" NumberOfComponents=\"3\" format=\"appended\" offset=\"" << offset
+        << "\"  />\n";
+    out << "         </Points>\n";
+    offset += (bytesPerByteVal + bytesPoints);
+
+    // CELLS SECTION
+    out << "         <Cells>\n";
+    out << "            <DataArray type=\"Int32\" Name=\"connectivity\" format=\"appended\" offset=\"" << offset
+        << "\" />\n";
+    offset += (bytesPerByteVal + bytesCellConnectivty);
+    out << "            <DataArray type=\"Int32\" Name=\"offsets\" format=\"appended\" offset=\"" << offset
+        << "\" />\n";
+    offset += (bytesPerByteVal + bytesCellOffsets);
+    out << "            <DataArray type=\"UInt8\" Name=\"types\" format=\"appended\" offset=\"" << offset << "\" />\n ";
+    offset += (bytesPerByteVal + bytesCellTypes);
+    out << "         </Cells>\n";
+
+    // DATA SECTION
+    out << "         <PointData>\n";
+    for (size_t s = 0; s < datanames.size(); ++s) {
+        out << "            <DataArray type=\"Float32\" Name=\"" << datanames[s] << "\" format=\"appended\" offset=\""
+            << offset << "\" /> \n";
+        offset += (bytesPerByteVal + bytesScalarData);
+    }
+    out << "         </PointData>\n";
+
+    out << "      </Piece>\n";
+    out << "   </UnstructuredGrid>\n";
+
+    // AppendedData SECTION
+    out << "   <AppendedData encoding=\"raw\">\n";
+    out << "_";
+
+    // POINTS SECTION
+    out.write((char *)&bytesPoints, bytesPerByteVal);
+    for (int n = 0; n < nofNodes; n++) {
+        out.write((char *)&val<1>(nodes[n]), sizeof(float));
+        out.write((char *)&val<2>(nodes[n]), sizeof(float));
+        out.write((char *)&val<3>(nodes[n]), sizeof(float));
+    }
+
+    // CELLS SECTION
+    // cellConnectivity
+    out.write((char *)&bytesCellConnectivty, bytesPerByteVal);
+    for (int c = 0; c < nofCells; c++) {
+        out.write((char *)&val<1>(cells[c]), sizeof(int));
+        out.write((char *)&val<2>(cells[c]), sizeof(int));
+        out.write((char *)&val<3>(cells[c]), sizeof(int));
+    }
+
+    // cellOffsets
+    out.write((char *)&bytesCellOffsets, bytesPerByteVal);
+    int itmp;
+    for (int c = 1; c <= nofCells; c++) {
+        itmp = 3 * c;
+        out.write((char *)&itmp, sizeof(int));
+    }
+
+    // cellTypes
+    out.write((char *)&bytesCellTypes, bytesPerByteVal);
+    unsigned char vtkCellType = 5;
+    for (int c = 0; c < nofCells; c++) {
+        out.write((char *)&vtkCellType, sizeof(unsigned char));
+    }
+
+    // DATA SECTION
+    // scalarData
+    for (size_t s = 0; s < datanames.size(); ++s) {
+        out.write((char *)&bytesScalarData, bytesPerByteVal);
+        for (size_t d = 0; d < nodedata[s].size(); ++d) {
+            // loake kopie machen, da in nodedata "doubles" sind
+            float tmp = (float)nodedata[s][d];
+            out.write((char *)&tmp, sizeof(float));
+        }
+    }
+    out << "\n</AppendedData>\n";
+    out << "</VTKFile>";
+    out << endl;
+    out.close();
+    UBLOG(logDEBUG1, "WbWriterVtkXmlBinary::writeTrianglesWithNodeData to " << vtkfilename << " - end");
+
+    return vtkfilename;
 }
 /*===============================================================================*/
-string WbWriterVtkXmlBinary::writeQuads(const string& filename,vector< UbTupleFloat3 >& nodes, vector< UbTupleInt4 >& cells)
+string WbWriterVtkXmlBinary::writeQuads(const string &filename, vector<UbTupleFloat3> &nodes,
+                                        vector<UbTupleInt4> &cells)
 {
-   string vtkfilename = filename+getFileExtension();
-   UBLOG(logDEBUG1,"WbWriterVtkXmlBinary::writeQuads to "<<vtkfilename<<" - start");
-
-   ofstream out(vtkfilename.c_str(),ios::out | ios::binary);
-   if(!out)
-   { 
-      out.clear(); //flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
-      string path = UbSystem::getPathFromString(vtkfilename);
-      if(path.size()>0){ UbSystem::makeDirectory(path); out.open(vtkfilename.c_str(),ios::out | ios::binary);}
-      if(!out) throw UbException(UB_EXARGS,"couldn't open file "+vtkfilename);
-   }
-
-   int nofNodes = (int)nodes.size(); 
-   int nofCells = (int)cells.size(); 
-
-   int bytesPerByteVal      = 4; //==sizeof(int)
-   int bytesPoints          = 3 /*x1/x2/x3        */ * nofNodes * sizeof(float);
-   int bytesCellConnectivty = 4 /*nodes per quad  */ * nofCells * sizeof(int  );
-   int bytesCellOffsets     = 1 /*offset per quad */ * nofCells * sizeof(int  );
-   int bytesCellTypes       = 1 /*type of quad    */ * nofCells * sizeof(unsigned char);
-  
-   int offset = 0;
-   //VTK FILE
-   out<<"<?xml version=\"1.0\"?>\n";
-   out<<"<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\" >"<<"\n";
-   out<<"   <UnstructuredGrid>"<<"\n";
-   out<<"      <Piece NumberOfPoints=\""<<nofNodes<<"\" NumberOfCells=\""<<nofCells<<"\">\n";
-
-   //POINTS SECTION
-   out<<"         <Points>\n"; 
-   out<<"            <DataArray type=\"Float32\" NumberOfComponents=\"3\" format=\"appended\" offset=\""<< offset <<"\"  />\n";
-   out<<"         </Points>\n";
-   offset += (bytesPerByteVal + bytesPoints);
-
-   //CELLS SECTION
-   out<<"         <Cells>\n";
-   out<<"            <DataArray type=\"Int32\" Name=\"connectivity\" format=\"appended\" offset=\""<< offset <<"\" />\n";
-   offset += (bytesPerByteVal + bytesCellConnectivty); 
-   out<<"            <DataArray type=\"Int32\" Name=\"offsets\" format=\"appended\" offset=\""<< offset <<"\" />\n";
-   offset += (bytesPerByteVal + bytesCellOffsets);
-   out<<"            <DataArray type=\"UInt8\" Name=\"types\" format=\"appended\" offset=\""<< offset <<"\" />\n ";
-   offset += (bytesPerByteVal + bytesCellTypes);
-   out<<"         </Cells>\n";
-
-   out<<"      </Piece>\n";
-   out<<"   </UnstructuredGrid>\n";
-
-   // AppendedData SECTION
-   out<<"   <AppendedData encoding=\"raw\">\n";
-   out<<"_";
-
-   //POINTS SECTION
-   out.write((char*)&bytesPoints,bytesPerByteVal);
-   for(int n=0; n<nofNodes; n++)
-   {
-      out.write((char*)&val<1>(nodes[n]),sizeof(float));
-      out.write((char*)&val<2>(nodes[n]),sizeof(float));
-      out.write((char*)&val<3>(nodes[n]),sizeof(float));
-   }
-
-   //CELLS SECTION
-   //cellConnectivity
-   out.write( (char*)&bytesCellConnectivty, bytesPerByteVal );  
-   for(int c=0; c<nofCells; c++) 
-   {
-      out.write( (char*)&val<1>(cells[c]), sizeof(int) );
-      out.write( (char*)&val<2>(cells[c]), sizeof(int) );
-      out.write( (char*)&val<4>(cells[c]), sizeof(int) );
-      out.write( (char*)&val<3>(cells[c]), sizeof(int) );
-   }
-
-   //cellOffsets
-   out.write( (char*)&bytesCellOffsets, bytesPerByteVal );
-   int itmp;
-   for(int c=1; c<=nofCells; c++)
-   {
-      itmp = 4 * c;    
-      out.write( (char*)&itmp, sizeof(int) );
-   }
-
-   //cellTypes
-   out.write( (char*)&bytesCellTypes, bytesPerByteVal );
-   unsigned char vtkCellType = 8;
-   for(int c=0; c<nofCells; c++)
-   {
-      out.write( (char*)&vtkCellType, sizeof(unsigned char) );
-   }
-   out<<"\n</AppendedData>\n";
-   out<<"</VTKFile>";
-   out<<endl;
-   out<<flush;
-   out.close();
-   UBLOG(logDEBUG1,"WbWriterVtkXmlBinary::writeQuads to "<<vtkfilename<<" - end");
-
-   return vtkfilename;
+    string vtkfilename = filename + getFileExtension();
+    UBLOG(logDEBUG1, "WbWriterVtkXmlBinary::writeQuads to " << vtkfilename << " - start");
+
+    ofstream out(vtkfilename.c_str(), ios::out | ios::binary);
+    if (!out) {
+        out.clear(); // flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
+        string path = UbSystem::getPathFromString(vtkfilename);
+        if (path.size() > 0) {
+            UbSystem::makeDirectory(path);
+            out.open(vtkfilename.c_str(), ios::out | ios::binary);
+        }
+        if (!out)
+            throw UbException(UB_EXARGS, "couldn't open file " + vtkfilename);
+    }
+
+    int nofNodes = (int)nodes.size();
+    int nofCells = (int)cells.size();
+
+    int bytesPerByteVal      = 4; //==sizeof(int)
+    int bytesPoints          = 3 /*x1/x2/x3        */ * nofNodes * sizeof(float);
+    int bytesCellConnectivty = 4 /*nodes per quad  */ * nofCells * sizeof(int);
+    int bytesCellOffsets     = 1 /*offset per quad */ * nofCells * sizeof(int);
+    int bytesCellTypes       = 1 /*type of quad    */ * nofCells * sizeof(unsigned char);
+
+    int offset = 0;
+    // VTK FILE
+    out << "<?xml version=\"1.0\"?>\n";
+    out << "<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\" >"
+        << "\n";
+    out << "   <UnstructuredGrid>"
+        << "\n";
+    out << "      <Piece NumberOfPoints=\"" << nofNodes << "\" NumberOfCells=\"" << nofCells << "\">\n";
+
+    // POINTS SECTION
+    out << "         <Points>\n";
+    out << "            <DataArray type=\"Float32\" NumberOfComponents=\"3\" format=\"appended\" offset=\"" << offset
+        << "\"  />\n";
+    out << "         </Points>\n";
+    offset += (bytesPerByteVal + bytesPoints);
+
+    // CELLS SECTION
+    out << "         <Cells>\n";
+    out << "            <DataArray type=\"Int32\" Name=\"connectivity\" format=\"appended\" offset=\"" << offset
+        << "\" />\n";
+    offset += (bytesPerByteVal + bytesCellConnectivty);
+    out << "            <DataArray type=\"Int32\" Name=\"offsets\" format=\"appended\" offset=\"" << offset
+        << "\" />\n";
+    offset += (bytesPerByteVal + bytesCellOffsets);
+    out << "            <DataArray type=\"UInt8\" Name=\"types\" format=\"appended\" offset=\"" << offset << "\" />\n ";
+    offset += (bytesPerByteVal + bytesCellTypes);
+    out << "         </Cells>\n";
+
+    out << "      </Piece>\n";
+    out << "   </UnstructuredGrid>\n";
+
+    // AppendedData SECTION
+    out << "   <AppendedData encoding=\"raw\">\n";
+    out << "_";
+
+    // POINTS SECTION
+    out.write((char *)&bytesPoints, bytesPerByteVal);
+    for (int n = 0; n < nofNodes; n++) {
+        out.write((char *)&val<1>(nodes[n]), sizeof(float));
+        out.write((char *)&val<2>(nodes[n]), sizeof(float));
+        out.write((char *)&val<3>(nodes[n]), sizeof(float));
+    }
+
+    // CELLS SECTION
+    // cellConnectivity
+    out.write((char *)&bytesCellConnectivty, bytesPerByteVal);
+    for (int c = 0; c < nofCells; c++) {
+        out.write((char *)&val<1>(cells[c]), sizeof(int));
+        out.write((char *)&val<2>(cells[c]), sizeof(int));
+        out.write((char *)&val<4>(cells[c]), sizeof(int));
+        out.write((char *)&val<3>(cells[c]), sizeof(int));
+    }
+
+    // cellOffsets
+    out.write((char *)&bytesCellOffsets, bytesPerByteVal);
+    int itmp;
+    for (int c = 1; c <= nofCells; c++) {
+        itmp = 4 * c;
+        out.write((char *)&itmp, sizeof(int));
+    }
+
+    // cellTypes
+    out.write((char *)&bytesCellTypes, bytesPerByteVal);
+    unsigned char vtkCellType = 8;
+    for (int c = 0; c < nofCells; c++) {
+        out.write((char *)&vtkCellType, sizeof(unsigned char));
+    }
+    out << "\n</AppendedData>\n";
+    out << "</VTKFile>";
+    out << endl;
+    out << flush;
+    out.close();
+    UBLOG(logDEBUG1, "WbWriterVtkXmlBinary::writeQuads to " << vtkfilename << " - end");
+
+    return vtkfilename;
 }
 /*===============================================================================*/
-string WbWriterVtkXmlBinary::writeQuadsWithNodeData(const string& filename,vector< UbTupleFloat3 >& nodes, vector< UbTupleInt4 >& cells, vector< string >& datanames, vector< vector< double > >& nodedata)
+string WbWriterVtkXmlBinary::writeQuadsWithNodeData(const string &filename, vector<UbTupleFloat3> &nodes,
+                                                    vector<UbTupleInt4> &cells, vector<string> &datanames,
+                                                    vector<vector<double>> &nodedata)
 {
-   string vtkfilename = filename+getFileExtension();
-   UBLOG(logDEBUG1,"WbWriterVtkXmlBinary::writeQuadsWithNodeData to "<<vtkfilename<<" - start");
-
-   ofstream out(vtkfilename.c_str(),ios::out | ios::binary);
-   if(!out)
-   { 
-      out.clear(); //flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
-      string path = UbSystem::getPathFromString(vtkfilename);
-      if(path.size()>0){ UbSystem::makeDirectory(path); out.open(vtkfilename.c_str(),ios::out | ios::binary);}
-      if(!out) throw UbException(UB_EXARGS,"couldn't open file "+vtkfilename);
-   }
-
-   int nofNodes = (int)nodes.size(); 
-   int nofCells = (int)cells.size(); 
-
-   int bytesPerByteVal      = 4; //==sizeof(int)
-   int bytesPoints          = 3 /*x1/x2/x3        */ * nofNodes * sizeof(float);
-   int bytesCellConnectivty = 4 /*nodes per quad  */ * nofCells * sizeof(int  );
-   int bytesCellOffsets     = 1 /*offset per quad */ * nofCells * sizeof(int  );
-   int bytesCellTypes       = 1 /*type of quad    */ * nofCells * sizeof(unsigned char);
-   int bytesScalarData      = 1 /*scalar          */ * nofNodes * sizeof(float); 
-
-   int offset = 0;
-   //VTK FILE
-   out<<"<?xml version=\"1.0\"?>\n";
-   out<<"<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\" >"<<"\n";
-   out<<"   <UnstructuredGrid>"<<"\n";
-   out<<"      <Piece NumberOfPoints=\""<<nofNodes<<"\" NumberOfCells=\""<<nofCells<<"\">\n";
-
-   //POINTS SECTION
-   out<<"         <Points>\n"; 
-   out<<"            <DataArray type=\"Float32\" NumberOfComponents=\"3\" format=\"appended\" offset=\""<< offset <<"\"  />\n";
-   out<<"         </Points>\n";
-   offset += (bytesPerByteVal + bytesPoints);
-
-   //CELLS SECTION
-   out<<"         <Cells>\n";
-   out<<"            <DataArray type=\"Int32\" Name=\"connectivity\" format=\"appended\" offset=\""<< offset <<"\" />\n";
-   offset += (bytesPerByteVal + bytesCellConnectivty); 
-   out<<"            <DataArray type=\"Int32\" Name=\"offsets\" format=\"appended\" offset=\""<< offset <<"\" />\n";
-   offset += (bytesPerByteVal + bytesCellOffsets);
-   out<<"            <DataArray type=\"UInt8\" Name=\"types\" format=\"appended\" offset=\""<< offset <<"\" />\n ";
-   offset += (bytesPerByteVal + bytesCellTypes);
-   out<<"         </Cells>\n";
-
-   //DATA SECTION
-   out<<"         <PointData>\n";
-   for(size_t s=0; s<datanames.size(); ++s)
-   {
-      out<< "            <DataArray type=\"Float64\" Name=\""<< datanames[s] <<"\" format=\"appended\" offset=\""<< offset <<"\" /> \n";
-      offset += (bytesPerByteVal + bytesScalarData);
-   }
-   out<<"         </PointData>\n";
-
-   out<<"      </Piece>\n";
-   out<<"   </UnstructuredGrid>\n";
-
-   // AppendedData SECTION
-   out<<"   <AppendedData encoding=\"raw\">\n";
-   out<<"_";
-
-   //POINTS SECTION
-   out.write((char*)&bytesPoints,bytesPerByteVal);
-   for(int n=0; n<nofNodes; n++)
-   {
-      out.write((char*)&val<1>(nodes[n]),sizeof(float));
-      out.write((char*)&val<2>(nodes[n]),sizeof(float));
-      out.write((char*)&val<3>(nodes[n]),sizeof(float));
-   }
-
-   //CELLS SECTION
-   //cellConnectivity
-   out.write( (char*)&bytesCellConnectivty, bytesPerByteVal );  
-   for(int c=0; c<nofCells; c++) 
-   {
-      out.write( (char*)&val<1>(cells[c]), sizeof(int) );
-      out.write( (char*)&val<2>(cells[c]), sizeof(int) );
-      out.write( (char*)&val<4>(cells[c]), sizeof(int) );
-      out.write( (char*)&val<3>(cells[c]), sizeof(int) );
-   }
-
-   //cellOffsets
-   out.write( (char*)&bytesCellOffsets, bytesPerByteVal );
-   int itmp;
-   for(int c=1; c<=nofCells; c++)
-   {
-      itmp = 4 * c;    
-      out.write( (char*)&itmp, sizeof(int) );
-   }
-
-   //cellTypes
-   out.write( (char*)&bytesCellTypes, bytesPerByteVal );
-   unsigned char vtkCellType = 8;
-   for(int c=0; c<nofCells; c++)
-   {
-      out.write( (char*)&vtkCellType, sizeof(unsigned char) );
-   }
-
-   //DATA SECTION
-   //scalarData
-   for(size_t s=0; s<datanames.size(); ++s)
-   {
-      out.write((char*)&bytesScalarData,bytesPerByteVal);
-      for(size_t d=0; d<nodedata[s].size(); ++d)
-      {
-         //loake kopie machen, da in nodedata "doubles" sind
-         float tmp = (float)nodedata[s][d];
-         out.write((char*)&tmp,sizeof(float));
-      }
-   }
-   out<<"\n</AppendedData>\n";
-   out<<"</VTKFile>";
-   out<<endl;
-   out.close();
-   UBLOG(logDEBUG1,"WbWriterVtkXmlBinary::writeQuadsWithNodeData to "<<vtkfilename<<" - end");
-
-   return vtkfilename;
+    string vtkfilename = filename + getFileExtension();
+    UBLOG(logDEBUG1, "WbWriterVtkXmlBinary::writeQuadsWithNodeData to " << vtkfilename << " - start");
+
+    ofstream out(vtkfilename.c_str(), ios::out | ios::binary);
+    if (!out) {
+        out.clear(); // flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
+        string path = UbSystem::getPathFromString(vtkfilename);
+        if (path.size() > 0) {
+            UbSystem::makeDirectory(path);
+            out.open(vtkfilename.c_str(), ios::out | ios::binary);
+        }
+        if (!out)
+            throw UbException(UB_EXARGS, "couldn't open file " + vtkfilename);
+    }
+
+    int nofNodes = (int)nodes.size();
+    int nofCells = (int)cells.size();
+
+    int bytesPerByteVal      = 4; //==sizeof(int)
+    int bytesPoints          = 3 /*x1/x2/x3        */ * nofNodes * sizeof(float);
+    int bytesCellConnectivty = 4 /*nodes per quad  */ * nofCells * sizeof(int);
+    int bytesCellOffsets     = 1 /*offset per quad */ * nofCells * sizeof(int);
+    int bytesCellTypes       = 1 /*type of quad    */ * nofCells * sizeof(unsigned char);
+    int bytesScalarData      = 1 /*scalar          */ * nofNodes * sizeof(float);
+
+    int offset = 0;
+    // VTK FILE
+    out << "<?xml version=\"1.0\"?>\n";
+    out << "<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\" >"
+        << "\n";
+    out << "   <UnstructuredGrid>"
+        << "\n";
+    out << "      <Piece NumberOfPoints=\"" << nofNodes << "\" NumberOfCells=\"" << nofCells << "\">\n";
+
+    // POINTS SECTION
+    out << "         <Points>\n";
+    out << "            <DataArray type=\"Float32\" NumberOfComponents=\"3\" format=\"appended\" offset=\"" << offset
+        << "\"  />\n";
+    out << "         </Points>\n";
+    offset += (bytesPerByteVal + bytesPoints);
+
+    // CELLS SECTION
+    out << "         <Cells>\n";
+    out << "            <DataArray type=\"Int32\" Name=\"connectivity\" format=\"appended\" offset=\"" << offset
+        << "\" />\n";
+    offset += (bytesPerByteVal + bytesCellConnectivty);
+    out << "            <DataArray type=\"Int32\" Name=\"offsets\" format=\"appended\" offset=\"" << offset
+        << "\" />\n";
+    offset += (bytesPerByteVal + bytesCellOffsets);
+    out << "            <DataArray type=\"UInt8\" Name=\"types\" format=\"appended\" offset=\"" << offset << "\" />\n ";
+    offset += (bytesPerByteVal + bytesCellTypes);
+    out << "         </Cells>\n";
+
+    // DATA SECTION
+    out << "         <PointData>\n";
+    for (size_t s = 0; s < datanames.size(); ++s) {
+        out << "            <DataArray type=\"Float64\" Name=\"" << datanames[s] << "\" format=\"appended\" offset=\""
+            << offset << "\" /> \n";
+        offset += (bytesPerByteVal + bytesScalarData);
+    }
+    out << "         </PointData>\n";
+
+    out << "      </Piece>\n";
+    out << "   </UnstructuredGrid>\n";
+
+    // AppendedData SECTION
+    out << "   <AppendedData encoding=\"raw\">\n";
+    out << "_";
+
+    // POINTS SECTION
+    out.write((char *)&bytesPoints, bytesPerByteVal);
+    for (int n = 0; n < nofNodes; n++) {
+        out.write((char *)&val<1>(nodes[n]), sizeof(float));
+        out.write((char *)&val<2>(nodes[n]), sizeof(float));
+        out.write((char *)&val<3>(nodes[n]), sizeof(float));
+    }
+
+    // CELLS SECTION
+    // cellConnectivity
+    out.write((char *)&bytesCellConnectivty, bytesPerByteVal);
+    for (int c = 0; c < nofCells; c++) {
+        out.write((char *)&val<1>(cells[c]), sizeof(int));
+        out.write((char *)&val<2>(cells[c]), sizeof(int));
+        out.write((char *)&val<4>(cells[c]), sizeof(int));
+        out.write((char *)&val<3>(cells[c]), sizeof(int));
+    }
+
+    // cellOffsets
+    out.write((char *)&bytesCellOffsets, bytesPerByteVal);
+    int itmp;
+    for (int c = 1; c <= nofCells; c++) {
+        itmp = 4 * c;
+        out.write((char *)&itmp, sizeof(int));
+    }
+
+    // cellTypes
+    out.write((char *)&bytesCellTypes, bytesPerByteVal);
+    unsigned char vtkCellType = 8;
+    for (int c = 0; c < nofCells; c++) {
+        out.write((char *)&vtkCellType, sizeof(unsigned char));
+    }
+
+    // DATA SECTION
+    // scalarData
+    for (size_t s = 0; s < datanames.size(); ++s) {
+        out.write((char *)&bytesScalarData, bytesPerByteVal);
+        for (size_t d = 0; d < nodedata[s].size(); ++d) {
+            // loake kopie machen, da in nodedata "doubles" sind
+            float tmp = (float)nodedata[s][d];
+            out.write((char *)&tmp, sizeof(float));
+        }
+    }
+    out << "\n</AppendedData>\n";
+    out << "</VTKFile>";
+    out << endl;
+    out.close();
+    UBLOG(logDEBUG1, "WbWriterVtkXmlBinary::writeQuadsWithNodeData to " << vtkfilename << " - end");
+
+    return vtkfilename;
 }
 /*===============================================================================*/
-string WbWriterVtkXmlBinary::writeQuadsWithCellData(const string& filename,vector< UbTupleFloat3 >& nodes, vector< UbTupleInt4 >& cells, vector< string >& datanames, vector< vector< double > >& celldata)
+string WbWriterVtkXmlBinary::writeQuadsWithCellData(const string &filename, vector<UbTupleFloat3> &nodes,
+                                                    vector<UbTupleInt4> &cells, vector<string> &datanames,
+                                                    vector<vector<double>> &celldata)
 {
-   string vtkfilename = filename+getFileExtension();
-   UBLOG(logDEBUG1,"WbWriterVtkXmlBinary::writeQuadsWithCellData to "<<vtkfilename<<" - start");
-
-   ofstream out(vtkfilename.c_str(),ios::out | ios::binary);
-   if(!out)
-   { 
-      out.clear(); //flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
-      string path = UbSystem::getPathFromString(vtkfilename);
-      if(path.size()>0){ UbSystem::makeDirectory(path); out.open(vtkfilename.c_str(),ios::out | ios::binary);}
-      if(!out) throw UbException(UB_EXARGS,"couldn't open file "+vtkfilename);
-   }
-
-   int nofNodes = (int)nodes.size(); 
-   int nofCells = (int)cells.size(); 
-
-   int bytesPerByteVal      = 4; //==sizeof(int)
-   int bytesPoints          = 3 /*x1/x2/x3        */ * nofNodes * sizeof(float);
-   int bytesCellConnectivty = 4 /*nodes per quad  */ * nofCells * sizeof(int  );
-   int bytesCellOffsets     = 1 /*offset per quad */ * nofCells * sizeof(int  );
-   int bytesCellTypes       = 1 /*type of quad    */ * nofCells * sizeof(unsigned char);
-   int bytesScalarData      = 1 /*scalar          */ * nofCells * sizeof(float); 
-
-   int offset = 0;
-   //VTK FILE
-   out<<"<?xml version=\"1.0\"?>\n";
-   out<<"<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\" >"<<"\n";
-   out<<"   <UnstructuredGrid>"<<"\n";
-   out<<"      <Piece NumberOfPoints=\""<<nofNodes<<"\" NumberOfCells=\""<<nofCells<<"\">\n";
-
-   //POINTS SECTION
-   out<<"         <Points>\n"; 
-   out<<"            <DataArray type=\"Float32\" NumberOfComponents=\"3\" format=\"appended\" offset=\""<< offset <<"\"  />\n";
-   out<<"         </Points>\n";
-   offset += (bytesPerByteVal + bytesPoints);
-
-   //CELLS SECTION
-   out<<"         <Cells>\n";
-   out<<"            <DataArray type=\"Int32\" Name=\"connectivity\" format=\"appended\" offset=\""<< offset <<"\" />\n";
-   offset += (bytesPerByteVal + bytesCellConnectivty); 
-   out<<"            <DataArray type=\"Int32\" Name=\"offsets\" format=\"appended\" offset=\""<< offset <<"\" />\n";
-   offset += (bytesPerByteVal + bytesCellOffsets);
-   out<<"            <DataArray type=\"UInt8\" Name=\"types\" format=\"appended\" offset=\""<< offset <<"\" />\n ";
-   offset += (bytesPerByteVal + bytesCellTypes);
-   out<<"         </Cells>\n";
-
-   //DATA SECTION
-   out<<"         <CellData>\n";
-   for(size_t s=0; s<datanames.size(); ++s)
-   {
-      out<< "            <DataArray type=\"Float32\" Name=\""<< datanames[s] <<"\" format=\"appended\" offset=\""<< offset <<"\" /> \n";
-      offset += (bytesPerByteVal + bytesScalarData);
-   }
-   out<<"         </CellData>\n";
-
-   out<<"      </Piece>\n";
-   out<<"   </UnstructuredGrid>\n";
-
-   // AppendedData SECTION
-   out<<"   <AppendedData encoding=\"raw\">\n";
-   out<<"_";
-
-   //POINTS SECTION
-   out.write((char*)&bytesPoints,bytesPerByteVal);
-   for(int n=0; n<nofNodes; n++)
-   {
-      out.write((char*)&val<1>(nodes[n]),sizeof(float));
-      out.write((char*)&val<2>(nodes[n]),sizeof(float));
-      out.write((char*)&val<3>(nodes[n]),sizeof(float));
-   }
-
-   //CELLS SECTION
-   //cellConnectivity
-   out.write( (char*)&bytesCellConnectivty, bytesPerByteVal );  
-   for(int c=0; c<nofCells; c++) 
-   {
-      out.write( (char*)&val<1>(cells[c]), sizeof(int) );
-      out.write( (char*)&val<2>(cells[c]), sizeof(int) );
-      out.write( (char*)&val<4>(cells[c]), sizeof(int) );
-      out.write( (char*)&val<3>(cells[c]), sizeof(int) );
-   }
-
-   //cellOffsets
-   out.write( (char*)&bytesCellOffsets, bytesPerByteVal );
-   int itmp;
-   for(int c=1; c<=nofCells; c++)
-   {
-      itmp = 4 * c;    
-      out.write( (char*)&itmp, sizeof(int) );
-   }
-
-   //cellTypes
-   out.write( (char*)&bytesCellTypes, bytesPerByteVal );
-   unsigned char vtkCellType = 8;
-   for(int c=0; c<nofCells; c++)
-   {
-      out.write( (char*)&vtkCellType, sizeof(unsigned char) );
-   }
-
-   //DATA SECTION
-   //scalarData
-   for(size_t s=0; s<datanames.size(); ++s)
-   {
-      out.write((char*)&bytesScalarData,bytesPerByteVal);
-      for(size_t d=0; d<celldata[s].size(); ++d)
-      {
-         //loake kopie machen, da in celldata "doubles" sind
-         float tmp = (float)celldata[s][d];
-         out.write((char*)&tmp,sizeof(float));
-      }
-   }
-
-   out<<"\n</AppendedData>\n";
-
-   out<<"</VTKFile>";
-   out<<endl;
-   out.close();
-   UBLOG(logDEBUG1,"WbWriterVtkXmlBinary::writeQuadsWithCellData to "<<vtkfilename<<" - end");
-
-   return vtkfilename;
+    string vtkfilename = filename + getFileExtension();
+    UBLOG(logDEBUG1, "WbWriterVtkXmlBinary::writeQuadsWithCellData to " << vtkfilename << " - start");
+
+    ofstream out(vtkfilename.c_str(), ios::out | ios::binary);
+    if (!out) {
+        out.clear(); // flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
+        string path = UbSystem::getPathFromString(vtkfilename);
+        if (path.size() > 0) {
+            UbSystem::makeDirectory(path);
+            out.open(vtkfilename.c_str(), ios::out | ios::binary);
+        }
+        if (!out)
+            throw UbException(UB_EXARGS, "couldn't open file " + vtkfilename);
+    }
+
+    int nofNodes = (int)nodes.size();
+    int nofCells = (int)cells.size();
+
+    int bytesPerByteVal      = 4; //==sizeof(int)
+    int bytesPoints          = 3 /*x1/x2/x3        */ * nofNodes * sizeof(float);
+    int bytesCellConnectivty = 4 /*nodes per quad  */ * nofCells * sizeof(int);
+    int bytesCellOffsets     = 1 /*offset per quad */ * nofCells * sizeof(int);
+    int bytesCellTypes       = 1 /*type of quad    */ * nofCells * sizeof(unsigned char);
+    int bytesScalarData      = 1 /*scalar          */ * nofCells * sizeof(float);
+
+    int offset = 0;
+    // VTK FILE
+    out << "<?xml version=\"1.0\"?>\n";
+    out << "<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\" >"
+        << "\n";
+    out << "   <UnstructuredGrid>"
+        << "\n";
+    out << "      <Piece NumberOfPoints=\"" << nofNodes << "\" NumberOfCells=\"" << nofCells << "\">\n";
+
+    // POINTS SECTION
+    out << "         <Points>\n";
+    out << "            <DataArray type=\"Float32\" NumberOfComponents=\"3\" format=\"appended\" offset=\"" << offset
+        << "\"  />\n";
+    out << "         </Points>\n";
+    offset += (bytesPerByteVal + bytesPoints);
+
+    // CELLS SECTION
+    out << "         <Cells>\n";
+    out << "            <DataArray type=\"Int32\" Name=\"connectivity\" format=\"appended\" offset=\"" << offset
+        << "\" />\n";
+    offset += (bytesPerByteVal + bytesCellConnectivty);
+    out << "            <DataArray type=\"Int32\" Name=\"offsets\" format=\"appended\" offset=\"" << offset
+        << "\" />\n";
+    offset += (bytesPerByteVal + bytesCellOffsets);
+    out << "            <DataArray type=\"UInt8\" Name=\"types\" format=\"appended\" offset=\"" << offset << "\" />\n ";
+    offset += (bytesPerByteVal + bytesCellTypes);
+    out << "         </Cells>\n";
+
+    // DATA SECTION
+    out << "         <CellData>\n";
+    for (size_t s = 0; s < datanames.size(); ++s) {
+        out << "            <DataArray type=\"Float32\" Name=\"" << datanames[s] << "\" format=\"appended\" offset=\""
+            << offset << "\" /> \n";
+        offset += (bytesPerByteVal + bytesScalarData);
+    }
+    out << "         </CellData>\n";
+
+    out << "      </Piece>\n";
+    out << "   </UnstructuredGrid>\n";
+
+    // AppendedData SECTION
+    out << "   <AppendedData encoding=\"raw\">\n";
+    out << "_";
+
+    // POINTS SECTION
+    out.write((char *)&bytesPoints, bytesPerByteVal);
+    for (int n = 0; n < nofNodes; n++) {
+        out.write((char *)&val<1>(nodes[n]), sizeof(float));
+        out.write((char *)&val<2>(nodes[n]), sizeof(float));
+        out.write((char *)&val<3>(nodes[n]), sizeof(float));
+    }
+
+    // CELLS SECTION
+    // cellConnectivity
+    out.write((char *)&bytesCellConnectivty, bytesPerByteVal);
+    for (int c = 0; c < nofCells; c++) {
+        out.write((char *)&val<1>(cells[c]), sizeof(int));
+        out.write((char *)&val<2>(cells[c]), sizeof(int));
+        out.write((char *)&val<4>(cells[c]), sizeof(int));
+        out.write((char *)&val<3>(cells[c]), sizeof(int));
+    }
+
+    // cellOffsets
+    out.write((char *)&bytesCellOffsets, bytesPerByteVal);
+    int itmp;
+    for (int c = 1; c <= nofCells; c++) {
+        itmp = 4 * c;
+        out.write((char *)&itmp, sizeof(int));
+    }
+
+    // cellTypes
+    out.write((char *)&bytesCellTypes, bytesPerByteVal);
+    unsigned char vtkCellType = 8;
+    for (int c = 0; c < nofCells; c++) {
+        out.write((char *)&vtkCellType, sizeof(unsigned char));
+    }
+
+    // DATA SECTION
+    // scalarData
+    for (size_t s = 0; s < datanames.size(); ++s) {
+        out.write((char *)&bytesScalarData, bytesPerByteVal);
+        for (size_t d = 0; d < celldata[s].size(); ++d) {
+            // loake kopie machen, da in celldata "doubles" sind
+            float tmp = (float)celldata[s][d];
+            out.write((char *)&tmp, sizeof(float));
+        }
+    }
+
+    out << "\n</AppendedData>\n";
+
+    out << "</VTKFile>";
+    out << endl;
+    out.close();
+    UBLOG(logDEBUG1, "WbWriterVtkXmlBinary::writeQuadsWithCellData to " << vtkfilename << " - end");
+
+    return vtkfilename;
 }
 /*===============================================================================*/
-string WbWriterVtkXmlBinary::writeQuadsWithNodeAndCellData(const string& filename,vector< UbTupleFloat3 >& nodes, vector< UbTupleInt4 >& cells, 
-                                                                vector< string >& nodedatanames, vector< vector< double > >& nodedata, vector< string >& celldatanames,
-                                                                vector< vector< double > >& celldata                                                                    )
+string WbWriterVtkXmlBinary::writeQuadsWithNodeAndCellData(const string &filename, vector<UbTupleFloat3> &nodes,
+                                                           vector<UbTupleInt4> &cells, vector<string> &nodedatanames,
+                                                           vector<vector<double>> &nodedata,
+                                                           vector<string> &celldatanames,
+                                                           vector<vector<double>> &celldata)
 {
-   string vtkfilename = filename+getFileExtension();
-   UBLOG(logDEBUG1,"WbWriterVtkXmlBinary::writeQuadsWithNodeAndCellData to "<<vtkfilename<<" - start");
-
-   ofstream out(vtkfilename.c_str(),ios::out | ios::binary);
-   if(!out)
-   { 
-      out.clear(); //flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
-      string path = UbSystem::getPathFromString(vtkfilename);
-      if(path.size()>0){ UbSystem::makeDirectory(path); out.open(vtkfilename.c_str(),ios::out | ios::binary);}
-      if(!out) throw UbException(UB_EXARGS,"couldn't open file "+vtkfilename);
-   }
-
-   int nofNodes = (int)nodes.size(); 
-   int nofCells = (int)cells.size(); 
-
-   int bytesPerByteVal      = 4; //==sizeof(int)
-   int bytesPoints          = 3 /*x1/x2/x3        */ * nofNodes * sizeof(float);
-   int bytesCellConnectivty = 4 /*nodes per quad  */ * nofCells * sizeof(int  );
-   int bytesCellOffsets     = 1 /*offset per quad */ * nofCells * sizeof(int  );
-   int bytesCellTypes       = 1 /*type of quad    */ * nofCells * sizeof(unsigned char);
-   int bytesScalarDataPoint = 1 /*scalar          */ * nofNodes * sizeof(float); 
-   int bytesScalarDataCell  = 1 /*scalar          */ * nofCells * sizeof(float); 
-
-   int offset = 0;
-   //VTK FILE
-   out<<"<?xml version=\"1.0\"?>\n";
-   out<<"<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\" >"<<"\n";
-   out<<"   <UnstructuredGrid>"<<"\n";
-   out<<"      <Piece NumberOfPoints=\""<<nofNodes<<"\" NumberOfCells=\""<<nofCells<<"\">\n";
-
-   //POINTS SECTION
-   out<<"         <Points>\n"; 
-   out<<"            <DataArray type=\"Float32\" NumberOfComponents=\"3\" format=\"appended\" offset=\""<< offset <<"\"  />\n";
-   out<<"         </Points>\n";
-   offset += (bytesPerByteVal + bytesPoints);
-
-   //CELLS SECTION
-   out<<"         <Cells>\n";
-   out<<"            <DataArray type=\"Int32\" Name=\"connectivity\" format=\"appended\" offset=\""<< offset <<"\" />\n";
-   offset += (bytesPerByteVal + bytesCellConnectivty); 
-   out<<"            <DataArray type=\"Int32\" Name=\"offsets\" format=\"appended\" offset=\""<< offset <<"\" />\n";
-   offset += (bytesPerByteVal + bytesCellOffsets);
-   out<<"            <DataArray type=\"UInt8\" Name=\"types\" format=\"appended\" offset=\""<< offset <<"\" />\n ";
-   offset += (bytesPerByteVal + bytesCellTypes);
-   out<<"         </Cells>\n";
-
-   // Point DATA SECTION
-   out<<"         <PointData>\n";
-   for(size_t s=0; s<nodedatanames.size(); ++s)
-   {
-      out<< "            <DataArray type=\"Float32\" Name=\""<< nodedatanames[s] <<"\" format=\"appended\" offset=\""<< offset <<"\" /> \n";
-      offset += (bytesPerByteVal + bytesScalarDataPoint);
-   }
-   out<<"         </PointData>\n";
-
-
-   // Cell DATA SECTION
-   out<<"         <CellData>\n";
-   for(size_t s=0; s<celldatanames.size(); ++s)
-   {
-      out<< "            <DataArray type=\"Float32\" Name=\""<< celldatanames[s] <<"\" format=\"appended\" offset=\""<< offset <<"\" /> \n";
-      offset += (bytesPerByteVal + bytesScalarDataCell);
-   }
-   out<<"         </CellData>\n";
-   out<<"      </Piece>\n";
-   out<<"   </UnstructuredGrid>\n";
-
-   // AppendedData SECTION
-   out<<"   <AppendedData encoding=\"raw\">\n";
-   out<<"_";
-
-   //POINTS SECTION
-   out.write((char*)&bytesPoints,bytesPerByteVal);
-   for(int n=0; n<nofNodes; n++)
-   {
-      out.write((char*)&val<1>(nodes[n]),sizeof(float));
-      out.write((char*)&val<2>(nodes[n]),sizeof(float));
-      out.write((char*)&val<3>(nodes[n]),sizeof(float));
-   }
-
-   //CELLS SECTION
-   //cellConnectivity
-   out.write( (char*)&bytesCellConnectivty, bytesPerByteVal );  
-   for(int c=0; c<nofCells; c++) 
-   {
-      out.write( (char*)&val<1>(cells[c]), sizeof(int) );
-      out.write( (char*)&val<2>(cells[c]), sizeof(int) );
-      out.write( (char*)&val<4>(cells[c]), sizeof(int) );
-      out.write( (char*)&val<3>(cells[c]), sizeof(int) );
-   }
-
-   //cellOffsets
-   out.write( (char*)&bytesCellOffsets, bytesPerByteVal );
-   int itmp;
-   for(int c=1; c<=nofCells; c++)
-   {
-      itmp = 4 * c;    
-      out.write( (char*)&itmp, sizeof(int) );
-   }
-
-   //cellTypes
-   out.write( (char*)&bytesCellTypes, bytesPerByteVal );
-   unsigned char vtkCellType = 8;
-   for(int c=0; c<nofCells; c++)
-   {
-      out.write( (char*)&vtkCellType, sizeof(unsigned char) );
-   }
-
-   //Point DATA SECTION
-   //scalarData
-   for(size_t s=0; s<nodedatanames.size(); ++s)
-   {
-      out.write((char*)&bytesScalarDataPoint,bytesPerByteVal);
-      for(size_t d=0; d<nodedata[s].size(); ++d)
-      {
-         //loake kopie machen, da in nodedata "doubles" sind
-         float tmp = (float)nodedata[s][d];
-         out.write((char*)&tmp,sizeof(float));
-      }
-   }
-   //Cell DATA SECTION
-   //scalarData
-   for(size_t s=0; s<celldatanames.size(); ++s)
-   {
-      out.write((char*)&bytesScalarDataCell,bytesPerByteVal);
-      for(size_t d=0; d<celldata[s].size(); ++d)
-      {
-         //loake kopie machen, da in celldata "doubles" sind
-         float tmp = (float)celldata[s][d];
-         out.write((char*)&tmp,sizeof(float));
-      }
-   }
-   out<<"\n</AppendedData>\n";
-   out<<"</VTKFile>";
-   out<<endl;
-   out.close();
-   UBLOG(logDEBUG1,"WbWriterVtkXmlBinary::writeQuadsWithNodeAndCellData to "<<vtkfilename<<" - end");
-
-   return vtkfilename;
+    string vtkfilename = filename + getFileExtension();
+    UBLOG(logDEBUG1, "WbWriterVtkXmlBinary::writeQuadsWithNodeAndCellData to " << vtkfilename << " - start");
+
+    ofstream out(vtkfilename.c_str(), ios::out | ios::binary);
+    if (!out) {
+        out.clear(); // flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
+        string path = UbSystem::getPathFromString(vtkfilename);
+        if (path.size() > 0) {
+            UbSystem::makeDirectory(path);
+            out.open(vtkfilename.c_str(), ios::out | ios::binary);
+        }
+        if (!out)
+            throw UbException(UB_EXARGS, "couldn't open file " + vtkfilename);
+    }
+
+    int nofNodes = (int)nodes.size();
+    int nofCells = (int)cells.size();
+
+    int bytesPerByteVal      = 4; //==sizeof(int)
+    int bytesPoints          = 3 /*x1/x2/x3        */ * nofNodes * sizeof(float);
+    int bytesCellConnectivty = 4 /*nodes per quad  */ * nofCells * sizeof(int);
+    int bytesCellOffsets     = 1 /*offset per quad */ * nofCells * sizeof(int);
+    int bytesCellTypes       = 1 /*type of quad    */ * nofCells * sizeof(unsigned char);
+    int bytesScalarDataPoint = 1 /*scalar          */ * nofNodes * sizeof(float);
+    int bytesScalarDataCell  = 1 /*scalar          */ * nofCells * sizeof(float);
+
+    int offset = 0;
+    // VTK FILE
+    out << "<?xml version=\"1.0\"?>\n";
+    out << "<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\" >"
+        << "\n";
+    out << "   <UnstructuredGrid>"
+        << "\n";
+    out << "      <Piece NumberOfPoints=\"" << nofNodes << "\" NumberOfCells=\"" << nofCells << "\">\n";
+
+    // POINTS SECTION
+    out << "         <Points>\n";
+    out << "            <DataArray type=\"Float32\" NumberOfComponents=\"3\" format=\"appended\" offset=\"" << offset
+        << "\"  />\n";
+    out << "         </Points>\n";
+    offset += (bytesPerByteVal + bytesPoints);
+
+    // CELLS SECTION
+    out << "         <Cells>\n";
+    out << "            <DataArray type=\"Int32\" Name=\"connectivity\" format=\"appended\" offset=\"" << offset
+        << "\" />\n";
+    offset += (bytesPerByteVal + bytesCellConnectivty);
+    out << "            <DataArray type=\"Int32\" Name=\"offsets\" format=\"appended\" offset=\"" << offset
+        << "\" />\n";
+    offset += (bytesPerByteVal + bytesCellOffsets);
+    out << "            <DataArray type=\"UInt8\" Name=\"types\" format=\"appended\" offset=\"" << offset << "\" />\n ";
+    offset += (bytesPerByteVal + bytesCellTypes);
+    out << "         </Cells>\n";
+
+    // Point DATA SECTION
+    out << "         <PointData>\n";
+    for (size_t s = 0; s < nodedatanames.size(); ++s) {
+        out << "            <DataArray type=\"Float32\" Name=\"" << nodedatanames[s]
+            << "\" format=\"appended\" offset=\"" << offset << "\" /> \n";
+        offset += (bytesPerByteVal + bytesScalarDataPoint);
+    }
+    out << "         </PointData>\n";
+
+    // Cell DATA SECTION
+    out << "         <CellData>\n";
+    for (size_t s = 0; s < celldatanames.size(); ++s) {
+        out << "            <DataArray type=\"Float32\" Name=\"" << celldatanames[s]
+            << "\" format=\"appended\" offset=\"" << offset << "\" /> \n";
+        offset += (bytesPerByteVal + bytesScalarDataCell);
+    }
+    out << "         </CellData>\n";
+    out << "      </Piece>\n";
+    out << "   </UnstructuredGrid>\n";
+
+    // AppendedData SECTION
+    out << "   <AppendedData encoding=\"raw\">\n";
+    out << "_";
+
+    // POINTS SECTION
+    out.write((char *)&bytesPoints, bytesPerByteVal);
+    for (int n = 0; n < nofNodes; n++) {
+        out.write((char *)&val<1>(nodes[n]), sizeof(float));
+        out.write((char *)&val<2>(nodes[n]), sizeof(float));
+        out.write((char *)&val<3>(nodes[n]), sizeof(float));
+    }
+
+    // CELLS SECTION
+    // cellConnectivity
+    out.write((char *)&bytesCellConnectivty, bytesPerByteVal);
+    for (int c = 0; c < nofCells; c++) {
+        out.write((char *)&val<1>(cells[c]), sizeof(int));
+        out.write((char *)&val<2>(cells[c]), sizeof(int));
+        out.write((char *)&val<4>(cells[c]), sizeof(int));
+        out.write((char *)&val<3>(cells[c]), sizeof(int));
+    }
+
+    // cellOffsets
+    out.write((char *)&bytesCellOffsets, bytesPerByteVal);
+    int itmp;
+    for (int c = 1; c <= nofCells; c++) {
+        itmp = 4 * c;
+        out.write((char *)&itmp, sizeof(int));
+    }
+
+    // cellTypes
+    out.write((char *)&bytesCellTypes, bytesPerByteVal);
+    unsigned char vtkCellType = 8;
+    for (int c = 0; c < nofCells; c++) {
+        out.write((char *)&vtkCellType, sizeof(unsigned char));
+    }
+
+    // Point DATA SECTION
+    // scalarData
+    for (size_t s = 0; s < nodedatanames.size(); ++s) {
+        out.write((char *)&bytesScalarDataPoint, bytesPerByteVal);
+        for (size_t d = 0; d < nodedata[s].size(); ++d) {
+            // loake kopie machen, da in nodedata "doubles" sind
+            float tmp = (float)nodedata[s][d];
+            out.write((char *)&tmp, sizeof(float));
+        }
+    }
+    // Cell DATA SECTION
+    // scalarData
+    for (size_t s = 0; s < celldatanames.size(); ++s) {
+        out.write((char *)&bytesScalarDataCell, bytesPerByteVal);
+        for (size_t d = 0; d < celldata[s].size(); ++d) {
+            // loake kopie machen, da in celldata "doubles" sind
+            float tmp = (float)celldata[s][d];
+            out.write((char *)&tmp, sizeof(float));
+        }
+    }
+    out << "\n</AppendedData>\n";
+    out << "</VTKFile>";
+    out << endl;
+    out.close();
+    UBLOG(logDEBUG1, "WbWriterVtkXmlBinary::writeQuadsWithNodeAndCellData to " << vtkfilename << " - end");
+
+    return vtkfilename;
 }
 /*===============================================================================*/
-string WbWriterVtkXmlBinary::writeOctsWithCellData(const string& filename,vector<UbTupleFloat3 >& nodes, vector<UbTupleInt8 >& cells, vector<string >& datanames, vector<vector<double > >& celldata)
+string WbWriterVtkXmlBinary::writeOctsWithCellData(const string &filename, vector<UbTupleFloat3> &nodes,
+                                                   vector<UbTupleInt8> &cells, vector<string> &datanames,
+                                                   vector<vector<double>> &celldata)
 {
-   string vtkfilename = filename+getFileExtension();
-   UBLOG(logDEBUG1,"WbWriterVtkXmlBinary::writeOctsWithCellData to "<<vtkfilename<<" - start");
-
-   ofstream out(vtkfilename.c_str(),ios::out | ios::binary);
-   if(!out)
-   { 
-      out.clear(); //flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
-      string path = UbSystem::getPathFromString(vtkfilename);
-      if(path.size()>0){ UbSystem::makeDirectory(path); out.open(vtkfilename.c_str(),ios::out | ios::binary);}
-      if(!out) throw UbException(UB_EXARGS,"couldn't open file "+vtkfilename);
-   }
-
-   int nofNodes = (int)nodes.size(); 
-   int nofCells = (int)cells.size(); 
-
-   int bytesPerByteVal      = 4; //==sizeof(int)
-   int bytesPoints          = 3 /*x1/x2/x3      */ * nofNodes * sizeof(float);
-   int bytesCellConnectivty = 8 /*nodes per oct */ * nofCells * sizeof(int  );
-   int bytesCellOffsets     = 1 /*offset per oct*/ * nofCells * sizeof(int  );
-   int bytesCellTypes       = 1 /*type of oct   */ * nofCells * sizeof(unsigned char);
-   int bytesScalarData      = 1 /*scalar        */ * nofCells * sizeof(float); 
-
-   int offset = 0;
-   //VTK FILE
-   out<<"<?xml version=\"1.0\"?>\n";
-   out<<"<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\" >"<<"\n";
-   out<<"   <UnstructuredGrid>"<<"\n";
-   out<<"      <Piece NumberOfPoints=\""<<nofNodes<<"\" NumberOfCells=\""<<nofCells<<"\">\n";
-
-   //POINTS SECTION
-   out<<"         <Points>\n"; 
-   out<<"            <DataArray type=\"Float32\" NumberOfComponents=\"3\" format=\"appended\" offset=\""<< offset <<"\"  />\n";
-   out<<"         </Points>\n";
-   offset += (bytesPerByteVal + bytesPoints);
-
-   //CELLS SECTION
-   out<<"         <Cells>\n";
-   out<<"            <DataArray type=\"Int32\" Name=\"connectivity\" format=\"appended\" offset=\""<< offset <<"\" />\n";
-   offset += (bytesPerByteVal + bytesCellConnectivty); 
-   out<<"            <DataArray type=\"Int32\" Name=\"offsets\" format=\"appended\" offset=\""<< offset <<"\" />\n";
-   offset += (bytesPerByteVal + bytesCellOffsets);
-   out<<"            <DataArray type=\"UInt8\" Name=\"types\" format=\"appended\" offset=\""<< offset <<"\" />\n ";
-   offset += (bytesPerByteVal + bytesCellTypes);
-   out<<"         </Cells>\n";
-
-   //DATA SECTION
-   out<<"         <CellData>\n";
-   for(size_t s=0; s<datanames.size(); ++s)
-   {
-      out<< "            <DataArray type=\"Float32\" Name=\""<< datanames[s] <<"\" format=\"appended\" offset=\""<< offset <<"\" /> \n";
-      offset += (bytesPerByteVal + bytesScalarData);
-   }
-   out<<"         </CellData>\n";
-
-   out<<"      </Piece>\n";
-   out<<"   </UnstructuredGrid>\n";
-
-   // AppendedData SECTION
-   out<<"   <AppendedData encoding=\"raw\">\n";
-   out<<"_";
-
-   //POINTS SECTION
-   out.write((char*)&bytesPoints,bytesPerByteVal);
-   for(int n=0; n<nofNodes; n++)
-   {
-      out.write((char*)&val<1>(nodes[n]),sizeof(float));
-      out.write((char*)&val<2>(nodes[n]),sizeof(float));
-      out.write((char*)&val<3>(nodes[n]),sizeof(float));
-   }
-
-   //CELLS SECTION
-   //cellConnectivity
-   out.write( (char*)&bytesCellConnectivty, bytesPerByteVal );  
-   for(int c=0; c<nofCells; c++) 
-   {
-      out.write( (char*)&val<1>(cells[c]), sizeof(int) );
-      out.write( (char*)&val<2>(cells[c]), sizeof(int) );
-      out.write( (char*)&val<4>(cells[c]), sizeof(int) );
-      out.write( (char*)&val<3>(cells[c]), sizeof(int) );
-      out.write( (char*)&val<5>(cells[c]), sizeof(int) );
-      out.write( (char*)&val<6>(cells[c]), sizeof(int) );
-      out.write( (char*)&val<8>(cells[c]), sizeof(int) );
-      out.write( (char*)&val<7>(cells[c]), sizeof(int) );
-   }
-
-   //cellOffsets
-   out.write( (char*)&bytesCellOffsets, bytesPerByteVal );
-   int itmp;
-   for(int c=1; c<=nofCells; c++)
-   {
-      itmp = 8 * c;    
-      out.write( (char*)&itmp, sizeof(int) );
-   }
-
-   //cellTypes
-   out.write( (char*)&bytesCellTypes, bytesPerByteVal );
-   unsigned char vtkCellType = 11;
-   for(int c=0; c<nofCells; c++)
-   {
-      out.write( (char*)&vtkCellType, sizeof(unsigned char) );
-   }
-
-   //DATA SECTION
-   //scalarData
-   for(size_t s=0; s<datanames.size(); ++s)
-   {
-      out.write((char*)&bytesScalarData,bytesPerByteVal);
-      for(size_t d=0; d<celldata[s].size(); ++d)
-      {
-         //loake kopie machen, da in celldata "doubles" sind
-         float tmp = (float)celldata[s][d];
-         out.write((char*)&tmp,sizeof(float));
-      }
-   }
-   out<<"\n</AppendedData>\n";
-   out<<"</VTKFile>";
-   out<<endl;
-   out.close();
-   UBLOG(logDEBUG1,"WbWriterVtkXmlBinary::writeOctsWithCellData to "<<vtkfilename<<" - end");
-
-   return vtkfilename;
+    string vtkfilename = filename + getFileExtension();
+    UBLOG(logDEBUG1, "WbWriterVtkXmlBinary::writeOctsWithCellData to " << vtkfilename << " - start");
+
+    ofstream out(vtkfilename.c_str(), ios::out | ios::binary);
+    if (!out) {
+        out.clear(); // flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
+        string path = UbSystem::getPathFromString(vtkfilename);
+        if (path.size() > 0) {
+            UbSystem::makeDirectory(path);
+            out.open(vtkfilename.c_str(), ios::out | ios::binary);
+        }
+        if (!out)
+            throw UbException(UB_EXARGS, "couldn't open file " + vtkfilename);
+    }
+
+    int nofNodes = (int)nodes.size();
+    int nofCells = (int)cells.size();
+
+    int bytesPerByteVal      = 4; //==sizeof(int)
+    int bytesPoints          = 3 /*x1/x2/x3      */ * nofNodes * sizeof(float);
+    int bytesCellConnectivty = 8 /*nodes per oct */ * nofCells * sizeof(int);
+    int bytesCellOffsets     = 1 /*offset per oct*/ * nofCells * sizeof(int);
+    int bytesCellTypes       = 1 /*type of oct   */ * nofCells * sizeof(unsigned char);
+    int bytesScalarData      = 1 /*scalar        */ * nofCells * sizeof(float);
+
+    int offset = 0;
+    // VTK FILE
+    out << "<?xml version=\"1.0\"?>\n";
+    out << "<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\" >"
+        << "\n";
+    out << "   <UnstructuredGrid>"
+        << "\n";
+    out << "      <Piece NumberOfPoints=\"" << nofNodes << "\" NumberOfCells=\"" << nofCells << "\">\n";
+
+    // POINTS SECTION
+    out << "         <Points>\n";
+    out << "            <DataArray type=\"Float32\" NumberOfComponents=\"3\" format=\"appended\" offset=\"" << offset
+        << "\"  />\n";
+    out << "         </Points>\n";
+    offset += (bytesPerByteVal + bytesPoints);
+
+    // CELLS SECTION
+    out << "         <Cells>\n";
+    out << "            <DataArray type=\"Int32\" Name=\"connectivity\" format=\"appended\" offset=\"" << offset
+        << "\" />\n";
+    offset += (bytesPerByteVal + bytesCellConnectivty);
+    out << "            <DataArray type=\"Int32\" Name=\"offsets\" format=\"appended\" offset=\"" << offset
+        << "\" />\n";
+    offset += (bytesPerByteVal + bytesCellOffsets);
+    out << "            <DataArray type=\"UInt8\" Name=\"types\" format=\"appended\" offset=\"" << offset << "\" />\n ";
+    offset += (bytesPerByteVal + bytesCellTypes);
+    out << "         </Cells>\n";
+
+    // DATA SECTION
+    out << "         <CellData>\n";
+    for (size_t s = 0; s < datanames.size(); ++s) {
+        out << "            <DataArray type=\"Float32\" Name=\"" << datanames[s] << "\" format=\"appended\" offset=\""
+            << offset << "\" /> \n";
+        offset += (bytesPerByteVal + bytesScalarData);
+    }
+    out << "         </CellData>\n";
+
+    out << "      </Piece>\n";
+    out << "   </UnstructuredGrid>\n";
+
+    // AppendedData SECTION
+    out << "   <AppendedData encoding=\"raw\">\n";
+    out << "_";
+
+    // POINTS SECTION
+    out.write((char *)&bytesPoints, bytesPerByteVal);
+    for (int n = 0; n < nofNodes; n++) {
+        out.write((char *)&val<1>(nodes[n]), sizeof(float));
+        out.write((char *)&val<2>(nodes[n]), sizeof(float));
+        out.write((char *)&val<3>(nodes[n]), sizeof(float));
+    }
+
+    // CELLS SECTION
+    // cellConnectivity
+    out.write((char *)&bytesCellConnectivty, bytesPerByteVal);
+    for (int c = 0; c < nofCells; c++) {
+        out.write((char *)&val<1>(cells[c]), sizeof(int));
+        out.write((char *)&val<2>(cells[c]), sizeof(int));
+        out.write((char *)&val<4>(cells[c]), sizeof(int));
+        out.write((char *)&val<3>(cells[c]), sizeof(int));
+        out.write((char *)&val<5>(cells[c]), sizeof(int));
+        out.write((char *)&val<6>(cells[c]), sizeof(int));
+        out.write((char *)&val<8>(cells[c]), sizeof(int));
+        out.write((char *)&val<7>(cells[c]), sizeof(int));
+    }
+
+    // cellOffsets
+    out.write((char *)&bytesCellOffsets, bytesPerByteVal);
+    int itmp;
+    for (int c = 1; c <= nofCells; c++) {
+        itmp = 8 * c;
+        out.write((char *)&itmp, sizeof(int));
+    }
+
+    // cellTypes
+    out.write((char *)&bytesCellTypes, bytesPerByteVal);
+    unsigned char vtkCellType = 11;
+    for (int c = 0; c < nofCells; c++) {
+        out.write((char *)&vtkCellType, sizeof(unsigned char));
+    }
+
+    // DATA SECTION
+    // scalarData
+    for (size_t s = 0; s < datanames.size(); ++s) {
+        out.write((char *)&bytesScalarData, bytesPerByteVal);
+        for (size_t d = 0; d < celldata[s].size(); ++d) {
+            // loake kopie machen, da in celldata "doubles" sind
+            float tmp = (float)celldata[s][d];
+            out.write((char *)&tmp, sizeof(float));
+        }
+    }
+    out << "\n</AppendedData>\n";
+    out << "</VTKFile>";
+    out << endl;
+    out.close();
+    UBLOG(logDEBUG1, "WbWriterVtkXmlBinary::writeOctsWithCellData to " << vtkfilename << " - end");
+
+    return vtkfilename;
 }
 /*===============================================================================*/
-string WbWriterVtkXmlBinary::writeOctsWithNodeData(const string& filename,vector<UbTupleFloat3 >& nodes, vector<UbTupleUInt8 >& cells, vector<string >& datanames, vector<vector<double > >& nodedata)
+string WbWriterVtkXmlBinary::writeOctsWithNodeData(const string &filename, vector<UbTupleFloat3> &nodes,
+                                                   vector<UbTupleUInt8> &cells, vector<string> &datanames,
+                                                   vector<vector<double>> &nodedata)
 {
-   string vtkfilename = filename+getFileExtension();
-   UBLOG(logDEBUG1,"WbWriterVtkXmlBinary::writeOctsWithNodeData to "<<vtkfilename<<" - start");
-
-   ofstream out(vtkfilename.c_str(),ios::out | ios::binary);
-   if(!out)
-   { 
-      out.clear(); //flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
-      string path = UbSystem::getPathFromString(vtkfilename);
-      if(path.size()>0){ UbSystem::makeDirectory(path); out.open(vtkfilename.c_str(),ios::out | ios::binary);}
-      if(!out) throw UbException(UB_EXARGS,"couldn't open file "+vtkfilename);
-   }
-
-   int nofNodes = (int)nodes.size(); 
-   int nofCells = (int)cells.size(); 
-
-   int bytesPerByteVal      = 4; //==sizeof(int)
-   int bytesPoints          = 3 /*x1/x2/x3      */ * nofNodes * sizeof(float);
-   int bytesCellConnectivty = 8 /*nodes per oct */ * nofCells * sizeof(int  );
-   int bytesCellOffsets     = 1 /*offset per oct*/ * nofCells * sizeof(int  );
-   int bytesCellTypes       = 1 /*type of oct   */ * nofCells * sizeof(unsigned char);
-   int bytesScalarData      = 1 /*scalar        */ * nofNodes * sizeof(double); 
-
-   unsigned long long offset = 0;
-   //VTK FILE
-   out<<"<?xml version=\"2.0\"?>\n";
-   out<<"<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\" >"<<"\n";
-   out<<"   <UnstructuredGrid>"<<"\n";
-   out<<"      <Piece NumberOfPoints=\""<<nofNodes<<"\" NumberOfCells=\""<<nofCells<<"\">\n";
-
-   //POINTS SECTION
-   out<<"         <Points>\n"; 
-   out<<"            <DataArray type=\"Float32\" NumberOfComponents=\"3\" format=\"appended\" offset=\""<< offset <<"\"  />\n";
-   out<<"         </Points>\n";
-   offset += (bytesPerByteVal + bytesPoints);
-
-   //CELLS SECTION
-   out<<"         <Cells>\n";
-   out<<"            <DataArray type=\"Int32\" Name=\"connectivity\" format=\"appended\" offset=\""<< offset <<"\" />\n";
-   offset += (bytesPerByteVal + bytesCellConnectivty); 
-   out<<"            <DataArray type=\"Int32\" Name=\"offsets\" format=\"appended\" offset=\""<< offset <<"\" />\n";
-   offset += (bytesPerByteVal + bytesCellOffsets);
-   out<<"            <DataArray type=\"UInt8\" Name=\"types\" format=\"appended\" offset=\""<< offset <<"\" />\n ";
-   offset += (bytesPerByteVal + bytesCellTypes);
-   out<<"         </Cells>\n";
-
-   //DATA SECTION
-   out<<"         <PointData>\n";
-   for(size_t s=0; s<datanames.size(); ++s)
-   {
-      out<< "            <DataArray type=\"Float64\" Name=\""<< datanames[s] <<"\" format=\"appended\" offset=\""<< offset <<"\" /> \n";
-      offset += (bytesPerByteVal + bytesScalarData);
-   }
-   out<<"         </PointData>\n";
-
-   out<<"      </Piece>\n";
-   out<<"   </UnstructuredGrid>\n";
-
-   // AppendedData SECTION
-   out<<"   <AppendedData encoding=\"raw\">\n";
-   out<<"_";
-
-   //POINTS SECTION
-   out.write((char*)&bytesPoints,bytesPerByteVal);
-   for(int n=0; n<nofNodes; n++)
-   {
-      out.write((char*)&val<1>(nodes[n]),sizeof(float));
-      out.write((char*)&val<2>(nodes[n]),sizeof(float));
-      out.write((char*)&val<3>(nodes[n]),sizeof(float));
-   }
-
-   //CELLS SECTION
-   //cellConnectivity
-   out.write( (char*)&bytesCellConnectivty, bytesPerByteVal );  
-   for(int c=0; c<nofCells; c++) 
-   {
-      out.write( (char*)&val<1>(cells[c]), sizeof(int) );
-      out.write( (char*)&val<2>(cells[c]), sizeof(int) );
-      out.write( (char*)&val<4>(cells[c]), sizeof(int) );
-      out.write( (char*)&val<3>(cells[c]), sizeof(int) );
-      out.write( (char*)&val<5>(cells[c]), sizeof(int) );
-      out.write( (char*)&val<6>(cells[c]), sizeof(int) );
-      out.write( (char*)&val<8>(cells[c]), sizeof(int) );
-      out.write( (char*)&val<7>(cells[c]), sizeof(int) );
-   }
-
-   //cellOffsets
-   out.write( (char*)&bytesCellOffsets, bytesPerByteVal );
-   int itmp;
-   for(int c=1; c<=nofCells; c++)
-   {
-      itmp = 8 * c;    
-      out.write( (char*)&itmp, sizeof(int) );
-   }
-
-   //cellTypes
-   out.write( (char*)&bytesCellTypes, bytesPerByteVal );
-   unsigned char vtkCellType = 11;
-   for(int c=0; c<nofCells; c++)
-   {
-      out.write( (char*)&vtkCellType, sizeof(unsigned char) );
-   }
-
-   //DATA SECTION
-   //scalarData
-   for(size_t s=0; s<datanames.size(); ++s)
-   {
-      out.write((char*)&bytesScalarData,bytesPerByteVal);
-      for(size_t d=0; d<nodedata[s].size(); ++d)
-      {
-         //loake kopie machen, da in nodedata "doubles" sind
-         //float tmp = (float)nodedata[s][d];
-         //out.write((char*)&tmp,sizeof(float));
-         double tmp = nodedata[s][d];
-         out.write((char*)&tmp,sizeof(double));
-      }
-   }
-   out<<"\n</AppendedData>\n";
-   out<<"</VTKFile>";
-   out<<endl;
-   out.close();
-   UBLOG(logDEBUG1,"WbWriterVtkXmlBinary::writeOctsWithNodeData to "<<vtkfilename<<" - end");
-
-   return vtkfilename;
+    string vtkfilename = filename + getFileExtension();
+    UBLOG(logDEBUG1, "WbWriterVtkXmlBinary::writeOctsWithNodeData to " << vtkfilename << " - start");
+
+    ofstream out(vtkfilename.c_str(), ios::out | ios::binary);
+    if (!out) {
+        out.clear(); // flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
+        string path = UbSystem::getPathFromString(vtkfilename);
+        if (path.size() > 0) {
+            UbSystem::makeDirectory(path);
+            out.open(vtkfilename.c_str(), ios::out | ios::binary);
+        }
+        if (!out)
+            throw UbException(UB_EXARGS, "couldn't open file " + vtkfilename);
+    }
+
+    int nofNodes = (int)nodes.size();
+    int nofCells = (int)cells.size();
+
+    int bytesPerByteVal      = 4; //==sizeof(int)
+    int bytesPoints          = 3 /*x1/x2/x3      */ * nofNodes * sizeof(float);
+    int bytesCellConnectivty = 8 /*nodes per oct */ * nofCells * sizeof(int);
+    int bytesCellOffsets     = 1 /*offset per oct*/ * nofCells * sizeof(int);
+    int bytesCellTypes       = 1 /*type of oct   */ * nofCells * sizeof(unsigned char);
+    int bytesScalarData      = 1 /*scalar        */ * nofNodes * sizeof(double);
+
+    unsigned long long offset = 0;
+    // VTK FILE
+    out << "<?xml version=\"2.0\"?>\n";
+    out << "<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\" >"
+        << "\n";
+    out << "   <UnstructuredGrid>"
+        << "\n";
+    out << "      <Piece NumberOfPoints=\"" << nofNodes << "\" NumberOfCells=\"" << nofCells << "\">\n";
+
+    // POINTS SECTION
+    out << "         <Points>\n";
+    out << "            <DataArray type=\"Float32\" NumberOfComponents=\"3\" format=\"appended\" offset=\"" << offset
+        << "\"  />\n";
+    out << "         </Points>\n";
+    offset += (bytesPerByteVal + bytesPoints);
+
+    // CELLS SECTION
+    out << "         <Cells>\n";
+    out << "            <DataArray type=\"Int32\" Name=\"connectivity\" format=\"appended\" offset=\"" << offset
+        << "\" />\n";
+    offset += (bytesPerByteVal + bytesCellConnectivty);
+    out << "            <DataArray type=\"Int32\" Name=\"offsets\" format=\"appended\" offset=\"" << offset
+        << "\" />\n";
+    offset += (bytesPerByteVal + bytesCellOffsets);
+    out << "            <DataArray type=\"UInt8\" Name=\"types\" format=\"appended\" offset=\"" << offset << "\" />\n ";
+    offset += (bytesPerByteVal + bytesCellTypes);
+    out << "         </Cells>\n";
+
+    // DATA SECTION
+    out << "         <PointData>\n";
+    for (size_t s = 0; s < datanames.size(); ++s) {
+        out << "            <DataArray type=\"Float64\" Name=\"" << datanames[s] << "\" format=\"appended\" offset=\""
+            << offset << "\" /> \n";
+        offset += (bytesPerByteVal + bytesScalarData);
+    }
+    out << "         </PointData>\n";
+
+    out << "      </Piece>\n";
+    out << "   </UnstructuredGrid>\n";
+
+    // AppendedData SECTION
+    out << "   <AppendedData encoding=\"raw\">\n";
+    out << "_";
+
+    // POINTS SECTION
+    out.write((char *)&bytesPoints, bytesPerByteVal);
+    for (int n = 0; n < nofNodes; n++) {
+        out.write((char *)&val<1>(nodes[n]), sizeof(float));
+        out.write((char *)&val<2>(nodes[n]), sizeof(float));
+        out.write((char *)&val<3>(nodes[n]), sizeof(float));
+    }
+
+    // CELLS SECTION
+    // cellConnectivity
+    out.write((char *)&bytesCellConnectivty, bytesPerByteVal);
+    for (int c = 0; c < nofCells; c++) {
+        out.write((char *)&val<1>(cells[c]), sizeof(int));
+        out.write((char *)&val<2>(cells[c]), sizeof(int));
+        out.write((char *)&val<4>(cells[c]), sizeof(int));
+        out.write((char *)&val<3>(cells[c]), sizeof(int));
+        out.write((char *)&val<5>(cells[c]), sizeof(int));
+        out.write((char *)&val<6>(cells[c]), sizeof(int));
+        out.write((char *)&val<8>(cells[c]), sizeof(int));
+        out.write((char *)&val<7>(cells[c]), sizeof(int));
+    }
+
+    // cellOffsets
+    out.write((char *)&bytesCellOffsets, bytesPerByteVal);
+    int itmp;
+    for (int c = 1; c <= nofCells; c++) {
+        itmp = 8 * c;
+        out.write((char *)&itmp, sizeof(int));
+    }
+
+    // cellTypes
+    out.write((char *)&bytesCellTypes, bytesPerByteVal);
+    unsigned char vtkCellType = 11;
+    for (int c = 0; c < nofCells; c++) {
+        out.write((char *)&vtkCellType, sizeof(unsigned char));
+    }
+
+    // DATA SECTION
+    // scalarData
+    for (size_t s = 0; s < datanames.size(); ++s) {
+        out.write((char *)&bytesScalarData, bytesPerByteVal);
+        for (size_t d = 0; d < nodedata[s].size(); ++d) {
+            // loake kopie machen, da in nodedata "doubles" sind
+            // float tmp = (float)nodedata[s][d];
+            // out.write((char*)&tmp,sizeof(float));
+            double tmp = nodedata[s][d];
+            out.write((char *)&tmp, sizeof(double));
+        }
+    }
+    out << "\n</AppendedData>\n";
+    out << "</VTKFile>";
+    out << endl;
+    out.close();
+    UBLOG(logDEBUG1, "WbWriterVtkXmlBinary::writeOctsWithNodeData to " << vtkfilename << " - end");
+
+    return vtkfilename;
 }
 /*===============================================================================*/
-string WbWriterVtkXmlBinary::writeOcts(const string& filename,vector< UbTupleFloat3 >& nodes, vector< UbTupleInt8 >& cells)
+string WbWriterVtkXmlBinary::writeOcts(const string &filename, vector<UbTupleFloat3> &nodes, vector<UbTupleInt8> &cells)
 {
-   string vtkfilename = filename+getFileExtension();
-   UBLOG(logDEBUG1,"WbWriterVtkXmlBinary::writeOcts to "<<vtkfilename<<" - start");
-
-   ofstream out(vtkfilename.c_str(),ios::out | ios::binary);
-   if(!out)
-   { 
-      out.clear(); //flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
-      string path = UbSystem::getPathFromString(vtkfilename);
-      if(path.size()>0){ UbSystem::makeDirectory(path); out.open(vtkfilename.c_str(),ios::out | ios::binary);}
-      if(!out) throw UbException(UB_EXARGS,"couldn't open file "+vtkfilename);
-   }
-
-   int nofNodes = (int)nodes.size(); 
-   int nofCells = (int)cells.size(); 
-
-   int bytesPerByteVal      = 4; //==sizeof(int)
-   int bytesPoints          = 3 /*x1/x2/x3      */ * nofNodes * sizeof(float);
-   int bytesCellConnectivty = 8 /*nodes per oct */ * nofCells * sizeof(int  );
-   int bytesCellOffsets     = 1 /*offset per oct*/ * nofCells * sizeof(int  );
-   int bytesCellTypes       = 1 /*type of oct   */ * nofCells * sizeof(unsigned char);
-   //int bytesScalarData      = 1 /*scalar        */ * nofNodes * sizeof(float); 
-
-   int offset = 0;
-   //VTK FILE
-   out<<"<?xml version=\"1.0\"?>\n";
-   out<<"<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\" >"<<"\n";
-   out<<"   <UnstructuredGrid>"<<"\n";
-   out<<"      <Piece NumberOfPoints=\""<<nofNodes<<"\" NumberOfCells=\""<<nofCells<<"\">\n";
-
-   //POINTS SECTION
-   out<<"         <Points>\n"; 
-   out<<"            <DataArray type=\"Float32\" NumberOfComponents=\"3\" format=\"appended\" offset=\""<< offset <<"\"  />\n";
-   out<<"         </Points>\n";
-   offset += (bytesPerByteVal + bytesPoints);
-
-   //CELLS SECTION
-   out<<"         <Cells>\n";
-   out<<"            <DataArray type=\"Int32\" Name=\"connectivity\" format=\"appended\" offset=\""<< offset <<"\" />\n";
-   offset += (bytesPerByteVal + bytesCellConnectivty); 
-   out<<"            <DataArray type=\"Int32\" Name=\"offsets\" format=\"appended\" offset=\""<< offset <<"\" />\n";
-   offset += (bytesPerByteVal + bytesCellOffsets);
-   out<<"            <DataArray type=\"UInt8\" Name=\"types\" format=\"appended\" offset=\""<< offset <<"\" />\n ";
-   offset += (bytesPerByteVal + bytesCellTypes);
-   out<<"         </Cells>\n";
-
-   out<<"      </Piece>\n";
-   out<<"   </UnstructuredGrid>\n";
-
-   // AppendedData SECTION
-   out<<"   <AppendedData encoding=\"raw\">\n";
-   out<<"_";
-
-   //POINTS SECTION
-   out.write((char*)&bytesPoints,bytesPerByteVal);
-   for(int n=0; n<nofNodes; n++)
-   {
-      out.write((char*)&val<1>(nodes[n]),sizeof(float));
-      out.write((char*)&val<2>(nodes[n]),sizeof(float));
-      out.write((char*)&val<3>(nodes[n]),sizeof(float));
-   }
-
-   //CELLS SECTION
-   //cellConnectivity
-   out.write( (char*)&bytesCellConnectivty, bytesPerByteVal );  
-   for(int c=0; c<nofCells; c++) 
-   {
-      out.write( (char*)&val<1>(cells[c]), sizeof(int) );
-      out.write( (char*)&val<2>(cells[c]), sizeof(int) );
-      out.write( (char*)&val<4>(cells[c]), sizeof(int) );
-      out.write( (char*)&val<3>(cells[c]), sizeof(int) );
-      out.write( (char*)&val<5>(cells[c]), sizeof(int) );
-      out.write( (char*)&val<6>(cells[c]), sizeof(int) );
-      out.write( (char*)&val<8>(cells[c]), sizeof(int) );
-      out.write( (char*)&val<7>(cells[c]), sizeof(int) );
-   }
-
-   //cellOffsets
-   out.write( (char*)&bytesCellOffsets, bytesPerByteVal );
-   int itmp;
-   for(int c=1; c<=nofCells; c++)
-   {
-      itmp = 8 * c;    
-      out.write( (char*)&itmp, sizeof(int) );
-   }
-
-   //cellTypes
-   out.write( (char*)&bytesCellTypes, bytesPerByteVal );
-   unsigned char vtkCellType = 11;
-   for(int c=0; c<nofCells; c++)
-   {
-      out.write( (char*)&vtkCellType, sizeof(unsigned char) );
-   }
-   out<<"\n</AppendedData>\n";
-   out<<"</VTKFile>";
-   out<<endl;
-   out.close();
-   UBLOG(logDEBUG1,"WbWriterVtkXmlBinary::writeOcts to "<<vtkfilename<<" - end");
-
-   return vtkfilename;
+    string vtkfilename = filename + getFileExtension();
+    UBLOG(logDEBUG1, "WbWriterVtkXmlBinary::writeOcts to " << vtkfilename << " - start");
+
+    ofstream out(vtkfilename.c_str(), ios::out | ios::binary);
+    if (!out) {
+        out.clear(); // flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
+        string path = UbSystem::getPathFromString(vtkfilename);
+        if (path.size() > 0) {
+            UbSystem::makeDirectory(path);
+            out.open(vtkfilename.c_str(), ios::out | ios::binary);
+        }
+        if (!out)
+            throw UbException(UB_EXARGS, "couldn't open file " + vtkfilename);
+    }
+
+    int nofNodes = (int)nodes.size();
+    int nofCells = (int)cells.size();
+
+    int bytesPerByteVal      = 4; //==sizeof(int)
+    int bytesPoints          = 3 /*x1/x2/x3      */ * nofNodes * sizeof(float);
+    int bytesCellConnectivty = 8 /*nodes per oct */ * nofCells * sizeof(int);
+    int bytesCellOffsets     = 1 /*offset per oct*/ * nofCells * sizeof(int);
+    int bytesCellTypes       = 1 /*type of oct   */ * nofCells * sizeof(unsigned char);
+    // int bytesScalarData      = 1 /*scalar        */ * nofNodes * sizeof(float);
+
+    int offset = 0;
+    // VTK FILE
+    out << "<?xml version=\"1.0\"?>\n";
+    out << "<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\" >"
+        << "\n";
+    out << "   <UnstructuredGrid>"
+        << "\n";
+    out << "      <Piece NumberOfPoints=\"" << nofNodes << "\" NumberOfCells=\"" << nofCells << "\">\n";
+
+    // POINTS SECTION
+    out << "         <Points>\n";
+    out << "            <DataArray type=\"Float32\" NumberOfComponents=\"3\" format=\"appended\" offset=\"" << offset
+        << "\"  />\n";
+    out << "         </Points>\n";
+    offset += (bytesPerByteVal + bytesPoints);
+
+    // CELLS SECTION
+    out << "         <Cells>\n";
+    out << "            <DataArray type=\"Int32\" Name=\"connectivity\" format=\"appended\" offset=\"" << offset
+        << "\" />\n";
+    offset += (bytesPerByteVal + bytesCellConnectivty);
+    out << "            <DataArray type=\"Int32\" Name=\"offsets\" format=\"appended\" offset=\"" << offset
+        << "\" />\n";
+    offset += (bytesPerByteVal + bytesCellOffsets);
+    out << "            <DataArray type=\"UInt8\" Name=\"types\" format=\"appended\" offset=\"" << offset << "\" />\n ";
+    offset += (bytesPerByteVal + bytesCellTypes);
+    out << "         </Cells>\n";
+
+    out << "      </Piece>\n";
+    out << "   </UnstructuredGrid>\n";
+
+    // AppendedData SECTION
+    out << "   <AppendedData encoding=\"raw\">\n";
+    out << "_";
+
+    // POINTS SECTION
+    out.write((char *)&bytesPoints, bytesPerByteVal);
+    for (int n = 0; n < nofNodes; n++) {
+        out.write((char *)&val<1>(nodes[n]), sizeof(float));
+        out.write((char *)&val<2>(nodes[n]), sizeof(float));
+        out.write((char *)&val<3>(nodes[n]), sizeof(float));
+    }
+
+    // CELLS SECTION
+    // cellConnectivity
+    out.write((char *)&bytesCellConnectivty, bytesPerByteVal);
+    for (int c = 0; c < nofCells; c++) {
+        out.write((char *)&val<1>(cells[c]), sizeof(int));
+        out.write((char *)&val<2>(cells[c]), sizeof(int));
+        out.write((char *)&val<4>(cells[c]), sizeof(int));
+        out.write((char *)&val<3>(cells[c]), sizeof(int));
+        out.write((char *)&val<5>(cells[c]), sizeof(int));
+        out.write((char *)&val<6>(cells[c]), sizeof(int));
+        out.write((char *)&val<8>(cells[c]), sizeof(int));
+        out.write((char *)&val<7>(cells[c]), sizeof(int));
+    }
+
+    // cellOffsets
+    out.write((char *)&bytesCellOffsets, bytesPerByteVal);
+    int itmp;
+    for (int c = 1; c <= nofCells; c++) {
+        itmp = 8 * c;
+        out.write((char *)&itmp, sizeof(int));
+    }
+
+    // cellTypes
+    out.write((char *)&bytesCellTypes, bytesPerByteVal);
+    unsigned char vtkCellType = 11;
+    for (int c = 0; c < nofCells; c++) {
+        out.write((char *)&vtkCellType, sizeof(unsigned char));
+    }
+    out << "\n</AppendedData>\n";
+    out << "</VTKFile>";
+    out << endl;
+    out.close();
+    UBLOG(logDEBUG1, "WbWriterVtkXmlBinary::writeOcts to " << vtkfilename << " - end");
+
+    return vtkfilename;
 }
-std::string WbWriterVtkXmlBinary::writeNodes(const std::string& filename,std::vector< UbTupleFloat3 >& nodes)
+std::string WbWriterVtkXmlBinary::writeNodes(const std::string &filename, std::vector<UbTupleFloat3> &nodes)
 {
-   string vtkfilename = filename+getFileExtension();
-   UBLOG(logDEBUG1,"WbWriterVtkXmlBinary::writeNodes to "<<vtkfilename<<" - start");
-
-   ofstream out(vtkfilename.c_str(),ios::out | ios::binary);
-   if(!out)
-   { 
-      out.clear(); //flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
-      string path = UbSystem::getPathFromString(vtkfilename);
-      if(path.size()>0){ UbSystem::makeDirectory(path); out.open(vtkfilename.c_str(),ios::out | ios::binary);}
-      if(!out) throw UbException(UB_EXARGS,"couldn't open file "+vtkfilename);
-   }
-
-   int nofNodes = (int)nodes.size(); 
-
-   int bytesPerByteVal      = 4; //==sizeof(int)
-   int bytesPoints          = 3 /*x1/x2/x3        */ * nofNodes * sizeof(float);
-   int bytesCellConnectivty = 1 /*nodes per cell  */ * nofNodes * sizeof(int  );
-   int bytesCellOffsets     = 1 /*offset per cell */ * nofNodes * sizeof(int  );
-   int bytesCellTypes       = 1 /*type of line    */ * nofNodes * sizeof(unsigned char);
-
-   int offset = 0;
-   //VTK FILE
-   out<<"<?xml version=\"1.0\"?>\n";
-   out<<"<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\" >"<<"\n";
-   out<<"   <UnstructuredGrid>"<<"\n";
-   out<<"      <Piece NumberOfPoints=\""<<nofNodes<<"\" NumberOfCells=\""<<nofNodes<<"\">\n";
-
-   //POINTS SECTION
-   out<<"         <Points>\n"; 
-   out<<"            <DataArray type=\"Float32\" NumberOfComponents=\"3\" format=\"appended\" offset=\""<< offset <<"\"  />\n";
-   out<<"         </Points>\n";
-   offset += (bytesPerByteVal + bytesPoints);
-
-   //CELLS SECTION
-   out<<"         <Cells>\n";
-   out<<"            <DataArray type=\"Int32\" Name=\"connectivity\" format=\"appended\" offset=\""<< offset <<"\" />\n";
-   offset += (bytesPerByteVal + bytesCellConnectivty); 
-   out<<"            <DataArray type=\"Int32\" Name=\"offsets\" format=\"appended\" offset=\""<< offset <<"\" />\n";
-   offset += (bytesPerByteVal + bytesCellOffsets);
-   out<<"            <DataArray type=\"UInt8\" Name=\"types\" format=\"appended\" offset=\""<< offset <<"\" />\n ";
-   offset += (bytesPerByteVal + bytesCellTypes);
-   out<<"         </Cells>\n";
-
-   out<<"      </Piece>\n";
-   out<<"   </UnstructuredGrid>\n";
-
-   // AppendedData SECTION
-   out<<"   <AppendedData encoding=\"raw\">\n";
-   out<<"_";
-
-   //POINTS SECTION
-   out.write((char*)&bytesPoints,bytesPerByteVal);
-   for(int n=0; n<nofNodes; n++)
-   {
-      out.write((char*)&val<1>(nodes[n]),sizeof(float));
-      out.write((char*)&val<2>(nodes[n]),sizeof(float));
-      out.write((char*)&val<3>(nodes[n]),sizeof(float));
-   }
-
-   //CELLS SECTION
-   //cellConnectivity
-   out.write( (char*)&bytesCellConnectivty, bytesPerByteVal );  
-   for(int c=0; c<nofNodes; c++) 
-      out.write( (char*)&c, sizeof(int) );
-
-   //cellOffsets
-   out.write( (char*)&bytesCellOffsets, bytesPerByteVal );
-   for(int c=1; c<=nofNodes; c++)
-      out.write( (char*)&c, sizeof(int) );
-
-   //cellTypes
-   out.write( (char*)&bytesCellTypes, bytesPerByteVal );
-   unsigned char vtkCellType = 1;
-   for(int c=0; c<nofNodes; c++)
-      out.write( (char*)&vtkCellType, sizeof(unsigned char) );
-
-   out<<"\n</AppendedData>\n";
-   out<<"</VTKFile>";
-   out<<endl;
-   out.close();
-   UBLOG(logDEBUG1,"WbWriterVtkXmlBinary::writeNodes to "<<vtkfilename<<" - end");
-
-   return vtkfilename;
+    string vtkfilename = filename + getFileExtension();
+    UBLOG(logDEBUG1, "WbWriterVtkXmlBinary::writeNodes to " << vtkfilename << " - start");
+
+    ofstream out(vtkfilename.c_str(), ios::out | ios::binary);
+    if (!out) {
+        out.clear(); // flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
+        string path = UbSystem::getPathFromString(vtkfilename);
+        if (path.size() > 0) {
+            UbSystem::makeDirectory(path);
+            out.open(vtkfilename.c_str(), ios::out | ios::binary);
+        }
+        if (!out)
+            throw UbException(UB_EXARGS, "couldn't open file " + vtkfilename);
+    }
+
+    int nofNodes = (int)nodes.size();
+
+    int bytesPerByteVal      = 4; //==sizeof(int)
+    int bytesPoints          = 3 /*x1/x2/x3        */ * nofNodes * sizeof(float);
+    int bytesCellConnectivty = 1 /*nodes per cell  */ * nofNodes * sizeof(int);
+    int bytesCellOffsets     = 1 /*offset per cell */ * nofNodes * sizeof(int);
+    int bytesCellTypes       = 1 /*type of line    */ * nofNodes * sizeof(unsigned char);
+
+    int offset = 0;
+    // VTK FILE
+    out << "<?xml version=\"1.0\"?>\n";
+    out << "<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\" >"
+        << "\n";
+    out << "   <UnstructuredGrid>"
+        << "\n";
+    out << "      <Piece NumberOfPoints=\"" << nofNodes << "\" NumberOfCells=\"" << nofNodes << "\">\n";
+
+    // POINTS SECTION
+    out << "         <Points>\n";
+    out << "            <DataArray type=\"Float32\" NumberOfComponents=\"3\" format=\"appended\" offset=\"" << offset
+        << "\"  />\n";
+    out << "         </Points>\n";
+    offset += (bytesPerByteVal + bytesPoints);
+
+    // CELLS SECTION
+    out << "         <Cells>\n";
+    out << "            <DataArray type=\"Int32\" Name=\"connectivity\" format=\"appended\" offset=\"" << offset
+        << "\" />\n";
+    offset += (bytesPerByteVal + bytesCellConnectivty);
+    out << "            <DataArray type=\"Int32\" Name=\"offsets\" format=\"appended\" offset=\"" << offset
+        << "\" />\n";
+    offset += (bytesPerByteVal + bytesCellOffsets);
+    out << "            <DataArray type=\"UInt8\" Name=\"types\" format=\"appended\" offset=\"" << offset << "\" />\n ";
+    offset += (bytesPerByteVal + bytesCellTypes);
+    out << "         </Cells>\n";
+
+    out << "      </Piece>\n";
+    out << "   </UnstructuredGrid>\n";
+
+    // AppendedData SECTION
+    out << "   <AppendedData encoding=\"raw\">\n";
+    out << "_";
+
+    // POINTS SECTION
+    out.write((char *)&bytesPoints, bytesPerByteVal);
+    for (int n = 0; n < nofNodes; n++) {
+        out.write((char *)&val<1>(nodes[n]), sizeof(float));
+        out.write((char *)&val<2>(nodes[n]), sizeof(float));
+        out.write((char *)&val<3>(nodes[n]), sizeof(float));
+    }
+
+    // CELLS SECTION
+    // cellConnectivity
+    out.write((char *)&bytesCellConnectivty, bytesPerByteVal);
+    for (int c = 0; c < nofNodes; c++)
+        out.write((char *)&c, sizeof(int));
+
+    // cellOffsets
+    out.write((char *)&bytesCellOffsets, bytesPerByteVal);
+    for (int c = 1; c <= nofNodes; c++)
+        out.write((char *)&c, sizeof(int));
+
+    // cellTypes
+    out.write((char *)&bytesCellTypes, bytesPerByteVal);
+    unsigned char vtkCellType = 1;
+    for (int c = 0; c < nofNodes; c++)
+        out.write((char *)&vtkCellType, sizeof(unsigned char));
+
+    out << "\n</AppendedData>\n";
+    out << "</VTKFile>";
+    out << endl;
+    out.close();
+    UBLOG(logDEBUG1, "WbWriterVtkXmlBinary::writeNodes to " << vtkfilename << " - end");
+
+    return vtkfilename;
 }
-std::string WbWriterVtkXmlBinary::writeNodesWithNodeData(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector<std::string >& datanames, std::vector<std::vector<double > >& nodedata)
+std::string WbWriterVtkXmlBinary::writeNodesWithNodeData(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                                                         std::vector<std::string> &datanames,
+                                                         std::vector<std::vector<double>> &nodedata)
 {
-   string vtkfilename = filename+getFileExtension();
-   UBLOG(logDEBUG1,"WbWriterVtkXmlBinary::writeNodesWithNodeData to "<<vtkfilename<<" - start");
-
-   ofstream out(vtkfilename.c_str(),ios::out | ios::binary);
-   if(!out)
-   { 
-      out.clear(); //flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
-      string path = UbSystem::getPathFromString(vtkfilename);
-      if(path.size()>0){ UbSystem::makeDirectory(path); out.open(vtkfilename.c_str(),ios::out | ios::binary);}
-      if(!out) throw UbException(UB_EXARGS,"couldn't open file "+vtkfilename);
-   }
-
-   int nofNodes = (int)nodes.size(); 
-
-   int bytesPerByteVal      = 4; //==sizeof(int)
-   int bytesPoints          = 3 /*x1/x2/x3       */ * nofNodes * sizeof(float);
-   int bytesCellConnectivty = 1 /*nodes per cell */ * nofNodes * sizeof(int  );
-   int bytesCellOffsets     = 1 /*offset per cell*/ * nofNodes * sizeof(int  );
-   int bytesCellTypes       = 1 /*type of oct    */ * nofNodes * sizeof(unsigned char);
-   int bytesScalarData      = 1 /*scalar         */ * nofNodes * sizeof(double); 
-
-   int offset = 0;
-   //VTK FILE
-   out<<"<?xml version=\"1.0\"?>\n";
-   out<<"<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\" >"<<"\n";
-   out<<"   <UnstructuredGrid>"<<"\n";
-   out<<"      <Piece NumberOfPoints=\""<<nofNodes<<"\" NumberOfCells=\""<<nofNodes<<"\">\n";
-
-   //POINTS SECTION
-   out<<"         <Points>\n"; 
-   out<<"            <DataArray type=\"Float32\" NumberOfComponents=\"3\" format=\"appended\" offset=\""<< offset <<"\"  />\n";
-   out<<"         </Points>\n";
-   offset += (bytesPerByteVal + bytesPoints);
-
-   //CELLS SECTION
-   out<<"         <Cells>\n";
-   out<<"            <DataArray type=\"Int32\" Name=\"connectivity\" format=\"appended\" offset=\""<< offset <<"\" />\n";
-   offset += (bytesPerByteVal + bytesCellConnectivty); 
-   out<<"            <DataArray type=\"Int32\" Name=\"offsets\" format=\"appended\" offset=\""<< offset <<"\" />\n";
-   offset += (bytesPerByteVal + bytesCellOffsets);
-   out<<"            <DataArray type=\"UInt8\" Name=\"types\" format=\"appended\" offset=\""<< offset <<"\" />\n ";
-   offset += (bytesPerByteVal + bytesCellTypes);
-   out<<"         </Cells>\n";
-
-   //DATA SECTION
-   out<<"         <PointData>\n";
-   for(size_t s=0; s<datanames.size(); ++s)
-   {
-      out<< "            <DataArray type=\"Float64\" Name=\""<< datanames[s] <<"\" format=\"appended\" offset=\""<< offset <<"\" /> \n";
-      offset += (bytesPerByteVal + bytesScalarData);
-   }
-   out<<"         </PointData>\n";
-
-   out<<"      </Piece>\n";
-   out<<"   </UnstructuredGrid>\n";
-
-   // AppendedData SECTION
-   out<<"   <AppendedData encoding=\"raw\">\n";
-   out<<"_";
-
-   //POINTS SECTION
-   out.write((char*)&bytesPoints,bytesPerByteVal);
-   for(int n=0; n<nofNodes; n++)
-   {
-      out.write((char*)&val<1>(nodes[n]),sizeof(float));
-      out.write((char*)&val<2>(nodes[n]),sizeof(float));
-      out.write((char*)&val<3>(nodes[n]),sizeof(float));
-   }
-
-   //CELLS SECTION
-   //cellConnectivity
-   out.write( (char*)&bytesCellConnectivty, bytesPerByteVal );  
-   for(int c=0; c<nofNodes; c++) 
-      out.write( (char*)&c, sizeof(int) );
-
-   //cellOffsets
-   out.write( (char*)&bytesCellOffsets, bytesPerByteVal );
-   for(int c=1; c<=nofNodes; c++)
-      out.write( (char*)&c, sizeof(int) );
-
-   //cellTypes
-   out.write( (char*)&bytesCellTypes, bytesPerByteVal );
-   unsigned char vtkCellType = 1;
-   for(int c=0; c<nofNodes; c++)
-      out.write( (char*)&vtkCellType, sizeof(unsigned char) );
-   
-   //DATA SECTION
-   //scalarData
-   for(size_t s=0; s<datanames.size(); ++s)
-   {
-      out.write((char*)&bytesScalarData,bytesPerByteVal);
-      for(size_t d=0; d<nodedata[s].size(); ++d)
-      {
-         //loake kopie machen, da in nodedata "doubles" sind
-         //float tmp = (float)nodedata[s][d];
-         //out.write((char*)&tmp,sizeof(float));
-         double tmp = nodedata[s][d];
-         out.write((char*)&tmp, sizeof(double));
-      }
-   }
-   out<<"\n</AppendedData>\n";
-   out<<"</VTKFile>";
-   out<<endl;
-   out.close();
-   UBLOG(logDEBUG1,"WbWriterVtkXmlBinary::writeNodesWithNodeData to "<<vtkfilename<<" - end");
-
-   return vtkfilename;
-
+    string vtkfilename = filename + getFileExtension();
+    UBLOG(logDEBUG1, "WbWriterVtkXmlBinary::writeNodesWithNodeData to " << vtkfilename << " - start");
+
+    ofstream out(vtkfilename.c_str(), ios::out | ios::binary);
+    if (!out) {
+        out.clear(); // flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
+        string path = UbSystem::getPathFromString(vtkfilename);
+        if (path.size() > 0) {
+            UbSystem::makeDirectory(path);
+            out.open(vtkfilename.c_str(), ios::out | ios::binary);
+        }
+        if (!out)
+            throw UbException(UB_EXARGS, "couldn't open file " + vtkfilename);
+    }
+
+    int nofNodes = (int)nodes.size();
+
+    int bytesPerByteVal      = 4; //==sizeof(int)
+    int bytesPoints          = 3 /*x1/x2/x3       */ * nofNodes * sizeof(float);
+    int bytesCellConnectivty = 1 /*nodes per cell */ * nofNodes * sizeof(int);
+    int bytesCellOffsets     = 1 /*offset per cell*/ * nofNodes * sizeof(int);
+    int bytesCellTypes       = 1 /*type of oct    */ * nofNodes * sizeof(unsigned char);
+    int bytesScalarData      = 1 /*scalar         */ * nofNodes * sizeof(double);
+
+    int offset = 0;
+    // VTK FILE
+    out << "<?xml version=\"1.0\"?>\n";
+    out << "<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\" >"
+        << "\n";
+    out << "   <UnstructuredGrid>"
+        << "\n";
+    out << "      <Piece NumberOfPoints=\"" << nofNodes << "\" NumberOfCells=\"" << nofNodes << "\">\n";
+
+    // POINTS SECTION
+    out << "         <Points>\n";
+    out << "            <DataArray type=\"Float32\" NumberOfComponents=\"3\" format=\"appended\" offset=\"" << offset
+        << "\"  />\n";
+    out << "         </Points>\n";
+    offset += (bytesPerByteVal + bytesPoints);
+
+    // CELLS SECTION
+    out << "         <Cells>\n";
+    out << "            <DataArray type=\"Int32\" Name=\"connectivity\" format=\"appended\" offset=\"" << offset
+        << "\" />\n";
+    offset += (bytesPerByteVal + bytesCellConnectivty);
+    out << "            <DataArray type=\"Int32\" Name=\"offsets\" format=\"appended\" offset=\"" << offset
+        << "\" />\n";
+    offset += (bytesPerByteVal + bytesCellOffsets);
+    out << "            <DataArray type=\"UInt8\" Name=\"types\" format=\"appended\" offset=\"" << offset << "\" />\n ";
+    offset += (bytesPerByteVal + bytesCellTypes);
+    out << "         </Cells>\n";
+
+    // DATA SECTION
+    out << "         <PointData>\n";
+    for (size_t s = 0; s < datanames.size(); ++s) {
+        out << "            <DataArray type=\"Float64\" Name=\"" << datanames[s] << "\" format=\"appended\" offset=\""
+            << offset << "\" /> \n";
+        offset += (bytesPerByteVal + bytesScalarData);
+    }
+    out << "         </PointData>\n";
+
+    out << "      </Piece>\n";
+    out << "   </UnstructuredGrid>\n";
+
+    // AppendedData SECTION
+    out << "   <AppendedData encoding=\"raw\">\n";
+    out << "_";
+
+    // POINTS SECTION
+    out.write((char *)&bytesPoints, bytesPerByteVal);
+    for (int n = 0; n < nofNodes; n++) {
+        out.write((char *)&val<1>(nodes[n]), sizeof(float));
+        out.write((char *)&val<2>(nodes[n]), sizeof(float));
+        out.write((char *)&val<3>(nodes[n]), sizeof(float));
+    }
+
+    // CELLS SECTION
+    // cellConnectivity
+    out.write((char *)&bytesCellConnectivty, bytesPerByteVal);
+    for (int c = 0; c < nofNodes; c++)
+        out.write((char *)&c, sizeof(int));
+
+    // cellOffsets
+    out.write((char *)&bytesCellOffsets, bytesPerByteVal);
+    for (int c = 1; c <= nofNodes; c++)
+        out.write((char *)&c, sizeof(int));
+
+    // cellTypes
+    out.write((char *)&bytesCellTypes, bytesPerByteVal);
+    unsigned char vtkCellType = 1;
+    for (int c = 0; c < nofNodes; c++)
+        out.write((char *)&vtkCellType, sizeof(unsigned char));
+
+    // DATA SECTION
+    // scalarData
+    for (size_t s = 0; s < datanames.size(); ++s) {
+        out.write((char *)&bytesScalarData, bytesPerByteVal);
+        for (size_t d = 0; d < nodedata[s].size(); ++d) {
+            // loake kopie machen, da in nodedata "doubles" sind
+            // float tmp = (float)nodedata[s][d];
+            // out.write((char*)&tmp,sizeof(float));
+            double tmp = nodedata[s][d];
+            out.write((char *)&tmp, sizeof(double));
+        }
+    }
+    out << "\n</AppendedData>\n";
+    out << "</VTKFile>";
+    out << endl;
+    out.close();
+    UBLOG(logDEBUG1, "WbWriterVtkXmlBinary::writeNodesWithNodeData to " << vtkfilename << " - end");
+
+    return vtkfilename;
 }
diff --git a/src/basics/basics/writer/WbWriterVtkXmlBinary.h b/src/basics/basics/writer/WbWriterVtkXmlBinary.h
index 2beda26b7aa4830b30d47c8bc1c0cddc24c4c730..393c6bb13b268805a3fc2ca0850dd75d3fdd5616 100644
--- a/src/basics/basics/writer/WbWriterVtkXmlBinary.h
+++ b/src/basics/basics/writer/WbWriterVtkXmlBinary.h
@@ -1,28 +1,28 @@
 //=======================================================================================
-// ____          ____    __    ______     __________   __      __       __        __         
-// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |        
-//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |        
-//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |        
-//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____    
-//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|   
-//      \    \  |    |   ________________________________________________________________    
-//       \    \ |    |  |  ______________________________________________________________|   
-//        \    \|    |  |  |         __          __     __     __     ______      _______    
-//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)   
-//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______    
+// ____          ____    __    ______     __________   __      __       __        __
+// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |
+//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |
+//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |
+//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____
+//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|
+//      \    \  |    |   ________________________________________________________________
+//       \    \ |    |  |  ______________________________________________________________|
+//        \    \|    |  |  |         __          __     __     __     ______      _______
+//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)
+//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______
 //           \       |  |  |        |  |_____   |   \_/   |   |  |   |  |_/  /    _____  |
-//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/   
+//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/
 //
-//  This file is part of VirtualFluids. VirtualFluids is free software: you can 
+//  This file is part of VirtualFluids. VirtualFluids is free software: you can
 //  redistribute it and/or modify it under the terms of the GNU General Public
-//  License as published by the Free Software Foundation, either version 3 of 
+//  License as published by the Free Software Foundation, either version 3 of
 //  the License, or (at your option) any later version.
-//  
-//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT 
-//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
-//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License 
+//
+//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT
+//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 //  for more details.
-//  
+//
 //  You should have received a copy of the GNU General Public License along
 //  with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>.
 //
@@ -37,87 +37,113 @@
 
 #include <basics/writer/WbWriter.h>
 
-class WbWriterVtkXmlBinary  : public WbWriter
+class WbWriterVtkXmlBinary : public WbWriter
 {
 public:
-   static WbWriterVtkXmlBinary* getInstance()
-   {
-      static WbWriterVtkXmlBinary instance;
-      return &instance;
-   }
+    static WbWriterVtkXmlBinary *getInstance()
+    {
+        static WbWriterVtkXmlBinary instance;
+        return &instance;
+    }
 
-    WbWriterVtkXmlBinary( const WbWriterVtkXmlBinary& ) = delete;
-    const WbWriterVtkXmlBinary& operator=( const WbWriterVtkXmlBinary& ) = delete;
+    WbWriterVtkXmlBinary(const WbWriterVtkXmlBinary &) = delete;
+    const WbWriterVtkXmlBinary &operator=(const WbWriterVtkXmlBinary &) = delete;
 
 private:
-   WbWriterVtkXmlBinary() : WbWriter() 
-   {
-      if(sizeof(unsigned char)!=1) throw UbException(UB_EXARGS,"machine error char  type mismatch");
-      if(sizeof(int)          !=4) throw UbException(UB_EXARGS,"machine error int   type mismatch");
-      if(sizeof(float)        !=4) throw UbException(UB_EXARGS,"machine error float type mismatch");
-   }
-
-   static const std::string  pvdEndTag;
+    WbWriterVtkXmlBinary() : WbWriter()
+    {
+        if (sizeof(unsigned char) != 1)
+            throw UbException(UB_EXARGS, "machine error char  type mismatch");
+        if (sizeof(int) != 4)
+            throw UbException(UB_EXARGS, "machine error int   type mismatch");
+        if (sizeof(float) != 4)
+            throw UbException(UB_EXARGS, "machine error float type mismatch");
+    }
+
+    static const std::string pvdEndTag;
+
 public:
-   std::string getFileExtension() override { return ".bin.vtu";   }
-
-   //write a metafile 
-   std::string writeCollection(const std::string& filename, const std::vector<std::string>& filenames, const double& timestep, const bool& sepGroups);
-   std::string addFilesToCollection(const std::string& filename, const std::vector<std::string>& filenames, const double& timestep, const bool& sepGroups);
-   std::string writeParallelFile(const std::string& filename,std::vector<std::string>& pieceSources, std::vector<std::string>& pointDataNames, std::vector<std::string>& cellDataNames);
-
-   //////////////////////////////////////////////////////////////////////////
-   //nodes
-   std::string writeNodes(const std::string& filename,std::vector< UbTupleFloat3 >& nodes) override;
-   std::string writeNodesWithNodeData(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector<std::string >& datanames, std::vector<std::vector<double > >& nodedata) override;
-
-   //////////////////////////////////////////////////////////////////////////
-   //lines
-   //     0 ---- 1
-   //nodenumbering must start with 0!
-   std::string writeLines(const std::string& filename,std::vector<UbTupleFloat3 >& nodes, std::vector<UbTupleInt2 >& lines) override;
-    //std::string writeLinesWithNodeData(const std::string& filename,std::vector<UbTupleFloat3 >& nodes, std::vector<UbTupleInt2 >& lines, std::vector< std::string >& datanames, std::vector< std::vector< double > >& nodedata);
+    std::string getFileExtension() override { return ".bin.vtu"; }
+
+    // write a metafile
+    std::string writeCollection(const std::string &filename, const std::vector<std::string> &filenames,
+                                const double &timestep, const bool &sepGroups);
+    std::string addFilesToCollection(const std::string &filename, const std::vector<std::string> &filenames,
+                                     const double &timestep, const bool &sepGroups);
+    std::string writeParallelFile(const std::string &filename, std::vector<std::string> &pieceSources,
+                                  std::vector<std::string> &pointDataNames, std::vector<std::string> &cellDataNames);
+
+    //////////////////////////////////////////////////////////////////////////
+    // nodes
+    std::string writeNodes(const std::string &filename, std::vector<UbTupleFloat3> &nodes) override;
+    std::string writeNodesWithNodeData(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                                       std::vector<std::string> &datanames,
+                                       std::vector<std::vector<double>> &nodedata) override;
+
+    //////////////////////////////////////////////////////////////////////////
+    // lines
+    //     0 ---- 1
+    // nodenumbering must start with 0!
+    std::string writeLines(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                           std::vector<UbTupleInt2> &lines) override;
+    // std::string writeLinesWithNodeData(const std::string& filename,std::vector<UbTupleFloat3 >& nodes,
+    // std::vector<UbTupleInt2 >& lines, std::vector< std::string >& datanames, std::vector< std::vector< double > >&
+    // nodedata);
     // FIXME: hides function in base class
 
-   //////////////////////////////////////////////////////////////////////////
-   //triangles
-   //                    2
-   //                     
-   //                  0---1
-   //nodenumbering must start with 0!
-   std::string writeTriangles(const std::string& filename,std::vector<UbTupleFloat3 >& nodes, std::vector<UbTupleInt3 >& triangles) override;
-   std::string writeTrianglesWithNodeData(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt3 >& cells, std::vector<std::string >& datanames, std::vector<std::vector<double > >& nodedata) override;
-
-   //////////////////////////////////////////////////////////////////////////
-   //2D
-   //cell numbering:
-   //                  3---2
-   //                  |   |
-   //                  0---1
-   //nodenumbering must start with 0!
-
-   std::string writeQuads(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt4 >& cells) override;
-   std::string writeQuadsWithNodeData(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt4 >& cells, std::vector< std::string >& datanames, std::vector< std::vector< double > >& nodedata) override;
-   std::string writeQuadsWithCellData(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt4 >& cells, std::vector< std::string >& datanames, std::vector< std::vector< double > >& celldata) override;
-   std::string writeQuadsWithNodeAndCellData(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt4 >& cells, 
-                                             std::vector< std::string >& nodedatanames, std::vector< std::vector< double > >& nodedata, std::vector< std::string >& celldatanames,
-                                             std::vector< std::vector< double > >& celldata                                                                    ) override;
-   
-   //////////////////////////////////////////////////////////////////////////
-   //octs
-   //     7 ---- 6
-   //    /|     /|
-   //   4 +--- 5 |
-   //   | |    | |
-   //   | 3 ---+ 2
-   //   |/     |/
-   //   0 ---- 1
-   std::string writeOcts(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt8 >& cells) override;
-   std::string writeOctsWithCellData(const std::string& filename,std::vector<UbTupleFloat3 >& nodes, std::vector<UbTupleInt8 >& cells, std::vector<std::string >& datanames, std::vector<std::vector<double > >& celldata) override;
-   std::string writeOctsWithNodeData(const std::string& filename,std::vector<UbTupleFloat3 >& nodes, std::vector<UbTupleUInt8 >& cells, std::vector<std::string >& datanames, std::vector<std::vector<double > >& nodedata) override;
-   
-private:
+    //////////////////////////////////////////////////////////////////////////
+    // triangles
+    //                    2
+    //
+    //                  0---1
+    // nodenumbering must start with 0!
+    std::string writeTriangles(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                               std::vector<UbTupleInt3> &triangles) override;
+    std::string writeTrianglesWithNodeData(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                                           std::vector<UbTupleInt3> &cells, std::vector<std::string> &datanames,
+                                           std::vector<std::vector<double>> &nodedata) override;
+
+    //////////////////////////////////////////////////////////////////////////
+    // 2D
+    // cell numbering:
+    //                  3---2
+    //                  |   |
+    //                  0---1
+    // nodenumbering must start with 0!
 
+    std::string writeQuads(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                           std::vector<UbTupleInt4> &cells) override;
+    std::string writeQuadsWithNodeData(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                                       std::vector<UbTupleInt4> &cells, std::vector<std::string> &datanames,
+                                       std::vector<std::vector<double>> &nodedata) override;
+    std::string writeQuadsWithCellData(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                                       std::vector<UbTupleInt4> &cells, std::vector<std::string> &datanames,
+                                       std::vector<std::vector<double>> &celldata) override;
+    std::string writeQuadsWithNodeAndCellData(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                                              std::vector<UbTupleInt4> &cells, std::vector<std::string> &nodedatanames,
+                                              std::vector<std::vector<double>> &nodedata,
+                                              std::vector<std::string> &celldatanames,
+                                              std::vector<std::vector<double>> &celldata) override;
+
+    //////////////////////////////////////////////////////////////////////////
+    // octs
+    //     7 ---- 6
+    //    /|     /|
+    //   4 +--- 5 |
+    //   | |    | |
+    //   | 3 ---+ 2
+    //   |/     |/
+    //   0 ---- 1
+    std::string writeOcts(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                          std::vector<UbTupleInt8> &cells) override;
+    std::string writeOctsWithCellData(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                                      std::vector<UbTupleInt8> &cells, std::vector<std::string> &datanames,
+                                      std::vector<std::vector<double>> &celldata) override;
+    std::string writeOctsWithNodeData(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                                      std::vector<UbTupleUInt8> &cells, std::vector<std::string> &datanames,
+                                      std::vector<std::vector<double>> &nodedata) override;
+
+private:
 };
 
-#endif //WBWRITERVTKXMLBINARY_H
+#endif // WBWRITERVTKXMLBINARY_H
diff --git a/src/basics/basics/writer/WbWriterX3D.cpp b/src/basics/basics/writer/WbWriterX3D.cpp
index 14d1b3741695e17f5c3608e275b676ea6e739491..3a043252314b44728847480bef5ca535d1f7fb86 100644
--- a/src/basics/basics/writer/WbWriterX3D.cpp
+++ b/src/basics/basics/writer/WbWriterX3D.cpp
@@ -1,152 +1,159 @@
-#include <basics/writer/WbWriterX3D.h>
 #include <basics/utilities/UbLogger.h>
+#include <basics/writer/WbWriterX3D.h>
 
 using namespace std;
 
 /*===============================================================================*/
-std::string WbWriterX3D::writeTriangles(const string& filename,vector<UbTupleFloat3 >& nodes, vector<UbTupleInt3 >& triangles)
+std::string WbWriterX3D::writeTriangles(const string &filename, vector<UbTupleFloat3> &nodes,
+                                        vector<UbTupleInt3> &triangles)
 {
-   string X3DFilename=filename+getFileExtension();
-   UBLOG(logDEBUG1,"WbWriterX3D::writeTriangles to "<<X3DFilename<<" - start");
-
-   std::ofstream out(X3DFilename.c_str());
-   if(!out)
-   { 
-      out.clear(); //flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
-      string path = UbSystem::getPathFromString(X3DFilename);
-      if(path.size()>0){UbSystem::makeDirectory(path);out.open(X3DFilename.c_str());}
-      if(!out) throw UbException(UB_EXARGS,"couldn't open file "+X3DFilename);
-   }
-
-   // General part
-
-   //Root Element
-   out<<"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"																																 	   <<endl;
-   out<<"<!DOCTYPE X3D PUBLIC \"ISO//Web3D//DTD X3D 3.1//EN\"   \"http://www.web3d.org/specifications/x3d-3.1.dtd\">"																	   <<endl;
-   out<<"<X3D profile='Interchange' version='3.1' xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation=' http://www.web3d.org/specifications/x3d-3.1.xsd '>"<<endl<<endl;
-
-   //Head
-   out<<"<head>"										 <<endl;
-   out<<"<meta content='Simple X3D Writer for blender'/>"<<endl;
-   out<<"</head>"										 <<endl<<endl;
-
-	//Scene, Shape beginn 
-   out<<"<Scene>"            <<endl;
-   out<<"<Shape>"            <<endl;
-
-	//IndexedFaceSet => Polylinien der Dreiecke
-	out<<"<IndexedFaceSet  coordIndex=\""<<endl;
-
-	// TRIANGLES Ponits SECTION
-	int nofTriangles= (int)triangles.size(); 
-	//out<<"   triangles "<<nofTriangles<<endl;
-	for(int c=0; c<nofTriangles; c++)
-		out<<"      "<<val<1>(triangles[c]) <<" "<< val<2>(triangles[c])<<" "<< val<3>(triangles[c])<<" -1"<<endl;
-	out<<"\">"            <<endl;
-    
-	//Coordinates
-	out<<"<Coordinate  point=\""    <<endl;
-
-	// Coordinates SECTION
-	int nofNodes = (int)nodes.size(); 
-	//out<<"   points "<<nofNodes<<endl;
-	for(int n=0; n<nofNodes; n++)
-		out<<"      "<< val<1>(nodes[n]) <<", "<< val<2>(nodes[n]) <<", "<< val<3>(nodes[n])<<", "<<endl;
-   out<<"\"/>"            <<endl;
-
-	//Footer
-	out<<"</IndexedFaceSet>"<< endl;
-	out<<"</Shape>"			<< endl;
-	out<<"</Scene>"         << endl;
-	out<<"</X3D>"           << endl;
-   
-
-   //// Image details
-   //out<<"image {"              <<endl;
-   //out<<"   resolution 640 480"<<endl;
-   //out<<"   aa 0 1"            <<endl;
-   //out<<"   filter mitchell"   <<endl;
-   //out<<"}"                    <<endl<<endl;
-
-   //// Camera position
-   //out<<"camera {"                 <<endl;
-   //out<<"   type pinhole"          <<endl;
-   //out<<"   eye    -0.25 -0.3 0.13"<<endl;
-   //out<<"   target -0.1 0.1 0.13"  <<endl;
-   //out<<"   up     0 0 1"          <<endl;
-   //out<<"   fov    60"             <<endl;
-   //out<<"   aspect 1.333333"       <<endl;
-   //out<<"}"                        <<endl<<endl;
-
-   //// Light
-   //out<<"light {"                  <<endl;
-   //out<<"   type ibl"              <<endl;
-   //out<<"   image sky_small.hdr"   <<endl;
-   //out<<"   center 0 -1 0"         <<endl;
-   //out<<"   up 0 0 1"              <<endl;
-   //out<<"   lock true"             <<endl;
-   //out<<"   samples 200"           <<endl;
-   //out<<"}"                        <<endl<<endl;
-
-   //// Shaders
-   //out<<"shader {"                 <<endl;
-   //out<<"   name default-shader"   <<endl;
-   //out<<"   type diffuse"          <<endl;
-   //out<<"   diff 0.25 0.25 0.25"   <<endl;
-   //out<<"}"                        <<endl<<endl;
-
-   //out<<"shader {"                 <<endl;
-   //out<<"   name Glass"            <<endl;
-   //out<<"   type glass"            <<endl;
-   //out<<"   eta 1.333"             <<endl;
-   //out<<"   color 0.1 0.3 0.8"     <<endl;
-   //out<<"}"                        <<endl<<endl;
-   //                                
-   //out<<"shader {"                 <<endl;
-   //out<<"   name Mirror"           <<endl;
-   //out<<"   type mirror"           <<endl;
-   //out<<"   refl 0.7 0.7 0.7"      <<endl;
-   //out<<"}"                        <<endl<<endl;
-
-   //// Objects
-   //// a) Ground plane
-   //out<<"object {"                 <<endl;
-   //out<<"   shader default-shader" <<endl;
-   //out<<"   type plane"            <<endl;
-   //out<<"   p 0 0 0"               <<endl;
-   //out<<"   n 0 0 1"               <<endl;
-   //out<<"}"                        <<endl<<endl;
-
-   //// b) Mesh
-   //out<<"object {"                 <<endl;
-   //out<<"   shader Glass"          <<endl;
-   //out<<"   transform {"           <<endl;
-   //out<<"      rotatey 270.0"      <<endl;
-   //out<<"   }"                     <<endl;
-   //out<<"   type generic-mesh"     <<endl;
-   //out<<"      name polySurfac"    <<endl<<endl;
-
-
-   //// POINTS SECTION
-   //int nofNodes = (int)nodes.size(); 
-   //out<<"   points "<<nofNodes<<endl;
-   //for(int n=0; n<nofNodes; n++)
-   //   out<<"      "<< val<1>(nodes[n]) <<" "<< val<2>(nodes[n]) <<" "<< val<3>(nodes[n]) <<endl;
-
-   //// TRIANGLES SECTION
-   //int nofTriangles= (int)triangles.size(); 
-   //out<<"   triangles "<<nofTriangles<<endl;
-   //for(int c=0; c<nofTriangles; c++)
-   //   out<<"      "<<val<1>(triangles[c]) <<" "<< val<2>(triangles[c])<<" "<< val<3>(triangles[c])<<endl;
-
-   //// FOOTER
-   //out<<"   normals none" << endl;
-   //out<<"   uvs none"     << endl;
-   //out<<"}"               << endl;
-
-   out.close();
-   UBLOG(logDEBUG1,"WbWriterX3D::writeTriangles to "<<X3DFilename<<" - end");
-
-   return X3DFilename;
+    string X3DFilename = filename + getFileExtension();
+    UBLOG(logDEBUG1, "WbWriterX3D::writeTriangles to " << X3DFilename << " - start");
+
+    std::ofstream out(X3DFilename.c_str());
+    if (!out) {
+        out.clear(); // flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!!
+        string path = UbSystem::getPathFromString(X3DFilename);
+        if (path.size() > 0) {
+            UbSystem::makeDirectory(path);
+            out.open(X3DFilename.c_str());
+        }
+        if (!out)
+            throw UbException(UB_EXARGS, "couldn't open file " + X3DFilename);
+    }
+
+    // General part
+
+    // Root Element
+    out << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << endl;
+    out << "<!DOCTYPE X3D PUBLIC \"ISO//Web3D//DTD X3D 3.1//EN\"   \"http://www.web3d.org/specifications/x3d-3.1.dtd\">"
+        << endl;
+    out << "<X3D profile='Interchange' version='3.1' xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' "
+           "xsd:noNamespaceSchemaLocation=' http://www.web3d.org/specifications/x3d-3.1.xsd '>"
+        << endl
+        << endl;
+
+    // Head
+    out << "<head>" << endl;
+    out << "<meta content='Simple X3D Writer for blender'/>" << endl;
+    out << "</head>" << endl << endl;
+
+    // Scene, Shape beginn
+    out << "<Scene>" << endl;
+    out << "<Shape>" << endl;
+
+    // IndexedFaceSet => Polylinien der Dreiecke
+    out << "<IndexedFaceSet  coordIndex=\"" << endl;
+
+    // TRIANGLES Ponits SECTION
+    int nofTriangles = (int)triangles.size();
+    // out<<"   triangles "<<nofTriangles<<endl;
+    for (int c = 0; c < nofTriangles; c++)
+        out << "      " << val<1>(triangles[c]) << " " << val<2>(triangles[c]) << " " << val<3>(triangles[c]) << " -1"
+            << endl;
+    out << "\">" << endl;
+
+    // Coordinates
+    out << "<Coordinate  point=\"" << endl;
+
+    // Coordinates SECTION
+    int nofNodes = (int)nodes.size();
+    // out<<"   points "<<nofNodes<<endl;
+    for (int n = 0; n < nofNodes; n++)
+        out << "      " << val<1>(nodes[n]) << ", " << val<2>(nodes[n]) << ", " << val<3>(nodes[n]) << ", " << endl;
+    out << "\"/>" << endl;
+
+    // Footer
+    out << "</IndexedFaceSet>" << endl;
+    out << "</Shape>" << endl;
+    out << "</Scene>" << endl;
+    out << "</X3D>" << endl;
+
+    //// Image details
+    // out<<"image {"              <<endl;
+    // out<<"   resolution 640 480"<<endl;
+    // out<<"   aa 0 1"            <<endl;
+    // out<<"   filter mitchell"   <<endl;
+    // out<<"}"                    <<endl<<endl;
+
+    //// Camera position
+    // out<<"camera {"                 <<endl;
+    // out<<"   type pinhole"          <<endl;
+    // out<<"   eye    -0.25 -0.3 0.13"<<endl;
+    // out<<"   target -0.1 0.1 0.13"  <<endl;
+    // out<<"   up     0 0 1"          <<endl;
+    // out<<"   fov    60"             <<endl;
+    // out<<"   aspect 1.333333"       <<endl;
+    // out<<"}"                        <<endl<<endl;
+
+    //// Light
+    // out<<"light {"                  <<endl;
+    // out<<"   type ibl"              <<endl;
+    // out<<"   image sky_small.hdr"   <<endl;
+    // out<<"   center 0 -1 0"         <<endl;
+    // out<<"   up 0 0 1"              <<endl;
+    // out<<"   lock true"             <<endl;
+    // out<<"   samples 200"           <<endl;
+    // out<<"}"                        <<endl<<endl;
+
+    //// Shaders
+    // out<<"shader {"                 <<endl;
+    // out<<"   name default-shader"   <<endl;
+    // out<<"   type diffuse"          <<endl;
+    // out<<"   diff 0.25 0.25 0.25"   <<endl;
+    // out<<"}"                        <<endl<<endl;
+
+    // out<<"shader {"                 <<endl;
+    // out<<"   name Glass"            <<endl;
+    // out<<"   type glass"            <<endl;
+    // out<<"   eta 1.333"             <<endl;
+    // out<<"   color 0.1 0.3 0.8"     <<endl;
+    // out<<"}"                        <<endl<<endl;
+    //
+    // out<<"shader {"                 <<endl;
+    // out<<"   name Mirror"           <<endl;
+    // out<<"   type mirror"           <<endl;
+    // out<<"   refl 0.7 0.7 0.7"      <<endl;
+    // out<<"}"                        <<endl<<endl;
+
+    //// Objects
+    //// a) Ground plane
+    // out<<"object {"                 <<endl;
+    // out<<"   shader default-shader" <<endl;
+    // out<<"   type plane"            <<endl;
+    // out<<"   p 0 0 0"               <<endl;
+    // out<<"   n 0 0 1"               <<endl;
+    // out<<"}"                        <<endl<<endl;
+
+    //// b) Mesh
+    // out<<"object {"                 <<endl;
+    // out<<"   shader Glass"          <<endl;
+    // out<<"   transform {"           <<endl;
+    // out<<"      rotatey 270.0"      <<endl;
+    // out<<"   }"                     <<endl;
+    // out<<"   type generic-mesh"     <<endl;
+    // out<<"      name polySurfac"    <<endl<<endl;
+
+    //// POINTS SECTION
+    // int nofNodes = (int)nodes.size();
+    // out<<"   points "<<nofNodes<<endl;
+    // for(int n=0; n<nofNodes; n++)
+    //   out<<"      "<< val<1>(nodes[n]) <<" "<< val<2>(nodes[n]) <<" "<< val<3>(nodes[n]) <<endl;
+
+    //// TRIANGLES SECTION
+    // int nofTriangles= (int)triangles.size();
+    // out<<"   triangles "<<nofTriangles<<endl;
+    // for(int c=0; c<nofTriangles; c++)
+    //   out<<"      "<<val<1>(triangles[c]) <<" "<< val<2>(triangles[c])<<" "<< val<3>(triangles[c])<<endl;
+
+    //// FOOTER
+    // out<<"   normals none" << endl;
+    // out<<"   uvs none"     << endl;
+    // out<<"}"               << endl;
+
+    out.close();
+    UBLOG(logDEBUG1, "WbWriterX3D::writeTriangles to " << X3DFilename << " - end");
+
+    return X3DFilename;
 }
 /*===============================================================================*/
diff --git a/src/basics/basics/writer/WbWriterX3D.h b/src/basics/basics/writer/WbWriterX3D.h
index a6527ce6a08e28cd87d8c6e446e70000bba3e94d..86f0abfb5da244ba14cc7dcf225c17c3faefa394 100644
--- a/src/basics/basics/writer/WbWriterX3D.h
+++ b/src/basics/basics/writer/WbWriterX3D.h
@@ -5,31 +5,36 @@
 
 #include <basics/writer/WbWriter.h>
 
-class WbWriterX3D  : public WbWriter
+class WbWriterX3D : public WbWriter
 {
 public:
-   static WbWriterX3D* getInstance()
-   {
-      static WbWriterX3D instance;
-      return &instance;
-   }
-
-    WbWriterX3D( const WbWriterX3D& ) = delete;
-    const WbWriterX3D& operator=( const WbWriterX3D& ) = delete;
-private:
-   WbWriterX3D() : WbWriter() 
-   {
-      if(sizeof(unsigned char)!=1) throw UbException(UB_EXARGS,"error char  type mismatch");
-      if(sizeof(int)          !=4) throw UbException(UB_EXARGS,"error int   type mismatch");
-      if(sizeof(float)        !=4) throw UbException(UB_EXARGS,"error float type mismatch");
-   }
+    static WbWriterX3D *getInstance()
+    {
+        static WbWriterX3D instance;
+        return &instance;
+    }
+
+    WbWriterX3D(const WbWriterX3D &) = delete;
+    const WbWriterX3D &operator=(const WbWriterX3D &) = delete;
 
-   static std::string  pvdEndTag;
+private:
+    WbWriterX3D() : WbWriter()
+    {
+        if (sizeof(unsigned char) != 1)
+            throw UbException(UB_EXARGS, "error char  type mismatch");
+        if (sizeof(int) != 4)
+            throw UbException(UB_EXARGS, "error int   type mismatch");
+        if (sizeof(float) != 4)
+            throw UbException(UB_EXARGS, "error float type mismatch");
+    }
+
+    static std::string pvdEndTag;
 
 public:
-   std::string getFileExtension() override  { return "ascii.X3D"; }
+    std::string getFileExtension() override { return "ascii.X3D"; }
 
-   std::string writeTriangles(const std::string& filename,std::vector<UbTupleFloat3 >& nodes, std::vector<UbTupleInt3 >& triangles) override;
+    std::string writeTriangles(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
+                               std::vector<UbTupleInt3> &triangles) override;
 };
 
-#endif //WBWRITERX3D_H
+#endif // WBWRITERX3D_H
diff --git a/src/basics/geometry3d/CoordinateTransformation3D.cpp b/src/basics/geometry3d/CoordinateTransformation3D.cpp
index c54d0e1c68865028e6c99b10b4c79e252606d84d..be758ced5561449c447abca8b0affd306077c420 100644
--- a/src/basics/geometry3d/CoordinateTransformation3D.cpp
+++ b/src/basics/geometry3d/CoordinateTransformation3D.cpp
@@ -1,28 +1,28 @@
 //=======================================================================================
-// ____          ____    __    ______     __________   __      __       __        __         
-// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |        
-//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |        
-//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |        
-//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____    
-//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|   
-//      \    \  |    |   ________________________________________________________________    
-//       \    \ |    |  |  ______________________________________________________________|   
-//        \    \|    |  |  |         __          __     __     __     ______      _______    
-//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)   
-//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______    
+// ____          ____    __    ______     __________   __      __       __        __
+// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |
+//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |
+//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |
+//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____
+//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|
+//      \    \  |    |   ________________________________________________________________
+//       \    \ |    |  |  ______________________________________________________________|
+//        \    \|    |  |  |         __          __     __     __     ______      _______
+//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)
+//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______
 //           \       |  |  |        |  |_____   |   \_/   |   |  |   |  |_/  /    _____  |
-//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/   
+//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/
 //
-//  This file is part of VirtualFluids. VirtualFluids is free software: you can 
+//  This file is part of VirtualFluids. VirtualFluids is free software: you can
 //  redistribute it and/or modify it under the terms of the GNU General Public
-//  License as published by the Free Software Foundation, either version 3 of 
+//  License as published by the Free Software Foundation, either version 3 of
 //  the License, or (at your option) any later version.
-//  
-//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT 
-//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
-//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License 
+//
+//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT
+//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 //  for more details.
-//  
+//
 //  You should have received a copy of the GNU General Public License along
 //  with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>.
 //
@@ -30,29 +30,36 @@
 //! \ingroup geometry3d
 //! \author Soeren Freudiger, Sebastian Geller
 //=======================================================================================
-#include <geometry3d/CoordinateTransformation3D.h>
 #include <basics/utilities/UbMath.h>
+#include <geometry3d/CoordinateTransformation3D.h>
 
 using namespace std;
 
 CoordinateTransformation3D::CoordinateTransformation3D()
 {
-   this->setTransformationValues(0.0,0.0,0.0,1.0,1.0,1.0,0.0,0.0,0.0);
+    this->setTransformationValues(0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0);
 }
 /*======================================================*/
-CoordinateTransformation3D::CoordinateTransformation3D(const double& originX1, const double& originX2, const double& originX3, const double& dx1, const double& dx2, const double& dx3, const double& alpha, const double& beta, const double& gamma) 
+CoordinateTransformation3D::CoordinateTransformation3D(const double &originX1, const double &originX2,
+                                                       const double &originX3, const double &dx1, const double &dx2,
+                                                       const double &dx3, const double &alpha, const double &beta,
+                                                       const double &gamma)
 {
-   this->setTransformationValues(originX1, originX2, originX3, dx1, dx2, dx3, alpha, beta, gamma);
+    this->setTransformationValues(originX1, originX2, originX3, dx1, dx2, dx3, alpha, beta, gamma);
 }
 /*======================================================*/
-CoordinateTransformation3D::CoordinateTransformation3D(const double& originX1, const double& originX2, const double& originX3, const double& dx1, const double& dx2, const double& dx3) 
+CoordinateTransformation3D::CoordinateTransformation3D(const double &originX1, const double &originX2,
+                                                       const double &originX3, const double &dx1, const double &dx2,
+                                                       const double &dx3)
 {
-   this->setTransformationValues(originX1, originX2, originX3, dx1, dx2, dx3, 0.0, 0.0, 0.0);
+    this->setTransformationValues(originX1, originX2, originX3, dx1, dx2, dx3, 0.0, 0.0, 0.0);
 }
 /*======================================================*/
-CoordinateTransformation3D::CoordinateTransformation3D(CoordinateTransformation3D* transformation)
+CoordinateTransformation3D::CoordinateTransformation3D(CoordinateTransformation3D *transformation)
 {
-   this->setTransformationValues(transformation->Tx1 , transformation->Tx2 , transformation->Tx3 , transformation->Sx1 , transformation->Sx2 , transformation->Sx3, transformation->alpha, transformation->beta, transformation->gamma);
+    this->setTransformationValues(transformation->Tx1, transformation->Tx2, transformation->Tx3, transformation->Sx1,
+                                  transformation->Sx2, transformation->Sx3, transformation->alpha, transformation->beta,
+                                  transformation->gamma);
 }
 /*======================================================*/
 // void CoordinateTransformation3D::init()
@@ -60,7 +67,7 @@ CoordinateTransformation3D::CoordinateTransformation3D(CoordinateTransformation3
 //    this->Tx1   = 0.0;      this->Tx2   = 0.0;	this->Tx3   = 0.0;
 //    this->Sx1   = 1.0;      this->Sx2   = 1.0;	this->Sx3   = 1.0;
 //    this->alpha = 0.0;		this->beta = 0.0;		this->gamma = 0.0;
-// 
+//
 //    this->toX1factorX1   = 1.0; this->toX1factorX2   = 0.0; this->toX1factorX3   = 0.0;
 //    this->toX2factorX1   = 0.0; this->toX2factorX2   = 1.0; this->toX2factorX3   = 0.0;
 //    this->toX3factorX1   = 0.0; this->toX3factorX2   = 0.0; this->toX3factorX3   = 1.0;
@@ -68,7 +75,7 @@ CoordinateTransformation3D::CoordinateTransformation3D(CoordinateTransformation3
 //    this->fromX1factorX1 = 1.0; this->fromX1factorX2 = 0.0; this->fromX1factorX3 = 0.0;
 //    this->fromX2factorX1 = 0.0; this->fromX2factorX2 = 1.0; this->fromX2factorX3 = 0.0;
 //    this->fromX3factorX1 = 0.0; this->fromX3factorX2 = 0.0; this->fromX3factorX3 = 1.0;
-//    
+//
 //    this->active         = false;
 //    this->transformation = false;
 // }
@@ -84,88 +91,95 @@ CoordinateTransformation3D::CoordinateTransformation3D(CoordinateTransformation3
 @param dx2    y coordinate scaling       (dy_transformed/dy_global)
 @param dx3    z coordinate scaling       (dz_transformed/dz_global)
 @param alpha rotation around z angle    (positive FROM global TO transformed coordinate system)
-@param beta  rotation around y angle            
-@param gamma rotation around x angle            
+@param beta  rotation around y angle
+@param gamma rotation around x angle
 @exception IllegalArgumentException if c1 of the scale values is between -1.0E-8 and 1.0E-8
 */
 
-void CoordinateTransformation3D::setTransformationValues(const double& originX1, const double& originX2, const double& originX3, const double& dx1, const double& dx2, const double& dx3, const double& alpha, const double& beta, const double& gamma)
+void CoordinateTransformation3D::setTransformationValues(const double &originX1, const double &originX2,
+                                                         const double &originX3, const double &dx1, const double &dx2,
+                                                         const double &dx3, const double &alpha, const double &beta,
+                                                         const double &gamma)
 {
-   if(UbMath::zero(dx1) || UbMath::zero(dx2) || UbMath::zero(dx3))
-      throw UbException(UB_EXARGS,"error: at least one delta==0.0");
-   
-   this->Tx1   = originX1; this->Tx2  = originX2; this->Tx3   = originX3;
-   this->Sx1   = dx1;	   this->Sx2  = dx2;	     this->Sx3   = dx3;
-   this->alpha = alpha;	   this->beta = beta;     this->gamma = gamma;
+    if (UbMath::zero(dx1) || UbMath::zero(dx2) || UbMath::zero(dx3))
+        throw UbException(UB_EXARGS, "error: at least one delta==0.0");
+
+    this->Tx1   = originX1;
+    this->Tx2   = originX2;
+    this->Tx3   = originX3;
+    this->Sx1   = dx1;
+    this->Sx2   = dx2;
+    this->Sx3   = dx3;
+    this->alpha = alpha;
+    this->beta  = beta;
+    this->gamma = gamma;
+
+    double ra   = UbMath::PI * alpha / 180.0;
+    double cosA = cos(ra);
+    double sinA = sin(ra);
+    double rb   = UbMath::PI * beta / 180.0;
+    double cosB = cos(rb);
+    double sinB = sin(rb);
+    double rg   = UbMath::PI * gamma / 180.0;
+    double cosG = cos(rg);
+    double sinG = sin(rg);
+
+    // Matrix-Werte von T_invers  (indizes: 12 = spalte 1 zeile 2)
+    double divisor = (Sx1 * Sx2 * Sx3);
+
+    this->toX1factorX1 = +cosB * cosA * Sx2 * Sx3 / divisor;
+    this->toX1factorX2 = -cosB * sinA * Sx1 * Sx3 / divisor;
+    this->toX1factorX3 = +sinB * Sx1 * Sx2 / divisor;
+    this->toX1delta =
+        (-Tx3 * Sx1 * Sx2 * sinB + Tx2 * Sx1 * Sx3 * sinA * cosB - Tx1 * Sx2 * Sx3 * cosB * cosA) / divisor;
+
+    this->toX2factorX1 = Sx2 * Sx3 * (sinG * sinB * cosA + cosG * sinA) / divisor;
+    this->toX2factorX2 = Sx1 * Sx3 * (-sinG * sinB * sinA + cosG * cosA) / divisor;
+    this->toX2factorX3 = -Sx1 * Sx2 * cosB * sinG / divisor;
+    this->toX2delta =
+        (-Tx2 * Sx1 * Sx3 * cosG * cosA + Tx3 * Sx1 * Sx2 * sinG * cosB + Tx2 * Sx1 * Sx3 * sinG * sinA * sinB -
+         Tx1 * Sx2 * Sx3 * cosG * sinA - Tx1 * Sx2 * Sx3 * sinB * sinG * cosA) /
+        divisor;
+
+    this->toX3factorX1 = Sx2 * Sx3 * (-cosG * sinB * cosA + sinG * sinA) / divisor;
+    this->toX3factorX2 = Sx1 * Sx3 * (sinB * cosG * sinA + sinG * cosA) / divisor;
+    this->toX3factorX3 = Sx1 * Sx2 * cosB * cosG / divisor;
+    this->toX3delta =
+        (-Tx2 * Sx1 * Sx3 * sinG * cosA - Tx3 * Sx1 * Sx2 * cosG * cosB - Tx2 * Sx1 * Sx3 * cosG * sinA * sinB -
+         Tx1 * Sx2 * Sx3 * sinG * sinA + Tx1 * Sx2 * Sx3 * sinB * cosG * cosA) /
+        divisor;
 
-   double ra   = UbMath::PI*alpha/180.0;
-   double cosA = cos(ra);
-   double sinA = sin(ra);
-   double rb   = UbMath::PI*beta/180.0;
-   double cosB = cos(rb);
-   double sinB = sin(rb);
-   double rg   = UbMath::PI*gamma/180.0;
-   double cosG = cos(rg);
-   double sinG = sin(rg);
+    // Matrix-Werte von T_invers  (indizes: 12 = spalte 1 zeile 2)
+    this->fromX1factorX1 = cosB * cosA * Sx1;
+    this->fromX1factorX2 = (sinG * sinB * cosA + cosG * sinA) * Sx1;
+    this->fromX1factorX3 = (-cosG * sinB * cosA + sinG * sinA) * Sx1;
+    this->fromX1delta    = Tx1;
 
-   //Matrix-Werte von T_invers  (indizes: 12 = spalte 1 zeile 2)
-   double divisor = (Sx1*Sx2*Sx3);
-   
-   this->toX1factorX1 = +cosB*cosA*Sx2*Sx3/divisor;
-   this->toX1factorX2 = -cosB*sinA*Sx1*Sx3/divisor;
-   this->toX1factorX3 = +sinB*Sx1*Sx2/divisor;
-   this->toX1delta    = (-Tx3*Sx1*Sx2*sinB       
-                         +Tx2*Sx1*Sx3*sinA*cosB  
-                         -Tx1*Sx2*Sx3*cosB*cosA)/divisor;
-   
-   this->toX2factorX1 = Sx2*Sx3*(sinG*sinB*cosA+cosG*sinA)/divisor;
-   this->toX2factorX2 = Sx1*Sx3*(-sinG*sinB*sinA+cosG*cosA)/divisor;
-   this->toX2factorX3 = -Sx1*Sx2*cosB*sinG/divisor;
-   this->toX2delta    = (-Tx2*Sx1*Sx3*cosG*cosA
-                         +Tx3*Sx1*Sx2*sinG*cosB
-                         +Tx2*Sx1*Sx3*sinG*sinA*sinB
-                         -Tx1*Sx2*Sx3*cosG*sinA
-                         -Tx1*Sx2*Sx3*sinB*sinG*cosA   )/divisor;
-   
+    this->fromX2factorX1 = -cosB * sinA * Sx2;
+    this->fromX2factorX2 = -(sinG * sinB * sinA - cosG * cosA) * Sx2;
+    this->fromX2factorX3 = (cosG * sinB * sinA + sinG * cosA) * Sx2;
+    this->fromX2delta    = Tx2;
 
-   this->toX3factorX1 = Sx2*Sx3*(-cosG*sinB*cosA+sinG*sinA)/divisor;
-   this->toX3factorX2 = Sx1*Sx3*(sinB*cosG*sinA+sinG*cosA)/divisor;
-   this->toX3factorX3 = Sx1*Sx2*cosB*cosG/divisor;
-   this->toX3delta    = (-Tx2*Sx1*Sx3*sinG*cosA
-                         -Tx3*Sx1*Sx2*cosG*cosB
-                         -Tx2*Sx1*Sx3*cosG*sinA*sinB
-                         -Tx1*Sx2*Sx3*sinG*sinA
-                         +Tx1*Sx2*Sx3*sinB*cosG*cosA  )/divisor;
-                        
-   //Matrix-Werte von T_invers  (indizes: 12 = spalte 1 zeile 2)
-   this->fromX1factorX1 =  cosB*cosA*Sx1;
-   this->fromX1factorX2 =  (sinG*sinB*cosA+cosG*sinA)*Sx1;
-   this->fromX1factorX3 =  (-cosG*sinB*cosA+sinG*sinA)*Sx1;
-   this->fromX1delta    =  Tx1;
+    this->fromX3factorX1 = sinB * Sx3;
+    this->fromX3factorX2 = -sinG * cosB * Sx3;
+    this->fromX3factorX3 = cosG * cosB * Sx3;
+    this->fromX3delta    = Tx3;
 
-   this->fromX2factorX1 =  -cosB*sinA*Sx2;
-   this->fromX2factorX2 =  -(sinG*sinB*sinA-cosG*cosA)*Sx2;
-   this->fromX2factorX3 =  (cosG*sinB*sinA+sinG*cosA)*Sx2;
-   this->fromX2delta    =  Tx2;
-   
-   this->fromX3factorX1 =  sinB*Sx3;
-   this->fromX3factorX2 =  -sinG*cosB*Sx3;
-   this->fromX3factorX3 =  cosG*cosB*Sx3;
-   this->fromX3delta    =  Tx3;
+    this->active = true;
 
-   this->active         =  true;
-   
-   this->transformation =  true;
+    this->transformation = true;
 }
 /*======================================================*/
 /*!
 Set transformation active state (if this IS a transformation)
 @param active true to be active, false otherwise
 **/
-void CoordinateTransformation3D::setActive(const bool& active)
+void CoordinateTransformation3D::setActive(const bool &active)
 {
-   if(this->active == active) return;
-   if(this->transformation)   this->active = active;
+    if (this->active == active)
+        return;
+    if (this->transformation)
+        this->active = active;
 }
 /*======================================================*/
 /*!
@@ -174,44 +188,59 @@ Transform FROM global coordinates TO transformed coordinates.
 @param x2  the global y coordinate
 @param x3  the global z coordinate
 **/
-double CoordinateTransformation3D::transformForwardToX1Coordinate(const double& x1, const double& x2, const double& x3) const
+double CoordinateTransformation3D::transformForwardToX1Coordinate(const double &x1, const double &x2,
+                                                                  const double &x3) const
 {
-   if(this->active) return this->toX1factorX1*x1 + this->toX1factorX2*x2 + this->toX1factorX3*x3 + this->toX1delta;
-   else             return x1;
+    if (this->active)
+        return this->toX1factorX1 * x1 + this->toX1factorX2 * x2 + this->toX1factorX3 * x3 + this->toX1delta;
+    else
+        return x1;
 }
 /*======================================================*/
-double CoordinateTransformation3D::transformForwardToX2Coordinate(const double& x1, const double& x2, const double& x3) const
+double CoordinateTransformation3D::transformForwardToX2Coordinate(const double &x1, const double &x2,
+                                                                  const double &x3) const
 {
-   if(this->active) return this->toX2factorX1*x1 + this->toX2factorX2*x2 + this->toX2factorX3*x3 + this->toX2delta;
-   else             return x2;
+    if (this->active)
+        return this->toX2factorX1 * x1 + this->toX2factorX2 * x2 + this->toX2factorX3 * x3 + this->toX2delta;
+    else
+        return x2;
 }
 /*======================================================*/
-double CoordinateTransformation3D::transformForwardToX3Coordinate(const double& x1, const double& x2, const double& x3) const
+double CoordinateTransformation3D::transformForwardToX3Coordinate(const double &x1, const double &x2,
+                                                                  const double &x3) const
 {
-   if(this->active) return this->toX3factorX1*x1 + this->toX3factorX2*x2 + this->toX3factorX3*x3 + this->toX3delta;
-   else             return x3;
+    if (this->active)
+        return this->toX3factorX1 * x1 + this->toX3factorX2 * x2 + this->toX3factorX3 * x3 + this->toX3delta;
+    else
+        return x3;
 }
 /*======================================================*/
 /*!
 Transform FROM global coordinates TO transformed coordinates (ignoring rotation).
 @param x1  the global x coordinate
 **/
-double CoordinateTransformation3D::transformForwardToX1CoordinateIgnoringRotation(const double& x1) const
+double CoordinateTransformation3D::transformForwardToX1CoordinateIgnoringRotation(const double &x1) const
 {
-   if(this->active) return (x1-this->Tx1)/this->Sx1;
-   else             return x1;
+    if (this->active)
+        return (x1 - this->Tx1) / this->Sx1;
+    else
+        return x1;
 }
 /*======================================================*/
-double CoordinateTransformation3D::transformForwardToX2CoordinateIgnoringRotation(const double& x2) const
+double CoordinateTransformation3D::transformForwardToX2CoordinateIgnoringRotation(const double &x2) const
 {
-   if(this->active) return (x2-this->Tx2)/this->Sx2;
-   else             return x2;
+    if (this->active)
+        return (x2 - this->Tx2) / this->Sx2;
+    else
+        return x2;
 }
 /*======================================================*/
-double CoordinateTransformation3D::transformForwardToX3CoordinateIgnoringRotation(const double& x3) const
+double CoordinateTransformation3D::transformForwardToX3CoordinateIgnoringRotation(const double &x3) const
 {
-   if(this->active) return (x3-this->Tx3)/this->Sx3;
-   else             return x3;
+    if (this->active)
+        return (x3 - this->Tx3) / this->Sx3;
+    else
+        return x3;
 }
 /*======================================================*/
 /*!
@@ -220,44 +249,59 @@ Transform FROM transformed coordinates TO global coordinates.
 @param x2  the transformed y coordinate
 @param x3  the transformed z coordinate
 **/
-double CoordinateTransformation3D::transformBackwardToX1Coordinate(const double& x1, const double& x2, const double& x3) const
+double CoordinateTransformation3D::transformBackwardToX1Coordinate(const double &x1, const double &x2,
+                                                                   const double &x3) const
 {
-   if(this->active) return this->fromX1factorX1*x1 + this->fromX1factorX2*x2 + this->fromX1factorX3*x3 + this->fromX1delta;
-   else             return x1;
+    if (this->active)
+        return this->fromX1factorX1 * x1 + this->fromX1factorX2 * x2 + this->fromX1factorX3 * x3 + this->fromX1delta;
+    else
+        return x1;
 }
 /*======================================================*/
-double CoordinateTransformation3D::transformBackwardToX2Coordinate(const double& x1, const double& x2, const double& x3) const
+double CoordinateTransformation3D::transformBackwardToX2Coordinate(const double &x1, const double &x2,
+                                                                   const double &x3) const
 {
-   if(this->active) return this->fromX2factorX1*x1 + this->fromX2factorX2*x2 + this->fromX2factorX3*x3 + this->fromX2delta;
-   else             return x2;
+    if (this->active)
+        return this->fromX2factorX1 * x1 + this->fromX2factorX2 * x2 + this->fromX2factorX3 * x3 + this->fromX2delta;
+    else
+        return x2;
 }
 /*======================================================*/
-double CoordinateTransformation3D::transformBackwardToX3Coordinate(const double& x1, const double& x2, const double& x3) const
+double CoordinateTransformation3D::transformBackwardToX3Coordinate(const double &x1, const double &x2,
+                                                                   const double &x3) const
 {
-   if(this->active) return this->fromX3factorX1*x1 + this->fromX3factorX2*x2 + this->fromX3factorX3*x3 + this->fromX3delta;
-   else             return x3;
+    if (this->active)
+        return this->fromX3factorX1 * x1 + this->fromX3factorX2 * x2 + this->fromX3factorX3 * x3 + this->fromX3delta;
+    else
+        return x3;
 }
 /*======================================================*/
 /*!
 Transform FROM transformed coordinates TO global coordinates (ignoring rotation).
 @param x1  the transformed x coordinate
 **/
-double CoordinateTransformation3D::transformBackwardToX1CoordinateIgnoringRotation(const double& x1) const
+double CoordinateTransformation3D::transformBackwardToX1CoordinateIgnoringRotation(const double &x1) const
 {
-   if(this->active) return x1*this->Sx1+this->Tx1;
-   else             return x1;
+    if (this->active)
+        return x1 * this->Sx1 + this->Tx1;
+    else
+        return x1;
 }
 /*======================================================*/
-double CoordinateTransformation3D::transformBackwardToX2CoordinateIgnoringRotation(const double& x2) const
+double CoordinateTransformation3D::transformBackwardToX2CoordinateIgnoringRotation(const double &x2) const
 {
-   if(this->active) return x2*this->Sx2+this->Tx2;
-   else             return x2;
+    if (this->active)
+        return x2 * this->Sx2 + this->Tx2;
+    else
+        return x2;
 }
 /*======================================================*/
-double CoordinateTransformation3D::transformBackwardToX3CoordinateIgnoringRotation(const double& x3) const
+double CoordinateTransformation3D::transformBackwardToX3CoordinateIgnoringRotation(const double &x3) const
 {
-   if(this->active) return x3*this->Sx3+this->Tx3;
-   else             return x3;
+    if (this->active)
+        return x3 * this->Sx3 + this->Tx3;
+    else
+        return x3;
 }
 /*======================================================*/
 /*!
@@ -266,23 +310,22 @@ Returns a string representation of this transformation.
 **/
 string CoordinateTransformation3D::toString() const
 {
-   stringstream ss;
-    ss<<" CoordinateTransformation3D\n";
-//    ss<<"[isTransformation="<<this->transformation;
-//    ss<<", isActive="<<this->active<<endl;
-    ss<<" ,a="<<this->Tx1<<", b="<<this->Tx2<<", c="<<this->Tx3<<endl;
-    ss<<" , dx1="<<this->Sx1<<", dx2="<<this->Sx2<<", dx2="<<this->Sx3<<endl;
-//    ss<<" , alpha="<<this->alpha<<", beta="<<this->beta<endl;
-//    ss<<"]";
-//    ss<<"[to11="<<this->to11<<", to12="<<this->to12<<", to13="<<this->to13;
-//    ss<<", to21="<<this->to21<<", to22="<<this->to22<<", to23="<<this->to23;
-//    ss<<", to31="<<this->to31<<", to32="<<this->to32<<", to33="<<this->to33;
-//    ss<<", toA="<<this->toA<<", toB="<<this->toB<<", toC="<<this->toC;
-//    ss<<", from11="<<this->from11<<", from12="<<this->from12<<", from13="<<this->from13;
-//    ss<<", from21="<<this->from21<<", from22="<<this->from22<<", from23="<<this->from23;
-//    ss<<", from31="<<this->from31<<", from32="<<this->from32<<", from33="<<this->from33;
-//    ss<<", fromA="<<this->fromA; ss<<", fromB="<<this->fromB; ss<<", fromC="<<this->fromC;
-//    ss<<"]}";
-   return ss.str();
+    stringstream ss;
+    ss << " CoordinateTransformation3D\n";
+    //    ss<<"[isTransformation="<<this->transformation;
+    //    ss<<", isActive="<<this->active<<endl;
+    ss << " ,a=" << this->Tx1 << ", b=" << this->Tx2 << ", c=" << this->Tx3 << endl;
+    ss << " , dx1=" << this->Sx1 << ", dx2=" << this->Sx2 << ", dx2=" << this->Sx3 << endl;
+    //    ss<<" , alpha="<<this->alpha<<", beta="<<this->beta<endl;
+    //    ss<<"]";
+    //    ss<<"[to11="<<this->to11<<", to12="<<this->to12<<", to13="<<this->to13;
+    //    ss<<", to21="<<this->to21<<", to22="<<this->to22<<", to23="<<this->to23;
+    //    ss<<", to31="<<this->to31<<", to32="<<this->to32<<", to33="<<this->to33;
+    //    ss<<", toA="<<this->toA<<", toB="<<this->toB<<", toC="<<this->toC;
+    //    ss<<", from11="<<this->from11<<", from12="<<this->from12<<", from13="<<this->from13;
+    //    ss<<", from21="<<this->from21<<", from22="<<this->from22<<", from23="<<this->from23;
+    //    ss<<", from31="<<this->from31<<", from32="<<this->from32<<", from33="<<this->from33;
+    //    ss<<", fromA="<<this->fromA; ss<<", fromB="<<this->fromB; ss<<", fromC="<<this->fromC;
+    //    ss<<"]}";
+    return ss.str();
 }
-                                     
diff --git a/src/basics/geometry3d/CoordinateTransformation3D.h b/src/basics/geometry3d/CoordinateTransformation3D.h
index 112f78789d2dda0f5db279a1ca83d82ff6d844d6..a0f88c1f6b22bfe0655736802c423a00ee2357e2 100644
--- a/src/basics/geometry3d/CoordinateTransformation3D.h
+++ b/src/basics/geometry3d/CoordinateTransformation3D.h
@@ -1,28 +1,28 @@
 //=======================================================================================
-// ____          ____    __    ______     __________   __      __       __        __         
-// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |        
-//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |        
-//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |        
-//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____    
-//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|   
-//      \    \  |    |   ________________________________________________________________    
-//       \    \ |    |  |  ______________________________________________________________|   
-//        \    \|    |  |  |         __          __     __     __     ______      _______    
-//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)   
-//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______    
+// ____          ____    __    ______     __________   __      __       __        __
+// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |
+//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |
+//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |
+//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____
+//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|
+//      \    \  |    |   ________________________________________________________________
+//       \    \ |    |  |  ______________________________________________________________|
+//        \    \|    |  |  |         __          __     __     __     ______      _______
+//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)
+//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______
 //           \       |  |  |        |  |_____   |   \_/   |   |  |   |  |_/  /    _____  |
-//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/   
+//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/
 //
-//  This file is part of VirtualFluids. VirtualFluids is free software: you can 
+//  This file is part of VirtualFluids. VirtualFluids is free software: you can
 //  redistribute it and/or modify it under the terms of the GNU General Public
-//  License as published by the Free Software Foundation, either version 3 of 
+//  License as published by the Free Software Foundation, either version 3 of
 //  the License, or (at your option) any later version.
-//  
-//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT 
-//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
-//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License 
+//
+//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT
+//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 //  for more details.
-//  
+//
 //  You should have received a copy of the GNU General Public License along
 //  with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>.
 //
@@ -34,19 +34,19 @@
 #define COORDINATETRANSFORMATION3D_H
 
 #include <cmath>
-#include <string>
 #include <sstream>
+#include <string>
 
 #include <basics/utilities/UbException.h>
 
 #include <PointerDefinitions.h>
 
 ///////////////////////////////////////////////////////////////////////////////////////
-//! 
+//!
 //! \brief A class provides 3d coordinate transformation
 //! \details
 //! description:     x1/x2/x3 = old, x1*/x2*/x3* = new
-//!    x2      
+//!    x2
 //!    ^             x*
 //!    |            /
 //!    |           2*
@@ -59,74 +59,89 @@
 //!    1         \                        THEN  rotation by gamma around "x3" axis
 //!    |           x1*
 //!    |--1--2--3--4--5------------- > x1
-//! 
+//!
 //!  Remark: It might be that the rotations around x1 and x3 axis are swapped.
-//! 
+//!
 //////////////////////////////////////////////////////////////////////////////////////
 
 class CoordinateTransformation3D
 {
 public:
-   CoordinateTransformation3D();
-   CoordinateTransformation3D(const double& originX1, const double& originX2, const double& originX3, const double& dx1, const double& dx2, const double& dx3, const double& alpha, const double& beta, const double& gamma);
-   CoordinateTransformation3D(const double& originX1, const double& originX2, const double& originX3, const double& dx1, const double& dx2, const double& dx3);
-   CoordinateTransformation3D(CoordinateTransformation3D* transformation);
-   
-   void setTransformationValues(const double& originX1, const double& originX2, const double& originX3, const double& dx1, const double& dx2, const double& dx3, const double& alpha, const double& beta, const double& gamma);
-   double getX1CoordinateOffset()  const { return this->Tx1;   }   //Translation
-   double getX2CoordinateOffset()  const { return this->Tx2;   }
-   double getX3CoordinateOffset()  const { return this->Tx3;   }
-   double getX1CoordinateScaling() const { return this->Sx1;   }	 //Scaling
-   double getX2CoordinateScaling() const { return this->Sx2;   }
-   double getX3CoordinateScaling() const { return this->Sx3;   }
-   double getRotationX1Angle()     const { return this->alpha; }
-   double getRotationX2Angle()     const { return this->beta;  }
-   double getRotationX3Angle()     const { return this->gamma; }	 //Rotation
-
-   //Achtung die Winkel passen nicht ueberein -siehe setTransformationValues
-   void setRotationX1Angle(double alpha) { this->setTransformationValues(this->Tx1, this->Tx2, this->Tx3, this->Sx1, this->Sx2, this->Sx3, alpha, this->beta, this->gamma); }
-   void setRotationX2Angle(double beta ) { this->setTransformationValues(this->Tx1, this->Tx2, this->Tx3, this->Sx1, this->Sx2, this->Sx3, this->alpha, beta, this->gamma); }
-   void setRotationX3Angle(double gamma) { this->setTransformationValues(this->Tx1, this->Tx2, this->Tx3, this->Sx1, this->Sx2, this->Sx3, this->alpha, this->beta, gamma); }
-
-   void setActive(const bool& active);
-   bool isActive()          const { return this->active; }
-   bool isTransformation()  const { return this->transformation; }
-
-   double transformForwardToX1Coordinate(const double& x1, const double& x2, const double& x3) const;
-   double transformForwardToX2Coordinate(const double& x1, const double& x2, const double& x3) const;
-   double transformForwardToX3Coordinate(const double& x1, const double& x2, const double& x3) const;
-   double transformForwardToX1CoordinateIgnoringRotation(const double& x1) const;
-   double transformForwardToX2CoordinateIgnoringRotation(const double& x2) const;
-   double transformForwardToX3CoordinateIgnoringRotation(const double& x3) const;
-   double transformBackwardToX1Coordinate(const double& x1, const double& x2, const double& x3) const;
-   double transformBackwardToX2Coordinate(const double& x1, const double& x2, const double& x3) const;
-   double transformBackwardToX3Coordinate(const double& x1, const double& x2, const double& x3) const;
-   double transformBackwardToX1CoordinateIgnoringRotation(const double& x1) const;
-   double transformBackwardToX2CoordinateIgnoringRotation(const double& x2) const;
-   double transformBackwardToX3CoordinateIgnoringRotation(const double& x3) const;
-   std::string toString() const;
+    CoordinateTransformation3D();
+    CoordinateTransformation3D(const double &originX1, const double &originX2, const double &originX3,
+                               const double &dx1, const double &dx2, const double &dx3, const double &alpha,
+                               const double &beta, const double &gamma);
+    CoordinateTransformation3D(const double &originX1, const double &originX2, const double &originX3,
+                               const double &dx1, const double &dx2, const double &dx3);
+    CoordinateTransformation3D(CoordinateTransformation3D *transformation);
+
+    void setTransformationValues(const double &originX1, const double &originX2, const double &originX3,
+                                 const double &dx1, const double &dx2, const double &dx3, const double &alpha,
+                                 const double &beta, const double &gamma);
+    double getX1CoordinateOffset() const { return this->Tx1; } // Translation
+    double getX2CoordinateOffset() const { return this->Tx2; }
+    double getX3CoordinateOffset() const { return this->Tx3; }
+    double getX1CoordinateScaling() const { return this->Sx1; } // Scaling
+    double getX2CoordinateScaling() const { return this->Sx2; }
+    double getX3CoordinateScaling() const { return this->Sx3; }
+    double getRotationX1Angle() const { return this->alpha; }
+    double getRotationX2Angle() const { return this->beta; }
+    double getRotationX3Angle() const { return this->gamma; } // Rotation
+
+    // Achtung die Winkel passen nicht ueberein -siehe setTransformationValues
+    void setRotationX1Angle(double alpha)
+    {
+        this->setTransformationValues(this->Tx1, this->Tx2, this->Tx3, this->Sx1, this->Sx2, this->Sx3, alpha,
+                                      this->beta, this->gamma);
+    }
+    void setRotationX2Angle(double beta)
+    {
+        this->setTransformationValues(this->Tx1, this->Tx2, this->Tx3, this->Sx1, this->Sx2, this->Sx3, this->alpha,
+                                      beta, this->gamma);
+    }
+    void setRotationX3Angle(double gamma)
+    {
+        this->setTransformationValues(this->Tx1, this->Tx2, this->Tx3, this->Sx1, this->Sx2, this->Sx3, this->alpha,
+                                      this->beta, gamma);
+    }
+
+    void setActive(const bool &active);
+    bool isActive() const { return this->active; }
+    bool isTransformation() const { return this->transformation; }
+
+    double transformForwardToX1Coordinate(const double &x1, const double &x2, const double &x3) const;
+    double transformForwardToX2Coordinate(const double &x1, const double &x2, const double &x3) const;
+    double transformForwardToX3Coordinate(const double &x1, const double &x2, const double &x3) const;
+    double transformForwardToX1CoordinateIgnoringRotation(const double &x1) const;
+    double transformForwardToX2CoordinateIgnoringRotation(const double &x2) const;
+    double transformForwardToX3CoordinateIgnoringRotation(const double &x3) const;
+    double transformBackwardToX1Coordinate(const double &x1, const double &x2, const double &x3) const;
+    double transformBackwardToX2Coordinate(const double &x1, const double &x2, const double &x3) const;
+    double transformBackwardToX3Coordinate(const double &x1, const double &x2, const double &x3) const;
+    double transformBackwardToX1CoordinateIgnoringRotation(const double &x1) const;
+    double transformBackwardToX2CoordinateIgnoringRotation(const double &x2) const;
+    double transformBackwardToX3CoordinateIgnoringRotation(const double &x3) const;
+    std::string toString() const;
 
 private:
-   double Tx1, Tx2, Tx3, Sx1, Sx2, Sx3, alpha, beta, gamma;
-
-   double toX1factorX1, toX1factorX2, toX1factorX3, toX1delta;
-   double toX2factorX1, toX2factorX2, toX2factorX3, toX2delta;
-   double toX3factorX1, toX3factorX2, toX3factorX3, toX3delta;
-
-   double fromX1factorX1, fromX1factorX2, fromX1factorX3, fromX1delta;
-   double fromX2factorX1, fromX2factorX2, fromX2factorX3, fromX2delta;
-   double fromX3factorX1, fromX3factorX2, fromX3factorX3, fromX3delta;
+    double Tx1, Tx2, Tx3, Sx1, Sx2, Sx3, alpha, beta, gamma;
 
-   bool   active;
-   bool   transformation;
+    double toX1factorX1, toX1factorX2, toX1factorX3, toX1delta;
+    double toX2factorX1, toX2factorX2, toX2factorX3, toX2delta;
+    double toX3factorX1, toX3factorX2, toX3factorX3, toX3delta;
 
-   friend class MPIIOCoProcessor;
-   friend class MPIIORestartCoProcessor;
-   friend class MPIIOMigrationCoProcessor;
-   friend class MPIIOMigrationBECoProcessor;
-   friend class CheckpointConverter;
+    double fromX1factorX1, fromX1factorX2, fromX1factorX3, fromX1delta;
+    double fromX2factorX1, fromX2factorX2, fromX2factorX3, fromX2delta;
+    double fromX3factorX1, fromX3factorX2, fromX3factorX3, fromX3delta;
 
+    bool active;
+    bool transformation;
 
+    friend class MPIIOCoProcessor;
+    friend class MPIIORestartCoProcessor;
+    friend class MPIIOMigrationCoProcessor;
+    friend class MPIIOMigrationBECoProcessor;
+    friend class CheckpointConverter;
 };
 
-#endif //COORDINATETRANSFORMATION3D_H
+#endif // COORDINATETRANSFORMATION3D_H
diff --git a/src/basics/geometry3d/GbCuboid3D.cpp b/src/basics/geometry3d/GbCuboid3D.cpp
index 55bb6331bdc3dba88a6089d64c9b760c61a2fb6c..3b29cf795ac7700dafec0b5666a1305b67512c5d 100644
--- a/src/basics/geometry3d/GbCuboid3D.cpp
+++ b/src/basics/geometry3d/GbCuboid3D.cpp
@@ -1,28 +1,28 @@
 //=======================================================================================
-// ____          ____    __    ______     __________   __      __       __        __         
-// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |        
-//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |        
-//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |        
-//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____    
-//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|   
-//      \    \  |    |   ________________________________________________________________    
-//       \    \ |    |  |  ______________________________________________________________|   
-//        \    \|    |  |  |         __          __     __     __     ______      _______    
-//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)   
-//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______    
+// ____          ____    __    ______     __________   __      __       __        __
+// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |
+//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |
+//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |
+//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____
+//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|
+//      \    \  |    |   ________________________________________________________________
+//       \    \ |    |  |  ______________________________________________________________|
+//        \    \|    |  |  |         __          __     __     __     ______      _______
+//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)
+//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______
 //           \       |  |  |        |  |_____   |   \_/   |   |  |   |  |_/  /    _____  |
-//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/   
+//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/
 //
-//  This file is part of VirtualFluids. VirtualFluids is free software: you can 
+//  This file is part of VirtualFluids. VirtualFluids is free software: you can
 //  redistribute it and/or modify it under the terms of the GNU General Public
-//  License as published by the Free Software Foundation, either version 3 of 
+//  License as published by the Free Software Foundation, either version 3 of
 //  the License, or (at your option) any later version.
-//  
-//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT 
-//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
-//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License 
+//
+//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT
+//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 //  for more details.
-//  
+//
 //  You should have received a copy of the GNU General Public License along
 //  with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>.
 //
@@ -42,526 +42,514 @@ using namespace std;
 // Konstruktor
 GbCuboid3D::GbCuboid3D() : GbObject3D()
 {
-   this->setName("cuboid");
-   this->p1 = new GbPoint3D(0.0, 0.0, 0.0);
-   this->p2 = new GbPoint3D(0.0, 0.0, 0.0);
-   this->p1->addObserver(this);
-   this->p2->addObserver(this);
+    this->setName("cuboid");
+    this->p1 = new GbPoint3D(0.0, 0.0, 0.0);
+    this->p2 = new GbPoint3D(0.0, 0.0, 0.0);
+    this->p1->addObserver(this);
+    this->p2->addObserver(this);
 }
 /*=======================================================*/
-GbCuboid3D::GbCuboid3D(const double& x1a,const double& x2a, const double& x3a, const double& x1b,const double& x2b, const double& x3b):GbObject3D()
+GbCuboid3D::GbCuboid3D(const double &x1a, const double &x2a, const double &x3a, const double &x1b, const double &x2b,
+                       const double &x3b)
+    : GbObject3D()
 {
-   this->setName("cuboid");
-   this->p1 = new GbPoint3D(x1a, x2a, x3a);
-   this->p1->addObserver(this);
-	this->p2 = new GbPoint3D(x1b, x2b, x3b);     
-   this->p2->addObserver(this);
+    this->setName("cuboid");
+    this->p1 = new GbPoint3D(x1a, x2a, x3a);
+    this->p1->addObserver(this);
+    this->p2 = new GbPoint3D(x1b, x2b, x3b);
+    this->p2->addObserver(this);
 }
 /*=======================================================*/
-GbCuboid3D::GbCuboid3D(GbPoint3D* p1, GbPoint3D* p2) : GbObject3D()
+GbCuboid3D::GbCuboid3D(GbPoint3D *p1, GbPoint3D *p2) : GbObject3D()
 {
-   this->setName("cuboid");
-	if(!p1 || !p2) throw UbException(UB_EXARGS,"one point ==NULL");
-   this->p1 = p1;
-   this->p1->addObserver(this);
-   this->p2 = p2;
-   this->p2->addObserver(this);
+    this->setName("cuboid");
+    if (!p1 || !p2)
+        throw UbException(UB_EXARGS, "one point ==NULL");
+    this->p1 = p1;
+    this->p1->addObserver(this);
+    this->p2 = p2;
+    this->p2->addObserver(this);
 }
 /*=======================================================*/
-GbCuboid3D::GbCuboid3D(GbCuboid3D* cuboid) : GbObject3D()
+GbCuboid3D::GbCuboid3D(GbCuboid3D *cuboid) : GbObject3D()
 {
-   this->setName("cuboid");
-   if(!cuboid->getPoint1() || !cuboid->getPoint2()) throw UbException(UB_EXARGS,"cuboid ==NULL");
-   this->p1 = cuboid->getPoint1()->clone();
-   this->p1->addObserver(this);
-   this->p2 = cuboid->getPoint2()->clone();
-   this->p2->addObserver(this);
+    this->setName("cuboid");
+    if (!cuboid->getPoint1() || !cuboid->getPoint2())
+        throw UbException(UB_EXARGS, "cuboid ==NULL");
+    this->p1 = cuboid->getPoint1()->clone();
+    this->p1->addObserver(this);
+    this->p2 = cuboid->getPoint2()->clone();
+    this->p2->addObserver(this);
 }
 /*=======================================================*/
 // Destruktor
 GbCuboid3D::~GbCuboid3D()
 {
-   //cout<<"~GbCuboid3D()"<<endl;
-   if(this->p1) this->p1->removeObserver(this);
-   if(this->p2) this->p2->removeObserver(this);
+    // cout<<"~GbCuboid3D()"<<endl;
+    if (this->p1)
+        this->p1->removeObserver(this);
+    if (this->p2)
+        this->p2->removeObserver(this);
 }
 /*=======================================================*/
-void GbCuboid3D::finalize() 
-{ 
-   if(this->p1) 
-   {
-      this->p1->removeObserver(this);
-      this->p1->finalize();
-      delete this->p1; 
-      this->p1=NULL;
-   } 
-   if(this->p2)
-   {
-      this->p2->removeObserver(this);
-      this->p2->finalize();
-      delete this->p2; 
-      this->p2=NULL;
-   }
+void GbCuboid3D::finalize()
+{
+    if (this->p1) {
+        this->p1->removeObserver(this);
+        this->p1->finalize();
+        delete this->p1;
+        this->p1 = NULL;
+    }
+    if (this->p2) {
+        this->p2->removeObserver(this);
+        this->p2->finalize();
+        delete this->p2;
+        this->p2 = NULL;
+    }
 }
 /*=======================================================*/
-void GbCuboid3D::setPoint1(GbPoint3D* point1)
-{ 
-   if(this->p1) this->p1->removeObserver(this);
-   this->p1 = point1;  
-   this->p1->addObserver(this);
+void GbCuboid3D::setPoint1(GbPoint3D *point1)
+{
+    if (this->p1)
+        this->p1->removeObserver(this);
+    this->p1 = point1;
+    this->p1->addObserver(this);
 
-   this->notifyObserversObjectChanged();
+    this->notifyObserversObjectChanged();
 }
 /*=======================================================*/
-void GbCuboid3D::setPoint2(GbPoint3D* point2)
-{ 
-   if(this->p2) this->p2->removeObserver(this);
-   this->p2 = point2;  
-   this->p2->addObserver(this);
+void GbCuboid3D::setPoint2(GbPoint3D *point2)
+{
+    if (this->p2)
+        this->p2->removeObserver(this);
+    this->p2 = point2;
+    this->p2->addObserver(this);
 
-   this->notifyObserversObjectChanged();
+    this->notifyObserversObjectChanged();
 }
 /*=======================================================*/
-void GbCuboid3D::setPoints(GbPoint3D* point1, GbPoint3D* point2)
-{ 
-   if(this->p1) this->p1->removeObserver(this);
-   if(this->p2) this->p2->removeObserver(this);
+void GbCuboid3D::setPoints(GbPoint3D *point1, GbPoint3D *point2)
+{
+    if (this->p1)
+        this->p1->removeObserver(this);
+    if (this->p2)
+        this->p2->removeObserver(this);
 
-   this->p1 = point1; 
-   this->p2 = point2;
+    this->p1 = point1;
+    this->p2 = point2;
 
-   this->p1->addObserver(this);
-   this->p2->addObserver(this);
+    this->p1->addObserver(this);
+    this->p2->addObserver(this);
 
-   this->notifyObserversObjectChanged();
+    this->notifyObserversObjectChanged();
 }
 /*=======================================================*/
-void GbCuboid3D::setCenterCoordinates(const double& x1, const double& x2, const double& x3) 
+void GbCuboid3D::setCenterCoordinates(const double &x1, const double &x2, const double &x3)
 {
-   this->translate(x1-getX1Centroid(), x2-getX2Centroid(), x3-getX3Centroid() );
+    this->translate(x1 - getX1Centroid(), x2 - getX2Centroid(), x3 - getX3Centroid());
 }
 /*=======================================================*/
-double GbCuboid3D::getX1Centroid()
-{
-   return (0.5*(p1->x1 + p2->x1)); 
-}
+double GbCuboid3D::getX1Centroid() { return (0.5 * (p1->x1 + p2->x1)); }
 /*=======================================================*/
-double GbCuboid3D::getX1Minimum()   
-{
-	return (this->p1->x1 < this->p2->x1 ? this->p1->x1 : this->p2->x1);
-}
+double GbCuboid3D::getX1Minimum() { return (this->p1->x1 < this->p2->x1 ? this->p1->x1 : this->p2->x1); }
 /*=======================================================*/
-double GbCuboid3D::getX1Maximum()   
-{
-	return (this->p1->x1 > this->p2->x1 ? this->p1->x1 : this->p2->x1);
-}
+double GbCuboid3D::getX1Maximum() { return (this->p1->x1 > this->p2->x1 ? this->p1->x1 : this->p2->x1); }
 /*=======================================================*/
-double GbCuboid3D::getX2Centroid()
-{
-   return (0.5*(p1->x2 + p2->x2)); 
-}
+double GbCuboid3D::getX2Centroid() { return (0.5 * (p1->x2 + p2->x2)); }
 /*=======================================================*/
-double GbCuboid3D::getX2Minimum()   
-{
-	return (this->p1->x2 < this->p2->x2 ? this->p1->x2 : this->p2->x2);
-}	
+double GbCuboid3D::getX2Minimum() { return (this->p1->x2 < this->p2->x2 ? this->p1->x2 : this->p2->x2); }
 /*=======================================================*/
-double GbCuboid3D::getX2Maximum()   
-{
-	return ( this->p1->x2 > this->p2->x2 ? this->p1->x2 : this->p2->x2);
-}
+double GbCuboid3D::getX2Maximum() { return (this->p1->x2 > this->p2->x2 ? this->p1->x2 : this->p2->x2); }
 /*=======================================================*/
-double GbCuboid3D::getX3Centroid()
-{
-   return (0.5*(p1->x3 + p2->x3)); 
-}
+double GbCuboid3D::getX3Centroid() { return (0.5 * (p1->x3 + p2->x3)); }
 /*=======================================================*/
-double GbCuboid3D::getX3Minimum()   
-{	
-	return (this->p1->x3 < this->p2->x3 ? this->p1->x3 : this->p2->x3);
-}	
+double GbCuboid3D::getX3Minimum() { return (this->p1->x3 < this->p2->x3 ? this->p1->x3 : this->p2->x3); }
 /*=======================================================*/
-double GbCuboid3D::getX3Maximum()   
-{
-	return (this->p1->x3 > this->p2->x3 ? this->p1->x3 : this->p2->x3);
-}
+double GbCuboid3D::getX3Maximum() { return (this->p1->x3 > this->p2->x3 ? this->p1->x3 : this->p2->x3); }
 /*=======================================================*/
-double GbCuboid3D::getLengthX1() 
-{ 
-   return (this->getX1Maximum() - this->getX1Minimum() ); 
-}
+double GbCuboid3D::getLengthX1() { return (this->getX1Maximum() - this->getX1Minimum()); }
 /*=======================================================*/
-double GbCuboid3D::getLengthX2() 
-{ 
-   return (this->getX2Maximum() - this->getX2Minimum());  
-}
+double GbCuboid3D::getLengthX2() { return (this->getX2Maximum() - this->getX2Minimum()); }
 /*=======================================================*/
-double GbCuboid3D::getLengthX3() 
-{ 
-   return (this->getX3Maximum() - this->getX3Minimum()); 
-}
+double GbCuboid3D::getLengthX3() { return (this->getX3Maximum() - this->getX3Minimum()); }
 /*=======================================================*/
-bool GbCuboid3D::isPointInGbObject3D(const double& x1p, const double& x2p, const double& x3p)
+bool GbCuboid3D::isPointInGbObject3D(const double &x1p, const double &x2p, const double &x3p)
 {
-   //true, wenn 'in Object' oder 'auf Boundary'!
-   if     (UbMath::less(x1p,this->getX1Minimum()))    return false;
-   else if(UbMath::less(x2p,this->getX2Minimum()))    return false;
-   else if(UbMath::less(x3p,this->getX3Minimum()))    return false;
-   else if(UbMath::greater(x1p,this->getX1Maximum())) return false;
-   else if(UbMath::greater(x2p,this->getX2Maximum())) return false;
-   else if(UbMath::greater(x3p,this->getX3Maximum())) return false;
-
-   return true;
-}
-/*=======================================================*/
-bool GbCuboid3D::isPointInGbObject3D(const double& x1p, const double& x2p, const double& x3p, bool& pointIsOnBoundary)
+    // true, wenn 'in Object' oder 'auf Boundary'!
+    if (UbMath::less(x1p, this->getX1Minimum()))
+        return false;
+    else if (UbMath::less(x2p, this->getX2Minimum()))
+        return false;
+    else if (UbMath::less(x3p, this->getX3Minimum()))
+        return false;
+    else if (UbMath::greater(x1p, this->getX1Maximum()))
+        return false;
+    else if (UbMath::greater(x2p, this->getX2Maximum()))
+        return false;
+    else if (UbMath::greater(x3p, this->getX3Maximum()))
+        return false;
+
+    return true;
+}
+/*=======================================================*/
+bool GbCuboid3D::isPointInGbObject3D(const double &x1p, const double &x2p, const double &x3p, bool &pointIsOnBoundary)
 {
-   pointIsOnBoundary = false;
-   
-   //true, wenn 'in Object' oder 'auf Boundary'!
-   if     (UbMath::less(x1p,this->getX1Minimum()))    return false;
-	else if(UbMath::less(x2p,this->getX2Minimum()))    return false;
-	else if(UbMath::less(x3p,this->getX3Minimum()))    return false;
-	else if(UbMath::greater(x1p,this->getX1Maximum())) return false;
-	else if(UbMath::greater(x2p,this->getX2Maximum())) return false;
-	else if(UbMath::greater(x3p,this->getX3Maximum())) return false;
-	
-   if     (UbMath::equal(x1p,this->getX1Minimum())) pointIsOnBoundary = true;
-   else if(UbMath::equal(x2p,this->getX2Minimum())) pointIsOnBoundary = true;
-   else if(UbMath::equal(x3p,this->getX3Minimum())) pointIsOnBoundary = true;
-   else if(UbMath::equal(x1p,this->getX1Maximum())) pointIsOnBoundary = true;
-   else if(UbMath::equal(x2p,this->getX2Maximum())) pointIsOnBoundary = true;
-   else if(UbMath::equal(x3p,this->getX3Maximum())) pointIsOnBoundary = true;
-   
-   return true;
-}
-/*=======================================================*/
-bool GbCuboid3D::isCellInsideGbObject3D(const double& x1p1,const double& x2p1,const double& x3p1,const double& x1p2,const double& x2p2,const double& x3p2)
+    pointIsOnBoundary = false;
+
+    // true, wenn 'in Object' oder 'auf Boundary'!
+    if (UbMath::less(x1p, this->getX1Minimum()))
+        return false;
+    else if (UbMath::less(x2p, this->getX2Minimum()))
+        return false;
+    else if (UbMath::less(x3p, this->getX3Minimum()))
+        return false;
+    else if (UbMath::greater(x1p, this->getX1Maximum()))
+        return false;
+    else if (UbMath::greater(x2p, this->getX2Maximum()))
+        return false;
+    else if (UbMath::greater(x3p, this->getX3Maximum()))
+        return false;
+
+    if (UbMath::equal(x1p, this->getX1Minimum()))
+        pointIsOnBoundary = true;
+    else if (UbMath::equal(x2p, this->getX2Minimum()))
+        pointIsOnBoundary = true;
+    else if (UbMath::equal(x3p, this->getX3Minimum()))
+        pointIsOnBoundary = true;
+    else if (UbMath::equal(x1p, this->getX1Maximum()))
+        pointIsOnBoundary = true;
+    else if (UbMath::equal(x2p, this->getX2Maximum()))
+        pointIsOnBoundary = true;
+    else if (UbMath::equal(x3p, this->getX3Maximum()))
+        pointIsOnBoundary = true;
+
+    return true;
+}
+/*=======================================================*/
+bool GbCuboid3D::isCellInsideGbObject3D(const double &x1p1, const double &x2p1, const double &x3p1, const double &x1p2,
+                                        const double &x2p2, const double &x3p2)
 {
-   if     ( UbMath::less   (x1p1, this->getX1Minimum() ) ) return false;
-   else if( UbMath::less   (x2p1, this->getX2Minimum() ) ) return false;
-   else if( UbMath::less   (x3p1, this->getX3Minimum() ) ) return false;
-   else if( UbMath::greater(x1p2, this->getX1Maximum() ) ) return false;
-   else if( UbMath::greater(x2p2, this->getX2Maximum() ) ) return false;
-   else if( UbMath::greater(x3p2, this->getX3Maximum() ) ) return false;
-
-   return true;
-}
-/*=======================================================*/
-bool GbCuboid3D::isCellCuttingGbObject3D(const double& x1a,const double& x2a,const double& x3a,const double& x1b,const double& x2b,const double& x3b)
-//Merksatz: cell oder deren Volumen schneidet oder beinhaltet komplette oder Teile der CuboidUmrandung
-//returns true:
+    if (UbMath::less(x1p1, this->getX1Minimum()))
+        return false;
+    else if (UbMath::less(x2p1, this->getX2Minimum()))
+        return false;
+    else if (UbMath::less(x3p1, this->getX3Minimum()))
+        return false;
+    else if (UbMath::greater(x1p2, this->getX1Maximum()))
+        return false;
+    else if (UbMath::greater(x2p2, this->getX2Maximum()))
+        return false;
+    else if (UbMath::greater(x3p2, this->getX3Maximum()))
+        return false;
+
+    return true;
+}
+/*=======================================================*/
+bool GbCuboid3D::isCellCuttingGbObject3D(const double &x1a, const double &x2a, const double &x3a, const double &x1b,
+                                         const double &x2b, const double &x3b)
+// Merksatz: cell oder deren Volumen schneidet oder beinhaltet komplette oder Teile der CuboidUmrandung
+// returns true:
 //  - cell cuts  cuboid3D
 //  - cell boxes cuboid3D
-//returns false:
+// returns false:
 //  - cell completely inside cuboid3D ( = cuboid3D boxes cell)
 //  - cell und cuboid3D haben kein gemeinsames Volumen
 {
-   //erstmal die dumm Loesung
-   if(   !this->isCellInsideGbObject3D(x1a,x2a,x3a,x1b,x2b,x3b) 
-      && this->isCellInsideOrCuttingGbObject3D(x1a,x2a,x3a,x1b,x2b,x3b) )
-   {
-      return true;
-   }
-
-   return false;
-
-   //GbCuboid3D* cube = GbSystem3D::clipRectangle3D(*this->p1, *this->p2, x1a,x2a,x3a,x1b,x2b,x3b);
-   //if(cube) 
-   //{
-   //   cube->finalize();
-   //   delete cube;
-   //   return true;
-   //}
-
-   //return false;
+    // erstmal die dumm Loesung
+    if (!this->isCellInsideGbObject3D(x1a, x2a, x3a, x1b, x2b, x3b) &&
+        this->isCellInsideOrCuttingGbObject3D(x1a, x2a, x3a, x1b, x2b, x3b)) {
+        return true;
+    }
+
+    return false;
+
+    // GbCuboid3D* cube = GbSystem3D::clipRectangle3D(*this->p1, *this->p2, x1a,x2a,x3a,x1b,x2b,x3b);
+    // if(cube)
+    //{
+    //   cube->finalize();
+    //   delete cube;
+    //   return true;
+    //}
+
+    // return false;
 }
 /*=======================================================*/
-bool GbCuboid3D::isCellInsideOrCuttingGbObject3D(const double& x1a,const double& x2a,const double& x3a,const double& x1b,const double& x2b,const double& x3b)
-//returns true:
+bool GbCuboid3D::isCellInsideOrCuttingGbObject3D(const double &x1a, const double &x2a, const double &x3a,
+                                                 const double &x1b, const double &x2b, const double &x3b)
+// returns true:
 //  - cell completely inside cuboid3D ( = cuboid3D boxes cell)
 //  - cell cuts  cuboid3D
 //  - cell boxes cuboid3D
-//returns false:
+// returns false:
 //  - cell und cuboid3D haben kein gemeinsames Volumen
 {
-    //simpler check, da unser GbCuboid3D ein AABB is:
-   //  anfA        midA         endA             anfB    midB    endB
-   //   |            x<-- dxA -->|                 |<-dxB->x       |
-   //                |<----------------- T --------------->|
-   //ist |T| <= dxA + dxB -> overlap!
-
-   if(     UbMath::lessEqual(  std::fabs( this->getX1Centroid() - 0.5*(x1b+x1a)      /*Tx1*/      )
-                             , 0.5*( this->getLengthX1()        + std::fabs(x1b-x1a) /*dx1A+dx1B*/) )
-
-        && UbMath::lessEqual(  std::fabs( this->getX2Centroid() - 0.5*(x2b+x2a)      /*Tx2*/      )
-                             , 0.5*( this->getLengthX2()        + std::fabs(x2b-x2a) /*dx2A+dx2B*/) )
-
-        && UbMath::lessEqual(  std::fabs( this->getX3Centroid() - 0.5*(x3b+x3a)      /*Tx3*/      )
-                             , 0.5*( this->getLengthX3()        + std::fabs(x3b-x3a) /*dx3A+dx3B*/) ) )
-    {
-       return true;
+    // simpler check, da unser GbCuboid3D ein AABB is:
+    //  anfA        midA         endA             anfB    midB    endB
+    //   |            x<-- dxA -->|                 |<-dxB->x       |
+    //                |<----------------- T --------------->|
+    // ist |T| <= dxA + dxB -> overlap!
+
+    if (UbMath::lessEqual(std::fabs(this->getX1Centroid() - 0.5 * (x1b + x1a) /*Tx1*/),
+                          0.5 * (this->getLengthX1() + std::fabs(x1b - x1a) /*dx1A+dx1B*/))
+
+        && UbMath::lessEqual(std::fabs(this->getX2Centroid() - 0.5 * (x2b + x2a) /*Tx2*/),
+                             0.5 * (this->getLengthX2() + std::fabs(x2b - x2a) /*dx2A+dx2B*/))
+
+        && UbMath::lessEqual(std::fabs(this->getX3Centroid() - 0.5 * (x3b + x3a) /*Tx3*/),
+                             0.5 * (this->getLengthX3() + std::fabs(x3b - x3a) /*dx3A+dx3B*/))) {
+        return true;
     }
 
     return false;
 
     // if(   this->isCellInsideGbObject3D(x1a,x2a,x3a,x1b,x2b,x3b)
-   //    || this->isCellCuttingGbObject3D(x1a,x2a,x3a,x1b,x2b,x3b) ) return true;
-   //
-   //return false;
+    //    || this->isCellCuttingGbObject3D(x1a,x2a,x3a,x1b,x2b,x3b) ) return true;
+    //
+    // return false;
 }
 /*=======================================================*/
-vector<GbTriangle3D*> GbCuboid3D::getSurfaceTriangleSet()
+vector<GbTriangle3D *> GbCuboid3D::getSurfaceTriangleSet()
 {
-   vector<GbTriangle3D*> triangles;
-   GbPoint3D p1(getX1Minimum(),getX2Minimum(),getX3Minimum());
-   GbPoint3D p2(getX1Maximum(),getX2Minimum(),getX3Minimum());
-   GbPoint3D p3(getX1Maximum(),getX2Maximum(),getX3Minimum());
-   GbPoint3D p4(getX1Minimum(),getX2Maximum(),getX3Minimum());
-   GbPoint3D p5(getX1Minimum(),getX2Minimum(),getX3Maximum());
-   GbPoint3D p6(getX1Maximum(),getX2Minimum(),getX3Maximum());
-   GbPoint3D p7(getX1Maximum(),getX2Maximum(),getX3Maximum());
-   GbPoint3D p8(getX1Minimum(),getX2Maximum(),getX3Maximum());
-
-   GbPoint3D pUnten(getX1Centroid(),getX2Centroid(),getX3Minimum());
-   GbPoint3D pOben(getX1Centroid(),getX2Centroid(),getX3Maximum());
-   GbPoint3D pLinks(getX1Minimum(), getX2Centroid(),getX3Centroid());
-   GbPoint3D pRechts(getX1Maximum(), getX2Centroid(),getX3Centroid());
-   GbPoint3D pVorne(getX1Centroid(),getX2Minimum(),getX3Centroid());
-   GbPoint3D pHinten(getX1Centroid(),getX2Maximum(),getX3Centroid());
-
-   //"unten"
-   triangles.push_back(new GbTriangle3D(new GbPoint3D(p2),new GbPoint3D(pUnten),new GbPoint3D(p3)));
-   triangles.push_back(new GbTriangle3D(new GbPoint3D(p2),new GbPoint3D(p1),new GbPoint3D(pUnten)));
-   triangles.push_back(new GbTriangle3D(new GbPoint3D(p3),new GbPoint3D(pUnten),new GbPoint3D(p4)));
-   triangles.push_back(new GbTriangle3D(new GbPoint3D(p1),new GbPoint3D(p4),new GbPoint3D(pUnten)));
-   //"oben"
-   triangles.push_back(new GbTriangle3D(new GbPoint3D(p5),new GbPoint3D(p6),new GbPoint3D(pOben)));
-   triangles.push_back(new GbTriangle3D(new GbPoint3D(p6),new GbPoint3D(p7),new GbPoint3D(pOben)));
-   triangles.push_back(new GbTriangle3D(new GbPoint3D(p5),new GbPoint3D(pOben),new GbPoint3D(p8)));
-   triangles.push_back(new GbTriangle3D(new GbPoint3D(pOben),new GbPoint3D(p7),new GbPoint3D(p8)));
-   //"links"
-   triangles.push_back(new GbTriangle3D(new GbPoint3D(p4),new GbPoint3D(p1),new GbPoint3D(pLinks)));
-   triangles.push_back(new GbTriangle3D(new GbPoint3D(p4),new GbPoint3D(pLinks),new GbPoint3D(p8)));
-   triangles.push_back(new GbTriangle3D(new GbPoint3D(p8),new GbPoint3D(pLinks),new GbPoint3D(p5)));
-   triangles.push_back(new GbTriangle3D(new GbPoint3D(pLinks),new GbPoint3D(p1),new GbPoint3D(p5)));
-   //"rechts"                                                               
-   triangles.push_back(new GbTriangle3D(new GbPoint3D(p2),new GbPoint3D(p3),new GbPoint3D(pRechts)));
-   triangles.push_back(new GbTriangle3D(new GbPoint3D(pRechts),new GbPoint3D(p3),new GbPoint3D(p7)));
-   triangles.push_back(new GbTriangle3D(new GbPoint3D(p2),new GbPoint3D(pRechts),new GbPoint3D(p6)));
-   triangles.push_back(new GbTriangle3D(new GbPoint3D(pRechts),new GbPoint3D(p7),new GbPoint3D(p6)));
-   //"hinten"                                                                       
-   triangles.push_back(new GbTriangle3D(new GbPoint3D(p3),new GbPoint3D(p4),new GbPoint3D(pHinten)));
-   triangles.push_back(new GbTriangle3D(new GbPoint3D(p3),new GbPoint3D(pHinten),new GbPoint3D(p7)));
-   triangles.push_back(new GbTriangle3D(new GbPoint3D(p7),new GbPoint3D(pHinten),new GbPoint3D(p8)));
-   triangles.push_back(new GbTriangle3D(new GbPoint3D(pHinten),new GbPoint3D(p4),new GbPoint3D(p8)));
-   //"vorne"                                                                        
-   triangles.push_back(new GbTriangle3D(new GbPoint3D(p1),new GbPoint3D(p2),new GbPoint3D(pVorne)));
-   triangles.push_back(new GbTriangle3D(new GbPoint3D(pVorne),new GbPoint3D(p2),new GbPoint3D(p6)));
-   triangles.push_back(new GbTriangle3D(new GbPoint3D(p1),new GbPoint3D(pVorne),new GbPoint3D(p5)));
-   triangles.push_back(new GbTriangle3D(new GbPoint3D(pVorne),new GbPoint3D(p6),new GbPoint3D(p5)));
-   return triangles;
-}
-/*=======================================================*/
-void GbCuboid3D::addSurfaceTriangleSet(vector<UbTupleFloat3>& nodes, vector<UbTupleInt3>& triangles)
+    vector<GbTriangle3D *> triangles;
+    GbPoint3D p1(getX1Minimum(), getX2Minimum(), getX3Minimum());
+    GbPoint3D p2(getX1Maximum(), getX2Minimum(), getX3Minimum());
+    GbPoint3D p3(getX1Maximum(), getX2Maximum(), getX3Minimum());
+    GbPoint3D p4(getX1Minimum(), getX2Maximum(), getX3Minimum());
+    GbPoint3D p5(getX1Minimum(), getX2Minimum(), getX3Maximum());
+    GbPoint3D p6(getX1Maximum(), getX2Minimum(), getX3Maximum());
+    GbPoint3D p7(getX1Maximum(), getX2Maximum(), getX3Maximum());
+    GbPoint3D p8(getX1Minimum(), getX2Maximum(), getX3Maximum());
+
+    GbPoint3D pUnten(getX1Centroid(), getX2Centroid(), getX3Minimum());
+    GbPoint3D pOben(getX1Centroid(), getX2Centroid(), getX3Maximum());
+    GbPoint3D pLinks(getX1Minimum(), getX2Centroid(), getX3Centroid());
+    GbPoint3D pRechts(getX1Maximum(), getX2Centroid(), getX3Centroid());
+    GbPoint3D pVorne(getX1Centroid(), getX2Minimum(), getX3Centroid());
+    GbPoint3D pHinten(getX1Centroid(), getX2Maximum(), getX3Centroid());
+
+    //"unten"
+    triangles.push_back(new GbTriangle3D(new GbPoint3D(p2), new GbPoint3D(pUnten), new GbPoint3D(p3)));
+    triangles.push_back(new GbTriangle3D(new GbPoint3D(p2), new GbPoint3D(p1), new GbPoint3D(pUnten)));
+    triangles.push_back(new GbTriangle3D(new GbPoint3D(p3), new GbPoint3D(pUnten), new GbPoint3D(p4)));
+    triangles.push_back(new GbTriangle3D(new GbPoint3D(p1), new GbPoint3D(p4), new GbPoint3D(pUnten)));
+    //"oben"
+    triangles.push_back(new GbTriangle3D(new GbPoint3D(p5), new GbPoint3D(p6), new GbPoint3D(pOben)));
+    triangles.push_back(new GbTriangle3D(new GbPoint3D(p6), new GbPoint3D(p7), new GbPoint3D(pOben)));
+    triangles.push_back(new GbTriangle3D(new GbPoint3D(p5), new GbPoint3D(pOben), new GbPoint3D(p8)));
+    triangles.push_back(new GbTriangle3D(new GbPoint3D(pOben), new GbPoint3D(p7), new GbPoint3D(p8)));
+    //"links"
+    triangles.push_back(new GbTriangle3D(new GbPoint3D(p4), new GbPoint3D(p1), new GbPoint3D(pLinks)));
+    triangles.push_back(new GbTriangle3D(new GbPoint3D(p4), new GbPoint3D(pLinks), new GbPoint3D(p8)));
+    triangles.push_back(new GbTriangle3D(new GbPoint3D(p8), new GbPoint3D(pLinks), new GbPoint3D(p5)));
+    triangles.push_back(new GbTriangle3D(new GbPoint3D(pLinks), new GbPoint3D(p1), new GbPoint3D(p5)));
+    //"rechts"
+    triangles.push_back(new GbTriangle3D(new GbPoint3D(p2), new GbPoint3D(p3), new GbPoint3D(pRechts)));
+    triangles.push_back(new GbTriangle3D(new GbPoint3D(pRechts), new GbPoint3D(p3), new GbPoint3D(p7)));
+    triangles.push_back(new GbTriangle3D(new GbPoint3D(p2), new GbPoint3D(pRechts), new GbPoint3D(p6)));
+    triangles.push_back(new GbTriangle3D(new GbPoint3D(pRechts), new GbPoint3D(p7), new GbPoint3D(p6)));
+    //"hinten"
+    triangles.push_back(new GbTriangle3D(new GbPoint3D(p3), new GbPoint3D(p4), new GbPoint3D(pHinten)));
+    triangles.push_back(new GbTriangle3D(new GbPoint3D(p3), new GbPoint3D(pHinten), new GbPoint3D(p7)));
+    triangles.push_back(new GbTriangle3D(new GbPoint3D(p7), new GbPoint3D(pHinten), new GbPoint3D(p8)));
+    triangles.push_back(new GbTriangle3D(new GbPoint3D(pHinten), new GbPoint3D(p4), new GbPoint3D(p8)));
+    //"vorne"
+    triangles.push_back(new GbTriangle3D(new GbPoint3D(p1), new GbPoint3D(p2), new GbPoint3D(pVorne)));
+    triangles.push_back(new GbTriangle3D(new GbPoint3D(pVorne), new GbPoint3D(p2), new GbPoint3D(p6)));
+    triangles.push_back(new GbTriangle3D(new GbPoint3D(p1), new GbPoint3D(pVorne), new GbPoint3D(p5)));
+    triangles.push_back(new GbTriangle3D(new GbPoint3D(pVorne), new GbPoint3D(p6), new GbPoint3D(p5)));
+    return triangles;
+}
+/*=======================================================*/
+void GbCuboid3D::addSurfaceTriangleSet(vector<UbTupleFloat3> &nodes, vector<UbTupleInt3> &triangles)
 {
-   /*0*/nodes.push_back( makeUbTuple((float)getX1Minimum(),(float)getX2Minimum(),(float)getX3Minimum()));
-   /*1*/nodes.push_back( makeUbTuple((float)getX1Maximum(),(float)getX2Minimum(),(float)getX3Minimum()));
-   /*2*/nodes.push_back( makeUbTuple((float)getX1Maximum(),(float)getX2Maximum(),(float)getX3Minimum()));
-   /*3*/nodes.push_back( makeUbTuple((float)getX1Minimum(),(float)getX2Maximum(),(float)getX3Minimum()));
-   
-   /*4*/nodes.push_back( makeUbTuple((float)getX1Minimum(),(float)getX2Minimum(),(float)getX3Maximum()));
-   /*5*/nodes.push_back( makeUbTuple((float)getX1Maximum(),(float)getX2Minimum(),(float)getX3Maximum()));
-   /*6*/nodes.push_back( makeUbTuple((float)getX1Maximum(),(float)getX2Maximum(),(float)getX3Maximum()));
-   /*7*/nodes.push_back( makeUbTuple((float)getX1Minimum(),(float)getX2Maximum(),(float)getX3Maximum()));
-
-   //"unten"
-   triangles.push_back( makeUbTuple( 0, 1, 2) );
-   triangles.push_back( makeUbTuple( 0, 2, 3) );
-   //"oben"
-   triangles.push_back( makeUbTuple( 4, 5, 6) );
-   triangles.push_back( makeUbTuple( 4, 6, 7) );
-   //"links"
-   triangles.push_back( makeUbTuple( 0, 3, 7) );
-   triangles.push_back( makeUbTuple( 0, 7, 4) );
-   //"rechts"                                                               
-   triangles.push_back( makeUbTuple( 1, 2, 6) );
-   triangles.push_back( makeUbTuple( 1, 6, 5) );
-   //"hinten"                                                                       
-   triangles.push_back( makeUbTuple( 3, 2, 7) );  
-   triangles.push_back( makeUbTuple( 2, 7, 6) );
-   //"vorne"                                                                        
-   triangles.push_back( makeUbTuple( 0, 1, 5) );
-   triangles.push_back( makeUbTuple( 0, 5, 4) );
-}
-/*=======================================================*/
-string GbCuboid3D::toString() 
+    /*0*/ nodes.push_back(makeUbTuple((float)getX1Minimum(), (float)getX2Minimum(), (float)getX3Minimum()));
+    /*1*/ nodes.push_back(makeUbTuple((float)getX1Maximum(), (float)getX2Minimum(), (float)getX3Minimum()));
+    /*2*/ nodes.push_back(makeUbTuple((float)getX1Maximum(), (float)getX2Maximum(), (float)getX3Minimum()));
+    /*3*/ nodes.push_back(makeUbTuple((float)getX1Minimum(), (float)getX2Maximum(), (float)getX3Minimum()));
+
+    /*4*/ nodes.push_back(makeUbTuple((float)getX1Minimum(), (float)getX2Minimum(), (float)getX3Maximum()));
+    /*5*/ nodes.push_back(makeUbTuple((float)getX1Maximum(), (float)getX2Minimum(), (float)getX3Maximum()));
+    /*6*/ nodes.push_back(makeUbTuple((float)getX1Maximum(), (float)getX2Maximum(), (float)getX3Maximum()));
+    /*7*/ nodes.push_back(makeUbTuple((float)getX1Minimum(), (float)getX2Maximum(), (float)getX3Maximum()));
+
+    //"unten"
+    triangles.push_back(makeUbTuple(0, 1, 2));
+    triangles.push_back(makeUbTuple(0, 2, 3));
+    //"oben"
+    triangles.push_back(makeUbTuple(4, 5, 6));
+    triangles.push_back(makeUbTuple(4, 6, 7));
+    //"links"
+    triangles.push_back(makeUbTuple(0, 3, 7));
+    triangles.push_back(makeUbTuple(0, 7, 4));
+    //"rechts"
+    triangles.push_back(makeUbTuple(1, 2, 6));
+    triangles.push_back(makeUbTuple(1, 6, 5));
+    //"hinten"
+    triangles.push_back(makeUbTuple(3, 2, 7));
+    triangles.push_back(makeUbTuple(2, 7, 6));
+    //"vorne"
+    triangles.push_back(makeUbTuple(0, 1, 5));
+    triangles.push_back(makeUbTuple(0, 5, 4));
+}
+/*=======================================================*/
+string GbCuboid3D::toString()
 {
-   stringstream ss;
-   ss<<"GbCuboid3D[";
-   ss<<"p1="<<this->p1->toString();
-   ss<<", p2="<<this->p2->toString();
-   ss<<"]";
-   return ss.str();
+    stringstream ss;
+    ss << "GbCuboid3D[";
+    ss << "p1=" << this->p1->toString();
+    ss << ", p2=" << this->p2->toString();
+    ss << "]";
+    return ss.str();
 }
 /*=======================================================*/
-GbPoint3D* GbCuboid3D::calculateInterSectionPoint3D(GbPoint3D&  /*point1*/, GbPoint3D&  /*point2*/)
+GbPoint3D *GbCuboid3D::calculateInterSectionPoint3D(GbPoint3D & /*point1*/, GbPoint3D & /*point2*/)
 {
-   throw UbException(UB_EXARGS,"not correct implemented");
+    throw UbException(UB_EXARGS, "not correct implemented");
 }
 /*=======================================================*/
-GbLine3D* GbCuboid3D::createClippedLine3D(GbPoint3D& point1, GbPoint3D& point2)
+GbLine3D *GbCuboid3D::createClippedLine3D(GbPoint3D &point1, GbPoint3D &point2)
 {
-   return GbSystem3D::createClipLine3D(point1, point2,
-                                       p1->getX1Coordinate(),p1->getX2Coordinate(),p1->getX3Coordinate(),
-                                       p2->getX1Coordinate(),p2->getX2Coordinate(),p2->getX3Coordinate() );
+    return GbSystem3D::createClipLine3D(point1, point2, p1->getX1Coordinate(), p1->getX2Coordinate(),
+                                        p1->getX3Coordinate(), p2->getX1Coordinate(), p2->getX2Coordinate(),
+                                        p2->getX3Coordinate());
 }
 /*==========================================================*/
-void GbCuboid3D::objectChanged(UbObservable* changedObject)
+void GbCuboid3D::objectChanged(UbObservable *changedObject)
 {
-   GbPoint3D* point = dynamic_cast<GbPoint3D*>(changedObject);
-   if(!point || (this->p1!=point && this->p2!=point)) return;
+    GbPoint3D *point = dynamic_cast<GbPoint3D *>(changedObject);
+    if (!point || (this->p1 != point && this->p2 != point))
+        return;
 
-   this->notifyObserversObjectChanged();
+    this->notifyObserversObjectChanged();
 }
 /*==========================================================*/
-void GbCuboid3D::objectWillBeDeleted(UbObservable* objectForDeletion)
+void GbCuboid3D::objectWillBeDeleted(UbObservable *objectForDeletion)
 {
-   if(this->p1)
-   {
-      UbObservable* observedObj = dynamic_cast<UbObservable*>(this->p1);
-      if(objectForDeletion == observedObj) { this->p1 = NULL; }
-   }
-   if(this->p2)
-   {
-      UbObservable* observedObj = dynamic_cast<UbObservable*>(this->p2);
-      if(objectForDeletion == observedObj) { this->p2 = NULL; }
-   }
-   //ACHTUNG: eigentlich muessten in allen methoden von GbLine if abfragen fuer NULL pointer hin... toDo
+    if (this->p1) {
+        UbObservable *observedObj = dynamic_cast<UbObservable *>(this->p1);
+        if (objectForDeletion == observedObj) {
+            this->p1 = NULL;
+        }
+    }
+    if (this->p2) {
+        UbObservable *observedObj = dynamic_cast<UbObservable *>(this->p2);
+        if (objectForDeletion == observedObj) {
+            this->p2 = NULL;
+        }
+    }
+    // ACHTUNG: eigentlich muessten in allen methoden von GbLine if abfragen fuer NULL pointer hin... toDo
 }
 /*=======================================================*/
-void GbCuboid3D::translate(const double& tx1, const double& tx2, const double& tx3)
-{  
-   this->p1->translate(tx1, tx2, tx3);
-   this->p2->translate(tx1, tx2, tx3);
-   this->notifyObserversObjectChanged();
+void GbCuboid3D::translate(const double &tx1, const double &tx2, const double &tx3)
+{
+    this->p1->translate(tx1, tx2, tx3);
+    this->p2->translate(tx1, tx2, tx3);
+    this->notifyObserversObjectChanged();
 }
 /*=======================================================*/
-void GbCuboid3D::scale(const double& sx1, const double& sx2, const double& sx3)
-{  
-   double lenX1 = this->getLengthX1();
-   double lenX2 = this->getLengthX2();
-   double lenX3 = this->getLengthX3();
+void GbCuboid3D::scale(const double &sx1, const double &sx2, const double &sx3)
+{
+    double lenX1 = this->getLengthX1();
+    double lenX2 = this->getLengthX2();
+    double lenX3 = this->getLengthX3();
 
-   double deltaX1 = lenX1*sx1 - lenX1;
-   double deltaX2 = lenX2*sx2 - lenX2;
-   double deltaX3 = lenX3*sx3 - lenX3;
+    double deltaX1 = lenX1 * sx1 - lenX1;
+    double deltaX2 = lenX2 * sx2 - lenX2;
+    double deltaX3 = lenX3 * sx3 - lenX3;
 
-   double p1X1 = this->p1->getX1Coordinate();
-   double p1X2 = this->p1->getX2Coordinate();
-   double p1X3 = this->p1->getX3Coordinate();
+    double p1X1 = this->p1->getX1Coordinate();
+    double p1X2 = this->p1->getX2Coordinate();
+    double p1X3 = this->p1->getX3Coordinate();
 
-   double p2X1 = this->p2->getX1Coordinate();
-   double p2X2 = this->p2->getX2Coordinate();
-   double p2X3 = this->p2->getX3Coordinate();
+    double p2X1 = this->p2->getX1Coordinate();
+    double p2X2 = this->p2->getX2Coordinate();
+    double p2X3 = this->p2->getX3Coordinate();
 
-   this->p1->setCoordinates(p1X1 - 0.5*deltaX1
-                           ,p1X2 - 0.5*deltaX2
-                           ,p1X3 - 0.5*deltaX3);
+    this->p1->setCoordinates(p1X1 - 0.5 * deltaX1, p1X2 - 0.5 * deltaX2, p1X3 - 0.5 * deltaX3);
 
-   this->p2->setCoordinates(p2X1 + 0.5*deltaX1
-                           ,p2X2 + 0.5*deltaX2
-                           ,p2X3 + 0.5*deltaX3);
+    this->p2->setCoordinates(p2X1 + 0.5 * deltaX1, p2X2 + 0.5 * deltaX2, p2X3 + 0.5 * deltaX3);
 }
 /*==========================================================*/
-double GbCuboid3D::getCellVolumeInsideGbObject3D(const double& x1a,const double& x2a,const double& x3a,const double& x1b,const double& x2b,const double& x3b)
+double GbCuboid3D::getCellVolumeInsideGbObject3D(const double &x1a, const double &x2a, const double &x3a,
+                                                 const double &x1b, const double &x2b, const double &x3b)
 {
-   if( this->isCellInsideGbObject3D(x1a,x2a,x3a,x1b,x2b,x3b) )       return 1.0*(x1b-x1a)*(x2b-x2a)*(x3b-x3a);
-   if( !(this->isCellCuttingGbObject3D(x1a,x2a,x3a,x1b,x2b,x3b)) )   return 0.0;
-
-   GbCuboid3D* cube = GbSystem3D::clipRectangle3D(*this->p1, *this->p2, x1a,x2a,x3a,x1b,x2b,x3b);
-
-   if(cube) 
-   {
-      double eps;
-      eps  = (cube->getLengthX1())*(cube->getLengthX2())*(cube->getLengthX3());
-      cube->finalize();
-      delete cube;
-      return eps;
-   }
-   return 0.0;
+    if (this->isCellInsideGbObject3D(x1a, x2a, x3a, x1b, x2b, x3b))
+        return 1.0 * (x1b - x1a) * (x2b - x2a) * (x3b - x3a);
+    if (!(this->isCellCuttingGbObject3D(x1a, x2a, x3a, x1b, x2b, x3b)))
+        return 0.0;
+
+    GbCuboid3D *cube = GbSystem3D::clipRectangle3D(*this->p1, *this->p2, x1a, x2a, x3a, x1b, x2b, x3b);
+
+    if (cube) {
+        double eps;
+        eps = (cube->getLengthX1()) * (cube->getLengthX2()) * (cube->getLengthX3());
+        cube->finalize();
+        delete cube;
+        return eps;
+    }
+    return 0.0;
 }
 /*==========================================================*/
-double GbCuboid3D::getIntersectionRaytraceFactor(const double& x1, const double& x2, const double& x3, const double& rx1, const double& rx2, const double& rx3)
+double GbCuboid3D::getIntersectionRaytraceFactor(const double &x1, const double &x2, const double &x3,
+                                                 const double &rx1, const double &rx2, const double &rx3)
 {
-   double minB[3]   = { this->getX1Minimum(), this->getX2Minimum(), this->getX3Minimum() };
-   double maxB[3]   = { this->getX1Maximum(), this->getX2Maximum(), this->getX3Maximum() };
-   double origin[3] = { x1,  x2,  x3  }; //point
-   double dir[3]    = { rx1, rx2, rx3 }; //ray 
-
-   bool inside = true;
-   char quadrant[3];
-   int  whichPlane;
-   double maxT[3];
-   double candidatePlane[3];
-
-   /* Find candidate planes; this loop can be avoided if
-   rays cast all from the eye(assume perpsective view) */
-   for(int i=0; i<3; i++)
-   {
-      if(origin[i] < minB[i])
-      {
-         quadrant[i] = 1/*LEFT*/;
-         candidatePlane[i] = minB[i];
-         inside = false;
-      }
-      else if(origin[i] > maxB[i]) 
-      {
-         quadrant[i] = 0/*RIGHT*/;
-         candidatePlane[i] = maxB[i];
-         inside = false;
-      }
-      else	
-      {
-         quadrant[i] = 2/*MIDDLE*/;
-      }
-   }
-   /* Ray origin inside bounding box */
-   if(inside)
-   {
-      //throw UbException(UB_EXARGS,"not done");
-      return 0.0;
-   }
-
-   /* Calculate T distances to candidate planes */
-   for(int i=0; i<3; i++)
-   {
-      if( quadrant[i]!=2/*MIDDLE*/ && fabs(dir[i])>1.E-10 )
-      {
-         maxT[i] = (candidatePlane[i]-origin[i])/dir[i];
-      }
-      else maxT[i] = -1.0;
-   }
-
-   /* Get largest of the maxT's for final choice of intersection */
-   whichPlane = 0;
-   for(int i=1; i<3; i++)
-      if (maxT[whichPlane] < maxT[i])
+    double minB[3]   = { this->getX1Minimum(), this->getX2Minimum(), this->getX3Minimum() };
+    double maxB[3]   = { this->getX1Maximum(), this->getX2Maximum(), this->getX3Maximum() };
+    double origin[3] = { x1, x2, x3 };    // point
+    double dir[3]    = { rx1, rx2, rx3 }; // ray
+
+    bool inside = true;
+    char quadrant[3];
+    int whichPlane;
+    double maxT[3];
+    double candidatePlane[3];
+
+    /* Find candidate planes; this loop can be avoided if
+    rays cast all from the eye(assume perpsective view) */
+    for (int i = 0; i < 3; i++) {
+        if (origin[i] < minB[i]) {
+            quadrant[i]       = 1 /*LEFT*/;
+            candidatePlane[i] = minB[i];
+            inside            = false;
+        } else if (origin[i] > maxB[i]) {
+            quadrant[i]       = 0 /*RIGHT*/;
+            candidatePlane[i] = maxB[i];
+            inside            = false;
+        } else {
+            quadrant[i] = 2 /*MIDDLE*/;
+        }
+    }
+    /* Ray origin inside bounding box */
+    if (inside) {
+        // throw UbException(UB_EXARGS,"not done");
+        return 0.0;
+    }
+
+    /* Calculate T distances to candidate planes */
+    for (int i = 0; i < 3; i++) {
+        if (quadrant[i] != 2 /*MIDDLE*/ && fabs(dir[i]) > 1.E-10) {
+            maxT[i] = (candidatePlane[i] - origin[i]) / dir[i];
+        } else
+            maxT[i] = -1.0;
+    }
+
+    /* Get largest of the maxT's for final choice of intersection */
+    whichPlane = 0;
+    for (int i = 1; i < 3; i++)
+        if (maxT[whichPlane] < maxT[i])
             whichPlane = i;
-   
-   /* Check final candidate actually inside box */
-   if(maxT[whichPlane]< -1.E-10) return -1.0;
-   double dummy;
-   for(int i= 0; i<3; i++)
-   {
-      if( whichPlane!= i) 
-      {
-         dummy = origin[i] + maxT[whichPlane]*dir[i];
-         if(dummy < minB[i] || dummy > maxB[i])
-            return -1.0;
-      } 
-   }
-
-   return maxT[whichPlane] ;				/* ray hits box */
-}	
 
+    /* Check final candidate actually inside box */
+    if (maxT[whichPlane] < -1.E-10)
+        return -1.0;
+    double dummy;
+    for (int i = 0; i < 3; i++) {
+        if (whichPlane != i) {
+            dummy = origin[i] + maxT[whichPlane] * dir[i];
+            if (dummy < minB[i] || dummy > maxB[i])
+                return -1.0;
+        }
+    }
+
+    return maxT[whichPlane]; /* ray hits box */
+}
diff --git a/src/basics/geometry3d/GbCuboid3D.h b/src/basics/geometry3d/GbCuboid3D.h
index 9a099737bd2259a78fcf05e826b488214ef1cc64..f0a0b0f9884999050495156f3c547b26d6398e61 100644
--- a/src/basics/geometry3d/GbCuboid3D.h
+++ b/src/basics/geometry3d/GbCuboid3D.h
@@ -1,28 +1,28 @@
 //=======================================================================================
-// ____          ____    __    ______     __________   __      __       __        __         
-// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |        
-//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |        
-//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |        
-//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____    
-//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|   
-//      \    \  |    |   ________________________________________________________________    
-//       \    \ |    |  |  ______________________________________________________________|   
-//        \    \|    |  |  |         __          __     __     __     ______      _______    
-//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)   
-//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______    
+// ____          ____    __    ______     __________   __      __       __        __
+// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |
+//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |
+//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |
+//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____
+//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|
+//      \    \  |    |   ________________________________________________________________
+//       \    \ |    |  |  ______________________________________________________________|
+//        \    \|    |  |  |         __          __     __     __     ______      _______
+//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)
+//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______
 //           \       |  |  |        |  |_____   |   \_/   |   |  |   |  |_/  /    _____  |
-//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/   
+//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/
 //
-//  This file is part of VirtualFluids. VirtualFluids is free software: you can 
+//  This file is part of VirtualFluids. VirtualFluids is free software: you can
 //  redistribute it and/or modify it under the terms of the GNU General Public
-//  License as published by the Free Software Foundation, either version 3 of 
+//  License as published by the Free Software Foundation, either version 3 of
 //  the License, or (at your option) any later version.
-//  
-//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT 
-//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
-//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License 
+//
+//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT
+//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 //  for more details.
-//  
+//
 //  You should have received a copy of the GNU General Public License along
 //  with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>.
 //
@@ -33,12 +33,12 @@
 #ifndef GBCUBOID3D_H
 #define GBCUBOID3D_H
 
-#include <vector>
 #include <cmath>
+#include <vector>
 
 #include <GbPoint3D.h>
-#include <basics/utilities/UbObserver.h>
 #include <basics/utilities/UbMath.h>
+#include <basics/utilities/UbObserver.h>
 
 class GbLine3D;
 class GbObject3DCreator;
@@ -50,96 +50,98 @@ using GbCuboid3DPtr = SPtr<GbCuboid3D>;
 //! \brief This Class provides basic 3D box objects.
 class GbCuboid3D : public GbObject3D, public UbObserver
 {
-public:              
-   GbCuboid3D();
-   GbCuboid3D(const double& minX1,const double& minX2, const double& minX3, const double& maxX1,const double& maxX2, const double& maxX3);
-   GbCuboid3D(GbPoint3D *p1, GbPoint3D *p2);
-   GbCuboid3D(GbCuboid3D *cuboid);
-   ~GbCuboid3D() override;   
-
-   GbCuboid3D* clone() override    { return new GbCuboid3D(this); }
-   void finalize() override;
-
-   GbPoint3D* getPoint1() { return this->p1; }
-   GbPoint3D* getPoint2() { return this->p2; }
-
-   void setPoint1(GbPoint3D* point1);
-   void setPoint2(GbPoint3D* point2);
-   void setPoints(GbPoint3D* point1, GbPoint3D* point2);
-
-   double getX1Centroid() override;
-   double getX1Minimum() override;
-   double getX1Maximum() override;
-   double getX2Centroid() override;
-   double getX2Minimum() override;
-   double getX2Maximum() override;
-   double getX3Centroid() override;
-   double getX3Minimum() override;
-   double getX3Maximum() override;
-   void setCenterCoordinates(const double& x1, const double& x2, const double& x3) override;
-
-   void translate(const double& x1, const double& x2, const double& x3) override;
-   void rotate(const double& rx1, const double& rx2, const double& rx3) override {}
-   void scale(const double& sx1, const double& sx2, const double& sx3) override;
-
-   double getLengthX1();
-   double getLengthX2();
-   double getLengthX3();
-
-   bool isPointInGbObject3D(const double& x1p, const double& x2p, const double& x3p, bool& pointIsOnBoundary) override;
-   bool isPointInGbObject3D(const double& x1p, const double& x2p, const double& x3p) override; 
-   bool isCellInsideGbObject3D(const double& x1a,const double& x2a,const double& x3a,const double& x1b,const double& x2b,const double& x3b) override;
-   bool isCellCuttingGbObject3D(const double& x1a,const double& x2a,const double& x3a,const double& x1b,const double& x2b,const double& x3b) override;
-   bool isCellInsideOrCuttingGbObject3D(const double& x1a,const double& x2a,const double& x3a,const double& x1b,const double& x2b,const double& x3b) override;
-   double getCellVolumeInsideGbObject3D(const double& x1a,const double& x2a,const double& x3a,const double& x1b,const double& x2b,const double& x3b) override;
-
-   GbPoint3D*  calculateInterSectionPoint3D(GbPoint3D& point1, GbPoint3D &point2);
-   //GbCuboid3D* createClippedRectangle3D(const double& x1a,const double& x2a,const double& x3a,const double& x1b,const double& x2b,const double& x3b);
-   GbLine3D*   createClippedLine3D(GbPoint3D& point1, GbPoint3D& point2) override;
-
-   std::vector<GbTriangle3D*> getSurfaceTriangleSet() override;
-   void addSurfaceTriangleSet(std::vector<UbTupleFloat3>& nodes, std::vector<UbTupleInt3>& triangles) override;
-
-   bool hasRaytracing() override { return true; }
-   /*|r| must be 1! einheitsvector!!*/
-   double getIntersectionRaytraceFactor(const double& x1, const double& x2, const double& x3, const double& rx1, const double& rx2, const double& rx3) override;
-
-
-   double getDistance(GbPoint3D* p)
-   {
-      return this->getDistance( p->getX1Coordinate(), p->getX2Coordinate(), p->getX3Coordinate() );
-   } 
-   double getDistance(const double& x1p, const double& x2p, const double& x3p)
-   {
-      throw UbException( UB_EXARGS, "not implemented" );
-
-      // falls punkt innerhalt ist: minimalen abstand ausrechnen
-      if( this->isPointInGbObject3D(x1p,x2p,x3p) )
-      {
-         double x1Dist = UbMath::min( std::abs(x1p-this->getX1Minimum()),std::abs(x1p-this->getX1Maximum()) );
-         double x2Dist = UbMath::min( std::abs(x2p-this->getX2Minimum()),std::abs(x2p-this->getX2Maximum()) );
-         double x3Dist = UbMath::min( std::abs(x3p-this->getX3Minimum()),std::abs(x3p-this->getX3Maximum()) );
-
-         return UbMath::min( x1Dist, x2Dist, x3Dist );
-      }
-      else
-      {
-
-      }
-   }
-
-   std::string toString() override;
-
-   //virtuelle Methoden von UbObserver
-   void objectChanged(UbObservable* changedObject) override;
-   void objectWillBeDeleted(UbObservable* objectForDeletion) override;
-
-
-   using GbObject3D::isPointInGbObject3D; //Grund: dadurch muss man hier  isPointInGbObject3D(GbPoint3D*) nicht ausprogrammieren, welche sonst hier "ueberdeckt" waere
+public:
+    GbCuboid3D();
+    GbCuboid3D(const double &minX1, const double &minX2, const double &minX3, const double &maxX1, const double &maxX2,
+               const double &maxX3);
+    GbCuboid3D(GbPoint3D *p1, GbPoint3D *p2);
+    GbCuboid3D(GbCuboid3D *cuboid);
+    ~GbCuboid3D() override;
+
+    GbCuboid3D *clone() override { return new GbCuboid3D(this); }
+    void finalize() override;
+
+    GbPoint3D *getPoint1() { return this->p1; }
+    GbPoint3D *getPoint2() { return this->p2; }
+
+    void setPoint1(GbPoint3D *point1);
+    void setPoint2(GbPoint3D *point2);
+    void setPoints(GbPoint3D *point1, GbPoint3D *point2);
+
+    double getX1Centroid() override;
+    double getX1Minimum() override;
+    double getX1Maximum() override;
+    double getX2Centroid() override;
+    double getX2Minimum() override;
+    double getX2Maximum() override;
+    double getX3Centroid() override;
+    double getX3Minimum() override;
+    double getX3Maximum() override;
+    void setCenterCoordinates(const double &x1, const double &x2, const double &x3) override;
+
+    void translate(const double &x1, const double &x2, const double &x3) override;
+    void rotate(const double &rx1, const double &rx2, const double &rx3) override {}
+    void scale(const double &sx1, const double &sx2, const double &sx3) override;
+
+    double getLengthX1();
+    double getLengthX2();
+    double getLengthX3();
+
+    bool isPointInGbObject3D(const double &x1p, const double &x2p, const double &x3p, bool &pointIsOnBoundary) override;
+    bool isPointInGbObject3D(const double &x1p, const double &x2p, const double &x3p) override;
+    bool isCellInsideGbObject3D(const double &x1a, const double &x2a, const double &x3a, const double &x1b,
+                                const double &x2b, const double &x3b) override;
+    bool isCellCuttingGbObject3D(const double &x1a, const double &x2a, const double &x3a, const double &x1b,
+                                 const double &x2b, const double &x3b) override;
+    bool isCellInsideOrCuttingGbObject3D(const double &x1a, const double &x2a, const double &x3a, const double &x1b,
+                                         const double &x2b, const double &x3b) override;
+    double getCellVolumeInsideGbObject3D(const double &x1a, const double &x2a, const double &x3a, const double &x1b,
+                                         const double &x2b, const double &x3b) override;
+
+    GbPoint3D *calculateInterSectionPoint3D(GbPoint3D &point1, GbPoint3D &point2);
+    // GbCuboid3D* createClippedRectangle3D(const double& x1a,const double& x2a,const double& x3a,const double&
+    // x1b,const double& x2b,const double& x3b);
+    GbLine3D *createClippedLine3D(GbPoint3D &point1, GbPoint3D &point2) override;
+
+    std::vector<GbTriangle3D *> getSurfaceTriangleSet() override;
+    void addSurfaceTriangleSet(std::vector<UbTupleFloat3> &nodes, std::vector<UbTupleInt3> &triangles) override;
+
+    bool hasRaytracing() override { return true; }
+    /*|r| must be 1! einheitsvector!!*/
+    double getIntersectionRaytraceFactor(const double &x1, const double &x2, const double &x3, const double &rx1,
+                                         const double &rx2, const double &rx3) override;
+
+    double getDistance(GbPoint3D *p)
+    {
+        return this->getDistance(p->getX1Coordinate(), p->getX2Coordinate(), p->getX3Coordinate());
+    }
+    double getDistance(const double &x1p, const double &x2p, const double &x3p)
+    {
+        throw UbException(UB_EXARGS, "not implemented");
+
+        // falls punkt innerhalt ist: minimalen abstand ausrechnen
+        if (this->isPointInGbObject3D(x1p, x2p, x3p)) {
+            double x1Dist = UbMath::min(std::abs(x1p - this->getX1Minimum()), std::abs(x1p - this->getX1Maximum()));
+            double x2Dist = UbMath::min(std::abs(x2p - this->getX2Minimum()), std::abs(x2p - this->getX2Maximum()));
+            double x3Dist = UbMath::min(std::abs(x3p - this->getX3Minimum()), std::abs(x3p - this->getX3Maximum()));
+
+            return UbMath::min(x1Dist, x2Dist, x3Dist);
+        } else {
+        }
+    }
+
+    std::string toString() override;
+
+    // virtuelle Methoden von UbObserver
+    void objectChanged(UbObservable *changedObject) override;
+    void objectWillBeDeleted(UbObservable *objectForDeletion) override;
+
+    using GbObject3D::isPointInGbObject3D; // Grund: dadurch muss man hier  isPointInGbObject3D(GbPoint3D*) nicht
+                                           // ausprogrammieren, welche sonst hier "ueberdeckt" waere
 
 protected:
-   GbPoint3D* p1;
-   GbPoint3D* p2;
+    GbPoint3D *p1;
+    GbPoint3D *p2;
 };
 
-#endif   
+#endif
diff --git a/src/basics/geometry3d/GbCylinder3D.cpp b/src/basics/geometry3d/GbCylinder3D.cpp
index e2bb839dd0734cd4b7eb91160afe431d2beea756..f6d1ed6e701fb7e3209a6e67720dc3d41d8f1aeb 100644
--- a/src/basics/geometry3d/GbCylinder3D.cpp
+++ b/src/basics/geometry3d/GbCylinder3D.cpp
@@ -1,1228 +1,1314 @@
+#include <basics/utilities/UbInfinity.h>
 #include <geometry3d/GbCylinder3D.h>
-#include <geometry3d/GbSystem3D.h>
 #include <geometry3d/GbPoint3D.h>
+#include <geometry3d/GbSystem3D.h>
 #include <geometry3d/GbTriangle3D.h>
-#include <basics/utilities/UbInfinity.h>
 
 using namespace std;
 
 // Konstruktor
 /*==========================================================*/
 GbCylinder3D::GbCylinder3D()
-    
+
 {
-   this->setName("cylinder");
-   GbPoint3D* p1 = new GbPoint3D();
-   GbPoint3D* p2 = new GbPoint3D();
-   mLine = new GbLine3D(p1,p2);
-   this->mLine->addObserver(this);
-   mRad = 0.0;
-   cylinderType = GbCylinder3D::NOTPARALLELTOAXIS;
-   this->mLine->addObserver(this);
-   this->calculateValues();
+    this->setName("cylinder");
+    GbPoint3D *p1 = new GbPoint3D();
+    GbPoint3D *p2 = new GbPoint3D();
+    mLine         = new GbLine3D(p1, p2);
+    this->mLine->addObserver(this);
+    mRad         = 0.0;
+    cylinderType = GbCylinder3D::NOTPARALLELTOAXIS;
+    this->mLine->addObserver(this);
+    this->calculateValues();
 }
 /*=======================================================*/
-GbCylinder3D::GbCylinder3D(GbCylinder3D* cylinder)
+GbCylinder3D::GbCylinder3D(GbCylinder3D *cylinder)
 {
-   this->setName("cylinder");
-   mRad         = cylinder->getRadius();
-   cylinderType = cylinder->cylinderType;
-   mLine        = cylinder->getLine()->clone();
+    this->setName("cylinder");
+    mRad         = cylinder->getRadius();
+    cylinderType = cylinder->cylinderType;
+    mLine        = cylinder->getLine()->clone();
 
-   this->mLine->addObserver(this);
-   this->calculateValues();
+    this->mLine->addObserver(this);
+    this->calculateValues();
 }
 /*==========================================================*/
-GbCylinder3D::GbCylinder3D(const double& x1a,const double& x2a, const double& x3a, const double& x1b,const double& x2b, const double& x3b, const double& rad)
+GbCylinder3D::GbCylinder3D(const double &x1a, const double &x2a, const double &x3a, const double &x1b,
+                           const double &x2b, const double &x3b, const double &rad)
 {
-   this->setName("cylinder");
-   mLine = new GbLine3D;
-   //Min/Max, damit gewaehrleistet ist, dass Startpunkt immer der "Achs-Minimale" ist
-   //Anm.: bin nich tsicher ob weiter unten irgendwelche Algos drauf beruhen...
-   //      geht nat nur solange, zylinder achs-parallel, aber das ist erzeit so!!!
-   mLine->setPoints( new GbPoint3D(min(x1a,x1b), min(x2a,x2b), min(x3a,x3b))
-	                 ,new GbPoint3D(max(x1a,x1b), max(x2a,x2b), max(x3a,x3b)));
-   //mLine->setPoints( new GbPoint3D(x1a,x2a,x3a),new GbPoint3D(x1b, x2b ,x3b ));
-   this->mLine->addObserver(this);
-   mRad = fabs(rad);
-
-   this->calculateValues();
+    this->setName("cylinder");
+    mLine = new GbLine3D;
+    // Min/Max, damit gewaehrleistet ist, dass Startpunkt immer der "Achs-Minimale" ist
+    // Anm.: bin nich tsicher ob weiter unten irgendwelche Algos drauf beruhen...
+    //      geht nat nur solange, zylinder achs-parallel, aber das ist erzeit so!!!
+    mLine->setPoints(new GbPoint3D(min(x1a, x1b), min(x2a, x2b), min(x3a, x3b)),
+                     new GbPoint3D(max(x1a, x1b), max(x2a, x2b), max(x3a, x3b)));
+    // mLine->setPoints( new GbPoint3D(x1a,x2a,x3a),new GbPoint3D(x1b, x2b ,x3b ));
+    this->mLine->addObserver(this);
+    mRad = fabs(rad);
+
+    this->calculateValues();
 }
 /*==========================================================*/
-GbCylinder3D::GbCylinder3D(GbPoint3D* p1, GbPoint3D* p2, const double& rad)
+GbCylinder3D::GbCylinder3D(GbPoint3D *p1, GbPoint3D *p2, const double &rad)
 {
-   this->setName("cylinder");
-   mRad = rad;
+    this->setName("cylinder");
+    mRad = rad;
 
-   mLine = new GbLine3D(p1,p2);
-   this->mLine->addObserver(this);
-   this->calculateValues();
+    mLine = new GbLine3D(p1, p2);
+    this->mLine->addObserver(this);
+    this->calculateValues();
 }
 /*==========================================================*/
-GbCylinder3D::GbCylinder3D(GbLine3D* line, const double& rad)
+GbCylinder3D::GbCylinder3D(GbLine3D *line, const double &rad)
 {
-   this->setName("cylinder");
-   mRad = rad;
+    this->setName("cylinder");
+    mRad = rad;
 
-   this->mLine = line;
-   this->mLine->addObserver(this);
+    this->mLine = line;
+    this->mLine->addObserver(this);
 
-   this->calculateValues();
+    this->calculateValues();
 }
 /*==========================================================*/
 // Destruktor
 GbCylinder3D::~GbCylinder3D()
 {
-   if(mLine) this->mLine->removeObserver(this);
-   mLine = NULL;
+    if (mLine)
+        this->mLine->removeObserver(this);
+    mLine = NULL;
 }
 /*=======================================================*/
 void GbCylinder3D::calculateValues()
 {
-   double x1a = mLine->getPoint1()->x1;    double x1b = mLine->getPoint2()->x1;
-   double x2a = mLine->getPoint1()->x2;    double x2b = mLine->getPoint2()->x2;
-   double x3a = mLine->getPoint1()->x3;    double x3b = mLine->getPoint2()->x3;
-
-   if     (x1a!=x1b && x2a==x2b && x3a==x3b)  this->cylinderType = X1PARALLEL;
-   else if(x2a!=x2b && x1a==x1b && x3a==x3b)  this->cylinderType = X2PARALLEL;
-   else if(x3a!=x3b && x1a==x1b && x2a==x2b)  this->cylinderType = X3PARALLEL;
-   // nach dem serialisieren ruft er den Standardkonstruktor auf wo alles 0 ist und bricht sonst hier ab
-   else if(x3a==x3b && x1a==x1b && x2a==x2b)  this->cylinderType = X1PARALLEL; 
-   else                                       this->cylinderType = NOTPARALLELTOAXIS;
-
-   if((this->cylinderType & NOTPARALLELTOAXIS)==NOTPARALLELTOAXIS)
-      throw UbException(UB_EXARGS,"derzeit nur zu Achsen orthogonale Zylinder erlaubt... isPointInObject3D funzt sonst ned");
-
-   if(this->isParallelToX1Axis())
-   {
-      minX1 = mLine->getX1Minimum();
-      maxX1 = mLine->getX1Maximum();
-      minX2 = mLine->getX2Centroid()-mRad; 
-      maxX2 = mLine->getX2Centroid()+mRad;
-      minX3 = mLine->getX3Centroid()-mRad; 
-      maxX3 = mLine->getX3Centroid()+mRad;
-   }
-   else if(this->isParallelToX2Axis()) 
-   {
-      minX1 = mLine->getX1Centroid()-mRad;
-      maxX1 = mLine->getX1Centroid()+mRad;
-      minX2 = mLine->getX2Minimum();   
-      maxX2 = mLine->getX2Maximum();
-      minX3 = mLine->getX3Centroid()-mRad;
-      maxX3 = mLine->getX3Centroid()+mRad;
-   }
-   else if(this->isParallelToX3Axis()) 
-   {
-      minX1 = mLine->getX1Centroid()-mRad;  
-      maxX1 = mLine->getX1Centroid()+mRad;
-      minX2 = mLine->getX2Centroid()-mRad;
-      maxX2 = mLine->getX2Centroid()+mRad;
-      minX3 = mLine->getX3Minimum();
-      maxX3 = mLine->getX3Maximum();
-   }
-
-   centerX1 = mLine->getX1Centroid();
-   centerX2 = mLine->getX2Centroid();
-   centerX3 = mLine->getX3Centroid();
+    double x1a = mLine->getPoint1()->x1;
+    double x1b = mLine->getPoint2()->x1;
+    double x2a = mLine->getPoint1()->x2;
+    double x2b = mLine->getPoint2()->x2;
+    double x3a = mLine->getPoint1()->x3;
+    double x3b = mLine->getPoint2()->x3;
+
+    if (x1a != x1b && x2a == x2b && x3a == x3b)
+        this->cylinderType = X1PARALLEL;
+    else if (x2a != x2b && x1a == x1b && x3a == x3b)
+        this->cylinderType = X2PARALLEL;
+    else if (x3a != x3b && x1a == x1b && x2a == x2b)
+        this->cylinderType = X3PARALLEL;
+    // nach dem serialisieren ruft er den Standardkonstruktor auf wo alles 0 ist und bricht sonst hier ab
+    else if (x3a == x3b && x1a == x1b && x2a == x2b)
+        this->cylinderType = X1PARALLEL;
+    else
+        this->cylinderType = NOTPARALLELTOAXIS;
+
+    if ((this->cylinderType & NOTPARALLELTOAXIS) == NOTPARALLELTOAXIS)
+        throw UbException(UB_EXARGS,
+                          "derzeit nur zu Achsen orthogonale Zylinder erlaubt... isPointInObject3D funzt sonst ned");
+
+    if (this->isParallelToX1Axis()) {
+        minX1 = mLine->getX1Minimum();
+        maxX1 = mLine->getX1Maximum();
+        minX2 = mLine->getX2Centroid() - mRad;
+        maxX2 = mLine->getX2Centroid() + mRad;
+        minX3 = mLine->getX3Centroid() - mRad;
+        maxX3 = mLine->getX3Centroid() + mRad;
+    } else if (this->isParallelToX2Axis()) {
+        minX1 = mLine->getX1Centroid() - mRad;
+        maxX1 = mLine->getX1Centroid() + mRad;
+        minX2 = mLine->getX2Minimum();
+        maxX2 = mLine->getX2Maximum();
+        minX3 = mLine->getX3Centroid() - mRad;
+        maxX3 = mLine->getX3Centroid() + mRad;
+    } else if (this->isParallelToX3Axis()) {
+        minX1 = mLine->getX1Centroid() - mRad;
+        maxX1 = mLine->getX1Centroid() + mRad;
+        minX2 = mLine->getX2Centroid() - mRad;
+        maxX2 = mLine->getX2Centroid() + mRad;
+        minX3 = mLine->getX3Minimum();
+        maxX3 = mLine->getX3Maximum();
+    }
+
+    centerX1 = mLine->getX1Centroid();
+    centerX2 = mLine->getX2Centroid();
+    centerX3 = mLine->getX3Centroid();
 }
- 
+
 /*=======================================================*/
 void GbCylinder3D::finalize()
 {
-   if(this->mLine)
-   {
-      mLine->finalize();
-      delete mLine;
-      mLine=NULL;
-   }
+    if (this->mLine) {
+        mLine->finalize();
+        delete mLine;
+        mLine = NULL;
+    }
 }
 /*=======================================================*/
 double GbCylinder3D::getHeight()
 {
-   if(mLine) 
-      return mLine->getLength();
-   
-   return 0.0;
+    if (mLine)
+        return mLine->getLength();
+
+    return 0.0;
 }
 /*=======================================================*/
-GbPoint3D* GbCylinder3D::getPoint1()
+GbPoint3D *GbCylinder3D::getPoint1()
 {
-   if(this->mLine) return this->mLine->getPoint1();
-   return NULL;
+    if (this->mLine)
+        return this->mLine->getPoint1();
+    return NULL;
 }
 /*=======================================================*/
-GbPoint3D* GbCylinder3D::getPoint2()
+GbPoint3D *GbCylinder3D::getPoint2()
 {
-   if(this->mLine) return this->mLine->getPoint2();
-   return NULL;
+    if (this->mLine)
+        return this->mLine->getPoint2();
+    return NULL;
 }
 /*=======================================================*/
-void GbCylinder3D::setRadius(const double& radius)
+void GbCylinder3D::setRadius(const double &radius)
 {
-   this->mRad = std::fabs(radius);
-   this->notifyObserversObjectChanged();
+    this->mRad = std::fabs(radius);
+    this->notifyObserversObjectChanged();
 }
 /*=======================================================*/
-void GbCylinder3D::setLine(GbLine3D* line)
+void GbCylinder3D::setLine(GbLine3D *line)
 {
-   if(this->mLine) this->mLine->removeObserver(this);
-   this->mLine = line;
-   this->mLine->addObserver(this);
-   this->calculateValues();
+    if (this->mLine)
+        this->mLine->removeObserver(this);
+    this->mLine = line;
+    this->mLine->addObserver(this);
+    this->calculateValues();
 
-   this->notifyObserversObjectChanged();
+    this->notifyObserversObjectChanged();
 }
 /*=======================================================*/
-void GbCylinder3D::setPoint1(const double& x1, const double& x2, const double& x3)
+void GbCylinder3D::setPoint1(const double &x1, const double &x2, const double &x3)
 {
-   if(!mLine->getPoint1()) throw UbException(UB_EXARGS,"line has no point1");
-   mLine->getPoint1()->setCoordinates(x1,x2,x3);
-   this->calculateValues();
+    if (!mLine->getPoint1())
+        throw UbException(UB_EXARGS, "line has no point1");
+    mLine->getPoint1()->setCoordinates(x1, x2, x3);
+    this->calculateValues();
 
-   //this->notifyObserversObjectChanged(); //wird automatisch aufgerufen, da der point (this) benachrichtigt...
+    // this->notifyObserversObjectChanged(); //wird automatisch aufgerufen, da der point (this) benachrichtigt...
 }
 /*=======================================================*/
-void GbCylinder3D::setPoint2(const double& x1, const double& x2, const double& x3)
+void GbCylinder3D::setPoint2(const double &x1, const double &x2, const double &x3)
 {
-   if(!mLine->getPoint2()) throw UbException(UB_EXARGS,"line has no point2");
-   mLine->getPoint2()->setCoordinates(x1,x2,x3);
-   this->calculateValues();
+    if (!mLine->getPoint2())
+        throw UbException(UB_EXARGS, "line has no point2");
+    mLine->getPoint2()->setCoordinates(x1, x2, x3);
+    this->calculateValues();
 
-   //this->notifyObserversObjectChanged(); //wird automatisch aufgerufen, da der point (this) benachrichtigt...
+    // this->notifyObserversObjectChanged(); //wird automatisch aufgerufen, da der point (this) benachrichtigt...
 }
 /*==========================================================*/
-bool GbCylinder3D::isPointInGbObject3D(const double& x1p, const double& x2p, const double& x3p)
+bool GbCylinder3D::isPointInGbObject3D(const double &x1p, const double &x2p, const double &x3p)
 {
-   //true, wenn 'in Object' oder 'auf Boundary'!
-   if     ( this->isParallelToX1Axis() && (UbMath::less(x1p,minX1) || UbMath::greater(x1p,maxX1)))  return false;
-   else if( this->isParallelToX2Axis() && (UbMath::less(x2p,minX2) || UbMath::greater(x2p,maxX2)))  return false;
-   else if( this->isParallelToX3Axis() && (UbMath::less(x3p,minX3) || UbMath::greater(x3p,maxX3)))  return false;
-   else if( this->isNotParallelToAxis() ) throw UbException(UB_EXARGS,"derzeit nur zu Achsen orthogonale Zylinder erlaubt... isPointInObject3D funzt sonst ned");
-
-   return UbMath::lessEqual(fabs(mLine->getDistance(x1p,x2p,x3p)),fabs(mRad));
+    // true, wenn 'in Object' oder 'auf Boundary'!
+    if (this->isParallelToX1Axis() && (UbMath::less(x1p, minX1) || UbMath::greater(x1p, maxX1)))
+        return false;
+    else if (this->isParallelToX2Axis() && (UbMath::less(x2p, minX2) || UbMath::greater(x2p, maxX2)))
+        return false;
+    else if (this->isParallelToX3Axis() && (UbMath::less(x3p, minX3) || UbMath::greater(x3p, maxX3)))
+        return false;
+    else if (this->isNotParallelToAxis())
+        throw UbException(UB_EXARGS,
+                          "derzeit nur zu Achsen orthogonale Zylinder erlaubt... isPointInObject3D funzt sonst ned");
+
+    return UbMath::lessEqual(fabs(mLine->getDistance(x1p, x2p, x3p)), fabs(mRad));
 }
 /*==========================================================*/
-bool GbCylinder3D::isPointInGbObject3D(const double& x1p, const double& x2p, const double& x3p, bool& pointIsOnBoundary)
+bool GbCylinder3D::isPointInGbObject3D(const double &x1p, const double &x2p, const double &x3p, bool &pointIsOnBoundary)
 {
-   //funzt derzeit nur bei achsparallelen cylindern
-   pointIsOnBoundary = false;
-
-   if     ( this->isParallelToX1Axis() && (UbMath::less(x1p,minX1) || UbMath::greater(x1p,maxX1)))  return false;
-   else if( this->isParallelToX2Axis() && (UbMath::less(x2p,minX2) || UbMath::greater(x2p,maxX2)))  return false;
-   else if( this->isParallelToX3Axis() && (UbMath::less(x3p,minX3) || UbMath::greater(x3p,maxX3)))  return false;
-   else if( this->isNotParallelToAxis() ) throw UbException(UB_EXARGS,"derzeit nur zu Achsen orthogonale Zylinder erlaubt... isPointInObject3D funzt sonst ned");
-
-   //true, wenn 'in Object' oder 'auf Boundary'!
-
-   double dis = mLine->getDistance(x1p,x2p,x3p);
-
-   if(UbMath::equal(dis,mRad)) pointIsOnBoundary = true;
- 
-   if     (this->isParallelToX1Axis() && (UbMath::equal(x1p,minX1) || UbMath::equal(x1p,maxX1))) pointIsOnBoundary = true;
-   else if(this->isParallelToX2Axis() && (UbMath::equal(x2p,minX2) || UbMath::equal(x2p,maxX2))) pointIsOnBoundary = true;
-   else if(this->isParallelToX3Axis() && (UbMath::equal(x3p,minX3) || UbMath::equal(x3p,maxX3))) pointIsOnBoundary = true;
-
-   return UbMath::lessEqual(dis,mRad);
+    // funzt derzeit nur bei achsparallelen cylindern
+    pointIsOnBoundary = false;
+
+    if (this->isParallelToX1Axis() && (UbMath::less(x1p, minX1) || UbMath::greater(x1p, maxX1)))
+        return false;
+    else if (this->isParallelToX2Axis() && (UbMath::less(x2p, minX2) || UbMath::greater(x2p, maxX2)))
+        return false;
+    else if (this->isParallelToX3Axis() && (UbMath::less(x3p, minX3) || UbMath::greater(x3p, maxX3)))
+        return false;
+    else if (this->isNotParallelToAxis())
+        throw UbException(UB_EXARGS,
+                          "derzeit nur zu Achsen orthogonale Zylinder erlaubt... isPointInObject3D funzt sonst ned");
+
+    // true, wenn 'in Object' oder 'auf Boundary'!
+
+    double dis = mLine->getDistance(x1p, x2p, x3p);
+
+    if (UbMath::equal(dis, mRad))
+        pointIsOnBoundary = true;
+
+    if (this->isParallelToX1Axis() && (UbMath::equal(x1p, minX1) || UbMath::equal(x1p, maxX1)))
+        pointIsOnBoundary = true;
+    else if (this->isParallelToX2Axis() && (UbMath::equal(x2p, minX2) || UbMath::equal(x2p, maxX2)))
+        pointIsOnBoundary = true;
+    else if (this->isParallelToX3Axis() && (UbMath::equal(x3p, minX3) || UbMath::equal(x3p, maxX3)))
+        pointIsOnBoundary = true;
+
+    return UbMath::lessEqual(dis, mRad);
 }
 /*==========================================================*/
 string GbCylinder3D::toString()
 {
-	stringstream ss;
-	ss<<"GbCylinder3D[";
-	ss<<"line="<<this->mLine->toString();
-   ss<<", r="<<this->mRad;
-   ss<<"]";
-   return(ss.str());
+    stringstream ss;
+    ss << "GbCylinder3D[";
+    ss << "line=" << this->mLine->toString();
+    ss << ", r=" << this->mRad;
+    ss << "]";
+    return (ss.str());
 }
 /*=======================================================*/
-bool GbCylinder3D::isCellInsideGbObject3D(const double& x1a,const double& x2a,const double& x3a,const double& x1b,const double& x2b,const double& x3b)
+bool GbCylinder3D::isCellInsideGbObject3D(const double &x1a, const double &x2a, const double &x3a, const double &x1b,
+                                          const double &x2b, const double &x3b)
 {
-   if(   this->isPointInGbObject3D(x1a, x2a, x3a)
-      && this->isPointInGbObject3D(x1b, x2a, x3a)
-      && this->isPointInGbObject3D(x1b, x2b, x3a)
-      && this->isPointInGbObject3D(x1a, x2b, x3a)
-      && this->isPointInGbObject3D(x1a, x2a, x3b)
-      && this->isPointInGbObject3D(x1b, x2a, x3b)
-      && this->isPointInGbObject3D(x1b, x2b, x3b)
-      && this->isPointInGbObject3D(x1a, x2b, x3b))
-   {
-      return true;
-   }
-   return false;
+    if (this->isPointInGbObject3D(x1a, x2a, x3a) && this->isPointInGbObject3D(x1b, x2a, x3a) &&
+        this->isPointInGbObject3D(x1b, x2b, x3a) && this->isPointInGbObject3D(x1a, x2b, x3a) &&
+        this->isPointInGbObject3D(x1a, x2a, x3b) && this->isPointInGbObject3D(x1b, x2a, x3b) &&
+        this->isPointInGbObject3D(x1b, x2b, x3b) && this->isPointInGbObject3D(x1a, x2b, x3b)) {
+        return true;
+    }
+    return false;
 }
 /*==========================================================*/
-bool GbCylinder3D::isCellCuttingGbObject3D(const double& x1a,const double& x2a,const double& x3a,const double& x1b,const double& x2b,const double& x3b)
-//Merksatz: cell oder deren Volumen schneidet oder beinhaltet komplette oder Teile der CuboidUmrandung
-//returns true:
+bool GbCylinder3D::isCellCuttingGbObject3D(const double &x1a, const double &x2a, const double &x3a, const double &x1b,
+                                           const double &x2b, const double &x3b)
+// Merksatz: cell oder deren Volumen schneidet oder beinhaltet komplette oder Teile der CuboidUmrandung
+// returns true:
 //  - cell cuts  cylinder3D
 //  - cell boxes cylinder3D
-//returns false:
+// returns false:
 //  - cell completely inside cylinder3D ( = cylinder3D boxes cell)
 //  - cell und cylinder3D haben kein gemeinsames Volumen
 {
-   //erstmal wieder die dumm Loesung
-   if(   this->isCellInsideOrCuttingGbObject3D(x1a,x2a,x3a,x1b,x2b,x3b)
-      && !this->isCellInsideGbObject3D(x1a,x2a,x3a,x1b,x2b,x3b) )
-   {
-      return true;
-   }
-
-   return false;
+    // erstmal wieder die dumm Loesung
+    if (this->isCellInsideOrCuttingGbObject3D(x1a, x2a, x3a, x1b, x2b, x3b) &&
+        !this->isCellInsideGbObject3D(x1a, x2a, x3a, x1b, x2b, x3b)) {
+        return true;
+    }
+
+    return false;
 }
 /*==========================================================*/
-bool GbCylinder3D::isCellInsideOrCuttingGbObject3D(const double& x1a,const double& x2a,const double& x3a,const double& x1b,const double& x2b,const double& x3b)
-//returns true:
+bool GbCylinder3D::isCellInsideOrCuttingGbObject3D(const double &x1a, const double &x2a, const double &x3a,
+                                                   const double &x1b, const double &x2b, const double &x3b)
+// returns true:
 //  - cell completely inside cylinder3D ( = cylinder3D boxes cell)
 //  - cell cuts  cylinder3D
 //  - cell boxes cylinder3D
-//returns false:
+// returns false:
 //  - cell und cylinder3D haben kein gemeinsames Volumen
 {
-   double dmin   = 0.0;
-
-   if(this->isParallelToX1Axis())
-   {
-      //check liegt Cell komplett !x1-ausserhalb"?
-      if(  UbMath::less   (x1a,minX1) && UbMath::less   (x1b,minX1) ) return false;
-      if(  UbMath::greater(x1a,maxX1) && UbMath::greater(x1b,maxX1) ) return false;
-
-      //mittelpunkt kreis-querschnitt
-      double& midX2 = mLine->getPoint1()->x2;
-      double& midX3 = mLine->getPoint1()->x3;
-      if     ( UbMath::less   ( midX2, x2a ) ) dmin += std::pow( midX2 - x2a, 2.0 ); 
-      else if( UbMath::greater( midX2, x2b ) ) dmin += std::pow( midX2 - x2b, 2.0 );     
-      if     ( UbMath::less   ( midX3, x3a ) ) dmin += std::pow( midX3 - x3a, 2.0 ); 
-      else if( UbMath::greater( midX3, x3b ) ) dmin += std::pow( midX3 - x3b, 2.0 );     
-      if( UbMath::lessEqual( dmin, mRad*mRad) ) return true;
-
-      return false;
-   }
-   else if(this->isParallelToX2Axis())
-   {
-      //check liegt Cell komplett !x2-ausserhalb"?
-      if(  UbMath::less   (x2a,minX2)   && UbMath::less   (x2b,minX2) ) return false;
-      if(  UbMath::greater(x2a,maxX2  ) && UbMath::greater(x2b,maxX2) ) return false;
-
-      //mittelpunkt kreis-querschnitt
-      double& midX1 = mLine->getPoint1()->x1;
-      double& midX3 = mLine->getPoint1()->x3;
-      if     ( UbMath::less   ( midX1, x1a ) ) dmin += std::pow( midX1 - x1a, 2.0 ); 
-      else if( UbMath::greater( midX1, x1b ) ) dmin += std::pow( midX1 - x1b, 2.0 );     
-      if     ( UbMath::less   ( midX3, x3a ) ) dmin += std::pow( midX3 - x3a, 2.0 ); 
-      else if( UbMath::greater( midX3, x3b ) ) dmin += std::pow( midX3 - x3b, 2.0 );     
-      if( UbMath::lessEqual( dmin, mRad*mRad ) ) return true;
-
-   }
-   else if(this->isParallelToX3Axis())
-   {
-      //check liegt Cell komplett !x3-ausserhalb"?
-      if(  UbMath::less   (x3a,minX3) && UbMath::less   (x3b,minX3) ) return false;
-      if(  UbMath::greater(x3a,maxX3) && UbMath::greater(x3b,maxX3) ) return false;
-
-      //mittelpunkt kreis-querschnitt
-      double& midX1 = mLine->getPoint1()->x1;
-      double& midX2 = mLine->getPoint1()->x2;
-      if     ( UbMath::less   ( midX1, x1a ) ) dmin += std::pow( midX1 - x1a, 2.0 ); 
-      else if( UbMath::greater( midX1, x1b ) ) dmin += std::pow( midX1 - x1b, 2.0 );     
-      if     ( UbMath::less   ( midX2, x2a ) ) dmin += std::pow( midX2 - x2a, 2.0 ); 
-      else if( UbMath::greater( midX2, x2b ) ) dmin += std::pow( midX2 - x2b, 2.0 );     
-      if( UbMath::lessEqual( dmin, mRad*mRad ) ) return true;
-   }
-
-   return false;
+    double dmin = 0.0;
+
+    if (this->isParallelToX1Axis()) {
+        // check liegt Cell komplett !x1-ausserhalb"?
+        if (UbMath::less(x1a, minX1) && UbMath::less(x1b, minX1))
+            return false;
+        if (UbMath::greater(x1a, maxX1) && UbMath::greater(x1b, maxX1))
+            return false;
+
+        // mittelpunkt kreis-querschnitt
+        double &midX2 = mLine->getPoint1()->x2;
+        double &midX3 = mLine->getPoint1()->x3;
+        if (UbMath::less(midX2, x2a))
+            dmin += std::pow(midX2 - x2a, 2.0);
+        else if (UbMath::greater(midX2, x2b))
+            dmin += std::pow(midX2 - x2b, 2.0);
+        if (UbMath::less(midX3, x3a))
+            dmin += std::pow(midX3 - x3a, 2.0);
+        else if (UbMath::greater(midX3, x3b))
+            dmin += std::pow(midX3 - x3b, 2.0);
+        if (UbMath::lessEqual(dmin, mRad * mRad))
+            return true;
+
+        return false;
+    } else if (this->isParallelToX2Axis()) {
+        // check liegt Cell komplett !x2-ausserhalb"?
+        if (UbMath::less(x2a, minX2) && UbMath::less(x2b, minX2))
+            return false;
+        if (UbMath::greater(x2a, maxX2) && UbMath::greater(x2b, maxX2))
+            return false;
+
+        // mittelpunkt kreis-querschnitt
+        double &midX1 = mLine->getPoint1()->x1;
+        double &midX3 = mLine->getPoint1()->x3;
+        if (UbMath::less(midX1, x1a))
+            dmin += std::pow(midX1 - x1a, 2.0);
+        else if (UbMath::greater(midX1, x1b))
+            dmin += std::pow(midX1 - x1b, 2.0);
+        if (UbMath::less(midX3, x3a))
+            dmin += std::pow(midX3 - x3a, 2.0);
+        else if (UbMath::greater(midX3, x3b))
+            dmin += std::pow(midX3 - x3b, 2.0);
+        if (UbMath::lessEqual(dmin, mRad * mRad))
+            return true;
+
+    } else if (this->isParallelToX3Axis()) {
+        // check liegt Cell komplett !x3-ausserhalb"?
+        if (UbMath::less(x3a, minX3) && UbMath::less(x3b, minX3))
+            return false;
+        if (UbMath::greater(x3a, maxX3) && UbMath::greater(x3b, maxX3))
+            return false;
+
+        // mittelpunkt kreis-querschnitt
+        double &midX1 = mLine->getPoint1()->x1;
+        double &midX2 = mLine->getPoint1()->x2;
+        if (UbMath::less(midX1, x1a))
+            dmin += std::pow(midX1 - x1a, 2.0);
+        else if (UbMath::greater(midX1, x1b))
+            dmin += std::pow(midX1 - x1b, 2.0);
+        if (UbMath::less(midX2, x2a))
+            dmin += std::pow(midX2 - x2a, 2.0);
+        else if (UbMath::greater(midX2, x2b))
+            dmin += std::pow(midX2 - x2b, 2.0);
+        if (UbMath::lessEqual(dmin, mRad * mRad))
+            return true;
+    }
+
+    return false;
 }
 /*==========================================================*/
-GbLine3D* GbCylinder3D::createClippedLine3D(GbPoint3D& point1, GbPoint3D& point2)
+GbLine3D *GbCylinder3D::createClippedLine3D(GbPoint3D &point1, GbPoint3D &point2)
 {
-   //liefert immer "innere" linie, also der teil, der vom Zylinder "abgeschnitten" wurde!
-   //funktioniert derzeit nur mit achsenparallelen Zylindern!
-   vector<GbPoint3D*> schnittpunkte;
-
-   double xa,ya,za,xb,yb,zb,xm,ym,zStart,zEnd,t1,t2;
-
-   if(this->isParallelToX1Axis())
-   {
-      xa     = point1.getX2Coordinate();
-      ya     = point1.getX3Coordinate();
-      za     = point1.getX1Coordinate();
-      xb     = point2.getX2Coordinate();
-      yb     = point2.getX3Coordinate();
-      zb     = point2.getX1Coordinate();
-      xm     = mLine->getPoint1()->getX2Coordinate();
-      ym     = mLine->getPoint1()->getX3Coordinate();
-      zStart = mLine->getPoint1()->getX1Coordinate();
-      zEnd   = mLine->getPoint2()->getX1Coordinate();
-   }
-   else if(this->isParallelToX2Axis())
-   {
-      xa     = point1.getX1Coordinate();
-      ya     = point1.getX3Coordinate();
-      za     = point1.getX2Coordinate();
-      xb     = point2.getX1Coordinate();
-      yb     = point2.getX3Coordinate();
-      zb     = point2.getX2Coordinate();
-      xm     = mLine->getPoint1()->getX1Coordinate();
-      ym     = mLine->getPoint1()->getX3Coordinate();
-      zStart = mLine->getPoint1()->getX2Coordinate();
-      zEnd   = mLine->getPoint2()->getX2Coordinate();
-   }
-   else if(this->isParallelToX3Axis())
-   {
-      xa     = point1.getX1Coordinate();
-      ya     = point1.getX2Coordinate();
-      za     = point1.getX3Coordinate();
-      xb     = point2.getX1Coordinate();
-      yb     = point2.getX2Coordinate();
-      zb     = point2.getX3Coordinate();
-      xm     = mLine->getPoint1()->getX1Coordinate();
-      ym     = mLine->getPoint1()->getX2Coordinate();
-      zStart = mLine->getPoint1()->getX3Coordinate();
-      zEnd   = mLine->getPoint2()->getX3Coordinate();
-   }
-   else throw UbException(UB_EXARGS,"funktioniert derzeit nur mit achsenparallelen Zylindern");
-
-   //Bestimmung des Schnittpunktes mit unendlich ausgedehntem Zylinder
-   double r   = mRad;
-   double r2  = r*r;
-   double xa2 = xa*xa;
-   double xb2 = xb*xb;
-   double ya2 = ya*ya;
-   double yb2 = yb*yb;
-   double xm2 = xm*xm;
-   double ym2 = ym*ym;
-
-   double wurzel  = 2.0*xa*xm*yb2+2.0*ya*ym*xb2-2.0*xa*xb*r2+2.0*xa*xb*ym2-2.0*ya*yb*r2+2.0*xa2*yb*ym
-                   +2.0*xa*xm*ya*ym-2.0*xa*xm*yb*ym-2.0*ya*ym*xb*xm+2.0*xb*xm*yb*ym+2.0*ya*yb*xa*xb
-                   -2.0*ya*yb*xa*xm-2.0*ya*yb*xb*xm-2.0*xa*xb*ya*ym-2.0*xa*xb*yb*ym+2.0*xb*xm*ya2
-                   +2.0*ya*yb*xm2-xa2*yb2-xb2*ya2+xa2*r2-xa2*ym2+xb2*r2-xb2*ym2+ya2*r2-ya2*xm2+yb2*r2-yb2*xm2;
-   double nenner  = -2.0*(ya*yb+xa*xb)+xa2+xb2+ya2+yb2;
-   double zaehler =  2.0*(-xa*xm+xb*xm-ya*ym+yb*ym)+xa2-xb2+ya2-yb2;
-
-   if(UbMath::greaterEqual(wurzel,0.0) && !UbMath::zero(nenner) )//fabs(nenner)>1.E-13)
-   {
-      t1 = (zaehler+2.0*sqrt(wurzel))/nenner;
-      t2 = (zaehler-2.0*sqrt(wurzel))/nenner;
-
-      if(UbMath::inClosedInterval(t1, -1.0, 1.0)) //Schnittpunkt innerhalb der Strecke
-      {
-         double x = xa*(0.5-0.5*t1)+xb*(0.5+0.5*t1);
-         double y = ya*(0.5-0.5*t1)+yb*(0.5+0.5*t1);
-         double z = za*(0.5-0.5*t1)+zb*(0.5+0.5*t1);
-
-         if(UbMath::inClosedInterval(z,zStart,zEnd)) //zWert muss sich innerhal der cylinderlaenge befinden
-         {
-            if     (this->isParallelToX1Axis()) schnittpunkte.push_back(new GbPoint3D(z,x,y));
-            else if(this->isParallelToX2Axis()) schnittpunkte.push_back(new GbPoint3D(x,z,y));
-            else if(this->isParallelToX3Axis()) schnittpunkte.push_back(new GbPoint3D(x,y,z));
-         }
-      }
-      if(fabs(t2-t1)>1.E-13 && UbMath::inClosedInterval(t2, -1.0, 1.0)) //Schnittpunkt innerhalb der Strecke
-      {
-         double x = xa*(0.5-0.5*t2)+xb*(0.5+0.5*t2);
-         double y = ya*(0.5-0.5*t2)+yb*(0.5+0.5*t2);
-         double z = za*(0.5-0.5*t2)+zb*(0.5+0.5*t2);
-
-         if(UbMath::inClosedInterval(z,zStart,zEnd)) //zWert muss sich innerhal der cylinderlaenge befinden
-         {
-            if     (this->isParallelToX1Axis()) schnittpunkte.push_back(new GbPoint3D(z,x,y));
-            else if(this->isParallelToX2Axis()) schnittpunkte.push_back(new GbPoint3D(x,z,y));
-            else if(this->isParallelToX3Axis()) schnittpunkte.push_back(new GbPoint3D(x,y,z));
-         }
-      }
-   }
-   //wenn nenner==0 -> Strecke parallel zu Zylinder! Es muss noch auf Schnittpunkt mit "Deckeln" geprueft werden
-
-   //Schnittpunkt mit Seitenflaechen bestimmen
-   //hierzu wird der schnittpunkt der gegebnen strecke mit den seitenflaechenberechnet
-   //als erstes "schaut man seitlich auf den Zylinder" --> kreisflaechen wird als strecke darsgestellt
-   //mit diesen "strecken" berechnet man Schnittpunkte.
-   //anschliessend wird geprueft, ob der berechnete Schnittpunkt ueberhaupt im kreis liegt
-   //falls ja --> Schnittpunkt vorhanden
-
-   double x1a,y1a,z1a,x1b,y1b,z1b, //uebergebene Strecke
-          x2a,y2a,x2b,y2b,         //erste "Kreisstrecke"
-          x3a,y3a,x3b,y3b,         //zweite "Kreisstrecke"
-          y2m,/*z2m,*/y3m,z3m;
-   double nenner1ab;
-
-   if(this->isParallelToX1Axis())
-   {
-      x1a=point1.getX1Coordinate();
-      y1a=point1.getX2Coordinate();
-      z1a=point1.getX3Coordinate();
-      x1b=point2.getX1Coordinate();
-      y1b=point2.getX2Coordinate();
-      z1b=point2.getX3Coordinate();
-
-      x2a=mLine->getPoint1()->getX1Coordinate();
-      y2m=mLine->getPoint1()->getX2Coordinate();
-//      z2m=mLine->getPoint1()->getX3Coordinate();
-      y2a=y2m+mRad;
-      x2b=mLine->getPoint1()->getX1Coordinate();
-      y2b=y2m-mRad;
-
-      x3a=mLine->getPoint2()->getX1Coordinate(); //
-      y3m=mLine->getPoint2()->getX2Coordinate();
-      z3m=mLine->getPoint2()->getX3Coordinate();
-      y3a=y3m+mRad;
-      x3b=mLine->getPoint2()->getX1Coordinate();
-      y3b=y3m-mRad;
-   }
-   else if(this->isParallelToX2Axis())
-   {
-      x1a=point1.getX2Coordinate();
-      y1a=point1.getX3Coordinate();
-      z1a=point1.getX1Coordinate();
-      x1b=point2.getX2Coordinate();
-      y1b=point2.getX3Coordinate();
-      z1b=point2.getX1Coordinate();
-
-      x2a=mLine->getPoint1()->getX2Coordinate();
-      y2m=mLine->getPoint1()->getX3Coordinate();
-//      z2m=mLine->getPoint1()->getX1Coordinate();
-      y2a=y2m+mRad;
-      x2b=mLine->getPoint1()->getX2Coordinate();
-      y2b=y2m-mRad;
-
-      x3a=mLine->getPoint2()->getX2Coordinate(); //
-      y3m=mLine->getPoint2()->getX3Coordinate();
-      z3m=mLine->getPoint2()->getX1Coordinate();
-      y3a=y3m+mRad;
-      x3b=mLine->getPoint2()->getX2Coordinate();
-      y3b=y3m-mRad;
-   }
-   else if(this->isParallelToX3Axis())
-   {
-      x1a=point1.getX3Coordinate();
-      y1a=point1.getX2Coordinate();
-      z1a=point1.getX1Coordinate();
-      x1b=point2.getX3Coordinate();
-      y1b=point2.getX2Coordinate();
-      z1b=point2.getX1Coordinate();
-
-      x2a=mLine->getPoint1()->getX3Coordinate();
-      y2m=mLine->getPoint1()->getX2Coordinate();
-//      z2m=mLine->getPoint1()->getX1Coordinate();
-      y2a=y2m+mRad;
-      x2b=mLine->getPoint1()->getX3Coordinate();
-      y2b=y2m-mRad;
-
-      x3a=mLine->getPoint2()->getX3Coordinate(); //
-      y3m=mLine->getPoint2()->getX2Coordinate();
-      z3m=mLine->getPoint2()->getX1Coordinate();
-      y3a=y3m+mRad;
-      x3b=mLine->getPoint2()->getX3Coordinate();
-      y3b=y3m-mRad;
-   }
-   else throw UbException(UB_EXARGS,"funktioniert derzeit nur mit achsenparallelen Zylindern");
-
-   nenner1ab = -y1a*x2a+y1a*x2b+y1b*x2a-y1b*x2b+x1a*y2a-x1a*y2b-x1b*y2a+x1b*y2b;
-   //double nenner2 = x1a*y2a-x1a*y2b-x1b*y2a+x1b*y2b-y1a*x2a+y1a*x2b+y1b*x2a-y1b*x2b;
-   if(fabs(nenner1ab)>1.E-13) //andernfalls sind die beiden Strecken parallel
-   {
-      //tStrecke ist fuer gegebene Strecke!
-      double t1ab = (-y1a*x2a+y1a*x2b-2.0*y2a*x2b+x1a*y2a-x1a*y2b-x1b*y2b+2.0*y2b*x2a+x1b*y2a-y1b*x2a+y1b*x2b)/nenner1ab;
-      //double tStrecke = -(-x1a*y2a+x1a*y2b+2.0*y2a*x2b+y1a*x2a-2.0*x2a*y2b-y1a*x2b+y1b*x2a-y1b*x2b-x1b*y2a+x1b*y2b)/nenner2;
-      //wenn -1 <= t2 <= +1 -> SP mit strecke
-      if(UbMath::inClosedInterval(t1ab, -1.0, 1.0)) //Schnittpunkt innerhalb der Strecke
-      {
-         double x,y,z,abstand_ist;
-         if     (this->isParallelToX1Axis())
-         {
-            x = x1a*(0.5-0.5*t1ab)+x1b*(0.5+0.5*t1ab);
-            y = y1a*(0.5-0.5*t1ab)+y1b*(0.5+0.5*t1ab);
-            z = z1a*(0.5-0.5*t1ab)+z1b*(0.5+0.5*t1ab);
-            abstand_ist=sqrt((y3m-y)*(y3m-y)+(z3m-z)*(z3m-z));
-         }
-         else if(this->isParallelToX2Axis())
-         {
-            y = x1a*(0.5-0.5*t1ab)+x1b*(0.5+0.5*t1ab);
-            z = y1a*(0.5-0.5*t1ab)+y1b*(0.5+0.5*t1ab);
-            x = z1a*(0.5-0.5*t1ab)+z1b*(0.5+0.5*t1ab);
-            abstand_ist=sqrt((y3m-z)*(y3m-z)+(z3m-x)*(z3m-x));
-         }
-         else if(this->isParallelToX3Axis())
-         {
-            z = x1a*(0.5-0.5*t1ab)+x1b*(0.5+0.5*t1ab);
-            y = y1a*(0.5-0.5*t1ab)+y1b*(0.5+0.5*t1ab);
-            x = z1a*(0.5-0.5*t1ab)+z1b*(0.5+0.5*t1ab);
-            abstand_ist=sqrt((y3m-y)*(y3m-y)+(z3m-x)*(z3m-x));
-         }
-         else throw UbException(UB_EXARGS,"funktioniert derzeit nur mit achsenparallelen Zylindern");
-         
-         //pruefen, ob Punkt Element von Kreisflaeche
-         //double abstand_ist=sqrt((y2m-y)*(y2m-y)+(z2m-z)*(z2m-z));
-         if(UbMath::lessEqual(abstand_ist,mRad))  //Punkt ist Schnittpunkt
-         {
-            bool exists = false;
-            for(int pos=0;pos<(int)schnittpunkte.size();++pos)
+    // liefert immer "innere" linie, also der teil, der vom Zylinder "abgeschnitten" wurde!
+    // funktioniert derzeit nur mit achsenparallelen Zylindern!
+    vector<GbPoint3D *> schnittpunkte;
+
+    double xa, ya, za, xb, yb, zb, xm, ym, zStart, zEnd, t1, t2;
+
+    if (this->isParallelToX1Axis()) {
+        xa     = point1.getX2Coordinate();
+        ya     = point1.getX3Coordinate();
+        za     = point1.getX1Coordinate();
+        xb     = point2.getX2Coordinate();
+        yb     = point2.getX3Coordinate();
+        zb     = point2.getX1Coordinate();
+        xm     = mLine->getPoint1()->getX2Coordinate();
+        ym     = mLine->getPoint1()->getX3Coordinate();
+        zStart = mLine->getPoint1()->getX1Coordinate();
+        zEnd   = mLine->getPoint2()->getX1Coordinate();
+    } else if (this->isParallelToX2Axis()) {
+        xa     = point1.getX1Coordinate();
+        ya     = point1.getX3Coordinate();
+        za     = point1.getX2Coordinate();
+        xb     = point2.getX1Coordinate();
+        yb     = point2.getX3Coordinate();
+        zb     = point2.getX2Coordinate();
+        xm     = mLine->getPoint1()->getX1Coordinate();
+        ym     = mLine->getPoint1()->getX3Coordinate();
+        zStart = mLine->getPoint1()->getX2Coordinate();
+        zEnd   = mLine->getPoint2()->getX2Coordinate();
+    } else if (this->isParallelToX3Axis()) {
+        xa     = point1.getX1Coordinate();
+        ya     = point1.getX2Coordinate();
+        za     = point1.getX3Coordinate();
+        xb     = point2.getX1Coordinate();
+        yb     = point2.getX2Coordinate();
+        zb     = point2.getX3Coordinate();
+        xm     = mLine->getPoint1()->getX1Coordinate();
+        ym     = mLine->getPoint1()->getX2Coordinate();
+        zStart = mLine->getPoint1()->getX3Coordinate();
+        zEnd   = mLine->getPoint2()->getX3Coordinate();
+    } else
+        throw UbException(UB_EXARGS, "funktioniert derzeit nur mit achsenparallelen Zylindern");
+
+    // Bestimmung des Schnittpunktes mit unendlich ausgedehntem Zylinder
+    double r   = mRad;
+    double r2  = r * r;
+    double xa2 = xa * xa;
+    double xb2 = xb * xb;
+    double ya2 = ya * ya;
+    double yb2 = yb * yb;
+    double xm2 = xm * xm;
+    double ym2 = ym * ym;
+
+    double wurzel = 2.0 * xa * xm * yb2 + 2.0 * ya * ym * xb2 - 2.0 * xa * xb * r2 + 2.0 * xa * xb * ym2 -
+                    2.0 * ya * yb * r2 + 2.0 * xa2 * yb * ym + 2.0 * xa * xm * ya * ym - 2.0 * xa * xm * yb * ym -
+                    2.0 * ya * ym * xb * xm + 2.0 * xb * xm * yb * ym + 2.0 * ya * yb * xa * xb -
+                    2.0 * ya * yb * xa * xm - 2.0 * ya * yb * xb * xm - 2.0 * xa * xb * ya * ym -
+                    2.0 * xa * xb * yb * ym + 2.0 * xb * xm * ya2 + 2.0 * ya * yb * xm2 - xa2 * yb2 - xb2 * ya2 +
+                    xa2 * r2 - xa2 * ym2 + xb2 * r2 - xb2 * ym2 + ya2 * r2 - ya2 * xm2 + yb2 * r2 - yb2 * xm2;
+    double nenner  = -2.0 * (ya * yb + xa * xb) + xa2 + xb2 + ya2 + yb2;
+    double zaehler = 2.0 * (-xa * xm + xb * xm - ya * ym + yb * ym) + xa2 - xb2 + ya2 - yb2;
+
+    if (UbMath::greaterEqual(wurzel, 0.0) && !UbMath::zero(nenner)) // fabs(nenner)>1.E-13)
+    {
+        t1 = (zaehler + 2.0 * sqrt(wurzel)) / nenner;
+        t2 = (zaehler - 2.0 * sqrt(wurzel)) / nenner;
+
+        if (UbMath::inClosedInterval(t1, -1.0, 1.0)) // Schnittpunkt innerhalb der Strecke
+        {
+            double x = xa * (0.5 - 0.5 * t1) + xb * (0.5 + 0.5 * t1);
+            double y = ya * (0.5 - 0.5 * t1) + yb * (0.5 + 0.5 * t1);
+            double z = za * (0.5 - 0.5 * t1) + zb * (0.5 + 0.5 * t1);
+
+            if (UbMath::inClosedInterval(z, zStart, zEnd)) // zWert muss sich innerhal der cylinderlaenge befinden
             {
-               if(    fabs(schnittpunkte[pos]->getX1Coordinate()-x)<1.E-13
-                   && fabs(schnittpunkte[pos]->getX2Coordinate()-y)<1.E-13
-                   && fabs(schnittpunkte[pos]->getX3Coordinate()-z)<1.E-13 ) exists=true;
+                if (this->isParallelToX1Axis())
+                    schnittpunkte.push_back(new GbPoint3D(z, x, y));
+                else if (this->isParallelToX2Axis())
+                    schnittpunkte.push_back(new GbPoint3D(x, z, y));
+                else if (this->isParallelToX3Axis())
+                    schnittpunkte.push_back(new GbPoint3D(x, y, z));
             }
-
-            if(!exists) schnittpunkte.push_back(new GbPoint3D(x,y,z));
-         }
-      }
-   }
-
-   nenner1ab = -y1a*x3a+y1a*x3b+y1b*x3a-y1b*x3b+x1a*y3a-x1a*y3b-x1b*y3a+x1b*y3b;
-
-   if(fabs(nenner1ab)>1.E-13) //andernfalls sind die beiden Strecken parallel
-   {
-      //tStrecke ist fuer gegebene Strecke!
-      double t1ab = (-y1a*x3a+y1a*x3b-x1b*y3b-2.0*y3a*x3b-x1a*y3b+2.0*y3b*x3a+x1a*y3a+x1b*y3a-y1b*x3a+y1b*x3b)/nenner1ab;
-
-      if(UbMath::inClosedInterval(t1ab, -1.0, 1.0)) //Schnittpunkt innerhalb der Strecke
-      {
-         double x,y,z,abstand_ist;
-         if     (this->isParallelToX1Axis())
-         {
-            x = x1a*(0.5-0.5*t1ab)+x1b*(0.5+0.5*t1ab);
-            y = y1a*(0.5-0.5*t1ab)+y1b*(0.5+0.5*t1ab);
-            z = z1a*(0.5-0.5*t1ab)+z1b*(0.5+0.5*t1ab);
-            abstand_ist=sqrt((y3m-y)*(y3m-y)+(z3m-z)*(z3m-z));
-         }
-         else if(this->isParallelToX2Axis())
-         {
-            y = x1a*(0.5-0.5*t1ab)+x1b*(0.5+0.5*t1ab);
-            z = y1a*(0.5-0.5*t1ab)+y1b*(0.5+0.5*t1ab);
-            x = z1a*(0.5-0.5*t1ab)+z1b*(0.5+0.5*t1ab);
-            abstand_ist=sqrt((y3m-z)*(y3m-z)+(z3m-x)*(z3m-x));
-         }
-         else if(this->isParallelToX3Axis())
-         {
-            z = x1a*(0.5-0.5*t1ab)+x1b*(0.5+0.5*t1ab);
-            y = y1a*(0.5-0.5*t1ab)+y1b*(0.5+0.5*t1ab);
-            x = z1a*(0.5-0.5*t1ab)+z1b*(0.5+0.5*t1ab);
-            abstand_ist=sqrt((y3m-y)*(y3m-y)+(z3m-x)*(z3m-x));
-         }
-         else throw UbException(UB_EXARGS,"cylinder must be parallel to one axis");
-
-         //pruefen, ob Punkt Element von Kreisflaeche
-         //double abstand_ist=sqrt((y2m-y)*(y2m-y)+(z2m-z)*(z2m-z));
-
-         if(UbMath::lessEqual(abstand_ist,mRad))  //Punkt ist Schnittpunkt
-         {
-            bool exists = false;
-            for(int pos=0;pos<(int)schnittpunkte.size();++pos)
+        }
+        if (fabs(t2 - t1) > 1.E-13 && UbMath::inClosedInterval(t2, -1.0, 1.0)) // Schnittpunkt innerhalb der Strecke
+        {
+            double x = xa * (0.5 - 0.5 * t2) + xb * (0.5 + 0.5 * t2);
+            double y = ya * (0.5 - 0.5 * t2) + yb * (0.5 + 0.5 * t2);
+            double z = za * (0.5 - 0.5 * t2) + zb * (0.5 + 0.5 * t2);
+
+            if (UbMath::inClosedInterval(z, zStart, zEnd)) // zWert muss sich innerhal der cylinderlaenge befinden
             {
-               if(   fabs(schnittpunkte[pos]->getX1Coordinate()-x)<1.E-13
-                  && fabs(schnittpunkte[pos]->getX2Coordinate()-y)<1.E-13
-                  && fabs(schnittpunkte[pos]->getX3Coordinate()-z)<1.E-13 ) exists=true;
+                if (this->isParallelToX1Axis())
+                    schnittpunkte.push_back(new GbPoint3D(z, x, y));
+                else if (this->isParallelToX2Axis())
+                    schnittpunkte.push_back(new GbPoint3D(x, z, y));
+                else if (this->isParallelToX3Axis())
+                    schnittpunkte.push_back(new GbPoint3D(x, y, z));
             }
-
-            if(!exists) schnittpunkte.push_back(new GbPoint3D(x,y,z));
-         }
-      }
-   }
-
-   int nofSchnittpunkte = (int)schnittpunkte.size();
-   if     (nofSchnittpunkte==0) return NULL;
-   else if(nofSchnittpunkte >2) throw UbException(UB_EXARGS,"more than three intersection points - not possible");
-   else if(nofSchnittpunkte==2) return new GbLine3D(schnittpunkte[0],schnittpunkte[1]);
-   else if(nofSchnittpunkte==1)
-   {
-      if     (this->isPointInGbObject3D(&point1)) return new GbLine3D(schnittpunkte[0],new GbPoint3D(point1));
-      else if(this->isPointInGbObject3D(&point2)) return new GbLine3D(schnittpunkte[0],new GbPoint3D(point2));
-      else  return new GbLine3D(schnittpunkte[0],new GbPoint3D(*(schnittpunkte[0]))); //strecke beruehrt clippedLine reduziert sich auf einen Punkt!!!
-   }
-
-   return NULL;
+        }
+    }
+    // wenn nenner==0 -> Strecke parallel zu Zylinder! Es muss noch auf Schnittpunkt mit "Deckeln" geprueft werden
+
+    // Schnittpunkt mit Seitenflaechen bestimmen
+    // hierzu wird der schnittpunkt der gegebnen strecke mit den seitenflaechenberechnet
+    // als erstes "schaut man seitlich auf den Zylinder" --> kreisflaechen wird als strecke darsgestellt
+    // mit diesen "strecken" berechnet man Schnittpunkte.
+    // anschliessend wird geprueft, ob der berechnete Schnittpunkt ueberhaupt im kreis liegt
+    // falls ja --> Schnittpunkt vorhanden
+
+    double x1a, y1a, z1a, x1b, y1b, z1b, // uebergebene Strecke
+        x2a, y2a, x2b, y2b,              // erste "Kreisstrecke"
+        x3a, y3a, x3b, y3b,              // zweite "Kreisstrecke"
+        y2m, /*z2m,*/ y3m, z3m;
+    double nenner1ab;
+
+    if (this->isParallelToX1Axis()) {
+        x1a = point1.getX1Coordinate();
+        y1a = point1.getX2Coordinate();
+        z1a = point1.getX3Coordinate();
+        x1b = point2.getX1Coordinate();
+        y1b = point2.getX2Coordinate();
+        z1b = point2.getX3Coordinate();
+
+        x2a = mLine->getPoint1()->getX1Coordinate();
+        y2m = mLine->getPoint1()->getX2Coordinate();
+        //      z2m=mLine->getPoint1()->getX3Coordinate();
+        y2a = y2m + mRad;
+        x2b = mLine->getPoint1()->getX1Coordinate();
+        y2b = y2m - mRad;
+
+        x3a = mLine->getPoint2()->getX1Coordinate(); //
+        y3m = mLine->getPoint2()->getX2Coordinate();
+        z3m = mLine->getPoint2()->getX3Coordinate();
+        y3a = y3m + mRad;
+        x3b = mLine->getPoint2()->getX1Coordinate();
+        y3b = y3m - mRad;
+    } else if (this->isParallelToX2Axis()) {
+        x1a = point1.getX2Coordinate();
+        y1a = point1.getX3Coordinate();
+        z1a = point1.getX1Coordinate();
+        x1b = point2.getX2Coordinate();
+        y1b = point2.getX3Coordinate();
+        z1b = point2.getX1Coordinate();
+
+        x2a = mLine->getPoint1()->getX2Coordinate();
+        y2m = mLine->getPoint1()->getX3Coordinate();
+        //      z2m=mLine->getPoint1()->getX1Coordinate();
+        y2a = y2m + mRad;
+        x2b = mLine->getPoint1()->getX2Coordinate();
+        y2b = y2m - mRad;
+
+        x3a = mLine->getPoint2()->getX2Coordinate(); //
+        y3m = mLine->getPoint2()->getX3Coordinate();
+        z3m = mLine->getPoint2()->getX1Coordinate();
+        y3a = y3m + mRad;
+        x3b = mLine->getPoint2()->getX2Coordinate();
+        y3b = y3m - mRad;
+    } else if (this->isParallelToX3Axis()) {
+        x1a = point1.getX3Coordinate();
+        y1a = point1.getX2Coordinate();
+        z1a = point1.getX1Coordinate();
+        x1b = point2.getX3Coordinate();
+        y1b = point2.getX2Coordinate();
+        z1b = point2.getX1Coordinate();
+
+        x2a = mLine->getPoint1()->getX3Coordinate();
+        y2m = mLine->getPoint1()->getX2Coordinate();
+        //      z2m=mLine->getPoint1()->getX1Coordinate();
+        y2a = y2m + mRad;
+        x2b = mLine->getPoint1()->getX3Coordinate();
+        y2b = y2m - mRad;
+
+        x3a = mLine->getPoint2()->getX3Coordinate(); //
+        y3m = mLine->getPoint2()->getX2Coordinate();
+        z3m = mLine->getPoint2()->getX1Coordinate();
+        y3a = y3m + mRad;
+        x3b = mLine->getPoint2()->getX3Coordinate();
+        y3b = y3m - mRad;
+    } else
+        throw UbException(UB_EXARGS, "funktioniert derzeit nur mit achsenparallelen Zylindern");
+
+    nenner1ab = -y1a * x2a + y1a * x2b + y1b * x2a - y1b * x2b + x1a * y2a - x1a * y2b - x1b * y2a + x1b * y2b;
+    // double nenner2 = x1a*y2a-x1a*y2b-x1b*y2a+x1b*y2b-y1a*x2a+y1a*x2b+y1b*x2a-y1b*x2b;
+    if (fabs(nenner1ab) > 1.E-13) // andernfalls sind die beiden Strecken parallel
+    {
+        // tStrecke ist fuer gegebene Strecke!
+        double t1ab = (-y1a * x2a + y1a * x2b - 2.0 * y2a * x2b + x1a * y2a - x1a * y2b - x1b * y2b + 2.0 * y2b * x2a +
+                       x1b * y2a - y1b * x2a + y1b * x2b) /
+                      nenner1ab;
+        // double tStrecke =
+        // -(-x1a*y2a+x1a*y2b+2.0*y2a*x2b+y1a*x2a-2.0*x2a*y2b-y1a*x2b+y1b*x2a-y1b*x2b-x1b*y2a+x1b*y2b)/nenner2; wenn -1
+        // <= t2 <= +1 -> SP mit strecke
+        if (UbMath::inClosedInterval(t1ab, -1.0, 1.0)) // Schnittpunkt innerhalb der Strecke
+        {
+            double x, y, z, abstand_ist;
+            if (this->isParallelToX1Axis()) {
+                x           = x1a * (0.5 - 0.5 * t1ab) + x1b * (0.5 + 0.5 * t1ab);
+                y           = y1a * (0.5 - 0.5 * t1ab) + y1b * (0.5 + 0.5 * t1ab);
+                z           = z1a * (0.5 - 0.5 * t1ab) + z1b * (0.5 + 0.5 * t1ab);
+                abstand_ist = sqrt((y3m - y) * (y3m - y) + (z3m - z) * (z3m - z));
+            } else if (this->isParallelToX2Axis()) {
+                y           = x1a * (0.5 - 0.5 * t1ab) + x1b * (0.5 + 0.5 * t1ab);
+                z           = y1a * (0.5 - 0.5 * t1ab) + y1b * (0.5 + 0.5 * t1ab);
+                x           = z1a * (0.5 - 0.5 * t1ab) + z1b * (0.5 + 0.5 * t1ab);
+                abstand_ist = sqrt((y3m - z) * (y3m - z) + (z3m - x) * (z3m - x));
+            } else if (this->isParallelToX3Axis()) {
+                z           = x1a * (0.5 - 0.5 * t1ab) + x1b * (0.5 + 0.5 * t1ab);
+                y           = y1a * (0.5 - 0.5 * t1ab) + y1b * (0.5 + 0.5 * t1ab);
+                x           = z1a * (0.5 - 0.5 * t1ab) + z1b * (0.5 + 0.5 * t1ab);
+                abstand_ist = sqrt((y3m - y) * (y3m - y) + (z3m - x) * (z3m - x));
+            } else
+                throw UbException(UB_EXARGS, "funktioniert derzeit nur mit achsenparallelen Zylindern");
+
+            // pruefen, ob Punkt Element von Kreisflaeche
+            // double abstand_ist=sqrt((y2m-y)*(y2m-y)+(z2m-z)*(z2m-z));
+            if (UbMath::lessEqual(abstand_ist, mRad)) // Punkt ist Schnittpunkt
+            {
+                bool exists = false;
+                for (int pos = 0; pos < (int)schnittpunkte.size(); ++pos) {
+                    if (fabs(schnittpunkte[pos]->getX1Coordinate() - x) < 1.E-13 &&
+                        fabs(schnittpunkte[pos]->getX2Coordinate() - y) < 1.E-13 &&
+                        fabs(schnittpunkte[pos]->getX3Coordinate() - z) < 1.E-13)
+                        exists = true;
+                }
+
+                if (!exists)
+                    schnittpunkte.push_back(new GbPoint3D(x, y, z));
+            }
+        }
+    }
+
+    nenner1ab = -y1a * x3a + y1a * x3b + y1b * x3a - y1b * x3b + x1a * y3a - x1a * y3b - x1b * y3a + x1b * y3b;
+
+    if (fabs(nenner1ab) > 1.E-13) // andernfalls sind die beiden Strecken parallel
+    {
+        // tStrecke ist fuer gegebene Strecke!
+        double t1ab = (-y1a * x3a + y1a * x3b - x1b * y3b - 2.0 * y3a * x3b - x1a * y3b + 2.0 * y3b * x3a + x1a * y3a +
+                       x1b * y3a - y1b * x3a + y1b * x3b) /
+                      nenner1ab;
+
+        if (UbMath::inClosedInterval(t1ab, -1.0, 1.0)) // Schnittpunkt innerhalb der Strecke
+        {
+            double x, y, z, abstand_ist;
+            if (this->isParallelToX1Axis()) {
+                x           = x1a * (0.5 - 0.5 * t1ab) + x1b * (0.5 + 0.5 * t1ab);
+                y           = y1a * (0.5 - 0.5 * t1ab) + y1b * (0.5 + 0.5 * t1ab);
+                z           = z1a * (0.5 - 0.5 * t1ab) + z1b * (0.5 + 0.5 * t1ab);
+                abstand_ist = sqrt((y3m - y) * (y3m - y) + (z3m - z) * (z3m - z));
+            } else if (this->isParallelToX2Axis()) {
+                y           = x1a * (0.5 - 0.5 * t1ab) + x1b * (0.5 + 0.5 * t1ab);
+                z           = y1a * (0.5 - 0.5 * t1ab) + y1b * (0.5 + 0.5 * t1ab);
+                x           = z1a * (0.5 - 0.5 * t1ab) + z1b * (0.5 + 0.5 * t1ab);
+                abstand_ist = sqrt((y3m - z) * (y3m - z) + (z3m - x) * (z3m - x));
+            } else if (this->isParallelToX3Axis()) {
+                z           = x1a * (0.5 - 0.5 * t1ab) + x1b * (0.5 + 0.5 * t1ab);
+                y           = y1a * (0.5 - 0.5 * t1ab) + y1b * (0.5 + 0.5 * t1ab);
+                x           = z1a * (0.5 - 0.5 * t1ab) + z1b * (0.5 + 0.5 * t1ab);
+                abstand_ist = sqrt((y3m - y) * (y3m - y) + (z3m - x) * (z3m - x));
+            } else
+                throw UbException(UB_EXARGS, "cylinder must be parallel to one axis");
+
+            // pruefen, ob Punkt Element von Kreisflaeche
+            // double abstand_ist=sqrt((y2m-y)*(y2m-y)+(z2m-z)*(z2m-z));
+
+            if (UbMath::lessEqual(abstand_ist, mRad)) // Punkt ist Schnittpunkt
+            {
+                bool exists = false;
+                for (int pos = 0; pos < (int)schnittpunkte.size(); ++pos) {
+                    if (fabs(schnittpunkte[pos]->getX1Coordinate() - x) < 1.E-13 &&
+                        fabs(schnittpunkte[pos]->getX2Coordinate() - y) < 1.E-13 &&
+                        fabs(schnittpunkte[pos]->getX3Coordinate() - z) < 1.E-13)
+                        exists = true;
+                }
+
+                if (!exists)
+                    schnittpunkte.push_back(new GbPoint3D(x, y, z));
+            }
+        }
+    }
+
+    int nofSchnittpunkte = (int)schnittpunkte.size();
+    if (nofSchnittpunkte == 0)
+        return NULL;
+    else if (nofSchnittpunkte > 2)
+        throw UbException(UB_EXARGS, "more than three intersection points - not possible");
+    else if (nofSchnittpunkte == 2)
+        return new GbLine3D(schnittpunkte[0], schnittpunkte[1]);
+    else if (nofSchnittpunkte == 1) {
+        if (this->isPointInGbObject3D(&point1))
+            return new GbLine3D(schnittpunkte[0], new GbPoint3D(point1));
+        else if (this->isPointInGbObject3D(&point2))
+            return new GbLine3D(schnittpunkte[0], new GbPoint3D(point2));
+        else
+            return new GbLine3D(
+                schnittpunkte[0],
+                new GbPoint3D(*(schnittpunkte[0]))); // strecke beruehrt clippedLine reduziert sich auf einen Punkt!!!
+    }
+
+    return NULL;
 }
 /*==========================================================*/
-vector<GbTriangle3D*> GbCylinder3D::getSurfaceTriangleSet()
+vector<GbTriangle3D *> GbCylinder3D::getSurfaceTriangleSet()
 {
-   double x1ma,x1mb,x2m,x3m;
-   if( this->isParallelToX1Axis() )
-   {
-      x1ma = this->getX1Minimum();
-      x1mb = this->getX1Maximum();
-      x2m  = this->getX2Centroid();
-      x3m  = this->getX3Centroid();
-   }
-   else if( this->isParallelToX2Axis() )
-   {
-      x1ma = this->getX2Minimum();
-      x1mb = this->getX2Maximum();
-      x2m  = this->getX1Centroid();
-      x3m  = this->getX3Centroid();
-   }
-   else if( this->isParallelToX3Axis() )
-   {
-      x1ma = this->getX3Minimum();
-      x1mb = this->getX3Maximum();
-      x2m  = this->getX2Centroid();
-      x3m  = this->getX1Centroid();
-   }
-   else throw UbException(UB_EXARGS,"cylinder not axis prallel");
-
-   vector<GbTriangle3D*> triangles;
-
-   int segmentsCircle  = 20;
-   double deltaPhi = UbMath::PI/(double)segmentsCircle;
-
-   double phiX1a,phiX1b;
-   double x1a,x2a,x3a,x1b,x2b,x3b,x1c,x2c,x3c,x1d,x2d,x3d;
-
-   double dXCylinder =  fabs((x1mb-x1ma))/(double)segmentsCircle;
-   int segmentsCylinder = (int)(fabs(x1mb-x1ma)/dXCylinder);
-   for(int segCyl = 0; segCyl<segmentsCylinder; segCyl++)
-   {
-      x1a = x1d = x1ma+segCyl*dXCylinder;
-      x1b = x1c = x1a+dXCylinder;
-
-      for(phiX1a=2.0*UbMath::PI; phiX1a>0; phiX1a-=deltaPhi)
-      {
-         phiX1b = phiX1a+deltaPhi;
-
-         x2a =  x2m+mRad*std::sin(phiX1a);
-         x3a =  x3m+mRad*std::cos(phiX1a);
-         x2b =  x2m+mRad*std::sin(phiX1b);
-         x3b =  x3m+mRad*std::cos(phiX1b);
-
-         if( this->isParallelToX1Axis() )
-         {
-            triangles.push_back(new GbTriangle3D(new GbPoint3D(x1b,x2b,x3b),new GbPoint3D(x1b,x2a,x3a),new GbPoint3D(x1a,x2a,x3a)));
-            triangles.push_back(new GbTriangle3D(new GbPoint3D(x1a,x2a,x3a),new GbPoint3D(x1a,x2b,x3b),new GbPoint3D(x1b,x2b,x3b)));
-         }
-         else if( this->isParallelToX2Axis() )
-         {
-            triangles.push_back(new GbTriangle3D(new GbPoint3D(x2b,x1b,x3b),new GbPoint3D(x2a,x1b,x3a),new GbPoint3D(x2a,x1a,x3a)));
-            triangles.push_back(new GbTriangle3D(new GbPoint3D(x2a,x1a,x3a),new GbPoint3D(x2b,x1a,x3b),new GbPoint3D(x2b,x1b,x3b)));
-         }
-         else if( this->isParallelToX3Axis() )
-         {
-            triangles.push_back(new GbTriangle3D(new GbPoint3D(x3b,x2b,x1b),new GbPoint3D(x3a,x2a,x1b),new GbPoint3D(x3a,x2a,x1a)));
-            triangles.push_back(new GbTriangle3D(new GbPoint3D(x3a,x2a,x1a),new GbPoint3D(x3b,x2b,x1a),new GbPoint3D(x3b,x2b,x1b)));
-         }
-
-      }
-   }
-
-   int segmentsSide = (int)(mRad/dXCylinder);
-   double radius0, radius1;
-   for(int segCyl = 0; segCyl<segmentsSide; segCyl++)
-   {
-      radius0 = segCyl*dXCylinder;
-      radius1 = radius0+dXCylinder;
-      if(segCyl==segmentsSide-1) radius1=mRad;
-
-      for(phiX1a=2.0*UbMath::PI; phiX1a>0; phiX1a-=deltaPhi)
-      {
-         phiX1b = phiX1a+deltaPhi;
-
-         x2a =  x2m+radius0*std::sin(phiX1a);
-         x3a =  x3m+radius0*std::cos(phiX1a);
-         x2b =  x2m+radius0*std::sin(phiX1b);
-         x3b =  x3m+radius0*std::cos(phiX1b);
-         x2c =  x2m+radius1*std::sin(phiX1b);
-         x3c =  x3m+radius1*std::cos(phiX1b);
-         x2d =  x2m+radius1*std::sin(phiX1a);
-         x3d =  x3m+radius1*std::cos(phiX1a);
-
-         if( this->isParallelToX1Axis() )
-         {
-            triangles.push_back(new GbTriangle3D(new GbPoint3D(x1ma,x2a,x3a),new GbPoint3D(x1ma,x2b,x3b),new GbPoint3D(x1ma,x2c,x3c)));
-            triangles.push_back(new GbTriangle3D(new GbPoint3D(x1ma,x2c,x3c),new GbPoint3D(x1ma,x2d,x3d),new GbPoint3D(x1ma,x2a,x3a)));
-            triangles.push_back(new GbTriangle3D(new GbPoint3D(x1mb,x2c,x3c),new GbPoint3D(x1mb,x2b,x3b),new GbPoint3D(x1mb,x2a,x3a)));
-            triangles.push_back(new GbTriangle3D(new GbPoint3D(x1mb,x2a,x3a),new GbPoint3D(x1mb,x2d,x3d),new GbPoint3D(x1mb,x2c,x3c)));
-         }
-         else if( this->isParallelToX2Axis() )
-         {
-            triangles.push_back(new GbTriangle3D(new GbPoint3D(x2a,x1ma,x3a),new GbPoint3D(x2b,x1ma,x3b),new GbPoint3D(x2c,x1ma,x3c)));
-            triangles.push_back(new GbTriangle3D(new GbPoint3D(x2c,x1ma,x3c),new GbPoint3D(x2d,x1ma,x3d),new GbPoint3D(x2a,x1ma,x3a)));
-            triangles.push_back(new GbTriangle3D(new GbPoint3D(x2c,x1mb,x3c),new GbPoint3D(x2b,x1mb,x3b),new GbPoint3D(x2a,x1mb,x3a)));
-            triangles.push_back(new GbTriangle3D(new GbPoint3D(x2a,x1mb,x3a),new GbPoint3D(x2d,x1mb,x3d),new GbPoint3D(x2c,x1mb,x3c)));
-         }
-         else if( this->isParallelToX3Axis() )
-         {
-            triangles.push_back(new GbTriangle3D(new GbPoint3D(x3a,x2a,x1ma),new GbPoint3D(x3b,x2b,x1ma),new GbPoint3D(x3c,x2c,x1ma)));
-            triangles.push_back(new GbTriangle3D(new GbPoint3D(x3c,x2c,x1ma),new GbPoint3D(x3d,x2d,x1ma),new GbPoint3D(x3a,x2a,x1ma)));
-            triangles.push_back(new GbTriangle3D(new GbPoint3D(x3c,x2c,x1mb),new GbPoint3D(x3b,x2b,x1mb),new GbPoint3D(x3a,x2a,x1mb)));
-            triangles.push_back(new GbTriangle3D(new GbPoint3D(x3a,x2a,x1mb),new GbPoint3D(x3d,x2d,x1mb),new GbPoint3D(x3c,x2c,x1mb)));
-         }
-      }
-   }
-
-   return triangles;
+    double x1ma, x1mb, x2m, x3m;
+    if (this->isParallelToX1Axis()) {
+        x1ma = this->getX1Minimum();
+        x1mb = this->getX1Maximum();
+        x2m  = this->getX2Centroid();
+        x3m  = this->getX3Centroid();
+    } else if (this->isParallelToX2Axis()) {
+        x1ma = this->getX2Minimum();
+        x1mb = this->getX2Maximum();
+        x2m  = this->getX1Centroid();
+        x3m  = this->getX3Centroid();
+    } else if (this->isParallelToX3Axis()) {
+        x1ma = this->getX3Minimum();
+        x1mb = this->getX3Maximum();
+        x2m  = this->getX2Centroid();
+        x3m  = this->getX1Centroid();
+    } else
+        throw UbException(UB_EXARGS, "cylinder not axis prallel");
+
+    vector<GbTriangle3D *> triangles;
+
+    int segmentsCircle = 20;
+    double deltaPhi    = UbMath::PI / (double)segmentsCircle;
+
+    double phiX1a, phiX1b;
+    double x1a, x2a, x3a, x1b, x2b, x3b, x1c, x2c, x3c, x1d, x2d, x3d;
+
+    double dXCylinder    = fabs((x1mb - x1ma)) / (double)segmentsCircle;
+    int segmentsCylinder = (int)(fabs(x1mb - x1ma) / dXCylinder);
+    for (int segCyl = 0; segCyl < segmentsCylinder; segCyl++) {
+        x1a = x1d = x1ma + segCyl * dXCylinder;
+        x1b = x1c = x1a + dXCylinder;
+
+        for (phiX1a = 2.0 * UbMath::PI; phiX1a > 0; phiX1a -= deltaPhi) {
+            phiX1b = phiX1a + deltaPhi;
+
+            x2a = x2m + mRad * std::sin(phiX1a);
+            x3a = x3m + mRad * std::cos(phiX1a);
+            x2b = x2m + mRad * std::sin(phiX1b);
+            x3b = x3m + mRad * std::cos(phiX1b);
+
+            if (this->isParallelToX1Axis()) {
+                triangles.push_back(new GbTriangle3D(new GbPoint3D(x1b, x2b, x3b), new GbPoint3D(x1b, x2a, x3a),
+                                                     new GbPoint3D(x1a, x2a, x3a)));
+                triangles.push_back(new GbTriangle3D(new GbPoint3D(x1a, x2a, x3a), new GbPoint3D(x1a, x2b, x3b),
+                                                     new GbPoint3D(x1b, x2b, x3b)));
+            } else if (this->isParallelToX2Axis()) {
+                triangles.push_back(new GbTriangle3D(new GbPoint3D(x2b, x1b, x3b), new GbPoint3D(x2a, x1b, x3a),
+                                                     new GbPoint3D(x2a, x1a, x3a)));
+                triangles.push_back(new GbTriangle3D(new GbPoint3D(x2a, x1a, x3a), new GbPoint3D(x2b, x1a, x3b),
+                                                     new GbPoint3D(x2b, x1b, x3b)));
+            } else if (this->isParallelToX3Axis()) {
+                triangles.push_back(new GbTriangle3D(new GbPoint3D(x3b, x2b, x1b), new GbPoint3D(x3a, x2a, x1b),
+                                                     new GbPoint3D(x3a, x2a, x1a)));
+                triangles.push_back(new GbTriangle3D(new GbPoint3D(x3a, x2a, x1a), new GbPoint3D(x3b, x2b, x1a),
+                                                     new GbPoint3D(x3b, x2b, x1b)));
+            }
+        }
+    }
+
+    int segmentsSide = (int)(mRad / dXCylinder);
+    double radius0, radius1;
+    for (int segCyl = 0; segCyl < segmentsSide; segCyl++) {
+        radius0 = segCyl * dXCylinder;
+        radius1 = radius0 + dXCylinder;
+        if (segCyl == segmentsSide - 1)
+            radius1 = mRad;
+
+        for (phiX1a = 2.0 * UbMath::PI; phiX1a > 0; phiX1a -= deltaPhi) {
+            phiX1b = phiX1a + deltaPhi;
+
+            x2a = x2m + radius0 * std::sin(phiX1a);
+            x3a = x3m + radius0 * std::cos(phiX1a);
+            x2b = x2m + radius0 * std::sin(phiX1b);
+            x3b = x3m + radius0 * std::cos(phiX1b);
+            x2c = x2m + radius1 * std::sin(phiX1b);
+            x3c = x3m + radius1 * std::cos(phiX1b);
+            x2d = x2m + radius1 * std::sin(phiX1a);
+            x3d = x3m + radius1 * std::cos(phiX1a);
+
+            if (this->isParallelToX1Axis()) {
+                triangles.push_back(new GbTriangle3D(new GbPoint3D(x1ma, x2a, x3a), new GbPoint3D(x1ma, x2b, x3b),
+                                                     new GbPoint3D(x1ma, x2c, x3c)));
+                triangles.push_back(new GbTriangle3D(new GbPoint3D(x1ma, x2c, x3c), new GbPoint3D(x1ma, x2d, x3d),
+                                                     new GbPoint3D(x1ma, x2a, x3a)));
+                triangles.push_back(new GbTriangle3D(new GbPoint3D(x1mb, x2c, x3c), new GbPoint3D(x1mb, x2b, x3b),
+                                                     new GbPoint3D(x1mb, x2a, x3a)));
+                triangles.push_back(new GbTriangle3D(new GbPoint3D(x1mb, x2a, x3a), new GbPoint3D(x1mb, x2d, x3d),
+                                                     new GbPoint3D(x1mb, x2c, x3c)));
+            } else if (this->isParallelToX2Axis()) {
+                triangles.push_back(new GbTriangle3D(new GbPoint3D(x2a, x1ma, x3a), new GbPoint3D(x2b, x1ma, x3b),
+                                                     new GbPoint3D(x2c, x1ma, x3c)));
+                triangles.push_back(new GbTriangle3D(new GbPoint3D(x2c, x1ma, x3c), new GbPoint3D(x2d, x1ma, x3d),
+                                                     new GbPoint3D(x2a, x1ma, x3a)));
+                triangles.push_back(new GbTriangle3D(new GbPoint3D(x2c, x1mb, x3c), new GbPoint3D(x2b, x1mb, x3b),
+                                                     new GbPoint3D(x2a, x1mb, x3a)));
+                triangles.push_back(new GbTriangle3D(new GbPoint3D(x2a, x1mb, x3a), new GbPoint3D(x2d, x1mb, x3d),
+                                                     new GbPoint3D(x2c, x1mb, x3c)));
+            } else if (this->isParallelToX3Axis()) {
+                triangles.push_back(new GbTriangle3D(new GbPoint3D(x3a, x2a, x1ma), new GbPoint3D(x3b, x2b, x1ma),
+                                                     new GbPoint3D(x3c, x2c, x1ma)));
+                triangles.push_back(new GbTriangle3D(new GbPoint3D(x3c, x2c, x1ma), new GbPoint3D(x3d, x2d, x1ma),
+                                                     new GbPoint3D(x3a, x2a, x1ma)));
+                triangles.push_back(new GbTriangle3D(new GbPoint3D(x3c, x2c, x1mb), new GbPoint3D(x3b, x2b, x1mb),
+                                                     new GbPoint3D(x3a, x2a, x1mb)));
+                triangles.push_back(new GbTriangle3D(new GbPoint3D(x3a, x2a, x1mb), new GbPoint3D(x3d, x2d, x1mb),
+                                                     new GbPoint3D(x3c, x2c, x1mb)));
+            }
+        }
+    }
+
+    return triangles;
 }
 /*==========================================================*/
-void GbCylinder3D::addSurfaceTriangleSet(vector<UbTupleFloat3>& nodes, vector<UbTupleInt3>& triangles)
+void GbCylinder3D::addSurfaceTriangleSet(vector<UbTupleFloat3> &nodes, vector<UbTupleInt3> &triangles)
 {
-   float x1ma,x1mb,x2m,x3m;
-   if( this->isParallelToX1Axis() )
-   {
-      x1ma = (float)this->getX1Minimum();
-      x1mb = (float)this->getX1Maximum();
-      x2m  = (float)this->getX2Centroid();
-      x3m  = (float)this->getX3Centroid();
-   }
-   else if( this->isParallelToX2Axis() )
-   {
-      x1ma = (float)this->getX2Minimum();
-      x1mb = (float)this->getX2Maximum();
-      x2m  = (float)this->getX1Centroid();
-      x3m  = (float)this->getX3Centroid();
-   }
-   else if( this->isParallelToX3Axis() )
-   {
-      x1ma = (float)this->getX3Minimum();
-      x1mb = (float)this->getX3Maximum();
-      x2m  = (float)this->getX2Centroid();
-      x3m  = (float)this->getX1Centroid();
-   }
-   else throw UbException(UB_EXARGS,"cylinder not axis prallel");
-
-   int segmentsCircle  = 20;
-   double deltaPhi = UbMath::PI/(double)segmentsCircle;
-
-   double phiX1a,phiX1b;
-   float x1a,x2a,x3a,x1b,x2b,x3b,x1c,x2c,x3c,x1d,x2d,x3d;
-
-   double dXCylinder =  fabs((x1mb-x1ma))/(double)segmentsCircle;
-   int segmentsCylinder = (int)(fabs(x1mb-x1ma)/dXCylinder);
-   int nodenr = 0;
-   for(int segCyl = 0; segCyl<segmentsCylinder; segCyl++)
-   {
-      x1a = x1d = (float)(x1ma+segCyl*dXCylinder);
-      x1b = x1c = (float)(x1a+dXCylinder);
-
-      for(phiX1a=2.0*UbMath::PI; phiX1a>0; phiX1a-=deltaPhi)
-      {
-         phiX1b = phiX1a+deltaPhi;
-
-         x2a =  (float)(x2m+mRad*std::sin(phiX1a));
-         x3a =  (float)(x3m+mRad*std::cos(phiX1a));
-         x2b =  (float)(x2m+mRad*std::sin(phiX1b));
-         x3b =  (float)(x3m+mRad*std::cos(phiX1b));
-
-         if( this->isParallelToX1Axis() )
-         {
-            nodes.push_back( makeUbTuple(x1b,x2b,x3b) ); nodes.push_back( makeUbTuple(x1b,x2a,x3a) ); nodes.push_back( makeUbTuple(x1a,x2a,x3a) );
-            nodes.push_back( makeUbTuple(x1a,x2a,x3a) ); nodes.push_back( makeUbTuple(x1a,x2b,x3b) ); nodes.push_back( makeUbTuple(x1b,x2b,x3b) );
-         }
-         else if( this->isParallelToX2Axis() )
-         {
-            nodes.push_back( makeUbTuple(x2b,x1b,x3b) ); nodes.push_back( makeUbTuple(x2a,x1b,x3a) ); nodes.push_back( makeUbTuple(x2a,x1a,x3a) );
-            nodes.push_back( makeUbTuple(x2a,x1a,x3a) ); nodes.push_back( makeUbTuple(x2b,x1a,x3b) ); nodes.push_back( makeUbTuple(x2b,x1b,x3b) );
-         }
-         else if( this->isParallelToX3Axis() )
-         {
-            nodes.push_back( makeUbTuple(x3b,x2b,x1b) ); nodes.push_back( makeUbTuple(x3a,x2a,x1b) ); nodes.push_back( makeUbTuple(x3a,x2a,x1a) );
-            nodes.push_back( makeUbTuple(x3a,x2a,x1a) ); nodes.push_back( makeUbTuple(x3b,x2b,x1a) ); nodes.push_back( makeUbTuple(x3b,x2b,x1b) );
-         }
-         triangles.push_back( makeUbTuple(nodenr  , nodenr+1, nodenr+2) );  nodenr+=3;
-         triangles.push_back( makeUbTuple(nodenr  , nodenr+1, nodenr+2) );  nodenr+=3;
-      }
-   }
-
-   int segmentsSide = (int)(mRad/dXCylinder);
-   double radius0, radius1;
-   for(int segCyl = 0; segCyl<segmentsSide; segCyl++)
-   {
-      radius0 = segCyl*dXCylinder;
-      radius1 = radius0+dXCylinder;
-      if(segCyl==segmentsSide-1) radius1=mRad;
-
-      for(phiX1a=2.0*UbMath::PI; phiX1a>0; phiX1a-=deltaPhi)
-      {
-         phiX1b = phiX1a+deltaPhi;
-
-         x2a = x2m+(float)(radius0*std::sin(phiX1a));
-         x3a = x3m+(float)(radius0*std::cos(phiX1a));
-         x2b = x2m+(float)(radius0*std::sin(phiX1b));
-         x3b = x3m+(float)(radius0*std::cos(phiX1b));
-         x2c = x2m+(float)(radius1*std::sin(phiX1b));
-         x3c = x3m+(float)(radius1*std::cos(phiX1b));
-         x2d = x2m+(float)(radius1*std::sin(phiX1a));
-         x3d = x3m+(float)(radius1*std::cos(phiX1a));
-
-         if( this->isParallelToX1Axis() )
-         {
-            nodes.push_back( makeUbTuple(x1ma,x2a,x3a) ); nodes.push_back( makeUbTuple(x1ma,x2b,x3b) ); nodes.push_back( makeUbTuple(x1ma,x2c,x3c) );
-            nodes.push_back( makeUbTuple(x1ma,x2c,x3c) ); nodes.push_back( makeUbTuple(x1ma,x2d,x3d) ); nodes.push_back( makeUbTuple(x1ma,x2a,x3a) );
-            nodes.push_back( makeUbTuple(x1mb,x2c,x3c) ); nodes.push_back( makeUbTuple(x1mb,x2b,x3b) ); nodes.push_back( makeUbTuple(x1mb,x2a,x3a) );
-            nodes.push_back( makeUbTuple(x1mb,x2a,x3a) ); nodes.push_back( makeUbTuple(x1mb,x2d,x3d) ); nodes.push_back( makeUbTuple(x1mb,x2c,x3c) );
-         }
-         else if( this->isParallelToX2Axis() )
-         {
-            nodes.push_back( makeUbTuple(x2a,x1ma,x3a) ); nodes.push_back( makeUbTuple(x2b,x1ma,x3b) ); nodes.push_back( makeUbTuple(x2c,x1ma,x3c) );
-            nodes.push_back( makeUbTuple(x2c,x1ma,x3c) ); nodes.push_back( makeUbTuple(x2d,x1ma,x3d) ); nodes.push_back( makeUbTuple(x2a,x1ma,x3a) );
-            nodes.push_back( makeUbTuple(x2c,x1mb,x3c) ); nodes.push_back( makeUbTuple(x2b,x1mb,x3b) ); nodes.push_back( makeUbTuple(x2a,x1mb,x3a) );
-            nodes.push_back( makeUbTuple(x2a,x1mb,x3a) ); nodes.push_back( makeUbTuple(x2d,x1mb,x3d) ); nodes.push_back( makeUbTuple(x2c,x1mb,x3c) );
-         }
-         else if( this->isParallelToX3Axis() )
-         {
-            nodes.push_back( makeUbTuple(x3a,x2a,x1ma) ); nodes.push_back( makeUbTuple(x3b,x2b,x1ma) ); nodes.push_back( makeUbTuple(x3c,x2c,x1ma) );
-            nodes.push_back( makeUbTuple(x3c,x2c,x1ma) ); nodes.push_back( makeUbTuple(x3d,x2d,x1ma) ); nodes.push_back( makeUbTuple(x3a,x2a,x1ma) );
-            nodes.push_back( makeUbTuple(x3c,x2c,x1mb) ); nodes.push_back( makeUbTuple(x3b,x2b,x1mb) ); nodes.push_back( makeUbTuple(x3a,x2a,x1mb) );
-            nodes.push_back( makeUbTuple(x3a,x2a,x1mb) ); nodes.push_back( makeUbTuple(x3d,x2d,x1mb) ); nodes.push_back( makeUbTuple(x3c,x2c,x1mb) );
-         }
-
-         triangles.push_back( makeUbTuple(nodenr  , nodenr+1, nodenr+2) );  nodenr+=3;
-         triangles.push_back( makeUbTuple(nodenr  , nodenr+1, nodenr+2) );  nodenr+=3;
-         triangles.push_back( makeUbTuple(nodenr  , nodenr+1, nodenr+2) );  nodenr+=3;
-         triangles.push_back( makeUbTuple(nodenr  , nodenr+1, nodenr+2) );  nodenr+=3;
-      }
-   }
+    float x1ma, x1mb, x2m, x3m;
+    if (this->isParallelToX1Axis()) {
+        x1ma = (float)this->getX1Minimum();
+        x1mb = (float)this->getX1Maximum();
+        x2m  = (float)this->getX2Centroid();
+        x3m  = (float)this->getX3Centroid();
+    } else if (this->isParallelToX2Axis()) {
+        x1ma = (float)this->getX2Minimum();
+        x1mb = (float)this->getX2Maximum();
+        x2m  = (float)this->getX1Centroid();
+        x3m  = (float)this->getX3Centroid();
+    } else if (this->isParallelToX3Axis()) {
+        x1ma = (float)this->getX3Minimum();
+        x1mb = (float)this->getX3Maximum();
+        x2m  = (float)this->getX2Centroid();
+        x3m  = (float)this->getX1Centroid();
+    } else
+        throw UbException(UB_EXARGS, "cylinder not axis prallel");
+
+    int segmentsCircle = 20;
+    double deltaPhi    = UbMath::PI / (double)segmentsCircle;
+
+    double phiX1a, phiX1b;
+    float x1a, x2a, x3a, x1b, x2b, x3b, x1c, x2c, x3c, x1d, x2d, x3d;
+
+    double dXCylinder    = fabs((x1mb - x1ma)) / (double)segmentsCircle;
+    int segmentsCylinder = (int)(fabs(x1mb - x1ma) / dXCylinder);
+    int nodenr           = 0;
+    for (int segCyl = 0; segCyl < segmentsCylinder; segCyl++) {
+        x1a = x1d = (float)(x1ma + segCyl * dXCylinder);
+        x1b = x1c = (float)(x1a + dXCylinder);
+
+        for (phiX1a = 2.0 * UbMath::PI; phiX1a > 0; phiX1a -= deltaPhi) {
+            phiX1b = phiX1a + deltaPhi;
+
+            x2a = (float)(x2m + mRad * std::sin(phiX1a));
+            x3a = (float)(x3m + mRad * std::cos(phiX1a));
+            x2b = (float)(x2m + mRad * std::sin(phiX1b));
+            x3b = (float)(x3m + mRad * std::cos(phiX1b));
+
+            if (this->isParallelToX1Axis()) {
+                nodes.push_back(makeUbTuple(x1b, x2b, x3b));
+                nodes.push_back(makeUbTuple(x1b, x2a, x3a));
+                nodes.push_back(makeUbTuple(x1a, x2a, x3a));
+                nodes.push_back(makeUbTuple(x1a, x2a, x3a));
+                nodes.push_back(makeUbTuple(x1a, x2b, x3b));
+                nodes.push_back(makeUbTuple(x1b, x2b, x3b));
+            } else if (this->isParallelToX2Axis()) {
+                nodes.push_back(makeUbTuple(x2b, x1b, x3b));
+                nodes.push_back(makeUbTuple(x2a, x1b, x3a));
+                nodes.push_back(makeUbTuple(x2a, x1a, x3a));
+                nodes.push_back(makeUbTuple(x2a, x1a, x3a));
+                nodes.push_back(makeUbTuple(x2b, x1a, x3b));
+                nodes.push_back(makeUbTuple(x2b, x1b, x3b));
+            } else if (this->isParallelToX3Axis()) {
+                nodes.push_back(makeUbTuple(x3b, x2b, x1b));
+                nodes.push_back(makeUbTuple(x3a, x2a, x1b));
+                nodes.push_back(makeUbTuple(x3a, x2a, x1a));
+                nodes.push_back(makeUbTuple(x3a, x2a, x1a));
+                nodes.push_back(makeUbTuple(x3b, x2b, x1a));
+                nodes.push_back(makeUbTuple(x3b, x2b, x1b));
+            }
+            triangles.push_back(makeUbTuple(nodenr, nodenr + 1, nodenr + 2));
+            nodenr += 3;
+            triangles.push_back(makeUbTuple(nodenr, nodenr + 1, nodenr + 2));
+            nodenr += 3;
+        }
+    }
+
+    int segmentsSide = (int)(mRad / dXCylinder);
+    double radius0, radius1;
+    for (int segCyl = 0; segCyl < segmentsSide; segCyl++) {
+        radius0 = segCyl * dXCylinder;
+        radius1 = radius0 + dXCylinder;
+        if (segCyl == segmentsSide - 1)
+            radius1 = mRad;
+
+        for (phiX1a = 2.0 * UbMath::PI; phiX1a > 0; phiX1a -= deltaPhi) {
+            phiX1b = phiX1a + deltaPhi;
+
+            x2a = x2m + (float)(radius0 * std::sin(phiX1a));
+            x3a = x3m + (float)(radius0 * std::cos(phiX1a));
+            x2b = x2m + (float)(radius0 * std::sin(phiX1b));
+            x3b = x3m + (float)(radius0 * std::cos(phiX1b));
+            x2c = x2m + (float)(radius1 * std::sin(phiX1b));
+            x3c = x3m + (float)(radius1 * std::cos(phiX1b));
+            x2d = x2m + (float)(radius1 * std::sin(phiX1a));
+            x3d = x3m + (float)(radius1 * std::cos(phiX1a));
+
+            if (this->isParallelToX1Axis()) {
+                nodes.push_back(makeUbTuple(x1ma, x2a, x3a));
+                nodes.push_back(makeUbTuple(x1ma, x2b, x3b));
+                nodes.push_back(makeUbTuple(x1ma, x2c, x3c));
+                nodes.push_back(makeUbTuple(x1ma, x2c, x3c));
+                nodes.push_back(makeUbTuple(x1ma, x2d, x3d));
+                nodes.push_back(makeUbTuple(x1ma, x2a, x3a));
+                nodes.push_back(makeUbTuple(x1mb, x2c, x3c));
+                nodes.push_back(makeUbTuple(x1mb, x2b, x3b));
+                nodes.push_back(makeUbTuple(x1mb, x2a, x3a));
+                nodes.push_back(makeUbTuple(x1mb, x2a, x3a));
+                nodes.push_back(makeUbTuple(x1mb, x2d, x3d));
+                nodes.push_back(makeUbTuple(x1mb, x2c, x3c));
+            } else if (this->isParallelToX2Axis()) {
+                nodes.push_back(makeUbTuple(x2a, x1ma, x3a));
+                nodes.push_back(makeUbTuple(x2b, x1ma, x3b));
+                nodes.push_back(makeUbTuple(x2c, x1ma, x3c));
+                nodes.push_back(makeUbTuple(x2c, x1ma, x3c));
+                nodes.push_back(makeUbTuple(x2d, x1ma, x3d));
+                nodes.push_back(makeUbTuple(x2a, x1ma, x3a));
+                nodes.push_back(makeUbTuple(x2c, x1mb, x3c));
+                nodes.push_back(makeUbTuple(x2b, x1mb, x3b));
+                nodes.push_back(makeUbTuple(x2a, x1mb, x3a));
+                nodes.push_back(makeUbTuple(x2a, x1mb, x3a));
+                nodes.push_back(makeUbTuple(x2d, x1mb, x3d));
+                nodes.push_back(makeUbTuple(x2c, x1mb, x3c));
+            } else if (this->isParallelToX3Axis()) {
+                nodes.push_back(makeUbTuple(x3a, x2a, x1ma));
+                nodes.push_back(makeUbTuple(x3b, x2b, x1ma));
+                nodes.push_back(makeUbTuple(x3c, x2c, x1ma));
+                nodes.push_back(makeUbTuple(x3c, x2c, x1ma));
+                nodes.push_back(makeUbTuple(x3d, x2d, x1ma));
+                nodes.push_back(makeUbTuple(x3a, x2a, x1ma));
+                nodes.push_back(makeUbTuple(x3c, x2c, x1mb));
+                nodes.push_back(makeUbTuple(x3b, x2b, x1mb));
+                nodes.push_back(makeUbTuple(x3a, x2a, x1mb));
+                nodes.push_back(makeUbTuple(x3a, x2a, x1mb));
+                nodes.push_back(makeUbTuple(x3d, x2d, x1mb));
+                nodes.push_back(makeUbTuple(x3c, x2c, x1mb));
+            }
+
+            triangles.push_back(makeUbTuple(nodenr, nodenr + 1, nodenr + 2));
+            nodenr += 3;
+            triangles.push_back(makeUbTuple(nodenr, nodenr + 1, nodenr + 2));
+            nodenr += 3;
+            triangles.push_back(makeUbTuple(nodenr, nodenr + 1, nodenr + 2));
+            nodenr += 3;
+            triangles.push_back(makeUbTuple(nodenr, nodenr + 1, nodenr + 2));
+            nodenr += 3;
+        }
+    }
 }
 /*==========================================================*/
-void GbCylinder3D::addSurfaceTriangleSetSegments(vector<UbTupleFloat3>& nodes, vector<UbTupleInt3>& triangles, int segmentsRound, int segmentsHeight )
+void GbCylinder3D::addSurfaceTriangleSetSegments(vector<UbTupleFloat3> &nodes, vector<UbTupleInt3> &triangles,
+                                                 int segmentsRound, int segmentsHeight)
 {
-   float x1ma,x1mb,x2m,x3m;
-   if( this->isParallelToX1Axis() )
-   {
-      x1ma = (float)this->getX1Minimum();
-      x1mb = (float)this->getX1Maximum();
-      x2m  = (float)this->getX2Centroid();
-      x3m  = (float)this->getX3Centroid();
-   }
-   else if( this->isParallelToX2Axis() )
-   {
-      x1ma = (float)this->getX2Minimum();
-      x1mb = (float)this->getX2Maximum();
-      x2m  = (float)this->getX1Centroid();
-      x3m  = (float)this->getX3Centroid();
-   }
-   else if( this->isParallelToX3Axis() )
-   {
-      x1ma = (float)this->getX3Minimum();
-      x1mb = (float)this->getX3Maximum();
-      x2m  = (float)this->getX2Centroid();
-      x3m  = (float)this->getX1Centroid();
-   }
-   else throw UbException(UB_EXARGS,"cylinder not axis prallel");
-
-   int segmentsCircle  = segmentsRound;
-   double deltaPhi = UbMath::PI/(double)segmentsCircle;
-
-   double phiX1a,phiX1b;
-   float x1a,x2a,x3a,x1b,x2b,x3b,x1c,x2c,x3c,x1d,x2d,x3d;
-
-   double dXCylinder =  fabs((x1mb-x1ma))/(double)segmentsHeight; //hier evtl. segmentsheight
-   int segmentsCylinder = (int)(fabs(x1mb-x1ma)/dXCylinder);
-   int nodenr = 0;
-   for(int segCyl = 0; segCyl<segmentsCylinder; segCyl++)
-   {
-      x1a = x1d = (float)(x1ma+segCyl*dXCylinder);
-      x1b = x1c = (float)(x1a+dXCylinder);
-
-      //for(phiX1a=2.0*UbMath::PI; phiX1a>0.0; phiX1a-=deltaPhi)
-      for(phiX1a=0.0; phiX1a<2.0*UbMath::PI-0.5*deltaPhi; phiX1a+=deltaPhi)
-      {
-         phiX1b = phiX1a+deltaPhi;
-
-         x2a =  (float)(x2m+mRad*std::sin(phiX1a));
-         x3a =  (float)(x3m+mRad*std::cos(phiX1a));
-         x2b =  (float)(x2m+mRad*std::sin(phiX1b));
-         x3b =  (float)(x3m+mRad*std::cos(phiX1b));
-
-         if( this->isParallelToX1Axis() )
-         {
-            nodes.push_back( makeUbTuple(x1b,x2b,x3b) ); nodes.push_back( makeUbTuple(x1b,x2a,x3a) ); nodes.push_back( makeUbTuple(x1a,x2a,x3a) );
-            nodes.push_back( makeUbTuple(x1a,x2a,x3a) ); nodes.push_back( makeUbTuple(x1a,x2b,x3b) ); nodes.push_back( makeUbTuple(x1b,x2b,x3b) );
-         }
-         else if( this->isParallelToX2Axis() )
-         {
-            nodes.push_back( makeUbTuple(x2b,x1b,x3b) ); nodes.push_back( makeUbTuple(x2a,x1b,x3a) ); nodes.push_back( makeUbTuple(x2a,x1a,x3a) );
-            nodes.push_back( makeUbTuple(x2a,x1a,x3a) ); nodes.push_back( makeUbTuple(x2b,x1a,x3b) ); nodes.push_back( makeUbTuple(x2b,x1b,x3b) );
-         }
-         else if( this->isParallelToX3Axis() )
-         {
-            nodes.push_back( makeUbTuple(x3b,x2b,x1b) ); nodes.push_back( makeUbTuple(x3a,x2a,x1b) ); nodes.push_back( makeUbTuple(x3a,x2a,x1a) );
-            nodes.push_back( makeUbTuple(x3a,x2a,x1a) ); nodes.push_back( makeUbTuple(x3b,x2b,x1a) ); nodes.push_back( makeUbTuple(x3b,x2b,x1b) );
-         }
-         triangles.push_back( makeUbTuple(nodenr  , nodenr+1, nodenr+2) );  nodenr+=3;
-         triangles.push_back( makeUbTuple(nodenr  , nodenr+1, nodenr+2) );  nodenr+=3;
-      }
-   }
-
-   int segmentsSide = (int)(mRad/dXCylinder);
-   double radius0, radius1;
-   for(int segCyl = 0; segCyl<segmentsSide; segCyl++)
-   {
-      radius0 = segCyl*dXCylinder;
-      radius1 = radius0+dXCylinder;
-      if(segCyl==segmentsSide-1) radius1=mRad;
-
-      //for(phiX1a=2.0*UbMath::PI; phiX1a>0.0; phiX1a-=deltaPhi)
-      for(phiX1a=0.0; phiX1a<2.0*UbMath::PI-0.5*deltaPhi; phiX1a+=deltaPhi)
-      {
-         phiX1b = phiX1a+deltaPhi;
-
-         x2a = x2m+(float)(radius0*std::sin(phiX1a));
-         x3a = x3m+(float)(radius0*std::cos(phiX1a));
-         x2b = x2m+(float)(radius0*std::sin(phiX1b));
-         x3b = x3m+(float)(radius0*std::cos(phiX1b));
-         x2c = x2m+(float)(radius1*std::sin(phiX1b));
-         x3c = x3m+(float)(radius1*std::cos(phiX1b));
-         x2d = x2m+(float)(radius1*std::sin(phiX1a));
-         x3d = x3m+(float)(radius1*std::cos(phiX1a));
-
-         if( this->isParallelToX1Axis() )
-         {
-            nodes.push_back( makeUbTuple(x1ma,x2a,x3a) ); nodes.push_back( makeUbTuple(x1ma,x2b,x3b) ); nodes.push_back( makeUbTuple(x1ma,x2c,x3c) );
-            nodes.push_back( makeUbTuple(x1ma,x2c,x3c) ); nodes.push_back( makeUbTuple(x1ma,x2d,x3d) ); nodes.push_back( makeUbTuple(x1ma,x2a,x3a) );
-            nodes.push_back( makeUbTuple(x1mb,x2c,x3c) ); nodes.push_back( makeUbTuple(x1mb,x2b,x3b) ); nodes.push_back( makeUbTuple(x1mb,x2a,x3a) );
-            nodes.push_back( makeUbTuple(x1mb,x2a,x3a) ); nodes.push_back( makeUbTuple(x1mb,x2d,x3d) ); nodes.push_back( makeUbTuple(x1mb,x2c,x3c) );
-         }
-         else if( this->isParallelToX2Axis() )
-         {
-            nodes.push_back( makeUbTuple(x2a,x1ma,x3a) ); nodes.push_back( makeUbTuple(x2b,x1ma,x3b) ); nodes.push_back( makeUbTuple(x2c,x1ma,x3c) );
-            nodes.push_back( makeUbTuple(x2c,x1ma,x3c) ); nodes.push_back( makeUbTuple(x2d,x1ma,x3d) ); nodes.push_back( makeUbTuple(x2a,x1ma,x3a) );
-            nodes.push_back( makeUbTuple(x2c,x1mb,x3c) ); nodes.push_back( makeUbTuple(x2b,x1mb,x3b) ); nodes.push_back( makeUbTuple(x2a,x1mb,x3a) );
-            nodes.push_back( makeUbTuple(x2a,x1mb,x3a) ); nodes.push_back( makeUbTuple(x2d,x1mb,x3d) ); nodes.push_back( makeUbTuple(x2c,x1mb,x3c) );
-         }
-         else if( this->isParallelToX3Axis() )
-         {
-            nodes.push_back( makeUbTuple(x3a,x2a,x1ma) ); nodes.push_back( makeUbTuple(x3b,x2b,x1ma) ); nodes.push_back( makeUbTuple(x3c,x2c,x1ma) );
-            nodes.push_back( makeUbTuple(x3c,x2c,x1ma) ); nodes.push_back( makeUbTuple(x3d,x2d,x1ma) ); nodes.push_back( makeUbTuple(x3a,x2a,x1ma) );
-            nodes.push_back( makeUbTuple(x3c,x2c,x1mb) ); nodes.push_back( makeUbTuple(x3b,x2b,x1mb) ); nodes.push_back( makeUbTuple(x3a,x2a,x1mb) );
-            nodes.push_back( makeUbTuple(x3a,x2a,x1mb) ); nodes.push_back( makeUbTuple(x3d,x2d,x1mb) ); nodes.push_back( makeUbTuple(x3c,x2c,x1mb) );
-         }
-
-         triangles.push_back( makeUbTuple(nodenr  , nodenr+1, nodenr+2) );  nodenr+=3;
-         triangles.push_back( makeUbTuple(nodenr  , nodenr+1, nodenr+2) );  nodenr+=3;
-         triangles.push_back( makeUbTuple(nodenr  , nodenr+1, nodenr+2) );  nodenr+=3;
-         triangles.push_back( makeUbTuple(nodenr  , nodenr+1, nodenr+2) );  nodenr+=3;
-      }
-   }
+    float x1ma, x1mb, x2m, x3m;
+    if (this->isParallelToX1Axis()) {
+        x1ma = (float)this->getX1Minimum();
+        x1mb = (float)this->getX1Maximum();
+        x2m  = (float)this->getX2Centroid();
+        x3m  = (float)this->getX3Centroid();
+    } else if (this->isParallelToX2Axis()) {
+        x1ma = (float)this->getX2Minimum();
+        x1mb = (float)this->getX2Maximum();
+        x2m  = (float)this->getX1Centroid();
+        x3m  = (float)this->getX3Centroid();
+    } else if (this->isParallelToX3Axis()) {
+        x1ma = (float)this->getX3Minimum();
+        x1mb = (float)this->getX3Maximum();
+        x2m  = (float)this->getX2Centroid();
+        x3m  = (float)this->getX1Centroid();
+    } else
+        throw UbException(UB_EXARGS, "cylinder not axis prallel");
+
+    int segmentsCircle = segmentsRound;
+    double deltaPhi    = UbMath::PI / (double)segmentsCircle;
+
+    double phiX1a, phiX1b;
+    float x1a, x2a, x3a, x1b, x2b, x3b, x1c, x2c, x3c, x1d, x2d, x3d;
+
+    double dXCylinder = fabs((x1mb - x1ma)) / (double)segmentsHeight; // hier evtl. segmentsheight
+    int segmentsCylinder = (int)(fabs(x1mb - x1ma) / dXCylinder);
+    int nodenr           = 0;
+    for (int segCyl = 0; segCyl < segmentsCylinder; segCyl++) {
+        x1a = x1d = (float)(x1ma + segCyl * dXCylinder);
+        x1b = x1c = (float)(x1a + dXCylinder);
+
+        // for(phiX1a=2.0*UbMath::PI; phiX1a>0.0; phiX1a-=deltaPhi)
+        for (phiX1a = 0.0; phiX1a < 2.0 * UbMath::PI - 0.5 * deltaPhi; phiX1a += deltaPhi) {
+            phiX1b = phiX1a + deltaPhi;
+
+            x2a = (float)(x2m + mRad * std::sin(phiX1a));
+            x3a = (float)(x3m + mRad * std::cos(phiX1a));
+            x2b = (float)(x2m + mRad * std::sin(phiX1b));
+            x3b = (float)(x3m + mRad * std::cos(phiX1b));
+
+            if (this->isParallelToX1Axis()) {
+                nodes.push_back(makeUbTuple(x1b, x2b, x3b));
+                nodes.push_back(makeUbTuple(x1b, x2a, x3a));
+                nodes.push_back(makeUbTuple(x1a, x2a, x3a));
+                nodes.push_back(makeUbTuple(x1a, x2a, x3a));
+                nodes.push_back(makeUbTuple(x1a, x2b, x3b));
+                nodes.push_back(makeUbTuple(x1b, x2b, x3b));
+            } else if (this->isParallelToX2Axis()) {
+                nodes.push_back(makeUbTuple(x2b, x1b, x3b));
+                nodes.push_back(makeUbTuple(x2a, x1b, x3a));
+                nodes.push_back(makeUbTuple(x2a, x1a, x3a));
+                nodes.push_back(makeUbTuple(x2a, x1a, x3a));
+                nodes.push_back(makeUbTuple(x2b, x1a, x3b));
+                nodes.push_back(makeUbTuple(x2b, x1b, x3b));
+            } else if (this->isParallelToX3Axis()) {
+                nodes.push_back(makeUbTuple(x3b, x2b, x1b));
+                nodes.push_back(makeUbTuple(x3a, x2a, x1b));
+                nodes.push_back(makeUbTuple(x3a, x2a, x1a));
+                nodes.push_back(makeUbTuple(x3a, x2a, x1a));
+                nodes.push_back(makeUbTuple(x3b, x2b, x1a));
+                nodes.push_back(makeUbTuple(x3b, x2b, x1b));
+            }
+            triangles.push_back(makeUbTuple(nodenr, nodenr + 1, nodenr + 2));
+            nodenr += 3;
+            triangles.push_back(makeUbTuple(nodenr, nodenr + 1, nodenr + 2));
+            nodenr += 3;
+        }
+    }
+
+    int segmentsSide = (int)(mRad / dXCylinder);
+    double radius0, radius1;
+    for (int segCyl = 0; segCyl < segmentsSide; segCyl++) {
+        radius0 = segCyl * dXCylinder;
+        radius1 = radius0 + dXCylinder;
+        if (segCyl == segmentsSide - 1)
+            radius1 = mRad;
+
+        // for(phiX1a=2.0*UbMath::PI; phiX1a>0.0; phiX1a-=deltaPhi)
+        for (phiX1a = 0.0; phiX1a < 2.0 * UbMath::PI - 0.5 * deltaPhi; phiX1a += deltaPhi) {
+            phiX1b = phiX1a + deltaPhi;
+
+            x2a = x2m + (float)(radius0 * std::sin(phiX1a));
+            x3a = x3m + (float)(radius0 * std::cos(phiX1a));
+            x2b = x2m + (float)(radius0 * std::sin(phiX1b));
+            x3b = x3m + (float)(radius0 * std::cos(phiX1b));
+            x2c = x2m + (float)(radius1 * std::sin(phiX1b));
+            x3c = x3m + (float)(radius1 * std::cos(phiX1b));
+            x2d = x2m + (float)(radius1 * std::sin(phiX1a));
+            x3d = x3m + (float)(radius1 * std::cos(phiX1a));
+
+            if (this->isParallelToX1Axis()) {
+                nodes.push_back(makeUbTuple(x1ma, x2a, x3a));
+                nodes.push_back(makeUbTuple(x1ma, x2b, x3b));
+                nodes.push_back(makeUbTuple(x1ma, x2c, x3c));
+                nodes.push_back(makeUbTuple(x1ma, x2c, x3c));
+                nodes.push_back(makeUbTuple(x1ma, x2d, x3d));
+                nodes.push_back(makeUbTuple(x1ma, x2a, x3a));
+                nodes.push_back(makeUbTuple(x1mb, x2c, x3c));
+                nodes.push_back(makeUbTuple(x1mb, x2b, x3b));
+                nodes.push_back(makeUbTuple(x1mb, x2a, x3a));
+                nodes.push_back(makeUbTuple(x1mb, x2a, x3a));
+                nodes.push_back(makeUbTuple(x1mb, x2d, x3d));
+                nodes.push_back(makeUbTuple(x1mb, x2c, x3c));
+            } else if (this->isParallelToX2Axis()) {
+                nodes.push_back(makeUbTuple(x2a, x1ma, x3a));
+                nodes.push_back(makeUbTuple(x2b, x1ma, x3b));
+                nodes.push_back(makeUbTuple(x2c, x1ma, x3c));
+                nodes.push_back(makeUbTuple(x2c, x1ma, x3c));
+                nodes.push_back(makeUbTuple(x2d, x1ma, x3d));
+                nodes.push_back(makeUbTuple(x2a, x1ma, x3a));
+                nodes.push_back(makeUbTuple(x2c, x1mb, x3c));
+                nodes.push_back(makeUbTuple(x2b, x1mb, x3b));
+                nodes.push_back(makeUbTuple(x2a, x1mb, x3a));
+                nodes.push_back(makeUbTuple(x2a, x1mb, x3a));
+                nodes.push_back(makeUbTuple(x2d, x1mb, x3d));
+                nodes.push_back(makeUbTuple(x2c, x1mb, x3c));
+            } else if (this->isParallelToX3Axis()) {
+                nodes.push_back(makeUbTuple(x3a, x2a, x1ma));
+                nodes.push_back(makeUbTuple(x3b, x2b, x1ma));
+                nodes.push_back(makeUbTuple(x3c, x2c, x1ma));
+                nodes.push_back(makeUbTuple(x3c, x2c, x1ma));
+                nodes.push_back(makeUbTuple(x3d, x2d, x1ma));
+                nodes.push_back(makeUbTuple(x3a, x2a, x1ma));
+                nodes.push_back(makeUbTuple(x3c, x2c, x1mb));
+                nodes.push_back(makeUbTuple(x3b, x2b, x1mb));
+                nodes.push_back(makeUbTuple(x3a, x2a, x1mb));
+                nodes.push_back(makeUbTuple(x3a, x2a, x1mb));
+                nodes.push_back(makeUbTuple(x3d, x2d, x1mb));
+                nodes.push_back(makeUbTuple(x3c, x2c, x1mb));
+            }
+
+            triangles.push_back(makeUbTuple(nodenr, nodenr + 1, nodenr + 2));
+            nodenr += 3;
+            triangles.push_back(makeUbTuple(nodenr, nodenr + 1, nodenr + 2));
+            nodenr += 3;
+            triangles.push_back(makeUbTuple(nodenr, nodenr + 1, nodenr + 2));
+            nodenr += 3;
+            triangles.push_back(makeUbTuple(nodenr, nodenr + 1, nodenr + 2));
+            nodenr += 3;
+        }
+    }
 }
 
 /*==========================================================*/
-void GbCylinder3D::objectChanged(UbObservable* changedObject)
+void GbCylinder3D::objectChanged(UbObservable *changedObject)
 {
-   GbLine3D* line = dynamic_cast<GbLine3D*>(changedObject);
-   if(!line || this->mLine!=line) return;
+    GbLine3D *line = dynamic_cast<GbLine3D *>(changedObject);
+    if (!line || this->mLine != line)
+        return;
 
-   this->notifyObserversObjectChanged();
+    this->notifyObserversObjectChanged();
 }
 /*==========================================================*/
-void GbCylinder3D::objectWillBeDeleted(UbObservable* objectForDeletion)
+void GbCylinder3D::objectWillBeDeleted(UbObservable *objectForDeletion)
 {
-   if(this->mLine)
-   {
-      UbObservable* observedObj = dynamic_cast<UbObservable*>(this->mLine);
-      if(objectForDeletion == observedObj) { this->mLine = NULL; }
-   }
+    if (this->mLine) {
+        UbObservable *observedObj = dynamic_cast<UbObservable *>(this->mLine);
+        if (objectForDeletion == observedObj) {
+            this->mLine = NULL;
+        }
+    }
 }
 /*=======================================================*/
-void GbCylinder3D::scale(const double& sx1, const double& sx2, const double& sx3)
+void GbCylinder3D::scale(const double &sx1, const double &sx2, const double &sx3)
 {
-   if( this->isParallelToX1Axis() )
-   {
-      if(!UbMath::equal(sx2,sx3)) throw UbException(UB_EXARGS,"|| to x1 -> different scaling sx2 and sx3 not possible");
-      this->mRad*=sx2;
-   }
-   else if( this->isParallelToX2Axis() )
-   {
-      if(!UbMath::equal(sx1,sx3)) throw UbException(UB_EXARGS,"|| to x2 -> different scaling sx1 and sx3 not possible");
-      this->mRad*=sx1;
-   }
-   else if( this->isParallelToX3Axis() )
-   {
-      if(!UbMath::equal(sx1,sx2)) throw UbException(UB_EXARGS,"|| to x3 -> different scaling sx1 and sx2 not possible");
-      this->mRad*=sx1;
-   }
-   else throw UbException(UB_EXARGS,"unknown direction");
-
-   this->mLine->scale(sx1,sx2,sx3);
-   //notify observer wird automatisch aufgerufen
+    if (this->isParallelToX1Axis()) {
+        if (!UbMath::equal(sx2, sx3))
+            throw UbException(UB_EXARGS, "|| to x1 -> different scaling sx2 and sx3 not possible");
+        this->mRad *= sx2;
+    } else if (this->isParallelToX2Axis()) {
+        if (!UbMath::equal(sx1, sx3))
+            throw UbException(UB_EXARGS, "|| to x2 -> different scaling sx1 and sx3 not possible");
+        this->mRad *= sx1;
+    } else if (this->isParallelToX3Axis()) {
+        if (!UbMath::equal(sx1, sx2))
+            throw UbException(UB_EXARGS, "|| to x3 -> different scaling sx1 and sx2 not possible");
+        this->mRad *= sx1;
+    } else
+        throw UbException(UB_EXARGS, "unknown direction");
+
+    this->mLine->scale(sx1, sx2, sx3);
+    // notify observer wird automatisch aufgerufen
 }
 
 /*==========================================================*/
-double GbCylinder3D::getIntersectionRaytraceFactor(const double& x1, const double& x2, const double& x3, const double& rx1, const double& rx2, const double& rx3)
+double GbCylinder3D::getIntersectionRaytraceFactor(const double &x1, const double &x2, const double &x3,
+                                                   const double &rx1, const double &rx2, const double &rx3)
 {
-   /*
-   Distance D of the intersection between a Ray((ox1,ox2,ox3),(dx1,dx2,dx3)) and a Plane P: ax+by+cz+d=0
-   dc = a*dx1 + b*dx2 + c*dx3
-   dw = a*ox1 + b*ox2 + c*ox3 + d
-   D =   - dw / dc
-   */
-   double px1, px2, px3;
-   double d = Ub::inf; // Distance to Min or Max Plane of the Zylinder
-                       // final distance should be less that d
-
-   if( this->isParallelToX1Axis() )
-   {
-      if     (UbMath::equal(x1 ,minX1) && UbMath::negative(rx1))    return -1.0;
-      else if(UbMath::equal(x1 ,maxX1) && UbMath::positive(rx1))    return -1.0;
-
-      //falls die Linie nicht parallel zu den Seitenflaechen ist
-      if( x1< minX1  ||  x1 > maxX1 ) //nur fuer punkte links und rechts des cylinders
-      {
-         px1 = (x1 < minX1 ? minX1 : maxX1);
-         //falls die Linie nicht parallel zu den Seitenflaechen ist
-         if( !UbMath::zero(rx1) )
-         {
-            // Plane a= 0, b= 1, c=0 d= -1*px2
-            d   = -1.0*(x1 - px1) / rx1;
-            px2 = x2 + d*rx2;
-            px3 = x3 + d*rx3;
-
-            if(UbMath::greater(mLine->getDistance(px1,px2,px3) , mRad))
-            {
-               if     (x1 < minX1 && rx1>0.0 ) d = Ub::inf;  //punkt liegt "links" vom cylinder und strahl hat evtl weiteren SP auf oberflaeche
-               else if(x1 > maxX1 && rx1<0.0 ) d = Ub::inf;
-               else return -1.0;
-            }
-            else return d;
-         }
-         else return -1.0;
-      }
-      else
-      {
-         //if     (UbMath::negative(rx1)) d = -1.0 * (x1 - minX1) / rx1;
-         //else if(UbMath::positive(rx1)) d = -1.0 * (x1 - maxX1) / rx1;
-         if     (UbMath::negative(rx1)) d = -1.0 * (x1 - maxX1) / rx1;
-         else if(UbMath::positive(rx1)) d = -1.0 * (x1 - minX1) / rx1;
-      }
-   }
-   else if( this->isParallelToX2Axis() )
-   {
-      if     (UbMath::equal(x2 ,minX2) && UbMath::negative(rx2))    return -1;
-      else if(UbMath::equal(x2 ,maxX2) && UbMath::positive(rx2))    return -1;
-
-      if( minX2 > x2  ||  x2 > maxX2 )
-      {
-         px2 = (x2 < minX2 ? minX2 : maxX2);
-         //falls die Linie nicht parallel zu den Seitenflaechen ist
-         if( !UbMath::zero(rx2) )
-         {
-            // Plane a= 0, b= 1, c=0 d= -1*px2
-            d   = -1*(x2 - px2) / rx2;
-            px1 = x1 + d*rx1;
-            px3 = x3 + d*rx3;
-
-            if (UbMath::greater(mLine->getDistance(px1,px2,px3) , mRad))
-            {
-               if     (x2 < minX2 && rx2>0.0 ) d = Ub::inf;  //punkt liegt "links oberhalb" vom cylinder und strahl mit pos x1 hat evtl weiteren SP auf oberflaeche
-               else if(x2 > maxX2 && rx2<0.0 ) d = Ub::inf;
-               else return -1.0;
-            }
-            else return d;
-         }
-         else return -1.0;
-      }
-      else
-      {
-         if     (UbMath::negative(rx2)) d = -1.0 * (x2 - minX2) / rx2;
-         else if(UbMath::positive(rx2)) d = -1.0 * (x2 - maxX2) / rx2;
-      }
-   }
-   else if( this->isParallelToX3Axis() )
-   {
-      if     (UbMath::equal(x3, minX3) && UbMath::negative(rx3)) return -1.0;
-      else if(UbMath::equal(x3, maxX3) && UbMath::positive(rx3)) return -1.0;
-
-      if(minX3 > x3  ||  x3 > maxX3 )
-      {
-         px3 = (x3 < minX3 ? minX3 : maxX3);
-         //falls die Linie nicht parallel zu den Seitenflaechen ist
-         if (!UbMath::zero(rx3))
-         {
-            // Plane a= 0, b= 0, c=1 d= -1*px3
-            d   = -1.0*(x3 - px3) / rx3;
-            px2 = x2 + d*rx2;
-            px1 = x1 + d*rx1;
-            if( UbMath::greater(mLine->getDistance(px1,px2,px3) , mRad) )
-            {
-               if     (x3 < minX3 && rx3>0.0 ) d = Ub::inf;
-               else if(x3 > maxX3 && rx3<0.0 ) d = Ub::inf;
-               else return -1.0;
-            }
-            else return d;
-         }
-         else return -1.0;
-      }
-      else
-      {
-         if     (UbMath::negative(rx3)) d = -1.0 * (x3 - minX3) / rx3;
-         else if(UbMath::positive(rx3)) d = -1.0 * (x3 - maxX3) / rx3;
-      }
-   }
-   else throw UbException(UB_EXARGS,"funzt nur bei achsen parallelem cylinder");
-   //////////////////////////////////////////////////////////////////////////
-   //Q berechnen fuer Infinity Zylinder
-   double axisX1 = mLine->getPoint2()->x1 - mLine->getPoint1()->x1;  /* Axis of the cylinder   */
-   double axisX2 = mLine->getPoint2()->x2 - mLine->getPoint1()->x2;  /* mit p1 als base of cylinder */
-   double axisX3 = mLine->getPoint2()->x3 - mLine->getPoint1()->x3;
-
-   //double dirlen = mLine->getLength();
-   //double abs, t, s;
-
-   double RCx1 = x1 - mLine->getPoint1()->x1;
-   double RCx2 = x2 - mLine->getPoint1()->x2;
-   double RCx3 = x3 - mLine->getPoint1()->x3;
-
-   //n = ray x axis
-   double nx1 = rx2*axisX3 - rx3*axisX2;
-   double nx2 = rx3*axisX1 - rx1*axisX3;
-   double nx3 = rx1*axisX2 - rx2*axisX1;
-   double nLength = nx1*nx1 + nx2*nx2 + nx3*nx3;
-
-   double abs;
-   if( UbMath::zero( nLength ) )
-   {  /* ray parallel to cyl  */
-      //abs = RC dot axis
-      double tmpabs = RCx1*axisX1 + RCx2*axisX2 + RCx3*axisX3;
-      double dx1 = RCx1 - tmpabs*axisX1;
-      double dx2 = RCx2 - tmpabs*axisX2;
-      double dx3 = RCx3 - tmpabs*axisX3;
-      if( UbMath::greater( dx1*dx1 + dx2*dx2 + dx3*dx3 , mRad*mRad) )
-         return -1.0;
-   }
-
-   //normalize "n"
-   nLength = std::sqrt(nLength);
-   double invnLength = 1.0/nLength;
-   nx1*=invnLength;
-   nx2*=invnLength;
-   nx3*=invnLength;
-
-   //shortest distance  = fabs( RC dot n )
-   abs = std::fabs( RCx1*nx1 + RCx2*nx2 + RCx3*nx3 );
-
-   if( UbMath::lessEqual(abs, mRad) )
-   {                    /* if ray hits cylinder */
-      //Ox1 = RC x axis
-      double Ox1 = RCx2*axisX3 - RCx3*axisX2;
-      double Ox2 = RCx3*axisX1 - RCx1*axisX3;
-      double Ox3 = RCx1*axisX2 - RCx2*axisX1;
-      //t = - O dot n / nLength;
-      double t = - (Ox1*nx1 + Ox2*nx2 + Ox3*nx3) / nLength;
-
-      //O = n x axis;
-      Ox1 = nx2*axisX3 - nx3*axisX2;
-      Ox2 = nx3*axisX1 - nx1*axisX3;
-      Ox3 = nx1*axisX2 - nx2*axisX1;
-
-      //normalize O
-      invnLength = 1.0/std::sqrt(Ox1*Ox1 + Ox2*Ox2 + Ox3*Ox3);
-      Ox1*=invnLength;
-      Ox2*=invnLength;
-      Ox3*=invnLength;
-
-      double s = std::fabs( sqrt(mRad*mRad - abs*abs) / (rx1*Ox1 + rx2*Ox2 + rx3*Ox3) );
-
-      //Wert a) t-s: entering distance
-      //     b) t+s: exiting  distance
-      //
-      // -> we only consider factors in ray-dir -> means positive values!
-      //    (s is always positive)
-
-      if(t>s)
-      {
-         return UbMath::min( t-s, d );
-      }
-      else if( (t+s) > 0 )
-      {
-         return UbMath::min( t+s, d );
-      }
-   }
-
-   return -1.0;
+    /*
+    Distance D of the intersection between a Ray((ox1,ox2,ox3),(dx1,dx2,dx3)) and a Plane P: ax+by+cz+d=0
+    dc = a*dx1 + b*dx2 + c*dx3
+    dw = a*ox1 + b*ox2 + c*ox3 + d
+    D =   - dw / dc
+    */
+    double px1, px2, px3;
+    double d = Ub::inf; // Distance to Min or Max Plane of the Zylinder
+                        // final distance should be less that d
+
+    if (this->isParallelToX1Axis()) {
+        if (UbMath::equal(x1, minX1) && UbMath::negative(rx1))
+            return -1.0;
+        else if (UbMath::equal(x1, maxX1) && UbMath::positive(rx1))
+            return -1.0;
+
+        // falls die Linie nicht parallel zu den Seitenflaechen ist
+        if (x1 < minX1 || x1 > maxX1) // nur fuer punkte links und rechts des cylinders
+        {
+            px1 = (x1 < minX1 ? minX1 : maxX1);
+            // falls die Linie nicht parallel zu den Seitenflaechen ist
+            if (!UbMath::zero(rx1)) {
+                // Plane a= 0, b= 1, c=0 d= -1*px2
+                d   = -1.0 * (x1 - px1) / rx1;
+                px2 = x2 + d * rx2;
+                px3 = x3 + d * rx3;
+
+                if (UbMath::greater(mLine->getDistance(px1, px2, px3), mRad)) {
+                    if (x1 < minX1 && rx1 > 0.0)
+                        d = Ub::inf; // punkt liegt "links" vom cylinder und strahl hat evtl weiteren SP auf oberflaeche
+                    else if (x1 > maxX1 && rx1 < 0.0)
+                        d = Ub::inf;
+                    else
+                        return -1.0;
+                } else
+                    return d;
+            } else
+                return -1.0;
+        } else {
+            // if     (UbMath::negative(rx1)) d = -1.0 * (x1 - minX1) / rx1;
+            // else if(UbMath::positive(rx1)) d = -1.0 * (x1 - maxX1) / rx1;
+            if (UbMath::negative(rx1))
+                d = -1.0 * (x1 - maxX1) / rx1;
+            else if (UbMath::positive(rx1))
+                d = -1.0 * (x1 - minX1) / rx1;
+        }
+    } else if (this->isParallelToX2Axis()) {
+        if (UbMath::equal(x2, minX2) && UbMath::negative(rx2))
+            return -1;
+        else if (UbMath::equal(x2, maxX2) && UbMath::positive(rx2))
+            return -1;
+
+        if (minX2 > x2 || x2 > maxX2) {
+            px2 = (x2 < minX2 ? minX2 : maxX2);
+            // falls die Linie nicht parallel zu den Seitenflaechen ist
+            if (!UbMath::zero(rx2)) {
+                // Plane a= 0, b= 1, c=0 d= -1*px2
+                d   = -1 * (x2 - px2) / rx2;
+                px1 = x1 + d * rx1;
+                px3 = x3 + d * rx3;
+
+                if (UbMath::greater(mLine->getDistance(px1, px2, px3), mRad)) {
+                    if (x2 < minX2 && rx2 > 0.0)
+                        d = Ub::inf; // punkt liegt "links oberhalb" vom cylinder und strahl mit pos x1 hat evtl
+                                     // weiteren SP auf oberflaeche
+                    else if (x2 > maxX2 && rx2 < 0.0)
+                        d = Ub::inf;
+                    else
+                        return -1.0;
+                } else
+                    return d;
+            } else
+                return -1.0;
+        } else {
+            if (UbMath::negative(rx2))
+                d = -1.0 * (x2 - minX2) / rx2;
+            else if (UbMath::positive(rx2))
+                d = -1.0 * (x2 - maxX2) / rx2;
+        }
+    } else if (this->isParallelToX3Axis()) {
+        if (UbMath::equal(x3, minX3) && UbMath::negative(rx3))
+            return -1.0;
+        else if (UbMath::equal(x3, maxX3) && UbMath::positive(rx3))
+            return -1.0;
+
+        if (minX3 > x3 || x3 > maxX3) {
+            px3 = (x3 < minX3 ? minX3 : maxX3);
+            // falls die Linie nicht parallel zu den Seitenflaechen ist
+            if (!UbMath::zero(rx3)) {
+                // Plane a= 0, b= 0, c=1 d= -1*px3
+                d   = -1.0 * (x3 - px3) / rx3;
+                px2 = x2 + d * rx2;
+                px1 = x1 + d * rx1;
+                if (UbMath::greater(mLine->getDistance(px1, px2, px3), mRad)) {
+                    if (x3 < minX3 && rx3 > 0.0)
+                        d = Ub::inf;
+                    else if (x3 > maxX3 && rx3 < 0.0)
+                        d = Ub::inf;
+                    else
+                        return -1.0;
+                } else
+                    return d;
+            } else
+                return -1.0;
+        } else {
+            if (UbMath::negative(rx3))
+                d = -1.0 * (x3 - minX3) / rx3;
+            else if (UbMath::positive(rx3))
+                d = -1.0 * (x3 - maxX3) / rx3;
+        }
+    } else
+        throw UbException(UB_EXARGS, "funzt nur bei achsen parallelem cylinder");
+    //////////////////////////////////////////////////////////////////////////
+    // Q berechnen fuer Infinity Zylinder
+    double axisX1 = mLine->getPoint2()->x1 - mLine->getPoint1()->x1; /* Axis of the cylinder   */
+    double axisX2 = mLine->getPoint2()->x2 - mLine->getPoint1()->x2; /* mit p1 als base of cylinder */
+    double axisX3 = mLine->getPoint2()->x3 - mLine->getPoint1()->x3;
+
+    // double dirlen = mLine->getLength();
+    // double abs, t, s;
+
+    double RCx1 = x1 - mLine->getPoint1()->x1;
+    double RCx2 = x2 - mLine->getPoint1()->x2;
+    double RCx3 = x3 - mLine->getPoint1()->x3;
+
+    // n = ray x axis
+    double nx1     = rx2 * axisX3 - rx3 * axisX2;
+    double nx2     = rx3 * axisX1 - rx1 * axisX3;
+    double nx3     = rx1 * axisX2 - rx2 * axisX1;
+    double nLength = nx1 * nx1 + nx2 * nx2 + nx3 * nx3;
+
+    double abs;
+    if (UbMath::zero(nLength)) { /* ray parallel to cyl  */
+        // abs = RC dot axis
+        double tmpabs = RCx1 * axisX1 + RCx2 * axisX2 + RCx3 * axisX3;
+        double dx1    = RCx1 - tmpabs * axisX1;
+        double dx2    = RCx2 - tmpabs * axisX2;
+        double dx3    = RCx3 - tmpabs * axisX3;
+        if (UbMath::greater(dx1 * dx1 + dx2 * dx2 + dx3 * dx3, mRad * mRad))
+            return -1.0;
+    }
+
+    // normalize "n"
+    nLength           = std::sqrt(nLength);
+    double invnLength = 1.0 / nLength;
+    nx1 *= invnLength;
+    nx2 *= invnLength;
+    nx3 *= invnLength;
+
+    // shortest distance  = fabs( RC dot n )
+    abs = std::fabs(RCx1 * nx1 + RCx2 * nx2 + RCx3 * nx3);
+
+    if (UbMath::lessEqual(abs, mRad)) { /* if ray hits cylinder */
+        // Ox1 = RC x axis
+        double Ox1 = RCx2 * axisX3 - RCx3 * axisX2;
+        double Ox2 = RCx3 * axisX1 - RCx1 * axisX3;
+        double Ox3 = RCx1 * axisX2 - RCx2 * axisX1;
+        // t = - O dot n / nLength;
+        double t = -(Ox1 * nx1 + Ox2 * nx2 + Ox3 * nx3) / nLength;
+
+        // O = n x axis;
+        Ox1 = nx2 * axisX3 - nx3 * axisX2;
+        Ox2 = nx3 * axisX1 - nx1 * axisX3;
+        Ox3 = nx1 * axisX2 - nx2 * axisX1;
+
+        // normalize O
+        invnLength = 1.0 / std::sqrt(Ox1 * Ox1 + Ox2 * Ox2 + Ox3 * Ox3);
+        Ox1 *= invnLength;
+        Ox2 *= invnLength;
+        Ox3 *= invnLength;
+
+        double s = std::fabs(sqrt(mRad * mRad - abs * abs) / (rx1 * Ox1 + rx2 * Ox2 + rx3 * Ox3));
+
+        // Wert a) t-s: entering distance
+        //     b) t+s: exiting  distance
+        //
+        // -> we only consider factors in ray-dir -> means positive values!
+        //    (s is always positive)
+
+        if (t > s) {
+            return UbMath::min(t - s, d);
+        } else if ((t + s) > 0) {
+            return UbMath::min(t + s, d);
+        }
+    }
+
+    return -1.0;
 }
 /*==========================================================*/
diff --git a/src/basics/geometry3d/GbCylinder3D.h b/src/basics/geometry3d/GbCylinder3D.h
index bf8e19a2843837bb9b9ac7155771d5560c8bb8f5..3740f18b11ea1f7820fe930dc91a5c264b5a600d 100644
--- a/src/basics/geometry3d/GbCylinder3D.h
+++ b/src/basics/geometry3d/GbCylinder3D.h
@@ -7,13 +7,12 @@
 #ifndef GBCYLINDER3D_H
 #define GBCYLINDER3D_H
 
-
-#include <vector>
 #include <cmath>
+#include <vector>
 
-#include <geometry3d/GbObject3D.h>
-#include <geometry3d/GbLine3D.h>
 #include <basics/utilities/UbObserver.h>
+#include <geometry3d/GbLine3D.h>
+#include <geometry3d/GbObject3D.h>
 
 class GbPoint3D;
 class GbLine3D;
@@ -25,104 +24,107 @@ class GbObject3DCreator;
 class GbCylinder3D;
 using GbCylinder3DPtr = SPtr<GbCylinder3D>;
 
-
-class GbCylinder3D : public GbObject3D , public UbObserver 
+class GbCylinder3D : public GbObject3D, public UbObserver
 {
 public:
-   GbCylinder3D();
-	GbCylinder3D(const double& x1a,const double& x2a, const double& x3a, const double& x1b,const double& x2b, const double& x3b, const double& radius);
-	GbCylinder3D(GbPoint3D* p1, GbPoint3D* p2, const double& radius);
-	GbCylinder3D(GbLine3D* line, const double& rad);
-	GbCylinder3D(GbCylinder3D* cylinder);
-	~GbCylinder3D() override;    
-
-	GbCylinder3D* clone() override { return new GbCylinder3D(this); }
-	void finalize() override;
-
-	double     getRadius() { return this->mRad; };
-	GbLine3D*  getLine() {return mLine;}
-	GbPoint3D* getPoint1();
-	GbPoint3D* getPoint2();
-
-	void setRadius(const double& radius);
-	void setLine(GbLine3D* line);
-	void setPoint1(const double& x1, const double& x2, const double& x3);
-	void setPoint2(const double& x1, const double& x2, const double& x3);
-
-	bool isParallelToX1Axis() { return((this->cylinderType & X1PARALLEL        )    ==  X1PARALLEL        );}
-	bool isParallelToX2Axis() { return((this->cylinderType & X2PARALLEL        )    ==  X2PARALLEL        );}
-	bool isParallelToX3Axis() { return((this->cylinderType & X3PARALLEL        )    ==  X3PARALLEL        );}
-	bool isNotParallelToAxis(){ return((this->cylinderType & NOTPARALLELTOAXIS )    ==  NOTPARALLELTOAXIS );}
-
-	double getHeight(); 
-
-	void scale(const double& sx1, const double& sx2, const double& sx3) override;
-
-   void translate(const double& x1, const double& x2, const double& x3) override 
-   {
-      this->mLine->translate( x1, x2, x3 );
-      this->calculateValues();
-      //this->notifyObserversObjectChanged();
-   }
-
-   double getX1Centroid() override { return centerX1; }
-   double getX1Minimum() override  { return minX1;    }
-	double getX1Maximum() override  { return maxX1;    }
-	double getX2Centroid() override { return centerX2; }
-	double getX2Minimum() override  { return minX2;    }
-	double getX2Maximum() override  { return maxX2;    }
-	double getX3Centroid() override { return centerX3; }
-	double getX3Minimum() override  { return minX3;    }
-	double getX3Maximum() override  { return maxX3;    }
-
-	bool isPointInGbObject3D(const double& x1p, const double& x2p, const double& x3p) override; 
-	bool isPointInGbObject3D(const double& x1p, const double& x2p, const double& x3p, bool& pointIsOnBoundary) override; 
-   bool isCellInsideGbObject3D(const double& x1a,const double& x2a,const double& x3a,const double& x1b,const double& x2b,const double& x3b) override;
-   bool isCellCuttingGbObject3D(const double& x1a,const double& x2a,const double& x3a,const double& x1b,const double& x2b,const double& x3b) override;
-   bool isCellInsideOrCuttingGbObject3D(const double& x1a,const double& x2a,const double& x3a,const double& x1b,const double& x2b,const double& x3b) override;
-
-	GbLine3D* createClippedLine3D(GbPoint3D& point1, GbPoint3D& point2) override;
-   
-   //SG ausdokumentieren, da der nur unendlcihe Zylinder macht ...
-   //bool hasRaytracing() { return true; }
-   bool hasRaytracing() override { return false; }
-   bool raytracingSupportsPointsInside() override { return true; }
-   
-   
-   /*|r| must be 1! einheitsvector!!*/
-   double getIntersectionRaytraceFactor(const double& x1, const double& x2, const double& x3, const double& rx1, const double& rx2, const double& rx3) override;
-
-	std::vector<GbTriangle3D*> getSurfaceTriangleSet() override;
-   void addSurfaceTriangleSet(std::vector<UbTupleFloat3>& nodes, std::vector<UbTupleInt3>& triangles) override;
-   void addSurfaceTriangleSetSegments(std::vector<UbTupleFloat3>& nodes, std::vector<UbTupleInt3>& triangles, int segmentsRound, int segmentsHeight );
-
-	std::string toString() override;
-
-	//virtuelle Methoden von UbObserver
-	void objectChanged(UbObservable* changedObject) override;
-	void objectWillBeDeleted(UbObservable* objectForDeletion) override;
-
-   
-   using GbObject3D::isPointInGbObject3D; //Grund: dadurch muss man hier  isPointInGbObject3D(GbPoint3D*) nicht ausprogrammieren, welche sonst hier "ueberdeckt" waere
-
+    GbCylinder3D();
+    GbCylinder3D(const double &x1a, const double &x2a, const double &x3a, const double &x1b, const double &x2b,
+                 const double &x3b, const double &radius);
+    GbCylinder3D(GbPoint3D *p1, GbPoint3D *p2, const double &radius);
+    GbCylinder3D(GbLine3D *line, const double &rad);
+    GbCylinder3D(GbCylinder3D *cylinder);
+    ~GbCylinder3D() override;
+
+    GbCylinder3D *clone() override { return new GbCylinder3D(this); }
+    void finalize() override;
+
+    double getRadius() { return this->mRad; };
+    GbLine3D *getLine() { return mLine; }
+    GbPoint3D *getPoint1();
+    GbPoint3D *getPoint2();
+
+    void setRadius(const double &radius);
+    void setLine(GbLine3D *line);
+    void setPoint1(const double &x1, const double &x2, const double &x3);
+    void setPoint2(const double &x1, const double &x2, const double &x3);
+
+    bool isParallelToX1Axis() { return ((this->cylinderType & X1PARALLEL) == X1PARALLEL); }
+    bool isParallelToX2Axis() { return ((this->cylinderType & X2PARALLEL) == X2PARALLEL); }
+    bool isParallelToX3Axis() { return ((this->cylinderType & X3PARALLEL) == X3PARALLEL); }
+    bool isNotParallelToAxis() { return ((this->cylinderType & NOTPARALLELTOAXIS) == NOTPARALLELTOAXIS); }
+
+    double getHeight();
+
+    void scale(const double &sx1, const double &sx2, const double &sx3) override;
+
+    void translate(const double &x1, const double &x2, const double &x3) override
+    {
+        this->mLine->translate(x1, x2, x3);
+        this->calculateValues();
+        // this->notifyObserversObjectChanged();
+    }
+
+    double getX1Centroid() override { return centerX1; }
+    double getX1Minimum() override { return minX1; }
+    double getX1Maximum() override { return maxX1; }
+    double getX2Centroid() override { return centerX2; }
+    double getX2Minimum() override { return minX2; }
+    double getX2Maximum() override { return maxX2; }
+    double getX3Centroid() override { return centerX3; }
+    double getX3Minimum() override { return minX3; }
+    double getX3Maximum() override { return maxX3; }
+
+    bool isPointInGbObject3D(const double &x1p, const double &x2p, const double &x3p) override;
+    bool isPointInGbObject3D(const double &x1p, const double &x2p, const double &x3p, bool &pointIsOnBoundary) override;
+    bool isCellInsideGbObject3D(const double &x1a, const double &x2a, const double &x3a, const double &x1b,
+                                const double &x2b, const double &x3b) override;
+    bool isCellCuttingGbObject3D(const double &x1a, const double &x2a, const double &x3a, const double &x1b,
+                                 const double &x2b, const double &x3b) override;
+    bool isCellInsideOrCuttingGbObject3D(const double &x1a, const double &x2a, const double &x3a, const double &x1b,
+                                         const double &x2b, const double &x3b) override;
+
+    GbLine3D *createClippedLine3D(GbPoint3D &point1, GbPoint3D &point2) override;
+
+    // SG ausdokumentieren, da der nur unendlcihe Zylinder macht ...
+    // bool hasRaytracing() { return true; }
+    bool hasRaytracing() override { return false; }
+    bool raytracingSupportsPointsInside() override { return true; }
+
+    /*|r| must be 1! einheitsvector!!*/
+    double getIntersectionRaytraceFactor(const double &x1, const double &x2, const double &x3, const double &rx1,
+                                         const double &rx2, const double &rx3) override;
+
+    std::vector<GbTriangle3D *> getSurfaceTriangleSet() override;
+    void addSurfaceTriangleSet(std::vector<UbTupleFloat3> &nodes, std::vector<UbTupleInt3> &triangles) override;
+    void addSurfaceTriangleSetSegments(std::vector<UbTupleFloat3> &nodes, std::vector<UbTupleInt3> &triangles,
+                                       int segmentsRound, int segmentsHeight);
+
+    std::string toString() override;
+
+    // virtuelle Methoden von UbObserver
+    void objectChanged(UbObservable *changedObject) override;
+    void objectWillBeDeleted(UbObservable *objectForDeletion) override;
+
+    using GbObject3D::isPointInGbObject3D; // Grund: dadurch muss man hier  isPointInGbObject3D(GbPoint3D*) nicht
+                                           // ausprogrammieren, welche sonst hier "ueberdeckt" waere
 
 protected:
-   void calculateValues();
+    void calculateValues();
 
-   GbLine3D* mLine;
-	double    mRad;
+    GbLine3D *mLine;
+    double mRad;
 
-   double minX1{0.0}, minX2{0.0}, minX3{0.0};
-   double maxX1{0.0}, maxX2{0.0}, maxX3{0.0};
-   double centerX1{0.0}, centerX2{0.0}, centerX3{0.0};
+    double minX1{ 0.0 }, minX2{ 0.0 }, minX3{ 0.0 };
+    double maxX1{ 0.0 }, maxX2{ 0.0 }, maxX3{ 0.0 };
+    double centerX1{ 0.0 }, centerX2{ 0.0 }, centerX3{ 0.0 };
 
-	int cylinderType;
+    int cylinderType;
 
-	//void berechneQuerschnittsWerte();
-   static const int NOTPARALLELTOAXIS  = (1<<0); //1
-   static const int X1PARALLEL         = (1<<1); //2
-   static const int X2PARALLEL         = (1<<2); //4
-   static const int X3PARALLEL         = (1<<3); //8
+    // void berechneQuerschnittsWerte();
+    static const int NOTPARALLELTOAXIS = (1 << 0); // 1
+    static const int X1PARALLEL        = (1 << 1); // 2
+    static const int X2PARALLEL        = (1 << 2); // 4
+    static const int X3PARALLEL        = (1 << 3); // 8
 };
 
-#endif   
+#endif
diff --git a/src/basics/geometry3d/GbHalfSpace3D.cpp b/src/basics/geometry3d/GbHalfSpace3D.cpp
index 04d8a39d8ea3760610c36089cb52bd968aa3d83e..8566d337d32ae269bb630d3f2a44f49b0cd70118 100644
--- a/src/basics/geometry3d/GbHalfSpace3D.cpp
+++ b/src/basics/geometry3d/GbHalfSpace3D.cpp
@@ -3,97 +3,97 @@
 using namespace std;
 
 /*==========================================================*/
-GbHalfSpace3D::GbHalfSpace3D(GbTriangle3D* triangle)
+GbHalfSpace3D::GbHalfSpace3D(GbTriangle3D *triangle)
 {
-   GbPoint3D* PointA = triangle->getPoint1();
-   GbPoint3D* PointB = triangle->getPoint2();
-   GbPoint3D* PointC = triangle->getPoint3();
-          
-   GbVector3D A(PointA->x1, PointA->x2, PointA->x3 );
-   GbVector3D BA(PointB->x1-PointA->x1, PointB->x2-PointA->x2, PointB->x3-PointA->x3 );
-   GbVector3D CA(PointC->x1-PointA->x1, PointC->x2-PointA->x2, PointC->x3-PointA->x3 );
-   GbVector3D BACA = BA.Cross(CA);
-   //this->Normal = PointB->subtract(PointA)->cross(PointC->subtract(PointA))->normalize();
-   BACA.Normalize(); 
-   //this->Normal = BACA; 
-   normalX = BACA[0];
-   normalY = BACA[1]; 
-   normalZ = BACA[2]; 
-   //this->d = this->Normal.Dot(A);
-   this->d = normalX*A[0] + normalY*A[1] + normalZ*A[2] ;
+    GbPoint3D *PointA = triangle->getPoint1();
+    GbPoint3D *PointB = triangle->getPoint2();
+    GbPoint3D *PointC = triangle->getPoint3();
+
+    GbVector3D A(PointA->x1, PointA->x2, PointA->x3);
+    GbVector3D BA(PointB->x1 - PointA->x1, PointB->x2 - PointA->x2, PointB->x3 - PointA->x3);
+    GbVector3D CA(PointC->x1 - PointA->x1, PointC->x2 - PointA->x2, PointC->x3 - PointA->x3);
+    GbVector3D BACA = BA.Cross(CA);
+    // this->Normal = PointB->subtract(PointA)->cross(PointC->subtract(PointA))->normalize();
+    BACA.Normalize();
+    // this->Normal = BACA;
+    normalX = BACA[0];
+    normalY = BACA[1];
+    normalZ = BACA[2];
+    // this->d = this->Normal.Dot(A);
+    this->d = normalX * A[0] + normalY * A[1] + normalZ * A[2];
 }
 /*==========================================================*/
-GbHalfSpace3D::GbHalfSpace3D(GbPoint3D* PointA, GbPoint3D* PointB, GbPoint3D* PointC)
+GbHalfSpace3D::GbHalfSpace3D(GbPoint3D *PointA, GbPoint3D *PointB, GbPoint3D *PointC)
 {
-   GbVector3D A(PointA->x1, PointA->x2, PointA->x3 );
-   GbVector3D BA(PointB->x1-PointA->x1, PointB->x2-PointA->x2, PointB->x3-PointA->x3 );
-   GbVector3D CA(PointC->x1-PointA->x1, PointC->x2-PointA->x2, PointC->x3-PointA->x3 );
-   GbVector3D BACA = BA.Cross(CA);
-	//this->Normal = PointB->subtract(PointA)->cross(PointC->subtract(PointA))->normalize();
-   BACA.Normalize(); 
-	//this->Normal = BACA; 
-   normalX = BACA[0];
-   normalY = BACA[1]; 
-   normalZ = BACA[2]; 
-   //this->d = this->Normal.Dot(A);
-   this->d = normalX*A[0] + normalY*A[1] + normalZ*A[2] ;
+    GbVector3D A(PointA->x1, PointA->x2, PointA->x3);
+    GbVector3D BA(PointB->x1 - PointA->x1, PointB->x2 - PointA->x2, PointB->x3 - PointA->x3);
+    GbVector3D CA(PointC->x1 - PointA->x1, PointC->x2 - PointA->x2, PointC->x3 - PointA->x3);
+    GbVector3D BACA = BA.Cross(CA);
+    // this->Normal = PointB->subtract(PointA)->cross(PointC->subtract(PointA))->normalize();
+    BACA.Normalize();
+    // this->Normal = BACA;
+    normalX = BACA[0];
+    normalY = BACA[1];
+    normalZ = BACA[2];
+    // this->d = this->Normal.Dot(A);
+    this->d = normalX * A[0] + normalY * A[1] + normalZ * A[2];
 }
 /*==========================================================*/
-GbHalfSpace3D::GbHalfSpace3D(GbPoint3D* PointA, GbPoint3D* PointB)
+GbHalfSpace3D::GbHalfSpace3D(GbPoint3D *PointA, GbPoint3D *PointB)
 {
-   GbVector3D A(PointA->x1, PointA->x2, PointA->x3 );
-   GbVector3D B(PointB->x1, PointB->x2, PointB->x3 );
-	GbVector3D K(0.0,0.0,0.99); // the vector from PointA - third point
-   
-	GbVector3D PointBA = B-A;
-	GbVector3D PointBAK = PointBA.Cross(K);
-   PointBAK.Normalize();
-	
-   //this->Normal = PointBAK;
-   normalX = PointBAK[0];
-   normalY = PointBAK[1]; 
-   normalZ = PointBAK[2]; 
-   
-   //this->d = this->Normal.Dot(A);
-   this->d = normalX*PointA->x1 + normalY*PointA->x2 + normalZ*PointA->x3;
+    GbVector3D A(PointA->x1, PointA->x2, PointA->x3);
+    GbVector3D B(PointB->x1, PointB->x2, PointB->x3);
+    GbVector3D K(0.0, 0.0, 0.99); // the vector from PointA - third point
+
+    GbVector3D PointBA  = B - A;
+    GbVector3D PointBAK = PointBA.Cross(K);
+    PointBAK.Normalize();
+
+    // this->Normal = PointBAK;
+    normalX = PointBAK[0];
+    normalY = PointBAK[1];
+    normalZ = PointBAK[2];
+
+    // this->d = this->Normal.Dot(A);
+    this->d = normalX * PointA->x1 + normalY * PointA->x2 + normalZ * PointA->x3;
 }
 /*==========================================================*/
-GbHalfSpace3D::GbHalfSpace3D(  const double& p1x, const double& p1y, const double& p1z
-                             , const double& p2x, const double& p2y, const double& p2z
-                             , const double& p3x, const double& p3y, const double& p3z )
+GbHalfSpace3D::GbHalfSpace3D(const double &p1x, const double &p1y, const double &p1z, const double &p2x,
+                             const double &p2y, const double &p2z, const double &p3x, const double &p3y,
+                             const double &p3z)
 {
-   double p2minusP1x = p2x-p1x;
-   double p2minusP1y = p2y-p1y;
-   double p2minusP1z = p2z-p1z;
-   
-   double P3minusP1x = p3x-p1x;
-   double P3minusP1y = p3y-p1y;
-   double P3minusP1z = p3z-p1z;
-   
-   //normal = BA x CA
-   normalX = p2minusP1y*P3minusP1z - p2minusP1z*P3minusP1y;
-   normalY = p2minusP1z*P3minusP1x - p2minusP1x*P3minusP1z;
-   normalZ = p2minusP1x*P3minusP1y - p2minusP1y*P3minusP1x;
-   
-   //normalize BACA
-   double oneOverNormalLength = 1.0 / ( std::sqrt( normalX*normalX + normalY*normalY + normalZ*normalZ ) );
-   normalX *= oneOverNormalLength;
-   normalY *= oneOverNormalLength;
-   normalZ *= oneOverNormalLength;
+    double p2minusP1x = p2x - p1x;
+    double p2minusP1y = p2y - p1y;
+    double p2minusP1z = p2z - p1z;
+
+    double P3minusP1x = p3x - p1x;
+    double P3minusP1y = p3y - p1y;
+    double P3minusP1z = p3z - p1z;
+
+    // normal = BA x CA
+    normalX = p2minusP1y * P3minusP1z - p2minusP1z * P3minusP1y;
+    normalY = p2minusP1z * P3minusP1x - p2minusP1x * P3minusP1z;
+    normalZ = p2minusP1x * P3minusP1y - p2minusP1y * P3minusP1x;
+
+    // normalize BACA
+    double oneOverNormalLength = 1.0 / (std::sqrt(normalX * normalX + normalY * normalY + normalZ * normalZ));
+    normalX *= oneOverNormalLength;
+    normalY *= oneOverNormalLength;
+    normalZ *= oneOverNormalLength;
 
-   //d = normal * p1
-   this->d = normalX*p1x + normalY*p1y + normalZ*p1z;
+    // d = normal * p1
+    this->d = normalX * p1x + normalY * p1y + normalZ * p1z;
 }
 /*==========================================================*/
-GbHalfSpace3D::GbHalfSpace3D( const double& p1x, const double& p1y, const double& p1z,
-                              const double& nx, const double& ny, const double& nz)
+GbHalfSpace3D::GbHalfSpace3D(const double &p1x, const double &p1y, const double &p1z, const double &nx,
+                             const double &ny, const double &nz)
 {
-	//normal = BA x CA
-	normalX =nx;
-	normalY =ny;
-	normalZ =nz;
+    // normal = BA x CA
+    normalX = nx;
+    normalY = ny;
+    normalZ = nz;
 
-	//d = normal * p1
-	this->d = nx*p1x + ny*p1y + nz*p1z;
+    // d = normal * p1
+    this->d = nx * p1x + ny * p1y + nz * p1z;
 }
 /*==========================================================*/
diff --git a/src/basics/geometry3d/GbHalfSpace3D.h b/src/basics/geometry3d/GbHalfSpace3D.h
index b63f550dd6d7e2760e126ce3e945fd41907f93a3..768a01c96c831405fb6024d1bd92d1d92de38c7a 100644
--- a/src/basics/geometry3d/GbHalfSpace3D.h
+++ b/src/basics/geometry3d/GbHalfSpace3D.h
@@ -7,8 +7,8 @@
 #ifndef GBHALFSPACE3D_H
 #define GBHALFSPACE3D_H
 
-#include <sstream>
 #include <iostream>
+#include <sstream>
 
 #include <basics/utilities/UbMath.h>
 
@@ -18,67 +18,65 @@
 
 #include <PointerDefinitions.h>
 
-
 /*=========================================================================*/
 /* GbHalfSpace3D                                                             */
 /*                                                                         */
 /**
-* This Class helps in performing some operations on a halfspace defined by 2 or 3 points
-*/
+ * This Class helps in performing some operations on a halfspace defined by 2 or 3 points
+ */
 
-class GbHalfSpace3D                            
+class GbHalfSpace3D
 {
 public:
-   GbHalfSpace3D(GbTriangle3D* triangle);
+    GbHalfSpace3D(GbTriangle3D *triangle);
 
-   GbHalfSpace3D(GbPoint3D* PointA, GbPoint3D* PointB, GbPoint3D* PointC);
+    GbHalfSpace3D(GbPoint3D *PointA, GbPoint3D *PointB, GbPoint3D *PointC);
 
-   GbHalfSpace3D(GbPoint3D* PointA, GbPoint3D* PointB);
+    GbHalfSpace3D(GbPoint3D *PointA, GbPoint3D *PointB);
 
-   GbHalfSpace3D(  const double& p1x, const double& p1y, const double& p1z
-                 , const double& p2x, const double& p2y, const double& p2z
-                 , const double& p3x, const double& p3y, const double& p3z );
-   GbHalfSpace3D( const double& p1x, const double& p1y, const double& p1z,
-                  const double& nx, const double& ny, const double& nz);
+    GbHalfSpace3D(const double &p1x, const double &p1y, const double &p1z, const double &p2x, const double &p2y,
+                  const double &p2z, const double &p3x, const double &p3y, const double &p3z);
+    GbHalfSpace3D(const double &p1x, const double &p1y, const double &p1z, const double &nx, const double &ny,
+                  const double &nz);
 
-   /*=======================================================*/
-   std::string getTypeID() {return "GbHalfSpace3D"; }
-   /*=============================================*/
-   bool ptInside(const double& x, const double& y, const double& z)
-   {
-      return UbMath::greaterEqual( normalX*x + normalY*y + normalZ*z, this->d );
-   }
-   /*=============================================*/
-   bool ptInside(GbPoint3D* pointX)
-   {
-      //GbVector3D X(PointX->x1, PointX->x2, PointX->x3 );
-      //return UbMath::greaterEqual(this->Normal.Dot(X), this->d);      
-      return UbMath::greaterEqual(  normalX*pointX->x1 + normalY*pointX->x2 + normalZ*pointX->x3, this->d );
-   }
-   /*=============================================*/
-   bool ptInside(GbVector3D& x)
-   {
-      //return UbMath::greaterEqual(this->Normal.Dot(X), this->d);
-      return UbMath::greaterEqual(  normalX*x[0] + normalY*x[1] + normalZ*x[2], this->d );
-   }
-   /*=============================================*/
-   double getDistance(const double& x1p, const double& x2p, const double& x3p)
-   {
-      return (normalX*x1p + normalY*x2p + normalZ*x3p) - this->d;
-   }
+    /*=======================================================*/
+    std::string getTypeID() { return "GbHalfSpace3D"; }
+    /*=============================================*/
+    bool ptInside(const double &x, const double &y, const double &z)
+    {
+        return UbMath::greaterEqual(normalX * x + normalY * y + normalZ * z, this->d);
+    }
+    /*=============================================*/
+    bool ptInside(GbPoint3D *pointX)
+    {
+        // GbVector3D X(PointX->x1, PointX->x2, PointX->x3 );
+        // return UbMath::greaterEqual(this->Normal.Dot(X), this->d);
+        return UbMath::greaterEqual(normalX * pointX->x1 + normalY * pointX->x2 + normalZ * pointX->x3, this->d);
+    }
+    /*=============================================*/
+    bool ptInside(GbVector3D &x)
+    {
+        // return UbMath::greaterEqual(this->Normal.Dot(X), this->d);
+        return UbMath::greaterEqual(normalX * x[0] + normalY * x[1] + normalZ * x[2], this->d);
+    }
+    /*=============================================*/
+    double getDistance(const double &x1p, const double &x2p, const double &x3p)
+    {
+        return (normalX * x1p + normalY * x2p + normalZ * x3p) - this->d;
+    }
 
-   const double& getNormalX() { return this->normalX; }
-   const double& getNormalY() { return this->normalY; }
-   const double& getNormalZ() { return this->normalZ; }
-   const double& getD()       { return this->d;       }
+    const double &getNormalX() { return this->normalX; }
+    const double &getNormalY() { return this->normalY; }
+    const double &getNormalZ() { return this->normalZ; }
+    const double &getD() { return this->d; }
 
 private:
-   //GbVector3D Normal;
-   double normalX;
-   double normalY;
-   double normalZ;
-   double d;
+    // GbVector3D Normal;
+    double normalX;
+    double normalY;
+    double normalZ;
+    double d;
 };
 /*=========================================================================*/
 
-#endif //GBHALFSPACE3D_H
+#endif // GBHALFSPACE3D_H
diff --git a/src/basics/geometry3d/GbHalfSpaceKrischan3D.cpp b/src/basics/geometry3d/GbHalfSpaceKrischan3D.cpp
index b8a00c647d335fb13d0031f2908a77ffbada8c62..903cffa95f56a0258989f477e07e37d7a7dcaadf 100644
--- a/src/basics/geometry3d/GbHalfSpaceKrischan3D.cpp
+++ b/src/basics/geometry3d/GbHalfSpaceKrischan3D.cpp
@@ -3,265 +3,269 @@
 using namespace std;
 
 /*==========================================================*/
-GbHalfSpaceKrischan3D::GbHalfSpaceKrischan3D(GbTriangle3D* triangle)
+GbHalfSpaceKrischan3D::GbHalfSpaceKrischan3D(GbTriangle3D *triangle)
 {
-   GbPoint3D* PointA = triangle->getPoint1();
-   GbPoint3D* PointB = triangle->getPoint2();
-   GbPoint3D* PointC = triangle->getPoint3();
-          
-   GbVector3D A(PointA->x1, PointA->x2, PointA->x3 );
-   GbVector3D BA(PointB->x1-PointA->x1, PointB->x2-PointA->x2, PointB->x3-PointA->x3 );
-   GbVector3D CA(PointC->x1-PointA->x1, PointC->x2-PointA->x2, PointC->x3-PointA->x3 );
-   GbVector3D BACA = BA.Cross(CA);
-   //this->Normal = PointB->subtract(PointA)->cross(PointC->subtract(PointA))->normalize();
-   BACA.Normalize(); 
-   this->Normal = BACA; 
-   this->d = this->Normal.Dot(A);
+    GbPoint3D *PointA = triangle->getPoint1();
+    GbPoint3D *PointB = triangle->getPoint2();
+    GbPoint3D *PointC = triangle->getPoint3();
+
+    GbVector3D A(PointA->x1, PointA->x2, PointA->x3);
+    GbVector3D BA(PointB->x1 - PointA->x1, PointB->x2 - PointA->x2, PointB->x3 - PointA->x3);
+    GbVector3D CA(PointC->x1 - PointA->x1, PointC->x2 - PointA->x2, PointC->x3 - PointA->x3);
+    GbVector3D BACA = BA.Cross(CA);
+    // this->Normal = PointB->subtract(PointA)->cross(PointC->subtract(PointA))->normalize();
+    BACA.Normalize();
+    this->Normal = BACA;
+    this->d      = this->Normal.Dot(A);
 }
 /*==========================================================*/
-GbHalfSpaceKrischan3D::GbHalfSpaceKrischan3D(GbPoint3D* PointA, GbPoint3D* PointB, GbPoint3D* PointC)
+GbHalfSpaceKrischan3D::GbHalfSpaceKrischan3D(GbPoint3D *PointA, GbPoint3D *PointB, GbPoint3D *PointC)
 {
-   GbVector3D A(PointA->x1, PointA->x2, PointA->x3 );
-   GbVector3D BA(PointB->x1-PointA->x1, PointB->x2-PointA->x2, PointB->x3-PointA->x3 );
-   GbVector3D CA(PointC->x1-PointA->x1, PointC->x2-PointA->x2, PointC->x3-PointA->x3 );
-   GbVector3D BACA = BA.Cross(CA);
-	//this->Normal = PointB->subtract(PointA)->cross(PointC->subtract(PointA))->normalize();
-   BACA.Normalize(); 
-	this->Normal = BACA; 
-	this->d = this->Normal.Dot(A);
+    GbVector3D A(PointA->x1, PointA->x2, PointA->x3);
+    GbVector3D BA(PointB->x1 - PointA->x1, PointB->x2 - PointA->x2, PointB->x3 - PointA->x3);
+    GbVector3D CA(PointC->x1 - PointA->x1, PointC->x2 - PointA->x2, PointC->x3 - PointA->x3);
+    GbVector3D BACA = BA.Cross(CA);
+    // this->Normal = PointB->subtract(PointA)->cross(PointC->subtract(PointA))->normalize();
+    BACA.Normalize();
+    this->Normal = BACA;
+    this->d      = this->Normal.Dot(A);
 }
 /*==========================================================*/
-GbHalfSpaceKrischan3D::GbHalfSpaceKrischan3D(GbPoint3D* PointA, GbPoint3D* PointB)
+GbHalfSpaceKrischan3D::GbHalfSpaceKrischan3D(GbPoint3D *PointA, GbPoint3D *PointB)
 {
-   GbVector3D A(PointA->x1, PointA->x2, PointA->x3 );
-   GbVector3D B(PointB->x1, PointB->x2, PointB->x3 );
-	GbVector3D K(0.0,0.0,0.99); // the vector from PointA - third point
-   
-	GbVector3D PointBA = B-A;
-	GbVector3D PointBAK = PointBA.Cross(K);
-   PointBAK.Normalize();
-	this->Normal = PointBAK;
-	this->d = this->Normal.Dot(A);
+    GbVector3D A(PointA->x1, PointA->x2, PointA->x3);
+    GbVector3D B(PointB->x1, PointB->x2, PointB->x3);
+    GbVector3D K(0.0, 0.0, 0.99); // the vector from PointA - third point
+
+    GbVector3D PointBA  = B - A;
+    GbVector3D PointBAK = PointBA.Cross(K);
+    PointBAK.Normalize();
+    this->Normal = PointBAK;
+    this->d      = this->Normal.Dot(A);
 }
 /*==========================================================*/
-GbHalfSpaceKrischan3D::GbHalfSpaceKrischan3D(  const double& p1x, const double& p1y, const double& p1z
-                             , const double& p2x, const double& p2y, const double& p2z
-                             , const double& p3x, const double& p3y, const double& p3z )
+GbHalfSpaceKrischan3D::GbHalfSpaceKrischan3D(const double &p1x, const double &p1y, const double &p1z, const double &p2x,
+                                             const double &p2y, const double &p2z, const double &p3x, const double &p3y,
+                                             const double &p3z)
 {
-   GbVector3D A( p1x, p1y, p1z );
-   GbVector3D BA(p2x-p1x, p2y-p1y, p2z-p1z );
-   GbVector3D CA(p3x-p1x, p3y-p1y, p3z-p1z );
-   GbVector3D BACA = BA.Cross(CA);
-
-   BACA.Normalize(); 
-   this->Normal = BACA; 
-   this->d = this->Normal.Dot(A);
+    GbVector3D A(p1x, p1y, p1z);
+    GbVector3D BA(p2x - p1x, p2y - p1y, p2z - p1z);
+    GbVector3D CA(p3x - p1x, p3y - p1y, p3z - p1z);
+    GbVector3D BACA = BA.Cross(CA);
+
+    BACA.Normalize();
+    this->Normal = BACA;
+    this->d      = this->Normal.Dot(A);
 }
 /*==========================================================*/
 GbHalfSpaceKrischan3D::GbHalfSpaceKrischan3D(double nx, double ny, double nz, double dist)
 {
-   this->Normal = GbVector3D(nx,ny,nz);
-   this->Normal.Normalize();
-   this->d = dist;
+    this->Normal = GbVector3D(nx, ny, nz);
+    this->Normal.Normalize();
+    this->d = dist;
 }
 /*==========================================================*/
-double GbHalfSpaceKrischan3D::getCellVolumeInsideGbObject3D(const double& x1a,const double& x2a,const double& x3a,const double& x1b,const double& x2b,const double& x3b)
+double GbHalfSpaceKrischan3D::getCellVolumeInsideGbObject3D(const double &x1a, const double &x2a, const double &x3a,
+                                                            const double &x1b, const double &x2b, const double &x3b)
 {
 
-	double x1 = x1b-x1a;
-   double x2 = x2b-x2a;
-   double x3 = x3b-x3a;
-
-   if( this->isCellInsideGbObject3D(x1a,x2a,x3a,x1b,x2b,x3b) )       return 1.0*x1*x2*x3;
-   if( !(this->isCellCuttingGbObject3D(x1a,x2a,x3a,x1b,x2b,x3b)) )   return 0.0;
-
-   double alpha=0.0;
-   double internX1,internX2,internX3;
-
-   for(int x1vers=0;x1vers<2;x1vers++){
-      for(int x2vers=0;x2vers<2;x2vers++){
-         for(int x3vers=0;x3vers<2;x3vers++){
-            internX1 = x1a + (x1b-x1a)*x1vers;
-            internX2 = x2a + (x2b-x2a)*x2vers;
-            internX3 = x3a + (x3b-x3a)*x3vers;
-
-            // if point is INSIDE the halfspace, distance is smaller than zero
-            // --> loop determines the minimum alpha...i.e. the alpha with maximum absolute value for all points INSIDE the halfspace
-            if( UbMath::lessEqual( this->getDistance(internX1,internX2,internX3) , alpha ) )
-               alpha = this->getDistance(internX1,internX2,internX3);
-            //cout<<zelltyp<<" "<<kugel->getDistance(internX1,internX2,internX3)<<" "<<alpha<<endl;
-         }//end first for
-      }//end second for
-   }//end third for
-
-   // PLIC needs alphas > 0.0
-   alpha = (-1)*alpha;
-
-
-
-   double n[3];
-   n[0] = this->Normal[0];
-   n[1] = this->Normal[1];
-   n[2] = this->Normal[2];
-
-   //cout << "Koordinaten:  "<<x1<<" "<<x2<<" "<<x3<<endl;
-   //cout << "Deltas:       "<<deltaX1<<" "<<deltaX2<<" "<<deltaX3<<endl;
-   //cout << "Halbe Zelle:  "<<halfcelldelta<<endl;
-
-   //cout<<"Centroid:  "<<kugel->getX1Centroid()<<" "<<kugel->getX2Centroid()<<" "<<kugel->getX3Centroid()<<endl;
-
-   //cout<<"Normals: "<<n[0]<<" "<<n[1]<<" "<<n[2]<<endl;
-
-   double normLength;
-   normLength = sqrt(n[0]*n[0] + n[1]*n[1] + n[2]*n[2]);
-   n[0] /= normLength;
-   n[1] /= normLength;
-   n[2] /= normLength;
-
-   if( UbMath::less(n[0],0.0) ) n[0] = -n[0];
-   if( UbMath::less(n[1],0.0) ) n[1] = -n[1];
-   if( UbMath::less(n[2],0.0) ) n[2] = -n[2];
-
-   //cout<<"Normals: "<<n[0]<<" "<<n[1]<<" "<<n[2]<<endl;
-
-   double dummy;
-   if( UbMath::greater(n[0],n[1])) {dummy=n[1]; n[1]=n[0]; n[0]=dummy;}
-   if( UbMath::greater(n[1],n[2])) {dummy=n[2]; n[2]=n[1]; n[1]=dummy;}
-   if( UbMath::greater(n[0],n[1])) {dummy=n[1]; n[1]=n[0]; n[0]=dummy;}
-
-   //cout<<"Normals: "<<n[0]<<" "<<n[1]<<" "<<n[2]<<endl;
-
-   double n1,n2,n3;
-   n1=n[0];
-   n2=n[1];
-   n3=n[2];
-
-   double preresult=0.0,result=0.0;
-
-   // 1D Check
-   if ( UbMath::lessEqual(n1,0.00001)&&UbMath::lessEqual(n2,0.00001) )
-   {
-      result = alpha * x1 * x2;
-   }                  
-   // 2D Check
-   else if ( UbMath::lessEqual(n1,0.00001) )
-   {
-      preresult = (2*n2*n3);
-      result = (alpha*alpha)/preresult;
-
-      if( UbMath::greater(alpha,n2*x2) )
-      {
-         result += -(alpha-n2*x2)*(alpha-n2*x2)/preresult;
-      }
-      if( UbMath::greater(alpha,n3*x3) )
-      {
-         result += -(alpha-n3*x3)*(alpha-n3*x3)/preresult;
-      }
-      if( UbMath::greater(alpha,n2*x2+n3*x3) )
-      {
-         result += (alpha-n2*x2-n3*x3)*(alpha-n2*x2-n3*x3)/preresult;
-      }
-
-      // tiefenrichtung mit einmultiplizieren...
-      result *= x1;
-   }	
-   // 3D Check
-   else	
-   { 	
-      preresult =6*n1*n2*n3;
-
-      result = alpha*alpha*alpha/preresult;
-
-      if ( UbMath::greater (alpha,n1*x1))
-      {
-         result+=-((alpha-n1*x1)*(alpha-n1*x1)*(alpha-n1*x1))/preresult;
-      }
-      if (UbMath::greater(alpha,n2*x2))
-      {
-         result+=-((alpha-n2*x2)*(alpha-n2*x2)*(alpha-n2*x2))/preresult;
-      }
-      if (UbMath::greater(alpha,n3*x3))
-      {
-         result+=-((alpha-n3*x3)*(alpha-n3*x3)*(alpha-n3*x3))/preresult;
-      }
-      if (UbMath::greater(alpha,(n1*x1+n2*x2)))
-      {
-         result+=((alpha-(n1*x1+n2*x2))*(alpha-(n1*x1+n2*x2))*(alpha-(n1*x1+n2*x2)))/preresult;
-      }
-      if (UbMath::greater(alpha,(n1*x1+n3*x3)))
-      {
-         result+=((alpha-(n1*x1+n3*x3))*(alpha-(n1*x1+n3*x3))*(alpha-(n1*x1+n3*x3)))/preresult;
-      }
-      if (UbMath::greater(alpha,(n2*x2+n3*x3)))
-      {
-         result+=((alpha-(n2*x2+n3*x3))*(alpha-(n2*x2+n3*x3))*(alpha-(n2*x2+n3*x3)))/preresult;
-      }
-
-      //NEW
-      if (UbMath::greater(alpha,(n1*x1+n2*x2+n3*x3)))
-      {
-         result+= -((alpha-(n1*x1+n2*x2+n3*x3))*(alpha-(n1*x1+n2*x2+n3*x3))*(alpha-(n1*x1+n2*x2+n3*x3)))/preresult;
-      }
-
-   }
-
-   if( !UbMath::inClosedInterval( result/ (x1*x2*x3), -0.01, 1.01) )
-   {
-      stringstream errMsg;
-
-      errMsg << "Danger...Fuellstand "<<result<<" nicht im Interfall [0.0..1.0]" << endl;
-      errMsg << "NormVec: " << n1 << " " << n2 << " " << n3 << endl;
-      errMsg << "Cell:    " << x1 << " " << x2 << " " << x3 << endl;
-      errMsg << "Alpha:   " << alpha << endl;
- 
-
-      throw UbException( UB_EXARGS, errMsg.str() );
-   }
-
-   return result;
-
-
-   //double eps=0.0;
-   //if( UbMath::equal(n1,0.0) && UbMath::equal(n2,0.0) )
-   //{
-   //   eps = alpha/n3;
-   //}
-   //else if( UbMath::equal(n1,0.0) )
-   //{
-   //   double dim1,dim2;
-   //   dim1 = alpha/n2;
-   //   dim2 = alpha/n3;
-
-   //   eps = 0.5*dim1*dim2;
-   //   if( UbMath::greater(dim1,1.0) )   eps -= 0.5*(dim1-1.0)*dim2/dim1*(dim1-1.0);
-   //   if( UbMath::greater(dim2,1.0) )   eps -= 0.5*(dim2-1.0)*dim1/dim2*(dim2-1.0);
-   //}
-   //else
-   //{
-   //   eps = alpha*alpha*alpha;
-   //   if( UbMath::greater(alpha,n1) )
-   //      eps -= (alpha-n1)*(alpha-n1)*(alpha-n1);
-   //   if( UbMath::greater(alpha,n2) )
-   //      eps -= (alpha-n2)*(alpha-n2)*(alpha-n2);
-   //   if( UbMath::greater(alpha,n3) )
-   //      eps -= (alpha-n3)*(alpha-n3)*(alpha-n3);
-
-   //   if( UbMath::greater(alpha,n1+n2) )
-   //      eps += (alpha-n1-n2)*(alpha-n1-n2)*(alpha-n1-n2);
-   //   if( UbMath::greater(alpha,n1+n3) )
-   //      eps += (alpha-n1-n3)*(alpha-n1-n3)*(alpha-n1-n3);
-   //   if( UbMath::greater(alpha,n2+n3) )
-   //      eps += (alpha-n2-n3)*(alpha-n2-n3)*(alpha-n2-n3);
-
-   //   //attention: use without delta_i
-   //   eps = eps / (6*n[0]*n[1]*n[2]);
-
-   //   eps = eps / (deltaX1*deltaX2*deltaX3);
-   //}
-
-
-   //return(eps) ;
-   //cout << "alpha ist " << alpha << endl;
-   //cout << "fillLevel ist " << eps << endl;
+    double x1 = x1b - x1a;
+    double x2 = x2b - x2a;
+    double x3 = x3b - x3a;
+
+    if (this->isCellInsideGbObject3D(x1a, x2a, x3a, x1b, x2b, x3b))
+        return 1.0 * x1 * x2 * x3;
+    if (!(this->isCellCuttingGbObject3D(x1a, x2a, x3a, x1b, x2b, x3b)))
+        return 0.0;
+
+    double alpha = 0.0;
+    double internX1, internX2, internX3;
+
+    for (int x1vers = 0; x1vers < 2; x1vers++) {
+        for (int x2vers = 0; x2vers < 2; x2vers++) {
+            for (int x3vers = 0; x3vers < 2; x3vers++) {
+                internX1 = x1a + (x1b - x1a) * x1vers;
+                internX2 = x2a + (x2b - x2a) * x2vers;
+                internX3 = x3a + (x3b - x3a) * x3vers;
+
+                // if point is INSIDE the halfspace, distance is smaller than zero
+                // --> loop determines the minimum alpha...i.e. the alpha with maximum absolute value for all points
+                // INSIDE the halfspace
+                if (UbMath::lessEqual(this->getDistance(internX1, internX2, internX3), alpha))
+                    alpha = this->getDistance(internX1, internX2, internX3);
+                // cout<<zelltyp<<" "<<kugel->getDistance(internX1,internX2,internX3)<<" "<<alpha<<endl;
+            } // end first for
+        }     // end second for
+    }         // end third for
+
+    // PLIC needs alphas > 0.0
+    alpha = (-1) * alpha;
+
+    double n[3];
+    n[0] = this->Normal[0];
+    n[1] = this->Normal[1];
+    n[2] = this->Normal[2];
+
+    // cout << "Koordinaten:  "<<x1<<" "<<x2<<" "<<x3<<endl;
+    // cout << "Deltas:       "<<deltaX1<<" "<<deltaX2<<" "<<deltaX3<<endl;
+    // cout << "Halbe Zelle:  "<<halfcelldelta<<endl;
+
+    // cout<<"Centroid:  "<<kugel->getX1Centroid()<<" "<<kugel->getX2Centroid()<<" "<<kugel->getX3Centroid()<<endl;
+
+    // cout<<"Normals: "<<n[0]<<" "<<n[1]<<" "<<n[2]<<endl;
+
+    double normLength;
+    normLength = sqrt(n[0] * n[0] + n[1] * n[1] + n[2] * n[2]);
+    n[0] /= normLength;
+    n[1] /= normLength;
+    n[2] /= normLength;
+
+    if (UbMath::less(n[0], 0.0))
+        n[0] = -n[0];
+    if (UbMath::less(n[1], 0.0))
+        n[1] = -n[1];
+    if (UbMath::less(n[2], 0.0))
+        n[2] = -n[2];
+
+    // cout<<"Normals: "<<n[0]<<" "<<n[1]<<" "<<n[2]<<endl;
+
+    double dummy;
+    if (UbMath::greater(n[0], n[1])) {
+        dummy = n[1];
+        n[1]  = n[0];
+        n[0]  = dummy;
+    }
+    if (UbMath::greater(n[1], n[2])) {
+        dummy = n[2];
+        n[2]  = n[1];
+        n[1]  = dummy;
+    }
+    if (UbMath::greater(n[0], n[1])) {
+        dummy = n[1];
+        n[1]  = n[0];
+        n[0]  = dummy;
+    }
+
+    // cout<<"Normals: "<<n[0]<<" "<<n[1]<<" "<<n[2]<<endl;
+
+    double n1, n2, n3;
+    n1 = n[0];
+    n2 = n[1];
+    n3 = n[2];
+
+    double preresult = 0.0, result = 0.0;
+
+    // 1D Check
+    if (UbMath::lessEqual(n1, 0.00001) && UbMath::lessEqual(n2, 0.00001)) {
+        result = alpha * x1 * x2;
+    }
+    // 2D Check
+    else if (UbMath::lessEqual(n1, 0.00001)) {
+        preresult = (2 * n2 * n3);
+        result    = (alpha * alpha) / preresult;
+
+        if (UbMath::greater(alpha, n2 * x2)) {
+            result += -(alpha - n2 * x2) * (alpha - n2 * x2) / preresult;
+        }
+        if (UbMath::greater(alpha, n3 * x3)) {
+            result += -(alpha - n3 * x3) * (alpha - n3 * x3) / preresult;
+        }
+        if (UbMath::greater(alpha, n2 * x2 + n3 * x3)) {
+            result += (alpha - n2 * x2 - n3 * x3) * (alpha - n2 * x2 - n3 * x3) / preresult;
+        }
+
+        // tiefenrichtung mit einmultiplizieren...
+        result *= x1;
+    }
+    // 3D Check
+    else {
+        preresult = 6 * n1 * n2 * n3;
+
+        result = alpha * alpha * alpha / preresult;
+
+        if (UbMath::greater(alpha, n1 * x1)) {
+            result += -((alpha - n1 * x1) * (alpha - n1 * x1) * (alpha - n1 * x1)) / preresult;
+        }
+        if (UbMath::greater(alpha, n2 * x2)) {
+            result += -((alpha - n2 * x2) * (alpha - n2 * x2) * (alpha - n2 * x2)) / preresult;
+        }
+        if (UbMath::greater(alpha, n3 * x3)) {
+            result += -((alpha - n3 * x3) * (alpha - n3 * x3) * (alpha - n3 * x3)) / preresult;
+        }
+        if (UbMath::greater(alpha, (n1 * x1 + n2 * x2))) {
+            result += ((alpha - (n1 * x1 + n2 * x2)) * (alpha - (n1 * x1 + n2 * x2)) * (alpha - (n1 * x1 + n2 * x2))) /
+                      preresult;
+        }
+        if (UbMath::greater(alpha, (n1 * x1 + n3 * x3))) {
+            result += ((alpha - (n1 * x1 + n3 * x3)) * (alpha - (n1 * x1 + n3 * x3)) * (alpha - (n1 * x1 + n3 * x3))) /
+                      preresult;
+        }
+        if (UbMath::greater(alpha, (n2 * x2 + n3 * x3))) {
+            result += ((alpha - (n2 * x2 + n3 * x3)) * (alpha - (n2 * x2 + n3 * x3)) * (alpha - (n2 * x2 + n3 * x3))) /
+                      preresult;
+        }
+
+        // NEW
+        if (UbMath::greater(alpha, (n1 * x1 + n2 * x2 + n3 * x3))) {
+            result += -((alpha - (n1 * x1 + n2 * x2 + n3 * x3)) * (alpha - (n1 * x1 + n2 * x2 + n3 * x3)) *
+                        (alpha - (n1 * x1 + n2 * x2 + n3 * x3))) /
+                      preresult;
+        }
+    }
+
+    if (!UbMath::inClosedInterval(result / (x1 * x2 * x3), -0.01, 1.01)) {
+        stringstream errMsg;
+
+        errMsg << "Danger...Fuellstand " << result << " nicht im Interfall [0.0..1.0]" << endl;
+        errMsg << "NormVec: " << n1 << " " << n2 << " " << n3 << endl;
+        errMsg << "Cell:    " << x1 << " " << x2 << " " << x3 << endl;
+        errMsg << "Alpha:   " << alpha << endl;
+
+        throw UbException(UB_EXARGS, errMsg.str());
+    }
+
+    return result;
+
+    // double eps=0.0;
+    // if( UbMath::equal(n1,0.0) && UbMath::equal(n2,0.0) )
+    //{
+    //   eps = alpha/n3;
+    //}
+    // else if( UbMath::equal(n1,0.0) )
+    //{
+    //   double dim1,dim2;
+    //   dim1 = alpha/n2;
+    //   dim2 = alpha/n3;
+
+    //   eps = 0.5*dim1*dim2;
+    //   if( UbMath::greater(dim1,1.0) )   eps -= 0.5*(dim1-1.0)*dim2/dim1*(dim1-1.0);
+    //   if( UbMath::greater(dim2,1.0) )   eps -= 0.5*(dim2-1.0)*dim1/dim2*(dim2-1.0);
+    //}
+    // else
+    //{
+    //   eps = alpha*alpha*alpha;
+    //   if( UbMath::greater(alpha,n1) )
+    //      eps -= (alpha-n1)*(alpha-n1)*(alpha-n1);
+    //   if( UbMath::greater(alpha,n2) )
+    //      eps -= (alpha-n2)*(alpha-n2)*(alpha-n2);
+    //   if( UbMath::greater(alpha,n3) )
+    //      eps -= (alpha-n3)*(alpha-n3)*(alpha-n3);
+
+    //   if( UbMath::greater(alpha,n1+n2) )
+    //      eps += (alpha-n1-n2)*(alpha-n1-n2)*(alpha-n1-n2);
+    //   if( UbMath::greater(alpha,n1+n3) )
+    //      eps += (alpha-n1-n3)*(alpha-n1-n3)*(alpha-n1-n3);
+    //   if( UbMath::greater(alpha,n2+n3) )
+    //      eps += (alpha-n2-n3)*(alpha-n2-n3)*(alpha-n2-n3);
+
+    //   //attention: use without delta_i
+    //   eps = eps / (6*n[0]*n[1]*n[2]);
+
+    //   eps = eps / (deltaX1*deltaX2*deltaX3);
+    //}
+
+    // return(eps) ;
+    // cout << "alpha ist " << alpha << endl;
+    // cout << "fillLevel ist " << eps << endl;
 }
 /*==========================================================*/
diff --git a/src/basics/geometry3d/GbHalfSpaceKrischan3D.h b/src/basics/geometry3d/GbHalfSpaceKrischan3D.h
index d3769a5f664ca060f2eeb51691fd81dd3bebc5ab..df01e6c7b30c5ebcc6a2bdbfd828e2523c4f927d 100644
--- a/src/basics/geometry3d/GbHalfSpaceKrischan3D.h
+++ b/src/basics/geometry3d/GbHalfSpaceKrischan3D.h
@@ -7,196 +7,194 @@
 #ifndef GbHalfSpaceKrischan3D_H
 #define GbHalfSpaceKrischan3D_H
 
-#include <sstream>
 #include <iostream>
+#include <sstream>
 
 #include <basics/utilities/UbMath.h>
 
+#include <geometry3d/GbLine3D.h>
 #include <geometry3d/GbPoint3D.h>
 #include <geometry3d/GbTriangle3D.h>
 #include <geometry3d/GbVector3D.h>
-#include <geometry3d/GbLine3D.h>
 
 /*=========================================================================*/
 /* GbHalfSpaceKrischan3D                                                             */
 /*                                                                         */
 /**
-* This Class helps in performing some operations on a halfspace defined by 2 or 3 points
-*/
+ * This Class helps in performing some operations on a halfspace defined by 2 or 3 points
+ */
 
-class GbHalfSpaceKrischan3D : public GbObject3D , public UbObserver                           
+class GbHalfSpaceKrischan3D : public GbObject3D, public UbObserver
 {
 public:
-   GbHalfSpaceKrischan3D(GbTriangle3D* triangle);
-
-   GbHalfSpaceKrischan3D(GbPoint3D* PointA, GbPoint3D* PointB, GbPoint3D* PointC);
-   
-   GbHalfSpaceKrischan3D(double nx, double ny, double nz, double dist);
-
-   GbHalfSpaceKrischan3D(GbPoint3D* PointA, GbPoint3D* PointB);
-
-   GbHalfSpaceKrischan3D(  const double& p1x, const double& p1y, const double& p1z
-                 , const double& p2x, const double& p2y, const double& p2z
-                 , const double& p3x, const double& p3y, const double& p3z );
-
-   /*=======================================================*/
-   ~GbHalfSpaceKrischan3D() override = default;
-   /*=======================================================*/
-   std::string getTypeID() {return "GbHalfSpaceKrischan3D"; }
-   /*=============================================*/
-   bool ptInside(const double& x, const double& y, const double& z)
-   {
-      return UbMath::lessEqual(Normal[0]*x+Normal[1]*y+Normal[2]*z, this->d);
-   }
-   /*=============================================*/
-   bool ptInside(GbPoint3D* PointX)
-   {
-      GbVector3D X(PointX->x1, PointX->x2, PointX->x3 );
-      return UbMath::lessEqual(this->Normal.Dot(X), this->d);      
-   }
-   /*=============================================*/
-   bool ptInside(GbVector3D &X)
-   {
-      return UbMath::lessEqual(this->Normal.Dot(X), this->d);
-   }
-
-   /*=====================================================*/
-   //true, wenn 'in Object' oder 'auf Boundary'!
-   bool isPointInGbObject3D(const double& x1p, const double& x2p, const double& x3p) override
-   {
-      return (ptInside(x1p,x2p,x3p));
-   }
-   /*=====================================================*/
-   //true, wenn 'in Object' oder 'auf Boundary'!
-   bool isPointInGbObject3D(const double& x1p, const double& x2p, const double& x3p, bool&  /*pointIsOnBoundary*/) override
-   {
-      return (ptInside(x1p,x2p,x3p));
-   }
-
-   void finalize() override{}
-
-   double getX1Centroid() override{ return      0.0; }
-   double getX1Minimum() override { return -99999.0; }
-   double getX1Maximum() override { return  99999.0; }
-   double getX2Centroid() override{ return      0.0; }
-   double getX2Minimum() override { return -99999.0; }
-   double getX2Maximum() override { return  99999.0; }
-   double getX3Centroid() override{ return      0.0; }
-   double getX3Minimum() override { return -99999.0; }
-   double getX3Maximum() override { return  99999.0; }
-
-
-   GbLine3D* createClippedLine3D (GbPoint3D &point1, GbPoint3D &point2) override
-   {
-	   GbPoint3D *p1 = new GbPoint3D(point1);
-	   GbPoint3D *p2 = new GbPoint3D(point2);
-
-	   GbVector3D p1p2( p2->x1-p1->x1, p2->x2-p1->x2, p2->x3-p1->x3);
-
-	   double dist1 = getDistance( p1->x1,p1->x2,p1->x3 );
-	   double dist2 = getDistance( p2->x1,p2->x2,p2->x3 );
-		   
-	   double totalDist = std::abs(dist1) + std::abs(dist2);
-
-	   // Falls erster Punkt nicht drinliegt
-	   if( !ptInside(p1) )
-	   {
-		   if( !ptInside(p2) ) return NULL;
-
-		   // distance ausrechnen (groesser null)
-		   if( UbMath::less( dist1, 0.0 ) )   throw UbException( UB_EXARGS, "Punkt ausserhalb, aber Distanz kleiner null???" );
-
-		   p1->x1 = p1->x1 + dist1/totalDist*p1p2[0];
-		   p1->x2 = p1->x2 + dist1/totalDist*p1p2[1];
-		   p1->x3 = p1->x3 + dist1/totalDist*p1p2[2];	   
-	   }
-	   // Falls zweiter Punkt nicht drinliegt
-	   if( !ptInside(p2) )
-	   {
-		   if( !ptInside(p1) ) return NULL;
-
-		   // distance ausrechnen (groesser null)
-		   if( UbMath::less( dist2, 0.0 ) )   throw UbException( UB_EXARGS, "Punkt ausserhalb, aber Distanz kleiner null???" );
-
-		   p2->x1 = p2->x1 - dist2/totalDist*p1p2[0];
-		   p2->x2 = p2->x2 - dist2/totalDist*p1p2[1];
-		   p2->x3 = p2->x3 - dist2/totalDist*p1p2[2];	   
-	   }
-
-	   return new GbLine3D(p1,p2);
-   }
- 
-
-   double getCellVolumeInsideGbObject3D(const double& x1a,const double& x2a,const double& x3a,const double& x1b,const double& x2b,const double& x3b) override;
-
-   double getDistance(const double& x1p, const double& x2p, const double& x3p)
-   {
-      return (Normal[0]*x1p + Normal[1]*x2p + Normal[2]*x3p) - this->d;
-   }
-
-   void getNormal( double& n1, double& n2, double& n3 )
-   {
-      n1 = this->Normal[0];
-      n2 = this->Normal[1];
-      n3 = this->Normal[2];
-   }
-
-   void addSurfaceTriangleSet(std::vector<UbTupleFloat3>&  /*nodes*/, std::vector<UbTupleInt3>&  /*triangles*/) override
-   {
-	   std::cout << " addSurfaceTriangleSet(): TO BE DONE AND CHECKED ... " << std::endl;
-   }
-
-   std::vector<GbTriangle3D*> getSurfaceTriangleSet() override
-   {
-      std::vector<GbTriangle3D*> triangles;
-      GbPoint3D p1( 0.0,0.0,0.0 );
-      GbPoint3D p2( 1.0,0.0,0.0 );
-      GbPoint3D p3( 0.0,1.0,0.0 );
-
-      triangles.push_back(new GbTriangle3D(new GbPoint3D(p1),new GbPoint3D(p2),new GbPoint3D(p3)));
-
-      return triangles;
-   }
-
-   void objectChanged(UbObservable*  /*changedObject*/) override
-   {
-      return;
-      
-      //GbLine3D* line = dynamic_cast<GbLine3D*>(changedObject);
-      //if(!line || this->mLine!=line) return;
-      //this->notifyObserversObjectChanged();
-   }
-   /*==========================================================*/
-   void objectWillBeDeleted(UbObservable*  /*objectForDeletion*/) override
-   {
-      return;
-      //if(this->mLine)
-      //{
-      //   UbObservable* observedObj = dynamic_cast<UbObservable*>(this->mLine);
-      //   if(objectForDeletion == observedObj) { this->mLine = NULL; }
-      //}
-   }
-
-   ObObject*   clone() override{ return NULL; };
-
-   std::string toString() override
-   { 
-	   std::stringstream temp;
-
-	   temp << "GbHalfSpaceKrischan3D:   ";
-	   temp << " Distance   " << this->d;
-	   temp << " Norm vec   " << this->Normal[0];
-	   temp << " " << this->Normal[1];
-	   temp << " " << this->Normal[2];
-	   
-	   
-	   return temp.str();
-   };
+    GbHalfSpaceKrischan3D(GbTriangle3D *triangle);
+
+    GbHalfSpaceKrischan3D(GbPoint3D *PointA, GbPoint3D *PointB, GbPoint3D *PointC);
+
+    GbHalfSpaceKrischan3D(double nx, double ny, double nz, double dist);
+
+    GbHalfSpaceKrischan3D(GbPoint3D *PointA, GbPoint3D *PointB);
+
+    GbHalfSpaceKrischan3D(const double &p1x, const double &p1y, const double &p1z, const double &p2x, const double &p2y,
+                          const double &p2z, const double &p3x, const double &p3y, const double &p3z);
+
+    /*=======================================================*/
+    ~GbHalfSpaceKrischan3D() override = default;
+    /*=======================================================*/
+    std::string getTypeID() { return "GbHalfSpaceKrischan3D"; }
+    /*=============================================*/
+    bool ptInside(const double &x, const double &y, const double &z)
+    {
+        return UbMath::lessEqual(Normal[0] * x + Normal[1] * y + Normal[2] * z, this->d);
+    }
+    /*=============================================*/
+    bool ptInside(GbPoint3D *PointX)
+    {
+        GbVector3D X(PointX->x1, PointX->x2, PointX->x3);
+        return UbMath::lessEqual(this->Normal.Dot(X), this->d);
+    }
+    /*=============================================*/
+    bool ptInside(GbVector3D &X) { return UbMath::lessEqual(this->Normal.Dot(X), this->d); }
+
+    /*=====================================================*/
+    // true, wenn 'in Object' oder 'auf Boundary'!
+    bool isPointInGbObject3D(const double &x1p, const double &x2p, const double &x3p) override
+    {
+        return (ptInside(x1p, x2p, x3p));
+    }
+    /*=====================================================*/
+    // true, wenn 'in Object' oder 'auf Boundary'!
+    bool isPointInGbObject3D(const double &x1p, const double &x2p, const double &x3p,
+                             bool & /*pointIsOnBoundary*/) override
+    {
+        return (ptInside(x1p, x2p, x3p));
+    }
+
+    void finalize() override {}
+
+    double getX1Centroid() override { return 0.0; }
+    double getX1Minimum() override { return -99999.0; }
+    double getX1Maximum() override { return 99999.0; }
+    double getX2Centroid() override { return 0.0; }
+    double getX2Minimum() override { return -99999.0; }
+    double getX2Maximum() override { return 99999.0; }
+    double getX3Centroid() override { return 0.0; }
+    double getX3Minimum() override { return -99999.0; }
+    double getX3Maximum() override { return 99999.0; }
+
+    GbLine3D *createClippedLine3D(GbPoint3D &point1, GbPoint3D &point2) override
+    {
+        GbPoint3D *p1 = new GbPoint3D(point1);
+        GbPoint3D *p2 = new GbPoint3D(point2);
+
+        GbVector3D p1p2(p2->x1 - p1->x1, p2->x2 - p1->x2, p2->x3 - p1->x3);
+
+        double dist1 = getDistance(p1->x1, p1->x2, p1->x3);
+        double dist2 = getDistance(p2->x1, p2->x2, p2->x3);
+
+        double totalDist = std::abs(dist1) + std::abs(dist2);
+
+        // Falls erster Punkt nicht drinliegt
+        if (!ptInside(p1)) {
+            if (!ptInside(p2))
+                return NULL;
+
+            // distance ausrechnen (groesser null)
+            if (UbMath::less(dist1, 0.0))
+                throw UbException(UB_EXARGS, "Punkt ausserhalb, aber Distanz kleiner null???");
+
+            p1->x1 = p1->x1 + dist1 / totalDist * p1p2[0];
+            p1->x2 = p1->x2 + dist1 / totalDist * p1p2[1];
+            p1->x3 = p1->x3 + dist1 / totalDist * p1p2[2];
+        }
+        // Falls zweiter Punkt nicht drinliegt
+        if (!ptInside(p2)) {
+            if (!ptInside(p1))
+                return NULL;
+
+            // distance ausrechnen (groesser null)
+            if (UbMath::less(dist2, 0.0))
+                throw UbException(UB_EXARGS, "Punkt ausserhalb, aber Distanz kleiner null???");
+
+            p2->x1 = p2->x1 - dist2 / totalDist * p1p2[0];
+            p2->x2 = p2->x2 - dist2 / totalDist * p1p2[1];
+            p2->x3 = p2->x3 - dist2 / totalDist * p1p2[2];
+        }
+
+        return new GbLine3D(p1, p2);
+    }
+
+    double getCellVolumeInsideGbObject3D(const double &x1a, const double &x2a, const double &x3a, const double &x1b,
+                                         const double &x2b, const double &x3b) override;
+
+    double getDistance(const double &x1p, const double &x2p, const double &x3p)
+    {
+        return (Normal[0] * x1p + Normal[1] * x2p + Normal[2] * x3p) - this->d;
+    }
+
+    void getNormal(double &n1, double &n2, double &n3)
+    {
+        n1 = this->Normal[0];
+        n2 = this->Normal[1];
+        n3 = this->Normal[2];
+    }
+
+    void addSurfaceTriangleSet(std::vector<UbTupleFloat3> & /*nodes*/,
+                               std::vector<UbTupleInt3> & /*triangles*/) override
+    {
+        std::cout << " addSurfaceTriangleSet(): TO BE DONE AND CHECKED ... " << std::endl;
+    }
+
+    std::vector<GbTriangle3D *> getSurfaceTriangleSet() override
+    {
+        std::vector<GbTriangle3D *> triangles;
+        GbPoint3D p1(0.0, 0.0, 0.0);
+        GbPoint3D p2(1.0, 0.0, 0.0);
+        GbPoint3D p3(0.0, 1.0, 0.0);
+
+        triangles.push_back(new GbTriangle3D(new GbPoint3D(p1), new GbPoint3D(p2), new GbPoint3D(p3)));
+
+        return triangles;
+    }
+
+    void objectChanged(UbObservable * /*changedObject*/) override
+    {
+        return;
+
+        // GbLine3D* line = dynamic_cast<GbLine3D*>(changedObject);
+        // if(!line || this->mLine!=line) return;
+        // this->notifyObserversObjectChanged();
+    }
+    /*==========================================================*/
+    void objectWillBeDeleted(UbObservable * /*objectForDeletion*/) override
+    {
+        return;
+        // if(this->mLine)
+        //{
+        //   UbObservable* observedObj = dynamic_cast<UbObservable*>(this->mLine);
+        //   if(objectForDeletion == observedObj) { this->mLine = NULL; }
+        //}
+    }
+
+    ObObject *clone() override { return NULL; };
+
+    std::string toString() override
+    {
+        std::stringstream temp;
+
+        temp << "GbHalfSpaceKrischan3D:   ";
+        temp << " Distance   " << this->d;
+        temp << " Norm vec   " << this->Normal[0];
+        temp << " " << this->Normal[1];
+        temp << " " << this->Normal[2];
+
+        return temp.str();
+    };
 
 private:
-   GbVector3D Normal;
-   double d;
+    GbVector3D Normal;
+    double d;
 };
 /*=========================================================================*/
 
-#endif //GbHalfSpaceKrischan3D_H
+#endif // GbHalfSpaceKrischan3D_H
diff --git a/src/basics/geometry3d/GbLine3D.cpp b/src/basics/geometry3d/GbLine3D.cpp
index 752e3a421c982fd7606f5b4ed6f73218f0ca7014..d883de49a91612d5a6b2fbc0903f3fca4cfeea6d 100644
--- a/src/basics/geometry3d/GbLine3D.cpp
+++ b/src/basics/geometry3d/GbLine3D.cpp
@@ -1,28 +1,28 @@
 //=======================================================================================
-// ____          ____    __    ______     __________   __      __       __        __         
-// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |        
-//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |        
-//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |        
-//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____    
-//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|   
-//      \    \  |    |   ________________________________________________________________    
-//       \    \ |    |  |  ______________________________________________________________|   
-//        \    \|    |  |  |         __          __     __     __     ______      _______    
-//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)   
-//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______    
+// ____          ____    __    ______     __________   __      __       __        __
+// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |
+//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |
+//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |
+//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____
+//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|
+//      \    \  |    |   ________________________________________________________________
+//       \    \ |    |  |  ______________________________________________________________|
+//        \    \|    |  |  |         __          __     __     __     ______      _______
+//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)
+//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______
 //           \       |  |  |        |  |_____   |   \_/   |   |  |   |  |_/  /    _____  |
-//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/   
+//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/
 //
-//  This file is part of VirtualFluids. VirtualFluids is free software: you can 
+//  This file is part of VirtualFluids. VirtualFluids is free software: you can
 //  redistribute it and/or modify it under the terms of the GNU General Public
-//  License as published by the Free Software Foundation, either version 3 of 
+//  License as published by the Free Software Foundation, either version 3 of
 //  the License, or (at your option) any later version.
-//  
-//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT 
-//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
-//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License 
+//
+//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT
+//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 //  for more details.
-//  
+//
 //  You should have received a copy of the GNU General Public License along
 //  with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>.
 //
@@ -30,9 +30,9 @@
 //! \ingroup geometry3d
 //! \author Soeren Freudiger, Sebastian Geller
 //=======================================================================================
+#include <GbCuboid3D.h>
 #include <GbLine3D.h>
 #include <GbSystem3D.h>
-#include <GbCuboid3D.h>
 #include <GbTriangle3D.h>
 
 using namespace std;
@@ -40,207 +40,232 @@ using namespace std;
 /*=======================================================*/
 GbLine3D::GbLine3D()
 {
-   p1     = NULL;
-   p2     = NULL;                       
-   length = 0.0;
+    p1     = NULL;
+    p2     = NULL;
+    length = 0.0;
 }
 /*=======================================================*/
-GbLine3D::GbLine3D(GbPoint3D* point1, GbPoint3D* point2)
+GbLine3D::GbLine3D(GbPoint3D *point1, GbPoint3D *point2)
 {
-   this->p1 = point1;
-   this->p2 = point2;
-   this->p1->addObserver(this);
-   this->p2->addObserver(this);
-   this->calculateValues();
+    this->p1 = point1;
+    this->p2 = point2;
+    this->p1->addObserver(this);
+    this->p2->addObserver(this);
+    this->calculateValues();
 }
 /*=======================================================*/
-GbLine3D::GbLine3D(GbLine3D* line)
+GbLine3D::GbLine3D(GbLine3D *line)
 {
-   this->p1 = line->p1->clone();            
-   this->p2 = line->p2->clone();
-   this->p1->addObserver(this);
-   this->p2->addObserver(this);
-   this->calculateValues();
+    this->p1 = line->p1->clone();
+    this->p2 = line->p2->clone();
+    this->p1->addObserver(this);
+    this->p2->addObserver(this);
+    this->calculateValues();
 }
 /*=======================================================*/
-GbLine3D::~GbLine3D() 
+GbLine3D::~GbLine3D()
 {
-   if(this->p1) this->p1->removeObserver(this);
-   if(this->p2) this->p2->removeObserver(this);
+    if (this->p1)
+        this->p1->removeObserver(this);
+    if (this->p2)
+        this->p2->removeObserver(this);
 }
 /*=======================================================*/
-void GbLine3D::finalize() 
-{
-   if(this->p1) 
-   {
-      this->p1->removeObserver(this);
-      this->p1->finalize();
-      delete this->p1;
-      this->p1 = NULL;
-   }
-   if(this->p2)
-   {
-      this->p2->removeObserver(this);
-      this->p2->finalize();
-      delete this->p2;
-      this->p2 = NULL;
-   }
+void GbLine3D::finalize()
+{
+    if (this->p1) {
+        this->p1->removeObserver(this);
+        this->p1->finalize();
+        delete this->p1;
+        this->p1 = NULL;
+    }
+    if (this->p2) {
+        this->p2->removeObserver(this);
+        this->p2->finalize();
+        delete this->p2;
+        this->p2 = NULL;
+    }
 }
 /*=======================================================*/
-vector<GbTriangle3D*> GbLine3D::getSurfaceTriangleSet()
+vector<GbTriangle3D *> GbLine3D::getSurfaceTriangleSet()
 {
-   vector<GbTriangle3D*> triangles;
-   GbPoint3D p1(getX1Minimum(),getX2Minimum(),getX3Minimum());
-   GbPoint3D p2(getX1Centroid(),getX2Centroid(),getX3Centroid());
-   GbPoint3D p3(getX1Maximum(),getX2Maximum(),getX3Maximum());
- 
-   triangles.push_back(new GbTriangle3D(new GbPoint3D(p1),new GbPoint3D(p2),new GbPoint3D(p3)));
-   
-   return triangles;
+    vector<GbTriangle3D *> triangles;
+    GbPoint3D p1(getX1Minimum(), getX2Minimum(), getX3Minimum());
+    GbPoint3D p2(getX1Centroid(), getX2Centroid(), getX3Centroid());
+    GbPoint3D p3(getX1Maximum(), getX2Maximum(), getX3Maximum());
+
+    triangles.push_back(new GbTriangle3D(new GbPoint3D(p1), new GbPoint3D(p2), new GbPoint3D(p3)));
+
+    return triangles;
 }
 /*=======================================================*/
-void GbLine3D::setPoint1(GbPoint3D* point1)
-{ 
-   if(this->p1) this->p1->removeObserver(this);
-   this->p1 = point1;  
-   this->p1->addObserver(this);
+void GbLine3D::setPoint1(GbPoint3D *point1)
+{
+    if (this->p1)
+        this->p1->removeObserver(this);
+    this->p1 = point1;
+    this->p1->addObserver(this);
 
-   if(this->p1 && this->p2) this->calculateValues(); 
+    if (this->p1 && this->p2)
+        this->calculateValues();
 }
 /*=======================================================*/
-void GbLine3D::setPoint2(GbPoint3D* point2)
-{ 
-   if(this->p2) this->p2->removeObserver(this);
-   this->p2 = point2;  
-   this->p2->addObserver(this);
+void GbLine3D::setPoint2(GbPoint3D *point2)
+{
+    if (this->p2)
+        this->p2->removeObserver(this);
+    this->p2 = point2;
+    this->p2->addObserver(this);
 
-   if(this->p1 && this->p2) this->calculateValues(); 
+    if (this->p1 && this->p2)
+        this->calculateValues();
 }
 /*=======================================================*/
-void GbLine3D::setPoints(GbPoint3D* point1, GbPoint3D* point2)
-{ 
-   if(this->p1) this->p1->removeObserver(this);
-   if(this->p2) this->p2->removeObserver(this);
+void GbLine3D::setPoints(GbPoint3D *point1, GbPoint3D *point2)
+{
+    if (this->p1)
+        this->p1->removeObserver(this);
+    if (this->p2)
+        this->p2->removeObserver(this);
 
-   this->p1 = point1; 
-   this->p2 = point2;
+    this->p1 = point1;
+    this->p2 = point2;
 
-   this->p1->addObserver(this);
-   this->p2->addObserver(this);
+    this->p1->addObserver(this);
+    this->p2->addObserver(this);
 
-   this->calculateValues(); 
+    this->calculateValues();
 }
 /*=======================================================*/
 string GbLine3D::toString()
 {
-   stringstream ss;
-   ss<<"GbLine3D[p1=";
-   ss<<this->p1->toString()<<",p2="<<this->p2->toString()<<",l="<<this->getLength()<<"]";
-   return(ss.str());
+    stringstream ss;
+    ss << "GbLine3D[p1=";
+    ss << this->p1->toString() << ",p2=" << this->p2->toString() << ",l=" << this->getLength() << "]";
+    return (ss.str());
 }
 /*=======================================================*/
-GbPoint3D* GbLine3D::calculateIntersectionPoint3D(GbLine3D*  /*line*/)
+GbPoint3D *GbLine3D::calculateIntersectionPoint3D(GbLine3D * /*line*/)
 {
-   throw UbException(UB_EXARGS," not implemented");
-   //return(GbSystem::calculateIntersectionPoint3D(*this->p1, *this->p2, *line->p1, *line->p2));
+    throw UbException(UB_EXARGS, " not implemented");
+    // return(GbSystem::calculateIntersectionPoint3D(*this->p1, *this->p2, *line->p1, *line->p2));
 }
 /*======================================================================*/
-GbLine3D* GbLine3D::createClippedLine3D(GbCuboid3D* cuboid)
+GbLine3D *GbLine3D::createClippedLine3D(GbCuboid3D *cuboid)
 {
-   return GbSystem3D::createClipLine3D(*this->p1, *this->p2, cuboid->getPoint1()->x1, cuboid->getPoint1()->x2, cuboid->getPoint1()->x3, cuboid->getPoint2()->x1, cuboid->getPoint2()->x2, cuboid->getPoint2()->x3);
-}                           
-/*======================================================================*/
-GbLine3D* GbLine3D::createClippedLine3D(GbPoint3D* pA, GbPoint3D* pE)
-{
-   return GbSystem3D::createClipLine3D(*this->p1, *this->p2, pA->x1, pA->x2, pA->x3, pE->x1, pE->x2, pE->x3);
+    return GbSystem3D::createClipLine3D(*this->p1, *this->p2, cuboid->getPoint1()->x1, cuboid->getPoint1()->x2,
+                                        cuboid->getPoint1()->x3, cuboid->getPoint2()->x1, cuboid->getPoint2()->x2,
+                                        cuboid->getPoint2()->x3);
 }
 /*======================================================================*/
-double GbLine3D::getDistance(const GbPoint3D& point)
+GbLine3D *GbLine3D::createClippedLine3D(GbPoint3D *pA, GbPoint3D *pE)
 {
-   return this->getDistance(point.x1,point.x2,point.x3);
+    return GbSystem3D::createClipLine3D(*this->p1, *this->p2, pA->x1, pA->x2, pA->x3, pE->x1, pE->x2, pE->x3);
 }
 /*======================================================================*/
-double GbLine3D::getDistance(const double& x1,const double& x2,const double& x3)
+double GbLine3D::getDistance(const GbPoint3D &point) { return this->getDistance(point.x1, point.x2, point.x3); }
+/*======================================================================*/
+double GbLine3D::getDistance(const double &x1, const double &x2, const double &x3)
 {
-   double dx1 = this->p2->x1 - this->p1->x1;
-   double dx2 = this->p2->x2 - this->p1->x2;
-   double dx3 = this->p2->x3 - this->p1->x3;
+    double dx1 = this->p2->x1 - this->p1->x1;
+    double dx2 = this->p2->x2 - this->p1->x2;
+    double dx3 = this->p2->x3 - this->p1->x3;
 
-   //double vec[3];
-   double a0 = x1 - p1->x1;
-   double a1 = x2 - p1->x2;
-   double a2 = x3 - p1->x3;
+    // double vec[3];
+    double a0 = x1 - p1->x1;
+    double a1 = x2 - p1->x2;
+    double a2 = x3 - p1->x3;
 
-   double kreuzProd0 = a1 * dx3 - a2 * dx2;
-   double kreuzProd1 = a2 * dx1 - a0 * dx3;
-   double kreuzProd2 = a0 * dx2 - a1 * dx1;
+    double kreuzProd0 = a1 * dx3 - a2 * dx2;
+    double kreuzProd1 = a2 * dx1 - a0 * dx3;
+    double kreuzProd2 = a0 * dx2 - a1 * dx1;
 
-   return (std::sqrt(kreuzProd0*kreuzProd0+kreuzProd1*kreuzProd1+kreuzProd2*kreuzProd2))/length;
+    return (std::sqrt(kreuzProd0 * kreuzProd0 + kreuzProd1 * kreuzProd1 + kreuzProd2 * kreuzProd2)) / length;
 }
 /*=======================================================*/
 void GbLine3D::calculateValues()
 {
-   double dx1 = this->p2->x1 - this->p1->x1;
-   double dx2 = this->p2->x2 - this->p1->x2;
-   double dx3 = this->p2->x3 - this->p1->x3;
-   this->length = std::sqrt(dx1*dx1+dx2*dx2+dx3*dx3);
+    double dx1   = this->p2->x1 - this->p1->x1;
+    double dx2   = this->p2->x2 - this->p1->x2;
+    double dx3   = this->p2->x3 - this->p1->x3;
+    this->length = std::sqrt(dx1 * dx1 + dx2 * dx2 + dx3 * dx3);
 }
 /*==========================================================*/
-void GbLine3D::objectChanged(UbObservable* changedObject)
+void GbLine3D::objectChanged(UbObservable *changedObject)
 {
-   GbPoint3D* point = dynamic_cast<GbPoint3D*>(changedObject);
-   if(!point || (this->p1!=point && this->p2!=point)) return;
+    GbPoint3D *point = dynamic_cast<GbPoint3D *>(changedObject);
+    if (!point || (this->p1 != point && this->p2 != point))
+        return;
 
-   this->calculateValues();
+    this->calculateValues();
 }
 /*==========================================================*/
-void GbLine3D::objectWillBeDeleted(UbObservable* objectForDeletion)
-{
-   if(this->p1)
-   {
-      UbObservable* observedObj = dynamic_cast<UbObservable*>(this->p1);
-      if(objectForDeletion == observedObj) { this->p1 = NULL; length = 0.0; }
-   }
-   if(this->p2)
-   {
-      UbObservable* observedObj = dynamic_cast<UbObservable*>(this->p2);
-      if(objectForDeletion == observedObj) { this->p2 = NULL; length = 0.0; }
-   }
-   //ACHTUNG: eigentlich muessten in allen methoden von GbLine if abfragen fuer NULL pointer hin... toDo
+void GbLine3D::objectWillBeDeleted(UbObservable *objectForDeletion)
+{
+    if (this->p1) {
+        UbObservable *observedObj = dynamic_cast<UbObservable *>(this->p1);
+        if (objectForDeletion == observedObj) {
+            this->p1 = NULL;
+            length   = 0.0;
+        }
+    }
+    if (this->p2) {
+        UbObservable *observedObj = dynamic_cast<UbObservable *>(this->p2);
+        if (objectForDeletion == observedObj) {
+            this->p2 = NULL;
+            length   = 0.0;
+        }
+    }
+    // ACHTUNG: eigentlich muessten in allen methoden von GbLine if abfragen fuer NULL pointer hin... toDo
 }
 /*==========================================================*/
-void GbLine3D::scale(const double& sx1, const double& sx2, const double& sx3)
-{  
-   double p1X1 = this->p1->getX1Coordinate();
-   double p1X2 = this->p1->getX2Coordinate();
-   double p1X3 = this->p1->getX3Coordinate();
-
-   double p2X1 = this->p2->getX1Coordinate();
-   double p2X2 = this->p2->getX2Coordinate();
-   double p2X3 = this->p2->getX3Coordinate();
-
-   double lenX1 = fabs( p1X1 - p2X1 );
-   double lenX2 = fabs( p1X2 - p2X2 );
-   double lenX3 = fabs( p1X3 - p2X3 );
-
-   double deltaX1 = lenX1*sx1 - lenX1;
-   double deltaX2 = lenX2*sx2 - lenX2;
-   double deltaX3 = lenX3*sx3 - lenX3;
-
-   if(p1X1<p2X1) { p1X1 -=  0.5*deltaX1;   p2X1 +=  0.5*deltaX1; }
-   else          { p1X1 +=  0.5*deltaX1;   p2X1 -=  0.5*deltaX1; }
-   if(p1X2<p2X2) { p1X2 -=  0.5*deltaX2;   p2X2 +=  0.5*deltaX2; }
-   else          { p1X2 +=  0.5*deltaX2;   p2X2 -=  0.5*deltaX2; }
-   if(p1X3<p2X3) { p1X3 -=  0.5*deltaX3;   p2X3 +=  0.5*deltaX3; }
-   else          { p1X3 +=  0.5*deltaX3;   p2X3 -=  0.5*deltaX3; }
-
-   this->p1->setCoordinates(p1X1,p1X2,p1X3);
-   this->p2->setCoordinates(p2X1,p2X2,p2X3);
+void GbLine3D::scale(const double &sx1, const double &sx2, const double &sx3)
+{
+    double p1X1 = this->p1->getX1Coordinate();
+    double p1X2 = this->p1->getX2Coordinate();
+    double p1X3 = this->p1->getX3Coordinate();
+
+    double p2X1 = this->p2->getX1Coordinate();
+    double p2X2 = this->p2->getX2Coordinate();
+    double p2X3 = this->p2->getX3Coordinate();
+
+    double lenX1 = fabs(p1X1 - p2X1);
+    double lenX2 = fabs(p1X2 - p2X2);
+    double lenX3 = fabs(p1X3 - p2X3);
+
+    double deltaX1 = lenX1 * sx1 - lenX1;
+    double deltaX2 = lenX2 * sx2 - lenX2;
+    double deltaX3 = lenX3 * sx3 - lenX3;
+
+    if (p1X1 < p2X1) {
+        p1X1 -= 0.5 * deltaX1;
+        p2X1 += 0.5 * deltaX1;
+    } else {
+        p1X1 += 0.5 * deltaX1;
+        p2X1 -= 0.5 * deltaX1;
+    }
+    if (p1X2 < p2X2) {
+        p1X2 -= 0.5 * deltaX2;
+        p2X2 += 0.5 * deltaX2;
+    } else {
+        p1X2 += 0.5 * deltaX2;
+        p2X2 -= 0.5 * deltaX2;
+    }
+    if (p1X3 < p2X3) {
+        p1X3 -= 0.5 * deltaX3;
+        p2X3 += 0.5 * deltaX3;
+    } else {
+        p1X3 += 0.5 * deltaX3;
+        p2X3 -= 0.5 * deltaX3;
+    }
+
+    this->p1->setCoordinates(p1X1, p1X2, p1X3);
+    this->p2->setCoordinates(p2X1, p2X2, p2X3);
 }
 /*=======================================================*/
-void GbLine3D::translate(const double& tx1, const double& tx2, const double& tx3)
-{  
-   this->p1->translate(tx1, tx2, tx3);
-   this->p2->translate(tx1, tx2, tx3);
-   //this->notifyObserversObjectChanged();
+void GbLine3D::translate(const double &tx1, const double &tx2, const double &tx3)
+{
+    this->p1->translate(tx1, tx2, tx3);
+    this->p2->translate(tx1, tx2, tx3);
+    // this->notifyObserversObjectChanged();
 }
diff --git a/src/basics/geometry3d/GbLine3D.h b/src/basics/geometry3d/GbLine3D.h
index 25697f59b3cb04d61c3f5bcdbc16218315b9ef9b..29e0a3740cbe85fdae760e0234dbefa53617de1f 100644
--- a/src/basics/geometry3d/GbLine3D.h
+++ b/src/basics/geometry3d/GbLine3D.h
@@ -1,28 +1,28 @@
 //=======================================================================================
-// ____          ____    __    ______     __________   __      __       __        __         
-// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |        
-//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |        
-//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |        
-//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____    
-//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|   
-//      \    \  |    |   ________________________________________________________________    
-//       \    \ |    |  |  ______________________________________________________________|   
-//        \    \|    |  |  |         __          __     __     __     ______      _______    
-//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)   
-//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______    
+// ____          ____    __    ______     __________   __      __       __        __
+// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |
+//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |
+//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |
+//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____
+//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|
+//      \    \  |    |   ________________________________________________________________
+//       \    \ |    |  |  ______________________________________________________________|
+//        \    \|    |  |  |         __          __     __     __     ______      _______
+//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)
+//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______
 //           \       |  |  |        |  |_____   |   \_/   |   |  |   |  |_/  /    _____  |
-//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/   
+//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/
 //
-//  This file is part of VirtualFluids. VirtualFluids is free software: you can 
+//  This file is part of VirtualFluids. VirtualFluids is free software: you can
 //  redistribute it and/or modify it under the terms of the GNU General Public
-//  License as published by the Free Software Foundation, either version 3 of 
+//  License as published by the Free Software Foundation, either version 3 of
 //  the License, or (at your option) any later version.
-//  
-//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT 
-//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
-//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License 
+//
+//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT
+//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 //  for more details.
-//  
+//
 //  You should have received a copy of the GNU General Public License along
 //  with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>.
 //
@@ -33,9 +33,9 @@
 #ifndef GBLINE3D_H
 #define GBLINE3D_H
 
-#include <sstream>
 #include <cmath>
-          
+#include <sstream>
+
 #include <basics/utilities/UbObserver.h>
 
 #include <GbObject3D.h>
@@ -46,90 +46,114 @@ class GbCuboid3D;
 #include <PointerDefinitions.h>
 
 //////////////////////////////////////////////////////////////////////////
-//! 
+//!
 //!  \class GbLine3D
-//! 
+//!
 //! \brief This Class provides basic 3D line objects.
 //! \details The describing points are observed by 3D line objects.
 //!
 //////////////////////////////////////////////////////////////////////////
 
-class GbLine3D	: public GbObject3D , public UbObserver
+class GbLine3D : public GbObject3D, public UbObserver
 {
 public:
-   GbLine3D();
-	GbLine3D(GbPoint3D* point1, GbPoint3D* point2);
-	GbLine3D(GbLine3D* line);
-   ~GbLine3D() override; 
-
-   GbLine3D* clone() override { return new GbLine3D(this); }
-   void finalize() override;
-
-   void setPoint1(GbPoint3D* point1);
-   void setPoint2(GbPoint3D* point2);
-   void setPoints(GbPoint3D* point1, GbPoint3D* point2);
-
-   void deletePoint1() { if(this->p1) {this->p1->removeObserver(this); delete this->p1; this->p1=NULL;} }
-   void deletePoint2() { if(this->p2) {this->p2->removeObserver(this); delete this->p2; this->p2=NULL;} }
-   void deletePoints() { this->deletePoint1(); this->deletePoint2(); }
-
-   GbPoint3D* getPoint1() { return this->p1; }
-   GbPoint3D* getPoint2() { return this->p2; }    
-   
-   double getLength()     { return(this->length); }
-	
-   double getX1Centroid() override { return((this->p1->x1+this->p2->x1)*0.5);}
-   double getX2Centroid() override { return((this->p1->x2+this->p2->x2)*0.5); };
-   double getX3Centroid() override { return((this->p1->x3+this->p2->x3)*0.5); }
-   
-   double getX1Minimum() override  { return(this->p1->x1 < this->p2->x1 ? this->p1->x1 : this->p2->x1); }
-   double getX2Minimum() override  { return(this->p1->x2 < this->p2->x2 ? this->p1->x2 : this->p2->x2); }
-   double getX3Minimum() override  { return(this->p1->x3 < this->p2->x3 ? this->p1->x3 : this->p2->x3); }
-   
-   double getX1Maximum() override  { return(this->p1->x1 > this->p2->x1 ? this->p1->x1 : this->p2->x1); }
-   double getX2Maximum() override  { return(this->p1->x2 > this->p2->x2 ? this->p1->x2 : this->p2->x2); }
-   double getX3Maximum() override  { return(this->p1->x3 > this->p2->x3 ? this->p1->x3 : this->p2->x3); }
-	                                               
-   void scale(const double& sx1, const double& sx2, const double& sx3) override;
-   void translate(const double& tx1, const double& tx2, const double& tx3) override;
-
-   GbPoint3D* calculateIntersectionPoint3D(GbLine3D* line);
-   GbLine3D*  createClippedLine3D(GbCuboid3D* cuboid);
-   GbLine3D*  createClippedLine3D(GbPoint3D* pA, GbPoint3D* pE);
-   
-   double     getDistance(const GbPoint3D& point);
-   double     getDistance(const double& x1,const double& x2,const double& x3);
-
-   std::vector<GbTriangle3D*> getSurfaceTriangleSet() override;
-   bool isPointInGbObject3D(const double&  /*x1*/, const double&  /*x2*/, const double&  /*x3*/) override
-   {
-      throw UbException(UB_EXARGS,"not implemented");
-   }
-   bool isPointInGbObject3D(const double&  /*x1*/, const double&  /*x2*/, const double&  /*x3*/, bool&  /*pointIsOnBoundary*/) override
-   {
-      throw UbException(UB_EXARGS,"not implemented");
-   }
-   bool isCellInsideGbObject3D(const double&  /*x11*/,const double&  /*x21*/,const double&  /*x31*/,const double&  /*x12*/,const double&  /*x22*/,const double&  /*x32*/) override { return false; }
-
-   GbLine3D* createClippedLine3D (GbPoint3D&  /*point1*/, GbPoint3D&  /*point2*/) override
-   {
-      throw UbException(UB_EXARGS,"not implemented");
-   }
-
-   //virtuelle Methoden von UbObserver
-   void objectChanged(UbObservable* changedObject) override;
-   void objectWillBeDeleted(UbObservable* objectForDeletion) override;
-
-   std::string toString() override;
-
-   using GbObject3D::isPointInGbObject3D; //Grund: dadurch muss man hier  isPointInGbObject3D(GbPoint3D*) nicht ausprogrammieren, welche sonst hier "ueberdeckt" waere
+    GbLine3D();
+    GbLine3D(GbPoint3D *point1, GbPoint3D *point2);
+    GbLine3D(GbLine3D *line);
+    ~GbLine3D() override;
+
+    GbLine3D *clone() override { return new GbLine3D(this); }
+    void finalize() override;
+
+    void setPoint1(GbPoint3D *point1);
+    void setPoint2(GbPoint3D *point2);
+    void setPoints(GbPoint3D *point1, GbPoint3D *point2);
+
+    void deletePoint1()
+    {
+        if (this->p1) {
+            this->p1->removeObserver(this);
+            delete this->p1;
+            this->p1 = NULL;
+        }
+    }
+    void deletePoint2()
+    {
+        if (this->p2) {
+            this->p2->removeObserver(this);
+            delete this->p2;
+            this->p2 = NULL;
+        }
+    }
+    void deletePoints()
+    {
+        this->deletePoint1();
+        this->deletePoint2();
+    }
+
+    GbPoint3D *getPoint1() { return this->p1; }
+    GbPoint3D *getPoint2() { return this->p2; }
+
+    double getLength() { return (this->length); }
+
+    double getX1Centroid() override { return ((this->p1->x1 + this->p2->x1) * 0.5); }
+    double getX2Centroid() override { return ((this->p1->x2 + this->p2->x2) * 0.5); };
+    double getX3Centroid() override { return ((this->p1->x3 + this->p2->x3) * 0.5); }
+
+    double getX1Minimum() override { return (this->p1->x1 < this->p2->x1 ? this->p1->x1 : this->p2->x1); }
+    double getX2Minimum() override { return (this->p1->x2 < this->p2->x2 ? this->p1->x2 : this->p2->x2); }
+    double getX3Minimum() override { return (this->p1->x3 < this->p2->x3 ? this->p1->x3 : this->p2->x3); }
+
+    double getX1Maximum() override { return (this->p1->x1 > this->p2->x1 ? this->p1->x1 : this->p2->x1); }
+    double getX2Maximum() override { return (this->p1->x2 > this->p2->x2 ? this->p1->x2 : this->p2->x2); }
+    double getX3Maximum() override { return (this->p1->x3 > this->p2->x3 ? this->p1->x3 : this->p2->x3); }
+
+    void scale(const double &sx1, const double &sx2, const double &sx3) override;
+    void translate(const double &tx1, const double &tx2, const double &tx3) override;
+
+    GbPoint3D *calculateIntersectionPoint3D(GbLine3D *line);
+    GbLine3D *createClippedLine3D(GbCuboid3D *cuboid);
+    GbLine3D *createClippedLine3D(GbPoint3D *pA, GbPoint3D *pE);
+
+    double getDistance(const GbPoint3D &point);
+    double getDistance(const double &x1, const double &x2, const double &x3);
+
+    std::vector<GbTriangle3D *> getSurfaceTriangleSet() override;
+    bool isPointInGbObject3D(const double & /*x1*/, const double & /*x2*/, const double & /*x3*/) override
+    {
+        throw UbException(UB_EXARGS, "not implemented");
+    }
+    bool isPointInGbObject3D(const double & /*x1*/, const double & /*x2*/, const double & /*x3*/,
+                             bool & /*pointIsOnBoundary*/) override
+    {
+        throw UbException(UB_EXARGS, "not implemented");
+    }
+    bool isCellInsideGbObject3D(const double & /*x11*/, const double & /*x21*/, const double & /*x31*/,
+                                const double & /*x12*/, const double & /*x22*/, const double & /*x32*/) override
+    {
+        return false;
+    }
+
+    GbLine3D *createClippedLine3D(GbPoint3D & /*point1*/, GbPoint3D & /*point2*/) override
+    {
+        throw UbException(UB_EXARGS, "not implemented");
+    }
+
+    // virtuelle Methoden von UbObserver
+    void objectChanged(UbObservable *changedObject) override;
+    void objectWillBeDeleted(UbObservable *objectForDeletion) override;
+
+    std::string toString() override;
+
+    using GbObject3D::isPointInGbObject3D; // Grund: dadurch muss man hier  isPointInGbObject3D(GbPoint3D*) nicht
+                                           // ausprogrammieren, welche sonst hier "ueberdeckt" waere
 protected:
-   GbPoint3D* p1;
-	GbPoint3D* p2;
-	double     length;
+    GbPoint3D *p1;
+    GbPoint3D *p2;
+    double length;
 
 private:
-   void calculateValues();
+    void calculateValues();
 };
 
 #endif
diff --git a/src/basics/geometry3d/GbMeshTools3D.h b/src/basics/geometry3d/GbMeshTools3D.h
index 9805e33a6b57ec89b9bf62300cfa247616016c09..2a93319acb87011e0d63e60378e5db025c1e5a18 100644
--- a/src/basics/geometry3d/GbMeshTools3D.h
+++ b/src/basics/geometry3d/GbMeshTools3D.h
@@ -1,253 +1,316 @@
 #ifndef GBMESHTOOLS3D_H
 #define GBMESHTOOLS3D_H
 
-#include <sstream>
 #include <iostream>
+#include <sstream>
 #include <vector>
 
 #include <basics/utilities/UbMath.h>
 
 namespace GbMeshTools3D
 {
-   inline int planeBoxOverlap(float normal[3], float vert[3], float maxbox[3])	// -NJMP-
-   {
-      int q;
-      float vmin[3],vmax[3],v;
-
-      for(q=0;q<=2;q++)
-      {
-         v=vert[q];					// -NJMP-
-         if(normal[q]>0.0f)
-         {
-            vmin[q]=-maxbox[q] - v;	// -NJMP-
-            vmax[q]= maxbox[q] - v;	// -NJMP-
-         }
-         else
-         {
-            vmin[q]= maxbox[q] - v;	// -NJMP-
-            vmax[q]=-maxbox[q] - v;	// -NJMP-
-         }
-      }
-      if(( normal[0]*vmin[0] + normal[1]*vmin[1] + normal[2]*vmin[2] )>0.0f ) return 0;	// -NJMP-
-      if(( normal[0]*vmax[0] + normal[1]*vmax[1] + normal[2]*vmax[2] )>=0.0f) return 1;	// -NJMP-
-      return 0;
-   }
-
-   //Testet auf schnittpunkt Box <-> Dreieck
-   //boxcenter   = Mittelpunkt der Box
-   //boxhalfsize = Halbe Laenge/Hoehe/Breite der Box
-   //triverts    = Koordinaten der Deickspunkte 
-   inline int triBoxOverlap(float boxcenter[3],float boxhalfsize[3],float triverts[3][3])
-   {
-      /*    use separating axis theorem to test overlap between triangle and box */
-      /*    need to test for overlap in these directions: */
-      /*    1) the {x,y,z}-directions (actually, since we use the AABB of the triangle */
-      /*       we do not even need to test these) */
-      /*    2) normal of the triangle */
-      /*    3) crossproduct(edge from tri, {x,y,z}-directin) */
-      /*       this gives 3x3=9 more tests */
-
-      float v0[3],v1[3],v2[3];
-
-      //   float axis[3];
-
-      float min,max,p0,p1,p2,rad,fex,fey,fez;		// -NJMP- "d" local variable removed
-      float normal[3],e0[3],e1[3],e2[3];
-
-      /* This is the fastest branch on Sun */
-      /* move everything so that the boxcenter is in (0,0,0) */
-      //SUB(v0,triverts[0],boxcenter);
-      //#define SUB(dest,v1,v2) 
-      v0[0]=triverts[0][0]-boxcenter[0]; 
-      v0[1]=triverts[0][1]-boxcenter[1]; 
-      v0[2]=triverts[0][2]-boxcenter[2]; 
-
-      //SUB(v1,triverts[1],boxcenter);
-      //#define SUB(dest,v1,v2) 
-      v1[0]=triverts[1][0]-boxcenter[0]; 
-      v1[1]=triverts[1][1]-boxcenter[1]; 
-      v1[2]=triverts[1][2]-boxcenter[2]; 
-
-      //SUB(v2,triverts[2],boxcenter);
-      //#define SUB(dest,v1,v2) 
-      v2[0]=triverts[2][0]-boxcenter[0]; 
-      v2[1]=triverts[2][1]-boxcenter[1]; 
-      v2[2]=triverts[2][2]-boxcenter[2]; 
-
-      /* compute triangle edges */
-      //SUB(e0,v1,v0);      /* tri edge 0 */
-      //#define SUB(dest,v1,v2) 
-      e0[0]=v1[0]-v0[0]; 
-      e0[1]=v1[1]-v0[1]; 
-      e0[2]=v1[2]-v0[2]; 
-
-      //SUB(e1,v2,v1);      /* tri edge 1 */
-      //#define SUB(dest,v1,v2) 
-      e1[0]=v2[0]-v1[0]; 
-      e1[1]=v2[1]-v1[1]; 
-      e1[2]=v2[2]-v1[2]; 
-
-      //SUB(e2,v0,v2);      /* tri edge 2 */
-      //#define SUB(dest,v1,v2) 
-      e2[0]=v0[0]-v2[0]; 
-      e2[1]=v0[1]-v2[1]; 
-      e2[2]=v0[2]-v2[2]; 
-
-      /* Bullet 3:  */
-      /*  test the 9 tests first (this was faster) */
-      fex = fabsf(e0[0]);
-      fey = fabsf(e0[1]);
-      fez = fabsf(e0[2]);
-
-      //AXISTEST_X01(e0[2], e0[1], fez, fey);
-      //#define AXISTEST_X01(a, b, fa, fb)			
-      p0 = e0[2]*v0[1] - e0[1]*v0[2];			       	   
-      p2 = e0[2]*v2[1] - e0[1]*v2[2];			       	   
-      if(p0<p2) {min=p0; max=p2;} else {min=p2; max=p0;} 
-      rad = fez * boxhalfsize[1] + fey * boxhalfsize[2];   
-      if(min>rad || max<-rad) return 0;
-
-      //AXISTEST_Y02(e0[2], e0[0], fez, fex);
-      //#define AXISTEST_Y02(a, b, fa, fb)			
-      p0 = -e0[2]*v0[0] + e0[0]*v0[2];		      	   
-      p2 = -e0[2]*v2[0] + e0[0]*v2[2];	       	       	   
-      if(p0<p2) {min=p0; max=p2;} else {min=p2; max=p0;} 
-      rad = fez * boxhalfsize[0] + fex * boxhalfsize[2];  
-      if(min>rad || max<-rad) return 0;
-
-      //AXISTEST_Z12(e0[1], e0[0], fey, fex);
-      //#define AXISTEST_Z12(a, b, fa, fb)		
-      p1 = e0[1]*v1[0] - e0[0]*v1[1];			           
-      p2 = e0[1]*v2[0] - e0[0]*v2[1];			       	   
-      if(p2<p1) {min=p2; max=p1;} else {min=p1; max=p2;} 
-      rad = fey * boxhalfsize[0] + fex * boxhalfsize[1];   
-      if(min>rad || max<-rad) return 0;
-      
-      fex = fabsf(e1[0]);
-      fey = fabsf(e1[1]);
-      fez = fabsf(e1[2]);
-
-      //AXISTEST_X01(e1[2], e1[1], fez, fey);
-      //#define AXISTEST_X01(a, b, fa, fb)			
-      p0 = e1[2]*v0[1] - e1[1]*v0[2];			       	   
-      p2 = e1[2]*v2[1] - e1[1]*v2[2];			       	   
-      if(p0<p2) {min=p0; max=p2;} else {min=p2; max=p0;} 
-      rad = fez * boxhalfsize[1] + fey * boxhalfsize[2];   
-      if(min>rad || max<-rad) return 0;
-      
-      //AXISTEST_Y02(e1[2], e1[0], fez, fex);
-      //#define AXISTEST_Y02(a, b, fa, fb)			
-      p0 = -e1[2]*v0[0] + e1[0]*v0[2];		      	   
-      p2 = -e1[2]*v2[0] + e1[0]*v2[2];	       	       	   
-      if(p0<p2) {min=p0; max=p2;} else {min=p2; max=p0;} 
-      rad = fez * boxhalfsize[0] + fex * boxhalfsize[2];   
-      if(min>rad || max<-rad) return 0;
-
-      //AXISTEST_Z0(e1[1], e1[0], fey, fex);
-      //#define AXISTEST_Z0(a, b, fa, fb)	
-      p0 = e1[1]*v0[0] - e1[0]*v0[1];				  
-      p1 = e1[1]*v1[0] - e1[0]*v1[1];			          
-      if(p0<p1) {min=p0; max=p1;} else {min=p1; max=p0;} 
-      rad = fey * boxhalfsize[0] + fex * boxhalfsize[2];   
-      if(min>rad || max<-rad) return 0;
-
-      fex = fabsf(e2[0]);
-      fey = fabsf(e2[1]);
-      fez = fabsf(e2[2]);
-      //AXISTEST_X2(e2[2], e2[1], fez, fey);
-      //#define AXISTEST_X2(a, b, fa, fb)			
-      p0 = e2[2]*v0[1] - e2[1]*v0[2];			           
-      p1 = e2[2]*v1[1] - e2[1]*v1[2];			       	   
-      if(p0<p1) {min=p0; max=p1;} else {min=p1; max=p0;} 
-      rad = fez * boxhalfsize[1] + fey * boxhalfsize[2];  
-      if(min>rad || max<-rad) return 0;
-      
-      //AXISTEST_Y1(e2[2], e2[0], fez, fex);
-      //#define AXISTEST_Y1(a, b, fa, fb)			
-      p0 = -e2[2]*v0[0] + e2[0]*v0[2];		      	  
-      p1 = -e2[2]*v1[0] + e2[0]*v1[2];	     	       	   
-      if(p0<p1) {min=p0; max=p1;} else {min=p1; max=p0;} 
-      rad = fez * boxhalfsize[0] + fex * boxhalfsize[2];   
-      if(min>rad || max<-rad) return 0;
-      
-      //AXISTEST_Z12(e2[1], e2[0], fey, fex);
-      //#define AXISTEST_Z12(a, b, fa, fb)		
-      p1 = e2[1]*v1[0] - e2[0]*v1[1];			           
-      p2 = e2[1]*v2[0] - e2[0]*v2[1];			       	   
-      if(p2<p1) {min=p2; max=p1;} else {min=p1; max=p2;} 
-      rad = fey * boxhalfsize[0] + fex * boxhalfsize[1];   
-      if(min>rad || max<-rad) return 0;
-   
-      /* Bullet 1: */
-      /*  first test overlap in the {x,y,z}-directions */
-      /*  find min, max of the triangle each direction, and test for overlap in */
-      /*  that direction -- this is equivalent to testing a minimal AABB around */
-      /*  the triangle against the AABB */
-      /* test in X-direction */
-      //FINDMINMAX(v0[0],v1[0],v2[0],min,max);
-      min = (float)UbMath::min(v0[0],v1[0],v2[0]);
-      max = (float)UbMath::max(v0[0],v1[0],v2[0]);
-      if(min>boxhalfsize[0] || max<-boxhalfsize[0]) return 0;
-
-      /* test in Y-direction */
-      //FINDMINMAX(v0[1],v1[1],v2[1],min,max);
-      min = (float)UbMath::min(v0[1],v1[1],v2[1]);
-      max = (float)UbMath::max(v0[1],v1[1],v2[1]);
-      if(min>boxhalfsize[1] || max<-boxhalfsize[1]) return 0;
-
-      /* test in Z-direction */
-      //FINDMINMAX(v0[2],v1[2],v2[2],min,max);
-      min = (float)UbMath::min(v0[2],v1[2],v2[2]);
-      max = (float)UbMath::max(v0[2],v1[2],v2[2]);
-
-      if(min>boxhalfsize[2] || max<-boxhalfsize[2]) return 0;
-
-      /* Bullet 2: */
-      /*  test if the box intersects the plane of the triangle */
-      /*  compute plane equation of triangle: normal*x+d=0 */
-      //CROSS(normal,e0,e1);
-      //#define CROSS(dest,v1,v2) 
-      normal[0]=e0[1]*e1[2]-e0[2]*e1[1]; 
-      normal[1]=e0[2]*e1[0]-e0[0]*e1[2]; 
-      normal[2]=e0[0]*e1[1]-e0[1]*e1[0]; 
-
-      // -NJMP- (line removed here)
-      if(!planeBoxOverlap(normal,v0,boxhalfsize)) return 0;	// -NJMP-
-      return 1;   /* box and triangle overlaps */
-   }
-
-
- 
-};
+inline int planeBoxOverlap(float normal[3], float vert[3], float maxbox[3]) // -NJMP-
+{
+    int q;
+    float vmin[3], vmax[3], v;
+
+    for (q = 0; q <= 2; q++) {
+        v = vert[q]; // -NJMP-
+        if (normal[q] > 0.0f) {
+            vmin[q] = -maxbox[q] - v; // -NJMP-
+            vmax[q] = maxbox[q] - v;  // -NJMP-
+        } else {
+            vmin[q] = maxbox[q] - v;  // -NJMP-
+            vmax[q] = -maxbox[q] - v; // -NJMP-
+        }
+    }
+    if ((normal[0] * vmin[0] + normal[1] * vmin[1] + normal[2] * vmin[2]) > 0.0f)
+        return 0; // -NJMP-
+    if ((normal[0] * vmax[0] + normal[1] * vmax[1] + normal[2] * vmax[2]) >= 0.0f)
+        return 1; // -NJMP-
+    return 0;
+}
+
+// Testet auf schnittpunkt Box <-> Dreieck
+// boxcenter   = Mittelpunkt der Box
+// boxhalfsize = Halbe Laenge/Hoehe/Breite der Box
+// triverts    = Koordinaten der Deickspunkte
+inline int triBoxOverlap(float boxcenter[3], float boxhalfsize[3], float triverts[3][3])
+{
+    /*    use separating axis theorem to test overlap between triangle and box */
+    /*    need to test for overlap in these directions: */
+    /*    1) the {x,y,z}-directions (actually, since we use the AABB of the triangle */
+    /*       we do not even need to test these) */
+    /*    2) normal of the triangle */
+    /*    3) crossproduct(edge from tri, {x,y,z}-directin) */
+    /*       this gives 3x3=9 more tests */
+
+    float v0[3], v1[3], v2[3];
+
+    //   float axis[3];
+
+    float min, max, p0, p1, p2, rad, fex, fey, fez; // -NJMP- "d" local variable removed
+    float normal[3], e0[3], e1[3], e2[3];
+
+    /* This is the fastest branch on Sun */
+    /* move everything so that the boxcenter is in (0,0,0) */
+    // SUB(v0,triverts[0],boxcenter);
+    //#define SUB(dest,v1,v2)
+    v0[0] = triverts[0][0] - boxcenter[0];
+    v0[1] = triverts[0][1] - boxcenter[1];
+    v0[2] = triverts[0][2] - boxcenter[2];
+
+    // SUB(v1,triverts[1],boxcenter);
+    //#define SUB(dest,v1,v2)
+    v1[0] = triverts[1][0] - boxcenter[0];
+    v1[1] = triverts[1][1] - boxcenter[1];
+    v1[2] = triverts[1][2] - boxcenter[2];
+
+    // SUB(v2,triverts[2],boxcenter);
+    //#define SUB(dest,v1,v2)
+    v2[0] = triverts[2][0] - boxcenter[0];
+    v2[1] = triverts[2][1] - boxcenter[1];
+    v2[2] = triverts[2][2] - boxcenter[2];
+
+    /* compute triangle edges */
+    // SUB(e0,v1,v0);      /* tri edge 0 */
+    //#define SUB(dest,v1,v2)
+    e0[0] = v1[0] - v0[0];
+    e0[1] = v1[1] - v0[1];
+    e0[2] = v1[2] - v0[2];
+
+    // SUB(e1,v2,v1);      /* tri edge 1 */
+    //#define SUB(dest,v1,v2)
+    e1[0] = v2[0] - v1[0];
+    e1[1] = v2[1] - v1[1];
+    e1[2] = v2[2] - v1[2];
+
+    // SUB(e2,v0,v2);      /* tri edge 2 */
+    //#define SUB(dest,v1,v2)
+    e2[0] = v0[0] - v2[0];
+    e2[1] = v0[1] - v2[1];
+    e2[2] = v0[2] - v2[2];
+
+    /* Bullet 3:  */
+    /*  test the 9 tests first (this was faster) */
+    fex = fabsf(e0[0]);
+    fey = fabsf(e0[1]);
+    fez = fabsf(e0[2]);
+
+    // AXISTEST_X01(e0[2], e0[1], fez, fey);
+    //#define AXISTEST_X01(a, b, fa, fb)
+    p0 = e0[2] * v0[1] - e0[1] * v0[2];
+    p2 = e0[2] * v2[1] - e0[1] * v2[2];
+    if (p0 < p2) {
+        min = p0;
+        max = p2;
+    } else {
+        min = p2;
+        max = p0;
+    }
+    rad = fez * boxhalfsize[1] + fey * boxhalfsize[2];
+    if (min > rad || max < -rad)
+        return 0;
+
+    // AXISTEST_Y02(e0[2], e0[0], fez, fex);
+    //#define AXISTEST_Y02(a, b, fa, fb)
+    p0 = -e0[2] * v0[0] + e0[0] * v0[2];
+    p2 = -e0[2] * v2[0] + e0[0] * v2[2];
+    if (p0 < p2) {
+        min = p0;
+        max = p2;
+    } else {
+        min = p2;
+        max = p0;
+    }
+    rad = fez * boxhalfsize[0] + fex * boxhalfsize[2];
+    if (min > rad || max < -rad)
+        return 0;
+
+    // AXISTEST_Z12(e0[1], e0[0], fey, fex);
+    //#define AXISTEST_Z12(a, b, fa, fb)
+    p1 = e0[1] * v1[0] - e0[0] * v1[1];
+    p2 = e0[1] * v2[0] - e0[0] * v2[1];
+    if (p2 < p1) {
+        min = p2;
+        max = p1;
+    } else {
+        min = p1;
+        max = p2;
+    }
+    rad = fey * boxhalfsize[0] + fex * boxhalfsize[1];
+    if (min > rad || max < -rad)
+        return 0;
+
+    fex = fabsf(e1[0]);
+    fey = fabsf(e1[1]);
+    fez = fabsf(e1[2]);
+
+    // AXISTEST_X01(e1[2], e1[1], fez, fey);
+    //#define AXISTEST_X01(a, b, fa, fb)
+    p0 = e1[2] * v0[1] - e1[1] * v0[2];
+    p2 = e1[2] * v2[1] - e1[1] * v2[2];
+    if (p0 < p2) {
+        min = p0;
+        max = p2;
+    } else {
+        min = p2;
+        max = p0;
+    }
+    rad = fez * boxhalfsize[1] + fey * boxhalfsize[2];
+    if (min > rad || max < -rad)
+        return 0;
+
+    // AXISTEST_Y02(e1[2], e1[0], fez, fex);
+    //#define AXISTEST_Y02(a, b, fa, fb)
+    p0 = -e1[2] * v0[0] + e1[0] * v0[2];
+    p2 = -e1[2] * v2[0] + e1[0] * v2[2];
+    if (p0 < p2) {
+        min = p0;
+        max = p2;
+    } else {
+        min = p2;
+        max = p0;
+    }
+    rad = fez * boxhalfsize[0] + fex * boxhalfsize[2];
+    if (min > rad || max < -rad)
+        return 0;
+
+    // AXISTEST_Z0(e1[1], e1[0], fey, fex);
+    //#define AXISTEST_Z0(a, b, fa, fb)
+    p0 = e1[1] * v0[0] - e1[0] * v0[1];
+    p1 = e1[1] * v1[0] - e1[0] * v1[1];
+    if (p0 < p1) {
+        min = p0;
+        max = p1;
+    } else {
+        min = p1;
+        max = p0;
+    }
+    rad = fey * boxhalfsize[0] + fex * boxhalfsize[2];
+    if (min > rad || max < -rad)
+        return 0;
+
+    fex = fabsf(e2[0]);
+    fey = fabsf(e2[1]);
+    fez = fabsf(e2[2]);
+    // AXISTEST_X2(e2[2], e2[1], fez, fey);
+    //#define AXISTEST_X2(a, b, fa, fb)
+    p0 = e2[2] * v0[1] - e2[1] * v0[2];
+    p1 = e2[2] * v1[1] - e2[1] * v1[2];
+    if (p0 < p1) {
+        min = p0;
+        max = p1;
+    } else {
+        min = p1;
+        max = p0;
+    }
+    rad = fez * boxhalfsize[1] + fey * boxhalfsize[2];
+    if (min > rad || max < -rad)
+        return 0;
+
+    // AXISTEST_Y1(e2[2], e2[0], fez, fex);
+    //#define AXISTEST_Y1(a, b, fa, fb)
+    p0 = -e2[2] * v0[0] + e2[0] * v0[2];
+    p1 = -e2[2] * v1[0] + e2[0] * v1[2];
+    if (p0 < p1) {
+        min = p0;
+        max = p1;
+    } else {
+        min = p1;
+        max = p0;
+    }
+    rad = fez * boxhalfsize[0] + fex * boxhalfsize[2];
+    if (min > rad || max < -rad)
+        return 0;
+
+    // AXISTEST_Z12(e2[1], e2[0], fey, fex);
+    //#define AXISTEST_Z12(a, b, fa, fb)
+    p1 = e2[1] * v1[0] - e2[0] * v1[1];
+    p2 = e2[1] * v2[0] - e2[0] * v2[1];
+    if (p2 < p1) {
+        min = p2;
+        max = p1;
+    } else {
+        min = p1;
+        max = p2;
+    }
+    rad = fey * boxhalfsize[0] + fex * boxhalfsize[1];
+    if (min > rad || max < -rad)
+        return 0;
+
+    /* Bullet 1: */
+    /*  first test overlap in the {x,y,z}-directions */
+    /*  find min, max of the triangle each direction, and test for overlap in */
+    /*  that direction -- this is equivalent to testing a minimal AABB around */
+    /*  the triangle against the AABB */
+    /* test in X-direction */
+    // FINDMINMAX(v0[0],v1[0],v2[0],min,max);
+    min = (float)UbMath::min(v0[0], v1[0], v2[0]);
+    max = (float)UbMath::max(v0[0], v1[0], v2[0]);
+    if (min > boxhalfsize[0] || max < -boxhalfsize[0])
+        return 0;
+
+    /* test in Y-direction */
+    // FINDMINMAX(v0[1],v1[1],v2[1],min,max);
+    min = (float)UbMath::min(v0[1], v1[1], v2[1]);
+    max = (float)UbMath::max(v0[1], v1[1], v2[1]);
+    if (min > boxhalfsize[1] || max < -boxhalfsize[1])
+        return 0;
+
+    /* test in Z-direction */
+    // FINDMINMAX(v0[2],v1[2],v2[2],min,max);
+    min = (float)UbMath::min(v0[2], v1[2], v2[2]);
+    max = (float)UbMath::max(v0[2], v1[2], v2[2]);
+
+    if (min > boxhalfsize[2] || max < -boxhalfsize[2])
+        return 0;
+
+    /* Bullet 2: */
+    /*  test if the box intersects the plane of the triangle */
+    /*  compute plane equation of triangle: normal*x+d=0 */
+    // CROSS(normal,e0,e1);
+    //#define CROSS(dest,v1,v2)
+    normal[0] = e0[1] * e1[2] - e0[2] * e1[1];
+    normal[1] = e0[2] * e1[0] - e0[0] * e1[2];
+    normal[2] = e0[0] * e1[1] - e0[1] * e1[0];
+
+    // -NJMP- (line removed here)
+    if (!planeBoxOverlap(normal, v0, boxhalfsize))
+        return 0; // -NJMP-
+    return 1;     /* box and triangle overlaps */
+}
+
+}; // namespace GbMeshTools3D
 
 #endif
 
-//original - NICHT LOESCHEN - von kroete lynn
+// original - NICHT LOESCHEN - von kroete lynn
 
 //#define X 0
 //#define Y 1
 //#define Z 2
 //
-//#define CROSS(dest,v1,v2) 
-//   dest[0]=v1[1]*v2[2]-v1[2]*v2[1]; 
-//   dest[1]=v1[2]*v2[0]-v1[0]*v2[2]; 
-//   dest[2]=v1[0]*v2[1]-v1[1]*v2[0]; 
+//#define CROSS(dest,v1,v2)
+//   dest[0]=v1[1]*v2[2]-v1[2]*v2[1];
+//   dest[1]=v1[2]*v2[0]-v1[0]*v2[2];
+//   dest[2]=v1[0]*v2[1]-v1[1]*v2[0];
 //
 //#define DOT(v1,v2) (v1[0]*v2[0]+v1[1]*v2[1]+v1[2]*v2[2])
 //
-//#define SUB(dest,v1,v2) 
-//   dest[0]=v1[0]-v2[0]; 
-//   dest[1]=v1[1]-v2[1]; 
-//   dest[2]=v1[2]-v2[2]; 
+//#define SUB(dest,v1,v2)
+//   dest[0]=v1[0]-v2[0];
+//   dest[1]=v1[1]-v2[1];
+//   dest[2]=v1[2]-v2[2];
 //
-//#define FINDMINMAX(x0,x1,x2,min,max) 
-//   min = max = x0;   
+//#define FINDMINMAX(x0,x1,x2,min,max)
+//   min = max = x0;
 //   if(x1<min) min=x1;
 //   if(x1>max) max=x1;
 //   if(x2<min) min=x2;
 //   if(x2>max) max=x2;
 //
-//int planeBoxOverlap(float normal[3], float vert[3], float maxbox[3])	// -NJMP-
+// int planeBoxOverlap(float normal[3], float vert[3], float maxbox[3])	// -NJMP-
 //{
 //   int q;
 //   float vmin[3],vmax[3],v;
@@ -273,63 +336,63 @@ namespace GbMeshTools3D
 //
 ///*======================== X-tests ========================
 //
-//#define AXISTEST_X01(a, b, fa, fb)			   
-//   p0 = a*v0[Y] - b*v0[Z];			       	   
-//   p2 = a*v2[Y] - b*v2[Z];			       	   
-//      if(p0<p2) {min=p0; max=p2;} else {min=p2; max=p0;} 
-//   rad = fa * boxhalfsize[Y] + fb * boxhalfsize[Z];   
+//#define AXISTEST_X01(a, b, fa, fb)
+//   p0 = a*v0[Y] - b*v0[Z];
+//   p2 = a*v2[Y] - b*v2[Z];
+//      if(p0<p2) {min=p0; max=p2;} else {min=p2; max=p0;}
+//   rad = fa * boxhalfsize[Y] + fb * boxhalfsize[Z];
 //   if(min>rad || max<-rad) return 0;
 //
-//#define AXISTEST_X2(a, b, fa, fb)			   
-//   p0 = a*v0[Y] - b*v0[Z];			          
-//   p1 = a*v1[Y] - b*v1[Z];			       	   
-//      if(p0<p1) {min=p0; max=p1;} else {min=p1; max=p0;} 
-//   rad = fa * boxhalfsize[Y] + fb * boxhalfsize[Z];   
+//#define AXISTEST_X2(a, b, fa, fb)
+//   p0 = a*v0[Y] - b*v0[Z];
+//   p1 = a*v1[Y] - b*v1[Z];
+//      if(p0<p1) {min=p0; max=p1;} else {min=p1; max=p0;}
+//   rad = fa * boxhalfsize[Y] + fb * boxhalfsize[Z];
 //   if(min>rad || max<-rad) return 0;
 //
 //
 //
 ///*======================== Y-tests ========================
 //
-//#define AXISTEST_Y02(a, b, fa, fb)			   
-//   p0 = -a*v0[X] + b*v0[Z];		      	   
-//   p2 = -a*v2[X] + b*v2[Z];	       	       	   
-//   if(p0<p2) {min=p0; max=p2;} else {min=p2; max=p0;} 
-//   rad = fa * boxhalfsize[X] + fb * boxhalfsize[Z];   
+//#define AXISTEST_Y02(a, b, fa, fb)
+//   p0 = -a*v0[X] + b*v0[Z];
+//   p2 = -a*v2[X] + b*v2[Z];
+//   if(p0<p2) {min=p0; max=p2;} else {min=p2; max=p0;}
+//   rad = fa * boxhalfsize[X] + fb * boxhalfsize[Z];
 //   if(min>rad || max<-rad) return 0;
 //
-//#define AXISTEST_Y1(a, b, fa, fb)			   
-//   p0 = -a*v0[X] + b*v0[Z];		      	   
-//   p1 = -a*v1[X] + b*v1[Z];	     	       	   
-//      if(p0<p1) {min=p0; max=p1;} else {min=p1; max=p0;} 
-//   rad = fa * boxhalfsize[X] + fb * boxhalfsize[Z];   
+//#define AXISTEST_Y1(a, b, fa, fb)
+//   p0 = -a*v0[X] + b*v0[Z];
+//   p1 = -a*v1[X] + b*v1[Z];
+//      if(p0<p1) {min=p0; max=p1;} else {min=p1; max=p0;}
+//   rad = fa * boxhalfsize[X] + fb * boxhalfsize[Z];
 //   if(min>rad || max<-rad) return 0;
 //
 //======================== Z-tests ========================
 //
-//#define AXISTEST_Z12(a, b, fa, fb)			   
-//   p1 = a*v1[X] - b*v1[Y];			           
-//   p2 = a*v2[X] - b*v2[Y];			       	   
-//      if(p2<p1) {min=p2; max=p1;} else {min=p1; max=p2;} 
-//   rad = fa * boxhalfsize[X] + fb * boxhalfsize[Y];   
+//#define AXISTEST_Z12(a, b, fa, fb)
+//   p1 = a*v1[X] - b*v1[Y];
+//   p2 = a*v2[X] - b*v2[Y];
+//      if(p2<p1) {min=p2; max=p1;} else {min=p1; max=p2;}
+//   rad = fa * boxhalfsize[X] + fb * boxhalfsize[Y];
 //   if(min>rad || max<-rad) return 0;
 //
-//#define AXISTEST_Z0(a, b, fa, fb)			   
-//   p0 = a*v0[X] - b*v0[Y];				   
-//   p1 = a*v1[X] - b*v1[Y];			           
+//#define AXISTEST_Z0(a, b, fa, fb)
+//   p0 = a*v0[X] - b*v0[Y];
+//   p1 = a*v1[X] - b*v1[Y];
 //      if(p0<p1) {min=p0; max=p1;} else {min=p1; max=p0;}
-//   rad = fa * boxhalfsize[X] + fb * boxhalfsize[Y];   
+//   rad = fa * boxhalfsize[X] + fb * boxhalfsize[Y];
 //   if(min>rad || max<-rad) return 0;
 //
-//int triBoxOverlap(float boxcenter[3],float boxhalfsize[3],float triverts[3][3])
+// int triBoxOverlap(float boxcenter[3],float boxhalfsize[3],float triverts[3][3])
 //{
-//      //use separating axis theorem to test overlap between triangle and box 
-//      //need to test for overlap in these directions: 
-//      //1) the {x,y,z}-directions (actually, since we use the AABB of the triangle 
-//      //   we do not even need to test these) 
-//      //2) normal of the triangle 
-//      //3) crossproduct(edge from tri, {x,y,z}-directin) 
-//      //   this gives 3x3=9 more tests 
+//      //use separating axis theorem to test overlap between triangle and box
+//      //need to test for overlap in these directions:
+//      //1) the {x,y,z}-directions (actually, since we use the AABB of the triangle
+//      //   we do not even need to test these)
+//      //2) normal of the triangle
+//      //3) crossproduct(edge from tri, {x,y,z}-directin)
+//      //   this gives 3x3=9 more tests
 //
 //   float v0[3],v1[3],v2[3];
 //
@@ -399,4 +462,3 @@ namespace GbMeshTools3D
 //   if(!planeBoxOverlap(normal,v0,boxhalfsize)) return 0;	// -NJMP-
 //   return 1;   /* box and triangle overlaps */
 //}
-
diff --git a/src/basics/geometry3d/GbObject3D.cpp b/src/basics/geometry3d/GbObject3D.cpp
index 1e96e72f3e00d8d24b717e670e2aff6f622b8413..b24831514c1168167f86a05a0c97714590e5a79a 100644
--- a/src/basics/geometry3d/GbObject3D.cpp
+++ b/src/basics/geometry3d/GbObject3D.cpp
@@ -1,28 +1,28 @@
 //=======================================================================================
-// ____          ____    __    ______     __________   __      __       __        __         
-// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |        
-//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |        
-//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |        
-//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____    
-//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|   
-//      \    \  |    |   ________________________________________________________________    
-//       \    \ |    |  |  ______________________________________________________________|   
-//        \    \|    |  |  |         __          __     __     __     ______      _______    
-//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)   
-//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______    
+// ____          ____    __    ______     __________   __      __       __        __
+// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |
+//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |
+//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |
+//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____
+//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|
+//      \    \  |    |   ________________________________________________________________
+//       \    \ |    |  |  ______________________________________________________________|
+//        \    \|    |  |  |         __          __     __     __     ______      _______
+//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)
+//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______
 //           \       |  |  |        |  |_____   |   \_/   |   |  |   |  |_/  /    _____  |
-//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/   
+//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/
 //
-//  This file is part of VirtualFluids. VirtualFluids is free software: you can 
+//  This file is part of VirtualFluids. VirtualFluids is free software: you can
 //  redistribute it and/or modify it under the terms of the GNU General Public
-//  License as published by the Free Software Foundation, either version 3 of 
+//  License as published by the Free Software Foundation, either version 3 of
 //  the License, or (at your option) any later version.
-//  
-//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT 
-//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
-//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License 
+//
+//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT
+//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 //  for more details.
-//  
+//
 //  You should have received a copy of the GNU General Public License along
 //  with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>.
 //
@@ -32,84 +32,66 @@
 //=======================================================================================
 #include <GbObject3D.h>
 #include <GbPoint3D.h>
-#include <basics/utilities/UbMath.h>                 
+#include <basics/utilities/UbMath.h>
 
 using namespace std;
 
 /*======================================================================*/
-bool GbObject3D::isPointInGbObject3D(GbPoint3D* p)
+bool GbObject3D::isPointInGbObject3D(GbPoint3D *p)
 {
-   return this->isPointInGbObject3D(p->getX1Centroid(),p->getX2Coordinate(),p->getX3Coordinate());
-} 
+    return this->isPointInGbObject3D(p->getX1Centroid(), p->getX2Coordinate(), p->getX3Coordinate());
+}
 /*======================================================================*/
-bool GbObject3D::isCellInsideGbObject3D(const double& x1a,const double& x2a,const double& x3a,const double& x1b,const double& x2b,const double& x3b) 
+bool GbObject3D::isCellInsideGbObject3D(const double &x1a, const double &x2a, const double &x3a, const double &x1b,
+                                        const double &x2b, const double &x3b)
 {
 
-   if(   this->isPointInGbObject3D(x1a, x2a, x3a) 
-      && this->isPointInGbObject3D(x1b, x2a, x3a) 
-      && this->isPointInGbObject3D(x1b, x2b, x3a)
-      && this->isPointInGbObject3D(x1a, x2b, x3a) 
-      && this->isPointInGbObject3D(x1a, x2a, x3b)
-      && this->isPointInGbObject3D(x1b, x2a, x3b)
-      && this->isPointInGbObject3D(x1b, x2b, x3b)
-      && this->isPointInGbObject3D(x1a, x2b, x3b))
-   {
-      return true;
-   }
+    if (this->isPointInGbObject3D(x1a, x2a, x3a) && this->isPointInGbObject3D(x1b, x2a, x3a) &&
+        this->isPointInGbObject3D(x1b, x2b, x3a) && this->isPointInGbObject3D(x1a, x2b, x3a) &&
+        this->isPointInGbObject3D(x1a, x2a, x3b) && this->isPointInGbObject3D(x1b, x2a, x3b) &&
+        this->isPointInGbObject3D(x1b, x2b, x3b) && this->isPointInGbObject3D(x1a, x2b, x3b)) {
+        return true;
+    }
 
-   return false;
+    return false;
 }
 /*======================================================================*/
-bool GbObject3D::isCellCuttingGbObject3D(const double& x1a,const double& x2a,const double& x3a,const double& x1b,const double& x2b,const double& x3b) 
+bool GbObject3D::isCellCuttingGbObject3D(const double &x1a, const double &x2a, const double &x3a, const double &x1b,
+                                         const double &x2b, const double &x3b)
 {
-   if(   this->isPointInGbObject3D(x1a, x2a, x3a)      
-      || this->isPointInGbObject3D(x1b, x2a, x3a)      
-      || this->isPointInGbObject3D(x1b, x2b, x3a)      
-      || this->isPointInGbObject3D(x1a, x2b, x3a)      
-      || this->isPointInGbObject3D(x1a, x2a, x3b)      
-      || this->isPointInGbObject3D(x1b, x2a, x3b)      
-      || this->isPointInGbObject3D(x1b, x2b, x3b)      
-      || this->isPointInGbObject3D(x1a, x2b, x3b) )    
-   {
-      if(   !this->isPointInGbObject3D(x1a, x2a, x3a) 
-         || !this->isPointInGbObject3D(x1b, x2a, x3a) 
-         || !this->isPointInGbObject3D(x1b, x2b, x3a) 
-         || !this->isPointInGbObject3D(x1a, x2b, x3a)
-         || !this->isPointInGbObject3D(x1a, x2a, x3b)
-         || !this->isPointInGbObject3D(x1b, x2a, x3b)
-         || !this->isPointInGbObject3D(x1b, x2b, x3b)
-         || !this->isPointInGbObject3D(x1a, x2b, x3b)) return true;
-   }
-   return false;
+    if (this->isPointInGbObject3D(x1a, x2a, x3a) || this->isPointInGbObject3D(x1b, x2a, x3a) ||
+        this->isPointInGbObject3D(x1b, x2b, x3a) || this->isPointInGbObject3D(x1a, x2b, x3a) ||
+        this->isPointInGbObject3D(x1a, x2a, x3b) || this->isPointInGbObject3D(x1b, x2a, x3b) ||
+        this->isPointInGbObject3D(x1b, x2b, x3b) || this->isPointInGbObject3D(x1a, x2b, x3b)) {
+        if (!this->isPointInGbObject3D(x1a, x2a, x3a) || !this->isPointInGbObject3D(x1b, x2a, x3a) ||
+            !this->isPointInGbObject3D(x1b, x2b, x3a) || !this->isPointInGbObject3D(x1a, x2b, x3a) ||
+            !this->isPointInGbObject3D(x1a, x2a, x3b) || !this->isPointInGbObject3D(x1b, x2a, x3b) ||
+            !this->isPointInGbObject3D(x1b, x2b, x3b) || !this->isPointInGbObject3D(x1a, x2b, x3b))
+            return true;
+    }
+    return false;
 }
 /*======================================================================*/
-bool GbObject3D::isCellInsideOrCuttingGbObject3D(const double& x1a,const double& x2a,const double& x3a,const double& x1b,const double& x2b,const double& x3b)
+bool GbObject3D::isCellInsideOrCuttingGbObject3D(const double &x1a, const double &x2a, const double &x3a,
+                                                 const double &x1b, const double &x2b, const double &x3b)
 {
-   if(   this->isPointInGbObject3D(x1a, x2a, x3a)   
-      || this->isPointInGbObject3D(x1b, x2a, x3a)   
-      || this->isPointInGbObject3D(x1b, x2b, x3a)   
-      || this->isPointInGbObject3D(x1a, x2b, x3a)   
-      || this->isPointInGbObject3D(x1a, x2a, x3b)   
-      || this->isPointInGbObject3D(x1b, x2a, x3b)   
-      || this->isPointInGbObject3D(x1b, x2b, x3b)   
-      || this->isPointInGbObject3D(x1a, x2b, x3b))  
-   {
-      return true;
-   }
+    if (this->isPointInGbObject3D(x1a, x2a, x3a) || this->isPointInGbObject3D(x1b, x2a, x3a) ||
+        this->isPointInGbObject3D(x1b, x2b, x3a) || this->isPointInGbObject3D(x1a, x2b, x3a) ||
+        this->isPointInGbObject3D(x1a, x2a, x3b) || this->isPointInGbObject3D(x1b, x2a, x3b) ||
+        this->isPointInGbObject3D(x1b, x2b, x3b) || this->isPointInGbObject3D(x1a, x2b, x3b)) {
+        return true;
+    }
 
-   return false;
+    return false;
 }
 /*=======================================================*/
-bool GbObject3D::isInsideCell(const double& minX1,const double& minX2,const double& minX3,const double& maxX1,const double& maxX2,const double& maxX3)
+bool GbObject3D::isInsideCell(const double &minX1, const double &minX2, const double &minX3, const double &maxX1,
+                              const double &maxX2, const double &maxX3)
 {
-   if(   UbMath::greaterEqual(this->getX1Minimum(),minX1)
-      && UbMath::greaterEqual(this->getX2Minimum(),minX2)
-      && UbMath::greaterEqual(this->getX3Minimum(),minX3)
-      && UbMath::lessEqual(this->getX1Maximum(),maxX1) 
-      && UbMath::lessEqual(this->getX2Maximum(),maxX2)   
-      && UbMath::lessEqual(this->getX2Maximum(),maxX3)     ) return true;
+    if (UbMath::greaterEqual(this->getX1Minimum(), minX1) && UbMath::greaterEqual(this->getX2Minimum(), minX2) &&
+        UbMath::greaterEqual(this->getX3Minimum(), minX3) && UbMath::lessEqual(this->getX1Maximum(), maxX1) &&
+        UbMath::lessEqual(this->getX2Maximum(), maxX2) && UbMath::lessEqual(this->getX2Maximum(), maxX3))
+        return true;
 
-   return false;
+    return false;
 }
-
-
diff --git a/src/basics/geometry3d/GbObject3D.h b/src/basics/geometry3d/GbObject3D.h
index be2191811bbf99c54998699073e90563d584db77..f60e64c8f95dfde84a389c422bbc6b9377e68187 100644
--- a/src/basics/geometry3d/GbObject3D.h
+++ b/src/basics/geometry3d/GbObject3D.h
@@ -1,28 +1,28 @@
 //=======================================================================================
-// ____          ____    __    ______     __________   __      __       __        __         
-// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |        
-//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |        
-//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |        
-//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____    
-//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|   
-//      \    \  |    |   ________________________________________________________________    
-//       \    \ |    |  |  ______________________________________________________________|   
-//        \    \|    |  |  |         __          __     __     __     ______      _______    
-//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)   
-//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______    
+// ____          ____    __    ______     __________   __      __       __        __
+// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |
+//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |
+//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |
+//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____
+//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|
+//      \    \  |    |   ________________________________________________________________
+//       \    \ |    |  |  ______________________________________________________________|
+//        \    \|    |  |  |         __          __     __     __     ______      _______
+//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)
+//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______
 //           \       |  |  |        |  |_____   |   \_/   |   |  |   |  |_/  /    _____  |
-//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/   
+//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/
 //
-//  This file is part of VirtualFluids. VirtualFluids is free software: you can 
+//  This file is part of VirtualFluids. VirtualFluids is free software: you can
 //  redistribute it and/or modify it under the terms of the GNU General Public
-//  License as published by the Free Software Foundation, either version 3 of 
+//  License as published by the Free Software Foundation, either version 3 of
 //  the License, or (at your option) any later version.
-//  
-//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT 
-//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
-//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License 
+//
+//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT
+//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 //  for more details.
-//  
+//
 //  You should have received a copy of the GNU General Public License along
 //  with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>.
 //
@@ -36,12 +36,11 @@
 #include <string>
 #include <vector>
 
-
-#include <basics/utilities/UbSystem.h>
+#include <basics/objects/ObObject.h>
 #include <basics/utilities/UbException.h>
 #include <basics/utilities/UbObservable.h>
+#include <basics/utilities/UbSystem.h>
 #include <basics/utilities/UbTuple.h>
-#include <basics/objects/ObObject.h>
 
 class GbPoint3D;
 class GbLine3D;
@@ -51,99 +50,139 @@ class GbObject3DCreator;
 #include <PointerDefinitions.h>
 
 //////////////////////////////////////////////////////////////////////////
-//! 
+//!
 //! \class GbObject3D
-//! 
+//!
 //! \brief This Interface provides basic 3D geometry objects methods.
-//! 
+//!
 //////////////////////////////////////////////////////////////////////////
 
 class GbObject3D : public ObObject
 {
 public:
-   //abstract Methods
-   virtual void finalize() = 0 ; //destroys also all dynamic objects (e.g. GbPoints in GbLine)
-   /**
-    * Returns the centroid x1 coordinate of this 3D object.
-    * @return the centroid x1 coordinate of this 3D object
-    */
-   virtual double getX1Centroid()=0;
-   /**
-    * Returns the minimum x1 coordinate of this 3D object.
-    * @return the minimum x1 coordinate of this 3D object
-    */
-   virtual double getX1Minimum()=0;
-   /**
-    * Returns the maximum x1 coordinate of this 3D object.
-    * @return the maximum x1 coordinate of this 3D object
-    */
-   virtual double getX1Maximum()=0;
-   /**
-    * Returns the centroid x2 coordinate of this 3D object.
-    * @return the centroid x2 coordinate of this 3D object
-    */
-   virtual double getX2Centroid()=0;
-   /**
-    * Returns the minimum x2 coordinate of this 3D object.
-    * @return the minimum x2 coordinate of this 3D object
-    */
-   virtual double getX2Minimum()=0;
-   /**
-    * Returns the maximum x2 coordinate of this 3D object.
-    * @return the maximum x2 coordinate of this 3D object
-    */
-   virtual double getX2Maximum()=0;
-
-	virtual double getX3Centroid()=0;
-   /**
-    * Returns the minimum x2 coordinate of this 3D object.
-    * @return the minimum x2 coordinate of this 3D object
-    */
-   virtual double getX3Minimum()=0;
-   /**
-    * Returns the maximum x2 coordinate of this 3D object.
-    * @return the maximum x2 coordinate of this 3D object
-    */
-   virtual double getX3Maximum()=0;
-
-   /*=======================================================*/
-   double getLengthX1() { return (getX1Maximum()-getX1Minimum()); }
-   double getLengthX2() { return (getX2Maximum()-getX2Minimum()); }
-   double getLengthX3() { return (getX3Maximum()-getX3Minimum()); }
-
-   virtual void setCenterX1Coordinate(const double&  /*value*/) { throw UbException(UB_EXARGS,"not implemented for "+(std::string)typeid(*this).name() ); }
-   virtual void setCenterX2Coordinate(const double&  /*value*/) { throw UbException(UB_EXARGS,"not implemented for "+(std::string)typeid(*this).name() ); }
-   virtual void setCenterX3Coordinate(const double&  /*value*/) { throw UbException(UB_EXARGS,"not implemented for "+(std::string)typeid(*this).name() ); }
-   virtual void setCenterCoordinates(const double&  /*x1*/, const double&  /*x2*/, const double&  /*x3*/) { throw UbException(UB_EXARGS, "not implemented for " + (std::string)typeid(*this).name()); }
-   virtual void setCenterCoordinates(const UbTupleDouble3&  /*position*/) { throw UbException(UB_EXARGS,"not implemented for "+(std::string)typeid(*this).name() ); }
-
-   //Rotates the Point in relation to the origen.
-   //Parameters must be radian measure.
-   virtual void rotate(const double&  /*rx1*/, const double&  /*rx2*/, const double&  /*rx3*/) { throw UbException(UB_EXARGS,"not implemented for "+(std::string)typeid(*this).name() ); }
-   virtual void translate(const double&  /*x1*/, const double&  /*x2*/, const double&  /*x3*/) { throw UbException(UB_EXARGS,"not implemented for "+(std::string)typeid(*this).name() ); }
-   virtual void scale(const double&  /*sx1*/, const double&  /*sx2*/, const double&  /*sx3*/)  { throw UbException(UB_EXARGS,"not implemented for "+(std::string)typeid(*this).name() ); }
-
-   virtual bool isPointInGbObject3D(GbPoint3D* p);
-   virtual bool isPointInGbObject3D(const double& x1, const double& x2, const double& x3, bool& pointIsOnBoundary)=0;
-   virtual bool isPointInGbObject3D(const double& x1, const double& x2, const double& x3)=0;
-
-   virtual bool isCellInsideGbObject3D(const double& x1a,const double& x2a,const double& x3a,const double& x1b,const double& x2b,const double& x3b);
-   virtual bool isCellCuttingGbObject3D(const double& x1a,const double& x2a,const double& x3a,const double& x1b,const double& x2b,const double& x3b);
-   virtual bool isCellInsideOrCuttingGbObject3D(const double& x1a,const double& x2a,const double& x3a,const double& x1b,const double& x2b,const double& x3b);
-   virtual double getCellVolumeInsideGbObject3D(const double&  /*x1a*/,const double&  /*x2a*/,const double&  /*x3a*/,const double&  /*x1b*/,const double&  /*x2b*/,const double&  /*x3b*/){ return -1.0;};
-
-   virtual bool isInsideCell(const double& minX1,const double& minX2,const double& minX3,const double& maxX1,const double& maxX2,const double& maxX3);
-
-   virtual GbLine3D* createClippedLine3D (GbPoint3D &point1, GbPoint3D &point2) = 0;
-   virtual std::vector<GbTriangle3D*> getSurfaceTriangleSet()=0;
-
-   virtual void addSurfaceTriangleSet(std::vector<UbTupleFloat3>&  /*nodes*/, std::vector<UbTupleInt3>&  /*triangles*/) { throw UbException("GbObject3D::addSurfaceTriangleSet - not implemented for "+(std::string)typeid(*this).name()); }
-
-   virtual bool hasRaytracing() { return false; }
-   virtual bool raytracingSupportsPointsInside() { return false; }
-   //|r| must be 1! einheitsvector!!
-   //return negativ value oder zero if no intersection
-   virtual double getIntersectionRaytraceFactor(const double&  /*x1*/, const double&  /*x2*/, const double&  /*x3*/, const double&  /*rx1*/, const double&  /*rx2*/, const double&  /*rx3*/) { throw UbException("GbObject3D::getIntersectionRaytraceFactor - not implemented"); }
+    // abstract Methods
+    virtual void finalize() = 0; // destroys also all dynamic objects (e.g. GbPoints in GbLine)
+    /**
+     * Returns the centroid x1 coordinate of this 3D object.
+     * @return the centroid x1 coordinate of this 3D object
+     */
+    virtual double getX1Centroid() = 0;
+    /**
+     * Returns the minimum x1 coordinate of this 3D object.
+     * @return the minimum x1 coordinate of this 3D object
+     */
+    virtual double getX1Minimum() = 0;
+    /**
+     * Returns the maximum x1 coordinate of this 3D object.
+     * @return the maximum x1 coordinate of this 3D object
+     */
+    virtual double getX1Maximum() = 0;
+    /**
+     * Returns the centroid x2 coordinate of this 3D object.
+     * @return the centroid x2 coordinate of this 3D object
+     */
+    virtual double getX2Centroid() = 0;
+    /**
+     * Returns the minimum x2 coordinate of this 3D object.
+     * @return the minimum x2 coordinate of this 3D object
+     */
+    virtual double getX2Minimum() = 0;
+    /**
+     * Returns the maximum x2 coordinate of this 3D object.
+     * @return the maximum x2 coordinate of this 3D object
+     */
+    virtual double getX2Maximum() = 0;
+
+    virtual double getX3Centroid() = 0;
+    /**
+     * Returns the minimum x2 coordinate of this 3D object.
+     * @return the minimum x2 coordinate of this 3D object
+     */
+    virtual double getX3Minimum() = 0;
+    /**
+     * Returns the maximum x2 coordinate of this 3D object.
+     * @return the maximum x2 coordinate of this 3D object
+     */
+    virtual double getX3Maximum() = 0;
+
+    /*=======================================================*/
+    double getLengthX1() { return (getX1Maximum() - getX1Minimum()); }
+    double getLengthX2() { return (getX2Maximum() - getX2Minimum()); }
+    double getLengthX3() { return (getX3Maximum() - getX3Minimum()); }
+
+    virtual void setCenterX1Coordinate(const double & /*value*/)
+    {
+        throw UbException(UB_EXARGS, "not implemented for " + (std::string) typeid(*this).name());
+    }
+    virtual void setCenterX2Coordinate(const double & /*value*/)
+    {
+        throw UbException(UB_EXARGS, "not implemented for " + (std::string) typeid(*this).name());
+    }
+    virtual void setCenterX3Coordinate(const double & /*value*/)
+    {
+        throw UbException(UB_EXARGS, "not implemented for " + (std::string) typeid(*this).name());
+    }
+    virtual void setCenterCoordinates(const double & /*x1*/, const double & /*x2*/, const double & /*x3*/)
+    {
+        throw UbException(UB_EXARGS, "not implemented for " + (std::string) typeid(*this).name());
+    }
+    virtual void setCenterCoordinates(const UbTupleDouble3 & /*position*/)
+    {
+        throw UbException(UB_EXARGS, "not implemented for " + (std::string) typeid(*this).name());
+    }
+
+    // Rotates the Point in relation to the origen.
+    // Parameters must be radian measure.
+    virtual void rotate(const double & /*rx1*/, const double & /*rx2*/, const double & /*rx3*/)
+    {
+        throw UbException(UB_EXARGS, "not implemented for " + (std::string) typeid(*this).name());
+    }
+    virtual void translate(const double & /*x1*/, const double & /*x2*/, const double & /*x3*/)
+    {
+        throw UbException(UB_EXARGS, "not implemented for " + (std::string) typeid(*this).name());
+    }
+    virtual void scale(const double & /*sx1*/, const double & /*sx2*/, const double & /*sx3*/)
+    {
+        throw UbException(UB_EXARGS, "not implemented for " + (std::string) typeid(*this).name());
+    }
+
+    virtual bool isPointInGbObject3D(GbPoint3D *p);
+    virtual bool isPointInGbObject3D(const double &x1, const double &x2, const double &x3, bool &pointIsOnBoundary) = 0;
+    virtual bool isPointInGbObject3D(const double &x1, const double &x2, const double &x3)                          = 0;
+
+    virtual bool isCellInsideGbObject3D(const double &x1a, const double &x2a, const double &x3a, const double &x1b,
+                                        const double &x2b, const double &x3b);
+    virtual bool isCellCuttingGbObject3D(const double &x1a, const double &x2a, const double &x3a, const double &x1b,
+                                         const double &x2b, const double &x3b);
+    virtual bool isCellInsideOrCuttingGbObject3D(const double &x1a, const double &x2a, const double &x3a,
+                                                 const double &x1b, const double &x2b, const double &x3b);
+    virtual double getCellVolumeInsideGbObject3D(const double & /*x1a*/, const double & /*x2a*/, const double & /*x3a*/,
+                                                 const double & /*x1b*/, const double & /*x2b*/, const double & /*x3b*/)
+    {
+        return -1.0;
+    };
+
+    virtual bool isInsideCell(const double &minX1, const double &minX2, const double &minX3, const double &maxX1,
+                              const double &maxX2, const double &maxX3);
+
+    virtual GbLine3D *createClippedLine3D(GbPoint3D &point1, GbPoint3D &point2) = 0;
+    virtual std::vector<GbTriangle3D *> getSurfaceTriangleSet()                 = 0;
+
+    virtual void addSurfaceTriangleSet(std::vector<UbTupleFloat3> & /*nodes*/, std::vector<UbTupleInt3> & /*triangles*/)
+    {
+        throw UbException("GbObject3D::addSurfaceTriangleSet - not implemented for " +
+                          (std::string) typeid(*this).name());
+    }
+
+    virtual bool hasRaytracing() { return false; }
+    virtual bool raytracingSupportsPointsInside() { return false; }
+    //|r| must be 1! einheitsvector!!
+    // return negativ value oder zero if no intersection
+    virtual double getIntersectionRaytraceFactor(const double & /*x1*/, const double & /*x2*/, const double & /*x3*/,
+                                                 const double & /*rx1*/, const double & /*rx2*/, const double & /*rx3*/)
+    {
+        throw UbException("GbObject3D::getIntersectionRaytraceFactor - not implemented");
+    }
 };
 /*=========================================================================*/
 
diff --git a/src/basics/geometry3d/GbObjectGroup3D.cpp b/src/basics/geometry3d/GbObjectGroup3D.cpp
index f96b9246aa80a4a37b51077b9956aee08c9ba4f4..e83ea5a605f8b77fdff45a8d17301c44f69614dd 100644
--- a/src/basics/geometry3d/GbObjectGroup3D.cpp
+++ b/src/basics/geometry3d/GbObjectGroup3D.cpp
@@ -1,133 +1,116 @@
+#include <geometry3d/GbLine3D.h>
 #include <geometry3d/GbObjectGroup3D.h>
-#include <geometry3d/GbSystem3D.h>
 #include <geometry3d/GbPoint3D.h>
-#include <geometry3d/GbLine3D.h>
+#include <geometry3d/GbSystem3D.h>
 #include <geometry3d/GbTriangle3D.h>
 
 using namespace std;
 
 /*=====================================================*/
-GbObjectGroup3D::GbObjectGroup3D()
-{
-   this->setName("ObjectGroup");
-}
+GbObjectGroup3D::GbObjectGroup3D() { this->setName("ObjectGroup"); }
 /*=====================================================*/
-GbObjectGroup3D::~GbObjectGroup3D()
-= default;
+GbObjectGroup3D::~GbObjectGroup3D() = default;
 /*=====================================================*/
-void GbObjectGroup3D::finalize()
-{
-   throw UbException(UB_EXARGS,"not implemented.");
-}
+void GbObjectGroup3D::finalize() { throw UbException(UB_EXARGS, "not implemented."); }
 /*=======================================================*/
-void GbObjectGroup3D::setCenterCoordinates(const double&  /*x1*/, const double&  /*x2*/, const double&  /*x3*/)
+void GbObjectGroup3D::setCenterCoordinates(const double & /*x1*/, const double & /*x2*/, const double & /*x3*/)
 {
-   throw UbException(UB_EXARGS,"not implemented.");
+    throw UbException(UB_EXARGS, "not implemented.");
 }
 /*=====================================================*/
-double GbObjectGroup3D::getDistance(GbPoint3D*  /*p*/)
-{
-   throw UbException(UB_EXARGS,"not implemented.");
-}
+double GbObjectGroup3D::getDistance(GbPoint3D * /*p*/) { throw UbException(UB_EXARGS, "not implemented."); }
 /*=====================================================*/
 
-void GbObjectGroup3D::setCenterX1Coordinate(const double&  /*value*/)
+void GbObjectGroup3D::setCenterX1Coordinate(const double & /*value*/)
 {
-   throw UbException(UB_EXARGS,"not implemented.");
+    throw UbException(UB_EXARGS, "not implemented.");
 }
 /*=====================================================*/
-void GbObjectGroup3D::setCenterX2Coordinate(const double&  /*value*/)
+void GbObjectGroup3D::setCenterX2Coordinate(const double & /*value*/)
 {
-   throw UbException(UB_EXARGS,"not implemented.");
+    throw UbException(UB_EXARGS, "not implemented.");
 }
 /*=====================================================*/
-void GbObjectGroup3D::setCenterX3Coordinate(const double&  /*value*/)
+void GbObjectGroup3D::setCenterX3Coordinate(const double & /*value*/)
 {
-   throw UbException(UB_EXARGS,"not implemented.");
+    throw UbException(UB_EXARGS, "not implemented.");
 }
 /*=====================================================*/
-void GbObjectGroup3D::setRadius(const double&  /*radius*/)
-{
-   throw UbException(UB_EXARGS,"not implemented.");
-}
+void GbObjectGroup3D::setRadius(const double & /*radius*/) { throw UbException(UB_EXARGS, "not implemented."); }
 /*=====================================================*/
-double GbObjectGroup3D::getDistance(const double&  /*x1p*/, const double&  /*x2p*/, const double&  /*x3p*/)
+double GbObjectGroup3D::getDistance(const double & /*x1p*/, const double & /*x2p*/, const double & /*x3p*/)
 {
-   throw UbException(UB_EXARGS,"not implemented.");
+    throw UbException(UB_EXARGS, "not implemented.");
 }
 /*=====================================================*/
-//true, wenn 'in Object' oder 'auf Boundary'!
-bool GbObjectGroup3D::isPointInGbObject3D(const double&  /*x1p*/, const double&  /*x2p*/, const double&  /*x3p*/)
+// true, wenn 'in Object' oder 'auf Boundary'!
+bool GbObjectGroup3D::isPointInGbObject3D(const double & /*x1p*/, const double & /*x2p*/, const double & /*x3p*/)
 {
-   return false;
+    return false;
 }
 /*=====================================================*/
-//true, wenn 'in Object' oder 'auf Boundary'!
-bool GbObjectGroup3D::isPointInGbObject3D(const double&  /*x1p*/, const double&  /*x2p*/, const double&  /*x3p*/, bool&  /*pointIsOnBoundary*/)
+// true, wenn 'in Object' oder 'auf Boundary'!
+bool GbObjectGroup3D::isPointInGbObject3D(const double & /*x1p*/, const double & /*x2p*/, const double & /*x3p*/,
+                                          bool & /*pointIsOnBoundary*/)
 {
-   return false;
+    return false;
 }
 /*=====================================================*/
 string GbObjectGroup3D::toString()
 {
-	stringstream ss;
-	ss<< "GbObjectGroup3D[";
-	ss <<"mid="<<midPoint->toString()<<", r="<<radius<<"]";
-	return ss.str();
+    stringstream ss;
+    ss << "GbObjectGroup3D[";
+    ss << "mid=" << midPoint->toString() << ", r=" << radius << "]";
+    return ss.str();
 }
 /*=====================================================*/
-GbLine3D* GbObjectGroup3D::createClippedLine3D(GbPoint3D&  /*point1*/, GbPoint3D&  /*point2*/)
-{
-   return NULL;
-}
+GbLine3D *GbObjectGroup3D::createClippedLine3D(GbPoint3D & /*point1*/, GbPoint3D & /*point2*/) { return NULL; }
 /*=========================================================================*/
-vector<GbTriangle3D*> GbObjectGroup3D::getSurfaceTriangleSet()
+vector<GbTriangle3D *> GbObjectGroup3D::getSurfaceTriangleSet()
 {
-   vector<GbTriangle3D*> allTriangles;
+    vector<GbTriangle3D *> allTriangles;
 
-   //loop ueber alle objekte in der group
-   for( std::list< GbObject3D* >::iterator iter = this->geoobjects.begin();
-                                          iter != this->geoobjects.end();
-                                          iter++ )
-   {
-      vector<GbTriangle3D*> triangles;
-      triangles = (*iter)->getSurfaceTriangleSet();
+    // loop ueber alle objekte in der group
+    for (std::list<GbObject3D *>::iterator iter = this->geoobjects.begin(); iter != this->geoobjects.end(); iter++) {
+        vector<GbTriangle3D *> triangles;
+        triangles = (*iter)->getSurfaceTriangleSet();
 
-      for( size_t i=0;i<triangles.size(); i++ )
-      {
-         //kopieren...
-         allTriangles.push_back( triangles[i] );
-      }
-   }
-   return allTriangles;
+        for (size_t i = 0; i < triangles.size(); i++) {
+            // kopieren...
+            allTriangles.push_back(triangles[i]);
+        }
+    }
+    return allTriangles;
 }
 /*=======================================================*/
-void GbObjectGroup3D::addSurfaceTriangleSet(vector<UbTupleFloat3>& nodes, vector<UbTupleInt3>& triangles)
-{
-}
+void GbObjectGroup3D::addSurfaceTriangleSet(vector<UbTupleFloat3> &nodes, vector<UbTupleInt3> &triangles) {}
 /*=======================================================*/
-bool GbObjectGroup3D::hasIntersectionWithDirectedLine(GbPoint3D  /*origin*/, GbPoint3D  /*direction*/)
-{
-   return false;
-}
+bool GbObjectGroup3D::hasIntersectionWithDirectedLine(GbPoint3D /*origin*/, GbPoint3D /*direction*/) { return false; }
 /*=======================================================*/
-bool GbObjectGroup3D::isCellCuttingGbObject3D(const double&  /*x1a*/,const double&  /*x2a*/,const double&  /*x3a*/,const double&  /*x1b*/,const double&  /*x2b*/,const double&  /*x3b*/)
+bool GbObjectGroup3D::isCellCuttingGbObject3D(const double & /*x1a*/, const double & /*x2a*/, const double & /*x3a*/,
+                                              const double & /*x1b*/, const double & /*x2b*/, const double & /*x3b*/)
 {
-   return false;
+    return false;
 }
 /*=======================================================*/
-bool GbObjectGroup3D::isCellInsideOrCuttingGbObject3D(const double&  /*x1a*/,const double&  /*x2a*/,const double&  /*x3a*/,const double&  /*x1b*/,const double&  /*x2b*/,const double&  /*x3b*/)
+bool GbObjectGroup3D::isCellInsideOrCuttingGbObject3D(const double & /*x1a*/, const double & /*x2a*/,
+                                                      const double & /*x3a*/, const double & /*x1b*/,
+                                                      const double & /*x2b*/, const double & /*x3b*/)
 {
-   return false;
+    return false;
 }
 /*==========================================================*/
-double GbObjectGroup3D::getCellVolumeInsideGbObject3D(const double&  /*x1a*/,const double&  /*x2a*/,const double&  /*x3a*/,const double&  /*x1b*/,const double&  /*x2b*/,const double&  /*x3b*/)
+double GbObjectGroup3D::getCellVolumeInsideGbObject3D(const double & /*x1a*/, const double & /*x2a*/,
+                                                      const double & /*x3a*/, const double & /*x1b*/,
+                                                      const double & /*x2b*/, const double & /*x3b*/)
 {
-   return 0.0;
+    return 0.0;
 }
 /*==========================================================*/
-double GbObjectGroup3D::getIntersectionRaytraceFactor(const double&  /*x1*/, const double&  /*x2*/, const double&  /*x3*/, const double&  /*rx1*/, const double&  /*rx2*/, const double&  /*rx3*/)
+double GbObjectGroup3D::getIntersectionRaytraceFactor(const double & /*x1*/, const double & /*x2*/,
+                                                      const double & /*x3*/, const double & /*rx1*/,
+                                                      const double & /*rx2*/, const double & /*rx3*/)
 {
-   return 0.0;
+    return 0.0;
 }
 /*=======================================================*/
diff --git a/src/basics/geometry3d/GbObjectGroup3D.h b/src/basics/geometry3d/GbObjectGroup3D.h
index 380174f4750acbfc296fc5338c640eb13cc1ae1d..a94703dc18a42be5762a876bd03d799b725b0812 100644
--- a/src/basics/geometry3d/GbObjectGroup3D.h
+++ b/src/basics/geometry3d/GbObjectGroup3D.h
@@ -8,14 +8,14 @@
 #define GBOBJECTGROUP3D_H
 
 #ifdef CAB_CTL
-   #include <ctl.h>
-#endif //CAB_CTL
+#include <ctl.h>
+#endif // CAB_CTL
 
-#include <vector>
 #include <cmath>
+#include <vector>
 
-#include <geometry3d/GbObject3D.h>
 #include <basics/utilities/UbObserver.h>
+#include <geometry3d/GbObject3D.h>
 #include <geometry3d/GbPoint3D.h>
 
 #include <PointerDefinitions.h>
@@ -25,110 +25,113 @@ class GbTriangle3D;
 class GbObject3DCreator;
 
 class GbObjectGroup3D : public GbObject3D, public UbObserver
-{                                              
+{
 public:
-   enum TRIANGULATIONMODE { CUBOIDPROJECTION ,RAYPROJECTION };
-   
-   //////////////////////////////////////////////////////////////////////////
-   // Konstruktoren
-   GbObjectGroup3D(); 
-   GbObjectGroup3D(GbObjectGroup3D * /*group*/){}; 
-   ~GbObjectGroup3D() override;
-
-   GbObjectGroup3D* clone() override {return new GbObjectGroup3D(this);}
-   void finalize() override;
-
-   void addGbObject(GbObject3D* object)
-   {
-      this->geoobjects.push_back(object);
-   }
-
-   double getRadius() const	{	return this->radius;	}
-
-   double getX1Centroid() override  { return midPoint->getX1Coordinate();}
-   double getX1Minimum() override   { return midPoint->getX1Coordinate()-radius;}
-   double getX1Maximum() override   { return midPoint->getX1Coordinate()+radius;}
-   double getX2Centroid() override  { return midPoint->getX2Coordinate();}
-   double getX2Minimum() override   { return midPoint->getX2Coordinate()-radius;}
-   double getX2Maximum() override   { return midPoint->getX2Coordinate()+radius;}
-   double getX3Centroid() override  { return midPoint->getX3Coordinate();}
-   double getX3Minimum() override   { return midPoint->getX3Coordinate()-radius;}
-   double getX3Maximum() override   { return midPoint->getX3Coordinate()+radius;}
-
-   void setCenterX1Coordinate(const double& value) override;
-   void setCenterX2Coordinate(const double& value) override;
-   void setCenterX3Coordinate(const double& value) override;
-   void setCenterCoordinates(const double& x1, const double& x2, const double& x3) override;
-   void setRadius(const double& radius);
-
-   GbLine3D* createClippedLine3D(GbPoint3D& point1, GbPoint3D& point2) override;
-   double getDistance(GbPoint3D* p); 
-   double getDistance(const double& x1p, const double& x2p, const double& x3p);
-
-   bool isPointInGbObject3D(const double& x1, const double& x2, const double& x3) override;
-   bool isPointInGbObject3D(const double& x1p, const double& x2p, const double& x3p, bool& pointIsOnBoundary) override;
-
-   bool isCellCuttingGbObject3D(const double& x1a,const double& x2a,const double& x3a,const double& x1b,const double& x2b,const double& x3b) override;
-   bool isCellInsideOrCuttingGbObject3D(const double& x1a,const double& x2a,const double& x3a,const double& x1b,const double& x2b,const double& x3b) override;
-   double getCellVolumeInsideGbObject3D(const double& x1a,const double& x2a,const double& x3a,const double& x1b,const double& x2b,const double& x3b) override;
-   
-   std::vector<GbTriangle3D*> getSurfaceTriangleSet() override;
-   void addSurfaceTriangleSet(std::vector<UbTupleFloat3>& nodes, std::vector<UbTupleInt3>& triangles) override;
-                                
-   bool hasRaytracing() override { return true; }
-   /*|r| must be 1! einheitsvector!!*/
-   double getIntersectionRaytraceFactor(const double& x1, const double& x2, const double& x3, const double& rx1, const double& rx2, const double& rx3) override;
-
-   bool hasIntersectionWithDirectedLine(GbPoint3D origin, GbPoint3D direction);
-
-	std::string toString() override;
-
-
-   void translate(const double& x1, const double& x2, const double& x3) override 
-   {
-      this->midPoint->translate(x1, x2, x3); 
-      this->notifyObserversObjectChanged();
-   }
-   void rotate(const double& rx1, const double& rx2, const double& rx3) override {/* rotation makes no sense*/ }
-   void scale(const double& sx1, const double&  /*sx2*/, const double&  /*sx3*/) override { this->radius *= sx1; }
-
-   TRIANGULATIONMODE getTriangulationMode() {return triangulationMode;}
-   void setTriangulationMode(TRIANGULATIONMODE mode) { this->triangulationMode = mode; }
-   
-   //virtuelle Methoden von UbObserver
-   void objectChanged(UbObservable*  /*changedObject*/) override
-   {
-      this->notifyObserversObjectChanged();
-      //std::cout<<"GbSphere:objectChanged() - toDo-);";
-   }
-   void objectWillBeDeleted(UbObservable*  /*objectForDeletion*/) override
-   {
-	   std::cout<<"throw UbException(-GbObjectGroup3D::finalize() - toDo-);";
-   }
-
-   using GbObject3D::isPointInGbObject3D; //Grund: dadurch muss man hier  isPointInGbObject3D(GbPoint3D*) nicht ausprogrammieren, welche sonst hier "ueberdeckt" waere, weil man eine
-
-   std::list< GbObject3D* > getGbObject3DList() { return this->geoobjects; }
+    enum TRIANGULATIONMODE { CUBOIDPROJECTION, RAYPROJECTION };
+
+    //////////////////////////////////////////////////////////////////////////
+    // Konstruktoren
+    GbObjectGroup3D();
+    GbObjectGroup3D(GbObjectGroup3D * /*group*/){};
+    ~GbObjectGroup3D() override;
+
+    GbObjectGroup3D *clone() override { return new GbObjectGroup3D(this); }
+    void finalize() override;
+
+    void addGbObject(GbObject3D *object) { this->geoobjects.push_back(object); }
+
+    double getRadius() const { return this->radius; }
+
+    double getX1Centroid() override { return midPoint->getX1Coordinate(); }
+    double getX1Minimum() override { return midPoint->getX1Coordinate() - radius; }
+    double getX1Maximum() override { return midPoint->getX1Coordinate() + radius; }
+    double getX2Centroid() override { return midPoint->getX2Coordinate(); }
+    double getX2Minimum() override { return midPoint->getX2Coordinate() - radius; }
+    double getX2Maximum() override { return midPoint->getX2Coordinate() + radius; }
+    double getX3Centroid() override { return midPoint->getX3Coordinate(); }
+    double getX3Minimum() override { return midPoint->getX3Coordinate() - radius; }
+    double getX3Maximum() override { return midPoint->getX3Coordinate() + radius; }
+
+    void setCenterX1Coordinate(const double &value) override;
+    void setCenterX2Coordinate(const double &value) override;
+    void setCenterX3Coordinate(const double &value) override;
+    void setCenterCoordinates(const double &x1, const double &x2, const double &x3) override;
+    void setRadius(const double &radius);
+
+    GbLine3D *createClippedLine3D(GbPoint3D &point1, GbPoint3D &point2) override;
+    double getDistance(GbPoint3D *p);
+    double getDistance(const double &x1p, const double &x2p, const double &x3p);
+
+    bool isPointInGbObject3D(const double &x1, const double &x2, const double &x3) override;
+    bool isPointInGbObject3D(const double &x1p, const double &x2p, const double &x3p, bool &pointIsOnBoundary) override;
+
+    bool isCellCuttingGbObject3D(const double &x1a, const double &x2a, const double &x3a, const double &x1b,
+                                 const double &x2b, const double &x3b) override;
+    bool isCellInsideOrCuttingGbObject3D(const double &x1a, const double &x2a, const double &x3a, const double &x1b,
+                                         const double &x2b, const double &x3b) override;
+    double getCellVolumeInsideGbObject3D(const double &x1a, const double &x2a, const double &x3a, const double &x1b,
+                                         const double &x2b, const double &x3b) override;
+
+    std::vector<GbTriangle3D *> getSurfaceTriangleSet() override;
+    void addSurfaceTriangleSet(std::vector<UbTupleFloat3> &nodes, std::vector<UbTupleInt3> &triangles) override;
+
+    bool hasRaytracing() override { return true; }
+    /*|r| must be 1! einheitsvector!!*/
+    double getIntersectionRaytraceFactor(const double &x1, const double &x2, const double &x3, const double &rx1,
+                                         const double &rx2, const double &rx3) override;
+
+    bool hasIntersectionWithDirectedLine(GbPoint3D origin, GbPoint3D direction);
+
+    std::string toString() override;
+
+    void translate(const double &x1, const double &x2, const double &x3) override
+    {
+        this->midPoint->translate(x1, x2, x3);
+        this->notifyObserversObjectChanged();
+    }
+    void rotate(const double &rx1, const double &rx2, const double &rx3) override
+    { /* rotation makes no sense*/
+    }
+    void scale(const double &sx1, const double & /*sx2*/, const double & /*sx3*/) override { this->radius *= sx1; }
+
+    TRIANGULATIONMODE getTriangulationMode() { return triangulationMode; }
+    void setTriangulationMode(TRIANGULATIONMODE mode) { this->triangulationMode = mode; }
+
+    // virtuelle Methoden von UbObserver
+    void objectChanged(UbObservable * /*changedObject*/) override
+    {
+        this->notifyObserversObjectChanged();
+        // std::cout<<"GbSphere:objectChanged() - toDo-);";
+    }
+    void objectWillBeDeleted(UbObservable * /*objectForDeletion*/) override
+    {
+        std::cout << "throw UbException(-GbObjectGroup3D::finalize() - toDo-);";
+    }
+
+    using GbObject3D::isPointInGbObject3D; // Grund: dadurch muss man hier  isPointInGbObject3D(GbPoint3D*) nicht
+                                           // ausprogrammieren, welche sonst hier "ueberdeckt" waere, weil man eine
+
+    std::list<GbObject3D *> getGbObject3DList() { return this->geoobjects; }
 
 #ifdef CAB_CTL
-   ctl::oStream &write(ctl::oStream &os) const
-   { 
-      midPoint->write(os);
-      return os<<radius; 
-   }
-   ctl::iStream &read(ctl::iStream &is) 
-   { 
-      midPoint->read(is);
-      return is>>radius;
-   }
-#endif //CAB_CTL
+    ctl::oStream &write(ctl::oStream &os) const
+    {
+        midPoint->write(os);
+        return os << radius;
+    }
+    ctl::iStream &read(ctl::iStream &is)
+    {
+        midPoint->read(is);
+        return is >> radius;
+    }
+#endif // CAB_CTL
 
 private:
-   GbPoint3D* midPoint;
-   double radius;  // Radius des Kreises
-   TRIANGULATIONMODE triangulationMode;
+    GbPoint3D *midPoint;
+    double radius; // Radius des Kreises
+    TRIANGULATIONMODE triangulationMode;
 
-   std::list< GbObject3D* > geoobjects;
+    std::list<GbObject3D *> geoobjects;
 };
 
-#endif //GbObjectGroup3D_H
+#endif // GbObjectGroup3D_H
diff --git a/src/basics/geometry3d/GbPoint3D.cpp b/src/basics/geometry3d/GbPoint3D.cpp
index ff6852e78ee176fb02633aa684dd3b7626e05930..c7780bb8be6f5b98c4b9c9e0c4266811af1bc9f7 100644
--- a/src/basics/geometry3d/GbPoint3D.cpp
+++ b/src/basics/geometry3d/GbPoint3D.cpp
@@ -1,28 +1,28 @@
 //=======================================================================================
-// ____          ____    __    ______     __________   __      __       __        __         
-// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |        
-//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |        
-//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |        
-//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____    
-//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|   
-//      \    \  |    |   ________________________________________________________________    
-//       \    \ |    |  |  ______________________________________________________________|   
-//        \    \|    |  |  |         __          __     __     __     ______      _______    
-//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)   
-//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______    
+// ____          ____    __    ______     __________   __      __       __        __
+// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |
+//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |
+//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |
+//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____
+//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|
+//      \    \  |    |   ________________________________________________________________
+//       \    \ |    |  |  ______________________________________________________________|
+//        \    \|    |  |  |         __          __     __     __     ______      _______
+//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)
+//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______
 //           \       |  |  |        |  |_____   |   \_/   |   |  |   |  |_/  /    _____  |
-//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/   
+//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/
 //
-//  This file is part of VirtualFluids. VirtualFluids is free software: you can 
+//  This file is part of VirtualFluids. VirtualFluids is free software: you can
 //  redistribute it and/or modify it under the terms of the GNU General Public
-//  License as published by the Free Software Foundation, either version 3 of 
+//  License as published by the Free Software Foundation, either version 3 of
 //  the License, or (at your option) any later version.
-//  
-//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT 
-//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
-//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License 
+//
+//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT
+//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 //  for more details.
-//  
+//
 //  You should have received a copy of the GNU General Public License along
 //  with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>.
 //
@@ -35,116 +35,120 @@ using namespace std;
 
 /*=======================================================*/
 GbPoint3D::GbPoint3D()
-{ 
-   this->x1=0.0; 
-   this->x2=0.0; 
-   this->x3=0.0;
-}                                             
+{
+    this->x1 = 0.0;
+    this->x2 = 0.0;
+    this->x3 = 0.0;
+}
 /*=======================================================*/
-GbPoint3D::GbPoint3D(const double& x1, const double& x2, const double& x3)
-{ 
-   this->x1=x1; 
-   this->x2=x2; 
-   this->x3=x3;
+GbPoint3D::GbPoint3D(const double &x1, const double &x2, const double &x3)
+{
+    this->x1 = x1;
+    this->x2 = x2;
+    this->x3 = x3;
 }
 /*=======================================================*/
-GbPoint3D::GbPoint3D(GbPoint3D* point)
+GbPoint3D::GbPoint3D(GbPoint3D *point)
 {
-   this->x1 = point->x1;                                             
-   this->x2 = point->x2;
-   this->x3 = point->x3;
-} 
+    this->x1 = point->x1;
+    this->x2 = point->x2;
+    this->x3 = point->x3;
+}
 /*=======================================================*/
-double GbPoint3D::getDistance(GbPoint3D* p)
+double GbPoint3D::getDistance(GbPoint3D *p)
 {
-   double dx1 = this->x1 - p->x1;
-   double dx2 = this->x2 - p->x2;
-   double dx3 = this->x3 - p->x3;
-   return std::sqrt(dx1*dx1 + dx2*dx2 + dx3*dx3);
+    double dx1 = this->x1 - p->x1;
+    double dx2 = this->x2 - p->x2;
+    double dx3 = this->x3 - p->x3;
+    return std::sqrt(dx1 * dx1 + dx2 * dx2 + dx3 * dx3);
 }
 /*=======================================================*/
-bool GbPoint3D::equals(const GbPoint3D* point) const
+bool GbPoint3D::equals(const GbPoint3D *point) const
 {
-   if(fabs(this->x1-point->x1)>1.E-10) return false;
-   if(fabs(this->x2-point->x2)>1.E-10) return false;
-   if(fabs(this->x3-point->x3)>1.E-10) return false;
+    if (fabs(this->x1 - point->x1) > 1.E-10)
+        return false;
+    if (fabs(this->x2 - point->x2) > 1.E-10)
+        return false;
+    if (fabs(this->x3 - point->x3) > 1.E-10)
+        return false;
 
-   return true;
+    return true;
 }
 /*=======================================================*/
 void GbPoint3D::transform(const double matrix[4][4])
 {
-   double tempX1 = x1;
-   double tempX2 = x2;
-   double tempX3 = x3;
-   x1 = matrix[0][0] * tempX1 + matrix[0][1] * tempX2 + matrix[0][2] * tempX3 + matrix[0][3] * 1.;
-   x2 = matrix[1][0] * tempX1 + matrix[1][1] * tempX2 + matrix[1][2] * tempX3 + matrix[1][3] * 1.;
-   x3 = matrix[2][0] * tempX1 + matrix[2][1] * tempX2 + matrix[2][2] * tempX3 + matrix[2][3] * 1.;
+    double tempX1 = x1;
+    double tempX2 = x2;
+    double tempX3 = x3;
+    x1            = matrix[0][0] * tempX1 + matrix[0][1] * tempX2 + matrix[0][2] * tempX3 + matrix[0][3] * 1.;
+    x2            = matrix[1][0] * tempX1 + matrix[1][1] * tempX2 + matrix[1][2] * tempX3 + matrix[1][3] * 1.;
+    x3            = matrix[2][0] * tempX1 + matrix[2][1] * tempX2 + matrix[2][2] * tempX3 + matrix[2][3] * 1.;
 }
 /*=======================================================*/
-bool GbPoint3D::isPointInGbObject3D(const double& x1, const double& x2, const double& x3)
+bool GbPoint3D::isPointInGbObject3D(const double &x1, const double &x2, const double &x3)
 {
-   return (fabs(x1)<1.E-13 && fabs(x2)<1.E-13 && fabs(x3)<1.E-13 );
+    return (fabs(x1) < 1.E-13 && fabs(x2) < 1.E-13 && fabs(x3) < 1.E-13);
 }
 /*=======================================================*/
-bool GbPoint3D::isPointInGbObject3D(const double& x1, const double& x2, const double& x3, bool& pointIsOnBoundary)
+bool GbPoint3D::isPointInGbObject3D(const double &x1, const double &x2, const double &x3, bool &pointIsOnBoundary)
 {
-   pointIsOnBoundary = (fabs(x1)<1.E-13 && fabs(x2)<1.E-13 && fabs(x3)<1.E-13 );
-   return pointIsOnBoundary;
+    pointIsOnBoundary = (fabs(x1) < 1.E-13 && fabs(x2) < 1.E-13 && fabs(x3) < 1.E-13);
+    return pointIsOnBoundary;
 }
 /*=======================================================*/
-vector<GbTriangle3D*> GbPoint3D::getSurfaceTriangleSet()
-{            
-   cout<<"GbPoint3D::getSurfaceTriangleSet() - test ... if no exception occurs, everything is fine\n";
-   vector<GbTriangle3D*> triangles;
-   return triangles; //<-empty vector! is okay!
-   
-   //old:
-   //to avoid unnecessary exceptions a point will generate a triangle with
-   //c3 point with same coordinates
-   //vector<GbTriangle3D*> triangles;
-   //GbPoint3D p1(getX1Coordinate(),getX2Coordinate(),getX3Coordinate());
-   //triangles.push_back(new GbTriangle3D(new GbPoint3D(p1),new GbPoint3D(p1),new GbPoint3D(p1)));
+vector<GbTriangle3D *> GbPoint3D::getSurfaceTriangleSet()
+{
+    cout << "GbPoint3D::getSurfaceTriangleSet() - test ... if no exception occurs, everything is fine\n";
+    vector<GbTriangle3D *> triangles;
+    return triangles; //<-empty vector! is okay!
+
+    // old:
+    // to avoid unnecessary exceptions a point will generate a triangle with
+    // c3 point with same coordinates
+    // vector<GbTriangle3D*> triangles;
+    // GbPoint3D p1(getX1Coordinate(),getX2Coordinate(),getX3Coordinate());
+    // triangles.push_back(new GbTriangle3D(new GbPoint3D(p1),new GbPoint3D(p1),new GbPoint3D(p1)));
 }
 /*=======================================================*/
-GbLine3D* GbPoint3D::createClippedLine3D (GbPoint3D&  /*point1*/, GbPoint3D&  /*point2*/)
+GbLine3D *GbPoint3D::createClippedLine3D(GbPoint3D & /*point1*/, GbPoint3D & /*point2*/)
 {
-   throw UbException(UB_EXARGS,"not implemented");
-} 
+    throw UbException(UB_EXARGS, "not implemented");
+}
 /*=======================================================*/
 string GbPoint3D::toString()
 {
-   stringstream ss;
-   ss<<"GbPoint3D["<<this->x1<<","<<this->x2<<","<<this->x3<<"]";
-   return((ss.str()).c_str());
+    stringstream ss;
+    ss << "GbPoint3D[" << this->x1 << "," << this->x2 << "," << this->x3 << "]";
+    return ((ss.str()).c_str());
 }
 /*=======================================================*/
-void GbPoint3D::translate(const double& dx1, const double& dx2, const double& dx3)
-{  
-   this->x1 += dx1;
-   this->x2 += dx2;
-   this->x3 += dx3;
-   this->notifyObserversObjectChanged(); 
+void GbPoint3D::translate(const double &dx1, const double &dx2, const double &dx3)
+{
+    this->x1 += dx1;
+    this->x2 += dx2;
+    this->x3 += dx3;
+    this->notifyObserversObjectChanged();
 }
 /*=======================================================*/
-void GbPoint3D::rotate(const double& rx1, const double& rx2, const double& rx3)
-{  
-   double newX1 = cos(rx3)*cos(rx2)*x1-x2*sin(rx3)*cos(rx1)+x2*cos(rx3)*sin(rx2)*sin(rx1)+x3*sin(rx3)*sin(rx1)+x3*cos(rx3)*sin(rx2)*cos(rx1);
-   double newX2 =  sin(rx3)*cos(rx2)*x1+x2*cos(rx3)*cos(rx1)+x2*sin(rx3)*sin(rx2)*sin(rx1)-x3*cos(rx3)*sin(rx1)+x3*sin(rx3)*sin(rx2)*cos(rx1);
-   double newX3 = -sin(rx2)*x1+cos(rx2)*sin(rx1)*x2+cos(rx2)*cos(rx1)*x3;
+void GbPoint3D::rotate(const double &rx1, const double &rx2, const double &rx3)
+{
+    double newX1 = cos(rx3) * cos(rx2) * x1 - x2 * sin(rx3) * cos(rx1) + x2 * cos(rx3) * sin(rx2) * sin(rx1) +
+                   x3 * sin(rx3) * sin(rx1) + x3 * cos(rx3) * sin(rx2) * cos(rx1);
+    double newX2 = sin(rx3) * cos(rx2) * x1 + x2 * cos(rx3) * cos(rx1) + x2 * sin(rx3) * sin(rx2) * sin(rx1) -
+                   x3 * cos(rx3) * sin(rx1) + x3 * sin(rx3) * sin(rx2) * cos(rx1);
+    double newX3 = -sin(rx2) * x1 + cos(rx2) * sin(rx1) * x2 + cos(rx2) * cos(rx1) * x3;
 
-   this->x1 = newX1;
-   this->x2 = newX2;
-   this->x3 = newX3;
-   this->notifyObserversObjectChanged(); 
+    this->x1 = newX1;
+    this->x2 = newX2;
+    this->x3 = newX3;
+    this->notifyObserversObjectChanged();
 }
 /*=======================================================*/
-void GbPoint3D::scale(const double& sx1, const double& sx2, const double& sx3)
-{  
-   this->x1 *= sx1;
-   this->x2 *= sx2;
-   this->x3 *= sx3;
-   this->notifyObserversObjectChanged(); 
+void GbPoint3D::scale(const double &sx1, const double &sx2, const double &sx3)
+{
+    this->x1 *= sx1;
+    this->x2 *= sx2;
+    this->x3 *= sx3;
+    this->notifyObserversObjectChanged();
 }
 /*=======================================================*/
-
diff --git a/src/basics/geometry3d/GbPoint3D.h b/src/basics/geometry3d/GbPoint3D.h
index 68760d789b2271e999a94997f8557bab65c8adc5..ccb8a9ab64a971bf847db591d9d0c04d0abbfbb6 100644
--- a/src/basics/geometry3d/GbPoint3D.h
+++ b/src/basics/geometry3d/GbPoint3D.h
@@ -1,28 +1,28 @@
 //=======================================================================================
-// ____          ____    __    ______     __________   __      __       __        __         
-// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |        
-//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |        
-//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |        
-//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____    
-//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|   
-//      \    \  |    |   ________________________________________________________________    
-//       \    \ |    |  |  ______________________________________________________________|   
-//        \    \|    |  |  |         __          __     __     __     ______      _______    
-//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)   
-//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______    
+// ____          ____    __    ______     __________   __      __       __        __
+// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |
+//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |
+//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |
+//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____
+//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|
+//      \    \  |    |   ________________________________________________________________
+//       \    \ |    |  |  ______________________________________________________________|
+//        \    \|    |  |  |         __          __     __     __     ______      _______
+//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)
+//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______
 //           \       |  |  |        |  |_____   |   \_/   |   |  |   |  |_/  /    _____  |
-//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/   
+//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/
 //
-//  This file is part of VirtualFluids. VirtualFluids is free software: you can 
+//  This file is part of VirtualFluids. VirtualFluids is free software: you can
 //  redistribute it and/or modify it under the terms of the GNU General Public
-//  License as published by the Free Software Foundation, either version 3 of 
+//  License as published by the Free Software Foundation, either version 3 of
 //  the License, or (at your option) any later version.
-//  
-//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT 
-//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
-//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License 
+//
+//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT
+//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 //  for more details.
-//  
+//
 //  You should have received a copy of the GNU General Public License along
 //  with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>.
 //
@@ -33,9 +33,9 @@
 #ifndef GBPOINT3D_H
 #define GBPOINT3D_H
 
-#include <string>
-#include <sstream>
 #include <cmath>
+#include <sstream>
+#include <string>
 
 #include <GbObject3D.h>
 
@@ -47,63 +47,79 @@ class GbTriangle3D;
 class GbPoint3D : public GbObject3D
 {
 public:
-   GbPoint3D();
-   GbPoint3D(const double& x1, const double& x2, const double& x3);
-   GbPoint3D(GbPoint3D *point);                
-   ~GbPoint3D() override = default;
-
-   GbPoint3D* clone() override {return new GbPoint3D(this);}
-   void finalize() override {}
-
-   void setCoordinates(const double& x1, const double& x2, const double& x3)
-   {
-       this->x1=x1;
-       this->x2=x2;
-       this->x3=x3;
-       this->notifyObserversObjectChanged();
-   }
-   void setX1(const double& x1) { this->x1=x1; this->notifyObserversObjectChanged(); }
-   void setX2(const double& x2) { this->x2=x2; this->notifyObserversObjectChanged(); }
-   void setX3(const double& x3) { this->x3=x3; this->notifyObserversObjectChanged(); }
-
-   double getX1Coordinate() const  { return this->x1; }
-   double getX2Coordinate() const  { return this->x2; }
-   double getX3Coordinate() const  { return this->x3; }
-
-   void transform(const double matrix[4][4]);
- 
-   double getX1Centroid() override  { return this->x1; }
-   double getX1Minimum() override   { return this->x1; }
-   double getX1Maximum() override   { return this->x1; }
-   double getX2Centroid() override  { return this->x2; }
-   double getX2Minimum() override   { return this->x2; }
-   double getX2Maximum() override   { return this->x2; }
-   double getX3Centroid() override  { return this->x3; }
-   double getX3Minimum() override   { return this->x3; }
-   double getX3Maximum() override   { return this->x3; }        
- 
-   void translate(const double& x1, const double& x2, const double& x3) override;
-   void rotate(const double& rx1, const double& rx2, const double& rx3) override;
-   void scale(const double& sx1, const double& sx2, const double& sx3) override;
-
-   double getDistance(GbPoint3D *p);
-   bool equals(const GbPoint3D* point) const;
-   bool isPointInGbObject3D(const double& x1, const double& x2, const double& x3, bool& pointIsOnBoundary) override;
-   bool isPointInGbObject3D(const double& x1, const double& x2, const double& x3) override;
-   bool isCellInsideGbObject3D(const double&  /*x11*/,const double&  /*x21*/,const double&  /*x31*/,const double&  /*x12*/,const double&  /*x22*/,const double&  /*x23*/) override { return false; }
-
-   std::vector<GbTriangle3D*> getSurfaceTriangleSet() override;
-   GbLine3D* createClippedLine3D(GbPoint3D &point1, GbPoint3D &point2) override;
-   std::string toString() override;
-
-   using GbObject3D::isPointInGbObject3D; //Grund: dadurch muss man hier  isPointInGbObject3D(GbPoint3D*) nicht ausprogrammieren
-                                          //, welche sonst hier "ueberdeckt" waere,da es dieselbe methode mit anderen args gibt!
-
-   //member
-   double x1;
-   double x2;
-   double x3;      
-};
+    GbPoint3D();
+    GbPoint3D(const double &x1, const double &x2, const double &x3);
+    GbPoint3D(GbPoint3D *point);
+    ~GbPoint3D() override = default;
+
+    GbPoint3D *clone() override { return new GbPoint3D(this); }
+    void finalize() override {}
+
+    void setCoordinates(const double &x1, const double &x2, const double &x3)
+    {
+        this->x1 = x1;
+        this->x2 = x2;
+        this->x3 = x3;
+        this->notifyObserversObjectChanged();
+    }
+    void setX1(const double &x1)
+    {
+        this->x1 = x1;
+        this->notifyObserversObjectChanged();
+    }
+    void setX2(const double &x2)
+    {
+        this->x2 = x2;
+        this->notifyObserversObjectChanged();
+    }
+    void setX3(const double &x3)
+    {
+        this->x3 = x3;
+        this->notifyObserversObjectChanged();
+    }
 
+    double getX1Coordinate() const { return this->x1; }
+    double getX2Coordinate() const { return this->x2; }
+    double getX3Coordinate() const { return this->x3; }
+
+    void transform(const double matrix[4][4]);
+
+    double getX1Centroid() override { return this->x1; }
+    double getX1Minimum() override { return this->x1; }
+    double getX1Maximum() override { return this->x1; }
+    double getX2Centroid() override { return this->x2; }
+    double getX2Minimum() override { return this->x2; }
+    double getX2Maximum() override { return this->x2; }
+    double getX3Centroid() override { return this->x3; }
+    double getX3Minimum() override { return this->x3; }
+    double getX3Maximum() override { return this->x3; }
+
+    void translate(const double &x1, const double &x2, const double &x3) override;
+    void rotate(const double &rx1, const double &rx2, const double &rx3) override;
+    void scale(const double &sx1, const double &sx2, const double &sx3) override;
+
+    double getDistance(GbPoint3D *p);
+    bool equals(const GbPoint3D *point) const;
+    bool isPointInGbObject3D(const double &x1, const double &x2, const double &x3, bool &pointIsOnBoundary) override;
+    bool isPointInGbObject3D(const double &x1, const double &x2, const double &x3) override;
+    bool isCellInsideGbObject3D(const double & /*x11*/, const double & /*x21*/, const double & /*x31*/,
+                                const double & /*x12*/, const double & /*x22*/, const double & /*x23*/) override
+    {
+        return false;
+    }
+
+    std::vector<GbTriangle3D *> getSurfaceTriangleSet() override;
+    GbLine3D *createClippedLine3D(GbPoint3D &point1, GbPoint3D &point2) override;
+    std::string toString() override;
+
+    using GbObject3D::isPointInGbObject3D; // Grund: dadurch muss man hier  isPointInGbObject3D(GbPoint3D*) nicht
+                                           // ausprogrammieren , welche sonst hier "ueberdeckt" waere,da es dieselbe
+                                           //methode mit anderen args gibt!
+
+    // member
+    double x1;
+    double x2;
+    double x3;
+};
 
 #endif
diff --git a/src/basics/geometry3d/GbPolygon3D.cpp b/src/basics/geometry3d/GbPolygon3D.cpp
index 713ce56f072e7017066f7c5a9a1f922bf8d762cf..02138f75767420502d585842c7e05b9741df5b28 100644
--- a/src/basics/geometry3d/GbPolygon3D.cpp
+++ b/src/basics/geometry3d/GbPolygon3D.cpp
@@ -1,28 +1,28 @@
 //=======================================================================================
-// ____          ____    __    ______     __________   __      __       __        __         
-// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |        
-//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |        
-//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |        
-//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____    
-//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|   
-//      \    \  |    |   ________________________________________________________________    
-//       \    \ |    |  |  ______________________________________________________________|   
-//        \    \|    |  |  |         __          __     __     __     ______      _______    
-//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)   
-//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______    
+// ____          ____    __    ______     __________   __      __       __        __
+// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |
+//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |
+//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |
+//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____
+//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|
+//      \    \  |    |   ________________________________________________________________
+//       \    \ |    |  |  ______________________________________________________________|
+//        \    \|    |  |  |         __          __     __     __     ______      _______
+//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)
+//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______
 //           \       |  |  |        |  |_____   |   \_/   |   |  |   |  |_/  /    _____  |
-//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/   
+//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/
 //
-//  This file is part of VirtualFluids. VirtualFluids is free software: you can 
+//  This file is part of VirtualFluids. VirtualFluids is free software: you can
 //  redistribute it and/or modify it under the terms of the GNU General Public
-//  License as published by the Free Software Foundation, either version 3 of 
+//  License as published by the Free Software Foundation, either version 3 of
 //  the License, or (at your option) any later version.
-//  
-//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT 
-//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
-//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License 
+//
+//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT
+//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 //  for more details.
-//  
+//
 //  You should have received a copy of the GNU General Public License along
 //  with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>.
 //
@@ -38,319 +38,332 @@ int GbPolygon3D::counter = 0;
 
 GbPolygon3D::GbPolygon3D()
 {
-   init();
-   counter++;
-   this->ps = new GbSystem3D::PointSet3(0);
+    init();
+    counter++;
+    this->ps = new GbSystem3D::PointSet3(0);
 }
 void GbPolygon3D::init()
 {
-   x1s        = 0.0;
-   x2s        = 0.0;
-   x1min      = 0.0;
-   x1max      = 0.0;
-   x2min      = 0.0;
-   x2max      = 0.0;
-   //		points   = NULL;
-   consistent = false;
-   ps         = NULL;
+    x1s   = 0.0;
+    x2s   = 0.0;
+    x1min = 0.0;
+    x1max = 0.0;
+    x2min = 0.0;
+    x2max = 0.0;
+    //		points   = NULL;
+    consistent = false;
+    ps         = NULL;
 }
 
 /*!
-* Creates an empty 3D polygon with the specified capacity.
-* @param capacity the initial capacity
-*/
+ * Creates an empty 3D polygon with the specified capacity.
+ * @param capacity the initial capacity
+ */
 GbPolygon3D::GbPolygon3D(int capacity)
 {
-   init();
-   counter++;
-   this->ps = new GbSystem3D::PointSet3(capacity);
-   //     this.po = new PointObserver(this);
+    init();
+    counter++;
+    this->ps = new GbSystem3D::PointSet3(capacity);
+    //     this.po = new PointObserver(this);
 }
 /**
-* Creates a 3D polygon with the specified points.
-* @param points the initial points of the polygon
-*/
-GbPolygon3D::GbPolygon3D(vector<GbPoint3D>& points)
+ * Creates a 3D polygon with the specified points.
+ * @param points the initial points of the polygon
+ */
+GbPolygon3D::GbPolygon3D(vector<GbPoint3D> &points)
 {
-   init();
-   counter++;
-   this->ps = new GbSystem3D::PointSet3((int)points.size());
-   this->addPoints(points);
+    init();
+    counter++;
+    this->ps = new GbSystem3D::PointSet3((int)points.size());
+    this->addPoints(points);
 }
 /**
-* Creates a 3D polygon as clone of the specified 3D polygon.
-* @param polygon the 3D polygon to be cloned
-*/
-GbPolygon3D::GbPolygon3D(GbPolygon3D* polygon)
+ * Creates a 3D polygon as clone of the specified 3D polygon.
+ * @param polygon the 3D polygon to be cloned
+ */
+GbPolygon3D::GbPolygon3D(GbPolygon3D *polygon)
 {
-   this->init();
-   counter++;
-   this->ps = new GbSystem3D::PointSet3((int)polygon->size());
-   vector<GbPoint3D> temp = polygon->getPoints();
-   this->addPoints( temp  );
+    this->init();
+    counter++;
+    this->ps               = new GbSystem3D::PointSet3((int)polygon->size());
+    vector<GbPoint3D> temp = polygon->getPoints();
+    this->addPoints(temp);
 }
 
 GbPolygon3D::~GbPolygon3D()
 {
-   counter--;
-   //if(points)
-   //for(unsigned u=0; u<points->size(); u++)
-   //{
-   //	delete (*points)[u];
-   //}
-   //		delete this->points;
-   delete this->ps;
+    counter--;
+    // if(points)
+    // for(unsigned u=0; u<points->size(); u++)
+    //{
+    //	delete (*points)[u];
+    //}
+    //		delete this->points;
+    delete this->ps;
 }
 
 /*======================================================================*/
 /**
-* Returns the number of points.
-* @return the number of points
-*/
-int GbPolygon3D::size()
-{
-   return(this->ps->size());
-}
+ * Returns the number of points.
+ * @return the number of points
+ */
+int GbPolygon3D::size() { return (this->ps->size()); }
 /**
-* Returns the number of times this 3D polygon contains the specified point.
-* @param point the point
-* @return the number of times this 3D polygon contains the specified point
-*/
-int GbPolygon3D::contains(GbPoint3D* point)
-{
-   return(this->ps->contains(point));
-}
+ * Returns the number of times this 3D polygon contains the specified point.
+ * @param point the point
+ * @return the number of times this 3D polygon contains the specified point
+ */
+int GbPolygon3D::contains(GbPoint3D *point) { return (this->ps->contains(point)); }
 /**
-* Returns the number of times this 3D polygon contains a point equal to the specified point.
-* @param point the point
-* @return the number of times this 3D polygon contains a point equal to the specified point
-*/
-int GbPolygon3D::containsEqual(GbPoint3D* point)
-{
-   return(this->ps->containsEqual(point));
-}
+ * Returns the number of times this 3D polygon contains a point equal to the specified point.
+ * @param point the point
+ * @return the number of times this 3D polygon contains a point equal to the specified point
+ */
+int GbPolygon3D::containsEqual(GbPoint3D *point) { return (this->ps->containsEqual(point)); }
 /**
-* Returns true, if this 3D polygon contains the specified line.
-* @param point1 the first point
-* @param point2 the second point
-* @return true, if this 3D polygon contains the specified line
-*/
-bool GbPolygon3D::containsLine(GbPoint3D* point1, GbPoint3D* point2)
+ * Returns true, if this 3D polygon contains the specified line.
+ * @param point1 the first point
+ * @param point2 the second point
+ * @return true, if this 3D polygon contains the specified line
+ */
+bool GbPolygon3D::containsLine(GbPoint3D *point1, GbPoint3D *point2)
 {
-   return(this->ps->containsLine(point1, point2));
+    return (this->ps->containsLine(point1, point2));
 }
 /**
-* Returns true, if this 3D polygon contains the specified line.
-* @param line the line
-* @return true, if this 3D polygon contains the specified line
-*/
-bool GbPolygon3D::containsLine(GbLine3D* line)
+ * Returns true, if this 3D polygon contains the specified line.
+ * @param line the line
+ * @return true, if this 3D polygon contains the specified line
+ */
+bool GbPolygon3D::containsLine(GbLine3D *line)
 {
-   return(this->ps->containsLine(line->getPoint1(), line->getPoint2()));
+    return (this->ps->containsLine(line->getPoint1(), line->getPoint2()));
 }
 /**
-* Returns the first point.
-* @return the first point
-*/
-GbPoint3D* GbPolygon3D::getFirstPoint()
-{
-   return(this->ps->getFirstPoint());
-}
+ * Returns the first point.
+ * @return the first point
+ */
+GbPoint3D *GbPolygon3D::getFirstPoint() { return (this->ps->getFirstPoint()); }
 /**
-* Returns the last point.
-* @return the last point
-*/
-GbPoint3D* GbPolygon3D::getLastPoint()
-{
-   return(this->ps->getLastPoint());
-}
+ * Returns the last point.
+ * @return the last point
+ */
+GbPoint3D *GbPolygon3D::getLastPoint() { return (this->ps->getLastPoint()); }
 /**
-* Returns the specified point.
-* @param index the index
-* @return the specified point
-* @exception ArrayIndexOutOfBoundsException if the specified index is not valid
-*/
-GbPoint3D* GbPolygon3D::getPoint(const int& index) 
+ * Returns the specified point.
+ * @param index the index
+ * @return the specified point
+ * @exception ArrayIndexOutOfBoundsException if the specified index is not valid
+ */
+GbPoint3D *GbPolygon3D::getPoint(const int &index)
 {
-   if(index < 0 || index > this->ps->size()) throw UbException(UB_EXARGS,"ArrayIndexOutOfBoundsException-GbPolygon3D.getPoint()");
-   return(this->ps->getPoint(index));
+    if (index < 0 || index > this->ps->size())
+        throw UbException(UB_EXARGS, "ArrayIndexOutOfBoundsException-GbPolygon3D.getPoint()");
+    return (this->ps->getPoint(index));
 }
 /**
-* Returns the points.
-* @return the points
-*/
+ * Returns the points.
+ * @return the points
+ */
 vector<GbPoint3D> GbPolygon3D::getPoints()
 {
-   if(!this->consistent) this->calculateValues();
-   return(this->points);
+    if (!this->consistent)
+        this->calculateValues();
+    return (this->points);
 }
 /**
-* Returns the points within the specified rectangle.
-* @param p1 the 1st point of the rectangle
-* @param p2 the 2nd point of the rectangle
-* @return the points within the specified rectangle
-*/
-vector<GbPoint3D> GbPolygon3D::getPoints(GbPoint3D* p1, GbPoint3D* p2)
+ * Returns the points within the specified rectangle.
+ * @param p1 the 1st point of the rectangle
+ * @param p2 the 2nd point of the rectangle
+ * @return the points within the specified rectangle
+ */
+vector<GbPoint3D> GbPolygon3D::getPoints(GbPoint3D *p1, GbPoint3D *p2)
 {
-   return(this->getPoints(p1->x1, p1->x2, p1->x3, p2->x1, p2->x2, p2->x3));
+    return (this->getPoints(p1->x1, p1->x2, p1->x3, p2->x1, p2->x2, p2->x3));
 }
 /**
-* Returns the points within the specified rectangle.
-* @param p1x1 the 1st x1 coordinate of the rectangle
-* @param p1x2 the 1st x2 coordinate of the rectangle
-* @param p1x3 the 1st x3 coordinate of the rectangle
-* @param p2x1 the 2nd x1 coordinate of the rectangle
-* @param p2x2 the 2nd x2 coordinate of the rectangle
-* @param p2x3 the 2nd x3 coordinate of the rectangle
-* @return the points within the specified rectangle
-*/
-vector<GbPoint3D> GbPolygon3D::getPoints(const double& p1x1, const double& p1x2, const double& p1x3, const double& p2x1, const double& p2x2, const double& p2x3)
+ * Returns the points within the specified rectangle.
+ * @param p1x1 the 1st x1 coordinate of the rectangle
+ * @param p1x2 the 1st x2 coordinate of the rectangle
+ * @param p1x3 the 1st x3 coordinate of the rectangle
+ * @param p2x1 the 2nd x1 coordinate of the rectangle
+ * @param p2x2 the 2nd x2 coordinate of the rectangle
+ * @param p2x3 the 2nd x3 coordinate of the rectangle
+ * @return the points within the specified rectangle
+ */
+vector<GbPoint3D> GbPolygon3D::getPoints(const double &p1x1, const double &p1x2, const double &p1x3, const double &p2x1,
+                                         const double &p2x2, const double &p2x3)
 {
-   double x1min, x1max, x2min, x2max, x3min, x3max;
+    double x1min, x1max, x2min, x2max, x3min, x3max;
 
-   if(UbMath::less(p1x1, p2x1)) { x1min = p1x1; x1max = p2x1; }
-   else                           { x1min = p2x1; x1max = p1x1; }
-   if(UbMath::less(p1x2, p2x2)) { x2min = p1x2; x2max = p2x2; }
-   else                           { x2min = p2x2; x2max = p1x2; }
-   if(UbMath::less(p1x3, p2x3)) { x3min = p1x3; x3max = p2x3; }
-   else                           { x3min = p2x3; x3max = p1x3; }
+    if (UbMath::less(p1x1, p2x1)) {
+        x1min = p1x1;
+        x1max = p2x1;
+    } else {
+        x1min = p2x1;
+        x1max = p1x1;
+    }
+    if (UbMath::less(p1x2, p2x2)) {
+        x2min = p1x2;
+        x2max = p2x2;
+    } else {
+        x2min = p2x2;
+        x2max = p1x2;
+    }
+    if (UbMath::less(p1x3, p2x3)) {
+        x3min = p1x3;
+        x3max = p2x3;
+    } else {
+        x3min = p2x3;
+        x3max = p1x3;
+    }
 
-   GbSystem3D::PointSet3 *pts = new GbSystem3D::PointSet3(1);
+    GbSystem3D::PointSet3 *pts = new GbSystem3D::PointSet3(1);
 
-   if(!this->consistent) this->calculateValues();
-   for(int i=this->size()-1; i>=0; i--)
-   {
-      if(UbMath::lessEqual(x1min, (this->points)[i].x1) && UbMath::greaterEqual(x1max, (this->points)[i].x1) &&
-         UbMath::lessEqual(x2min, (this->points)[i].x2) && UbMath::greaterEqual(x2max, (this->points)[i].x2) &&
-         UbMath::lessEqual(x3min, (this->points)[i].x3) && UbMath::greaterEqual(x3max, (this->points)[i].x3))     pts->add((this->points)[i]);
-   }
-   return(pts->getPoints());
+    if (!this->consistent)
+        this->calculateValues();
+    for (int i = this->size() - 1; i >= 0; i--) {
+        if (UbMath::lessEqual(x1min, (this->points)[i].x1) && UbMath::greaterEqual(x1max, (this->points)[i].x1) &&
+            UbMath::lessEqual(x2min, (this->points)[i].x2) && UbMath::greaterEqual(x2max, (this->points)[i].x2) &&
+            UbMath::lessEqual(x3min, (this->points)[i].x3) && UbMath::greaterEqual(x3max, (this->points)[i].x3))
+            pts->add((this->points)[i]);
+    }
+    return (pts->getPoints());
 }
 /**
-* Returns the area of this polygon.
-* The area is positive for positive ordered points, otherwise negative.
-* @return the area of this polygon
-*/
-//double getArea()
+ * Returns the area of this polygon.
+ * The area is positive for positive ordered points, otherwise negative.
+ * @return the area of this polygon
+ */
+// double getArea()
 //{
 //   if(!this.consistent) this.calculateValues();
 //   return(this.area);
 //}
 double GbPolygon3D::getX1Centroid()
 {
-   if(!this->consistent) this->calculateValues();
-   return(this->x1s);
+    if (!this->consistent)
+        this->calculateValues();
+    return (this->x1s);
 }
 double GbPolygon3D::getX1Minimum()
 {
-   if(!this->consistent) this->calculateValues();
-   return(this->x1min);
+    if (!this->consistent)
+        this->calculateValues();
+    return (this->x1min);
 }
 double GbPolygon3D::getX1Maximum()
 {
-   if(!this->consistent) this->calculateValues();
-   return(this->x1max);
+    if (!this->consistent)
+        this->calculateValues();
+    return (this->x1max);
 }
 double GbPolygon3D::getX2Centroid()
 {
-   if(!this->consistent) this->calculateValues();
-   return(this->x2s);
+    if (!this->consistent)
+        this->calculateValues();
+    return (this->x2s);
 }
 double GbPolygon3D::getX2Minimum()
 {
-   if(!this->consistent) this->calculateValues();
-   return(this->x2min);
+    if (!this->consistent)
+        this->calculateValues();
+    return (this->x2min);
 }
 double GbPolygon3D::getX2Maximum()
 {
-   if(!this->consistent) this->calculateValues();
-   return(this->x2max);
+    if (!this->consistent)
+        this->calculateValues();
+    return (this->x2max);
 }
 double GbPolygon3D::getX3Centroid()
 {
-   if(!this->consistent) this->calculateValues();
-   return(this->x3s);
+    if (!this->consistent)
+        this->calculateValues();
+    return (this->x3s);
 }
 double GbPolygon3D::getX3Minimum()
 {
-   if(!this->consistent) this->calculateValues();
-   return(this->x3min);
+    if (!this->consistent)
+        this->calculateValues();
+    return (this->x3min);
 }
 double GbPolygon3D::getX3Maximum()
 {
-   if(!this->consistent) this->calculateValues();
-   return(this->x3max);
+    if (!this->consistent)
+        this->calculateValues();
+    return (this->x3max);
 }
 
 /**
-* Adds a point to the end of this polygon. Notifies the observers of this 3D polygon.
-* @param point the point
-*/
-void GbPolygon3D::addPoint(GbPoint3D* point)
+ * Adds a point to the end of this polygon. Notifies the observers of this 3D polygon.
+ * @param point the point
+ */
+void GbPolygon3D::addPoint(GbPoint3D *point)
 {
-   //if((this instanceof GbPolygon3D) && !(point instanceof GbPoint3D)) throw new IllegalArgumentException("GbPolygon3D.addPoint(): points of 3D polygons have to be 3D points!");
+    // if((this instanceof GbPolygon3D) && !(point instanceof GbPoint3D)) throw new
+    // IllegalArgumentException("GbPolygon3D.addPoint(): points of 3D polygons have to be 3D points!");
 
-   this->ps->add(point);
-   //point.addObserver(this.po);
-   this->consistent = false;
-   //super.notifyObservers();
+    this->ps->add(point);
+    // point.addObserver(this.po);
+    this->consistent = false;
+    // super.notifyObservers();
 }
 /**
-* Adds a number of points to the end of this polygon. Notifies the observers of this 3D polygon.
-* @param points the points
-*/
-void GbPolygon3D::addPoints(vector<GbPoint3D>& points)
+ * Adds a number of points to the end of this polygon. Notifies the observers of this 3D polygon.
+ * @param points the points
+ */
+void GbPolygon3D::addPoints(vector<GbPoint3D> &points)
 {
-   //if((this instanceof GbPolygon3D) && (points.getClass().getComponentType() != GbPoint3D.class)) throw new IllegalArgumentException("GbPolygon3D.addPoints(): points of 3D polygons have to be 3D points!");
+    // if((this instanceof GbPolygon3D) && (points.getClass().getComponentType() != GbPoint3D.class)) throw new
+    // IllegalArgumentException("GbPolygon3D.addPoints(): points of 3D polygons have to be 3D points!");
 
-   this->ps->add(points);
-   //for(int i=0; i<points.length; i++) points[i].addObserver(this.po);
-   this->consistent = false;
-   //super.notifyObservers();
+    this->ps->add(points);
+    // for(int i=0; i<points.length; i++) points[i].addObserver(this.po);
+    this->consistent = false;
+    // super.notifyObservers();
 }
 /**
-* Removes all points from this polygon. Notifies the observers of this 3D polygon.
-*/
+ * Removes all points from this polygon. Notifies the observers of this 3D polygon.
+ */
 void GbPolygon3D::clear()
 {
-   //		delete this->points;
-   this->ps->clearAndTrim();
-   delete this->ps;
+    //		delete this->points;
+    this->ps->clearAndTrim();
+    delete this->ps;
 
-   //for(int i=points.length-1; i>=0; i--) points[i].removeObserver(this.po);
-   this->consistent = false;
-   //super.notifyObservers();
+    // for(int i=points.length-1; i>=0; i--) points[i].removeObserver(this.po);
+    this->consistent = false;
+    // super.notifyObservers();
 }
 /**
-* Returns a string representation of this 3D polygon.
-* @return a string representation of this 3D polygon
-*/
+ * Returns a string representation of this 3D polygon.
+ * @return a string representation of this 3D polygon
+ */
 string GbPolygon3D::toString()
 {
-   stringstream ss;
-   ss<<"GbPolygon3D[";
-   ss<<this->size()<<" points";
-   ss<<"]"<<endl;
-   for(int u=0; u<this->size(); u++)
-      ss<<this->ps->getPoint(u)->toString()<<endl;
+    stringstream ss;
+    ss << "GbPolygon3D[";
+    ss << this->size() << " points";
+    ss << "]" << endl;
+    for (int u = 0; u < this->size(); u++)
+        ss << this->ps->getPoint(u)->toString() << endl;
 
-   return(ss.str());
+    return (ss.str());
 }
 /*======================================================================*/
 
 void GbPolygon3D::calculateValues()
 {
-   this->x1s        = 0.0;
-   this->x2s        = 0.0;
-   this->x3s        = 0.0;
-   this->x1min      = 0.0;
-   this->x1max      = 0.0;
-   this->x2min      = 0.0;
-   this->x2max      = 0.0;
-   this->x3min      = 0.0;
-   this->x3max      = 0.0;
-   throw UbException(UB_EXARGS,"should be implemented");
+    this->x1s   = 0.0;
+    this->x2s   = 0.0;
+    this->x3s   = 0.0;
+    this->x1min = 0.0;
+    this->x1max = 0.0;
+    this->x2min = 0.0;
+    this->x2max = 0.0;
+    this->x3min = 0.0;
+    this->x3max = 0.0;
+    throw UbException(UB_EXARGS, "should be implemented");
 }
 /*======================================================================*/
-
-
diff --git a/src/basics/geometry3d/GbPolygon3D.h b/src/basics/geometry3d/GbPolygon3D.h
index 279b8bdb81c9460b9c3f35291652e1fc4900ff89..e4f44b5be5d31e3751be584c6623597229df5cd2 100644
--- a/src/basics/geometry3d/GbPolygon3D.h
+++ b/src/basics/geometry3d/GbPolygon3D.h
@@ -1,28 +1,28 @@
 //=======================================================================================
-// ____          ____    __    ______     __________   __      __       __        __         
-// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |        
-//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |        
-//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |        
-//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____    
-//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|   
-//      \    \  |    |   ________________________________________________________________    
-//       \    \ |    |  |  ______________________________________________________________|   
-//        \    \|    |  |  |         __          __     __     __     ______      _______    
-//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)   
-//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______    
+// ____          ____    __    ______     __________   __      __       __        __
+// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |
+//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |
+//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |
+//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____
+//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|
+//      \    \  |    |   ________________________________________________________________
+//       \    \ |    |  |  ______________________________________________________________|
+//        \    \|    |  |  |         __          __     __     __     ______      _______
+//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)
+//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______
 //           \       |  |  |        |  |_____   |   \_/   |   |  |   |  |_/  /    _____  |
-//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/   
+//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/
 //
-//  This file is part of VirtualFluids. VirtualFluids is free software: you can 
+//  This file is part of VirtualFluids. VirtualFluids is free software: you can
 //  redistribute it and/or modify it under the terms of the GNU General Public
-//  License as published by the Free Software Foundation, either version 3 of 
+//  License as published by the Free Software Foundation, either version 3 of
 //  the License, or (at your option) any later version.
-//  
-//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT 
-//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
-//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License 
+//
+//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT
+//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 //  for more details.
-//  
+//
 //  You should have received a copy of the GNU General Public License along
 //  with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>.
 //
@@ -33,254 +33,248 @@
 #ifndef GBPOLYGON3D_H
 #define GBPOLYGON3D_H
 
-#include <sstream>
 #include <iostream>
+#include <sstream>
 
-
-#include <GbObject3D.h>
 #include <GbLine3D.h>
-#include <GbTriangle3D.h>
+#include <GbObject3D.h>
 #include <GbSystem3D.h>
+#include <GbTriangle3D.h>
 
 #include <PointerDefinitions.h>
 
-
 /*=========================================================================*/
-//! \class GbPolygon2D                                         
+//! \class GbPolygon2D
 /*                                                                         */
 //! \brief This Class provides basic 3D polygon objects.
 
 class GbPolygon3D : public GbObject3D
 {
 public:
-   using GbObject3D::isPointInGbObject3D; //Grund: dadurch muss man hier  isPointInGbObject3D(GbPoint3D*) nicht ausprogrammieren, welche sonst hier "ueberdeckt" waere
+    using GbObject3D::isPointInGbObject3D; // Grund: dadurch muss man hier  isPointInGbObject3D(GbPoint3D*) nicht
+                                           // ausprogrammieren, welche sonst hier "ueberdeckt" waere
 private:
-   /*======================================================================*/
-   double            x1s  ;
-   double            x2s  ;
-   double            x3s  ;
-   double            x1min;
-   double            x1max;
-   double            x2min;
-   double            x2max;
-   double            x3min;
-   double            x3max;
-
-   std::vector<GbPoint3D> points;
-   bool                   consistent;
+    /*======================================================================*/
+    double x1s;
+    double x2s;
+    double x3s;
+    double x1min;
+    double x1max;
+    double x2min;
+    double x2max;
+    double x3min;
+    double x3max;
 
-   GbSystem3D::PointSet3 *ps;
-   //private PointObserver     po         = null;
+    std::vector<GbPoint3D> points;
+    bool consistent;
 
-   void init();
+    GbSystem3D::PointSet3 *ps;
+    // private PointObserver     po         = null;
 
-   /*======================================================================*/
+    void init();
 
+    /*======================================================================*/
 
-   /*======================================================================*/
-   /*  Construcrors                                                       */
-   /*                                                                      */
-   /*
-   * Creates an empty 2D polygon.
-   */
+    /*======================================================================*/
+    /*  Construcrors                                                       */
+    /*                                                                      */
+    /*
+     * Creates an empty 2D polygon.
+     */
 public:
-   static int counter;
-   GbPolygon3D();
-   /*
-   * Creates an empty 2D polygon with the specified capacity.
-   * @param capacity the initial capacity
-   */
-   GbPolygon3D(int capacity);
-   /*
-   * Creates a 2D polygon with the specified points.
-   * @param points the initial points of the polygon
-   */
-   GbPolygon3D(std::vector<GbPoint3D> &points);
-   /*
-   * Creates a 2D polygon as clone of the specified 2D polygon.
-   * @param polygon the 2D polygon to be cloned
-   */
-   GbPolygon3D(GbPolygon3D *polygon);
-
-   ~GbPolygon3D() override;
+    static int counter;
+    GbPolygon3D();
+    /*
+     * Creates an empty 2D polygon with the specified capacity.
+     * @param capacity the initial capacity
+     */
+    GbPolygon3D(int capacity);
+    /*
+     * Creates a 2D polygon with the specified points.
+     * @param points the initial points of the polygon
+     */
+    GbPolygon3D(std::vector<GbPoint3D> &points);
+    /*
+     * Creates a 2D polygon as clone of the specified 2D polygon.
+     * @param polygon the 2D polygon to be cloned
+     */
+    GbPolygon3D(GbPolygon3D *polygon);
 
-   /*======================================================================*/
+    ~GbPolygon3D() override;
 
+    /*======================================================================*/
 
-   /*======================================================================*/
-   /*  Methoden                                                            */
-   /*                                                                      */
-   /*
-   * Creates a 2D polygon as clone of this 2D polygon.
-   */
-   GbPolygon3D* clone() override { return(new GbPolygon3D(this)); }
-   void finalize() override
-   {
-      throw UbException(UB_EXARGS,"toDo");
-   }
+    /*======================================================================*/
+    /*  Methoden                                                            */
+    /*                                                                      */
+    /*
+     * Creates a 2D polygon as clone of this 2D polygon.
+     */
+    GbPolygon3D *clone() override { return (new GbPolygon3D(this)); }
+    void finalize() override { throw UbException(UB_EXARGS, "toDo"); }
 
-   /*
-   * Returns the number of points.
-   * @return the number of points
-   */
-   int size();
-   /*
-   * Returns the number of times this 2D polygon contains the specified point.
-   * @param point the point
-   * @return the number of times this 2D polygon contains the specified point
-   */
-   int contains(GbPoint3D *point);
-   /*
-   * Returns the number of times this 2D polygon contains a point equal to the specified point.
-   * @param point the point
-   * @return the number of times this 2D polygon contains a point equal to the specified point
-   */
-   int containsEqual(GbPoint3D* point);
-   /*
-   * Returns true, if this 2D polygon contains the specified line.
-   * @param point1 the first point
-   * @param point2 the second point
-   * @return true, if this 2D polygon contains the specified line
-   */
-   bool containsLine(GbPoint3D* point1, GbPoint3D* point2);
-   /*
-   * Returns true, if this 2D polygon contains the specified line.
-   * @param line the line
-   * @return true, if this 2D polygon contains the specified line
-   */
-   bool containsLine(GbLine3D* line);
-   /*
-   * Returns the first point.
-   * @return the first point
-   */
-   GbPoint3D* getFirstPoint();
-   /*
-   * Returns the last point.
-   * @return the last point
-   */
-   GbPoint3D* getLastPoint();
-   /*
-   * Returns the specified point.
-   * @param index the index
-   * @return the specified point
-   * @exception ArrayIndexOutOfBoundsException if the specified index is not valid
-   */
-   GbPoint3D* getPoint(const int& index);
-   /*
-   * Returns the points.
-   * @return the points
-   */
-   std::vector<GbPoint3D> getPoints();
-   /*
-   * Returns the points within the specified rectangle.
-   * @param p1 the 1st point of the rectangle
-   * @param p2 the 2nd point of the rectangle
-   * @return the points within the specified rectangle
-   */
-   std::vector<GbPoint3D> getPoints(GbPoint3D* p1, GbPoint3D* p2);
-   /*
-   * Returns the points within the specified rectangle.
-   * @param p1x1 the 1st x1 coordinate of the rectangle
-   * @param p1x2 the 1st x2 coordinate of the rectangle
-   * @param p2x1 the 2nd x1 coordinate of the rectangle
-   * @param p2x2 the 2nd x2 coordinate of the rectangle
-   * @return the points within the specified rectangle
-   */
-   std::vector<GbPoint3D> getPoints(const double& p1x1, const double& p1x2, const double& p1x3, const double& p2x1, const double& p2x2, const double& p2x3);
-   /*
-   * Returns the area of this polygon.
-   * The area is positive for positive ordered points, otherwise negative.
-   * @return the area of this polygon
-   */
-   //double getArea()
-   //{
-   //   if(!this.consistent) this.calculateValues();
-   //   return(this.area);
-   //}
-   double getX1Centroid() override;
-   double getX1Minimum() override;
-   double getX1Maximum() override;
-   double getX2Centroid() override;
-   double getX2Minimum() override;
-   double getX2Maximum() override;
-   double getX3Centroid() override;
-   double getX3Minimum() override;
-   double getX3Maximum() override;
+    /*
+     * Returns the number of points.
+     * @return the number of points
+     */
+    int size();
+    /*
+     * Returns the number of times this 2D polygon contains the specified point.
+     * @param point the point
+     * @return the number of times this 2D polygon contains the specified point
+     */
+    int contains(GbPoint3D *point);
+    /*
+     * Returns the number of times this 2D polygon contains a point equal to the specified point.
+     * @param point the point
+     * @return the number of times this 2D polygon contains a point equal to the specified point
+     */
+    int containsEqual(GbPoint3D *point);
+    /*
+     * Returns true, if this 2D polygon contains the specified line.
+     * @param point1 the first point
+     * @param point2 the second point
+     * @return true, if this 2D polygon contains the specified line
+     */
+    bool containsLine(GbPoint3D *point1, GbPoint3D *point2);
+    /*
+     * Returns true, if this 2D polygon contains the specified line.
+     * @param line the line
+     * @return true, if this 2D polygon contains the specified line
+     */
+    bool containsLine(GbLine3D *line);
+    /*
+     * Returns the first point.
+     * @return the first point
+     */
+    GbPoint3D *getFirstPoint();
+    /*
+     * Returns the last point.
+     * @return the last point
+     */
+    GbPoint3D *getLastPoint();
+    /*
+     * Returns the specified point.
+     * @param index the index
+     * @return the specified point
+     * @exception ArrayIndexOutOfBoundsException if the specified index is not valid
+     */
+    GbPoint3D *getPoint(const int &index);
+    /*
+     * Returns the points.
+     * @return the points
+     */
+    std::vector<GbPoint3D> getPoints();
+    /*
+     * Returns the points within the specified rectangle.
+     * @param p1 the 1st point of the rectangle
+     * @param p2 the 2nd point of the rectangle
+     * @return the points within the specified rectangle
+     */
+    std::vector<GbPoint3D> getPoints(GbPoint3D *p1, GbPoint3D *p2);
+    /*
+     * Returns the points within the specified rectangle.
+     * @param p1x1 the 1st x1 coordinate of the rectangle
+     * @param p1x2 the 1st x2 coordinate of the rectangle
+     * @param p2x1 the 2nd x1 coordinate of the rectangle
+     * @param p2x2 the 2nd x2 coordinate of the rectangle
+     * @return the points within the specified rectangle
+     */
+    std::vector<GbPoint3D> getPoints(const double &p1x1, const double &p1x2, const double &p1x3, const double &p2x1,
+                                     const double &p2x2, const double &p2x3);
+    /*
+     * Returns the area of this polygon.
+     * The area is positive for positive ordered points, otherwise negative.
+     * @return the area of this polygon
+     */
+    // double getArea()
+    //{
+    //   if(!this.consistent) this.calculateValues();
+    //   return(this.area);
+    //}
+    double getX1Centroid() override;
+    double getX1Minimum() override;
+    double getX1Maximum() override;
+    double getX2Centroid() override;
+    double getX2Minimum() override;
+    double getX2Maximum() override;
+    double getX3Centroid() override;
+    double getX3Minimum() override;
+    double getX3Maximum() override;
 
-   /*
-   * Adds a point to the end of this polygon. Notifies the observers of this 2D polygon.
-   * @param point the point
-   */
-   void addPoint(GbPoint3D* point);
-   /*
-   * Adds a number of points to the end of this polygon. Notifies the observers of this 2D polygon.
-   * @param points the points
-   */
-   void addPoints(std::vector<GbPoint3D>& points);
-   /*
-   * Removes all points from this polygon. Notifies the observers of this 2D polygon.
-   */
-   void clear();
+    /*
+     * Adds a point to the end of this polygon. Notifies the observers of this 2D polygon.
+     * @param point the point
+     */
+    void addPoint(GbPoint3D *point);
+    /*
+     * Adds a number of points to the end of this polygon. Notifies the observers of this 2D polygon.
+     * @param points the points
+     */
+    void addPoints(std::vector<GbPoint3D> &points);
+    /*
+     * Removes all points from this polygon. Notifies the observers of this 2D polygon.
+     */
+    void clear();
 
-   /*
-   * Returns true if this 2D polygon equals the specified object.
-   * Two polygon are equal, if their points are equal.
-   * <BR>Note that the order of points is recognized!
-   * @return true if this 2D polygon equals the specified object
-   * @see GbPoint2D#equals(java.lang.Object)
-   * @see GbPoint3D#equals(java.lang.Object)
-   */
-   // bool equals(Object object)
-   // {
-   //    try
-   //    {
-   //	GbPolygon2D polygon = (GbPolygon2D) object;
-   //int         n       = this.size();
+    /*
+     * Returns true if this 2D polygon equals the specified object.
+     * Two polygon are equal, if their points are equal.
+     * <BR>Note that the order of points is recognized!
+     * @return true if this 2D polygon equals the specified object
+     * @see GbPoint2D#equals(java.lang.Object)
+     * @see GbPoint3D#equals(java.lang.Object)
+     */
+    // bool equals(Object object)
+    // {
+    //    try
+    //    {
+    //	GbPolygon2D polygon = (GbPolygon2D) object;
+    // int         n       = this.size();
 
-   //if(n != polygon.size()) return(false);
-   //for(int i=0; i<n; i++) if(!this.getPoint(i).equals(polygon.getPoint(i))) return(false);
-   //return(true);
-   //    }
-   //    catch(Exception e){ return(false); }
-   // }
-   std::vector<GbTriangle3D*> getSurfaceTriangleSet() override
-   {
-      std::cout<<"GbPolygon3D::getSurfaceTriangleSet() - not implemented\n";
-      std::vector<GbTriangle3D*> tmp;
-      return tmp;
-   }
-   bool isPointInGbObject3D(const double&  /*x1*/, const double&  /*x2*/, const double&  /*x3*/) override
-   {
-      throw UbException(__FILE__, __LINE__, "GbPolygon3D::isPointInObject3D- not implemented");
-   }
-   bool isPointInGbObject3D(const double&  /*x1*/, const double&  /*x2*/, const double&  /*x3*/, bool&  /*pointIsOnBoundary*/) override
-   {
-      throw UbException(__FILE__, __LINE__, "GbPolygon3D::isPointInObject3D- not implemented");
-   }
-   bool isCellInsideGbObject3D(const double&  /*x1a*/,const double&  /*x2a*/,const double&  /*x3a*/,const double&  /*x1b*/,const double&  /*x2b*/,const double&  /*x3b*/) override { return false; }
+    // if(n != polygon.size()) return(false);
+    // for(int i=0; i<n; i++) if(!this.getPoint(i).equals(polygon.getPoint(i))) return(false);
+    // return(true);
+    //    }
+    //    catch(Exception e){ return(false); }
+    // }
+    std::vector<GbTriangle3D *> getSurfaceTriangleSet() override
+    {
+        std::cout << "GbPolygon3D::getSurfaceTriangleSet() - not implemented\n";
+        std::vector<GbTriangle3D *> tmp;
+        return tmp;
+    }
+    bool isPointInGbObject3D(const double & /*x1*/, const double & /*x2*/, const double & /*x3*/) override
+    {
+        throw UbException(__FILE__, __LINE__, "GbPolygon3D::isPointInObject3D- not implemented");
+    }
+    bool isPointInGbObject3D(const double & /*x1*/, const double & /*x2*/, const double & /*x3*/,
+                             bool & /*pointIsOnBoundary*/) override
+    {
+        throw UbException(__FILE__, __LINE__, "GbPolygon3D::isPointInObject3D- not implemented");
+    }
+    bool isCellInsideGbObject3D(const double & /*x1a*/, const double & /*x2a*/, const double & /*x3a*/,
+                                const double & /*x1b*/, const double & /*x2b*/, const double & /*x3b*/) override
+    {
+        return false;
+    }
 
-   GbLine3D* createClippedLine3D (GbPoint3D&  /*point1*/, GbPoint3D & /*point2*/) override
-   {
-      throw UbException(__FILE__, __LINE__, "GbPolygon3D::createClippedLine3D - not implemented");
-   }
+    GbLine3D *createClippedLine3D(GbPoint3D & /*point1*/, GbPoint3D & /*point2*/) override
+    {
+        throw UbException(__FILE__, __LINE__, "GbPolygon3D::createClippedLine3D - not implemented");
+    }
 
-/*
-   * Returns a string representation of this 2D polygon.
-   * @return a string representation of this 2D polygon
-   */
-   std::string toString() override;
+    /*
+     * Returns a string representation of this 2D polygon.
+     * @return a string representation of this 2D polygon
+     */
+    std::string toString() override;
 
-   /*======================================================================*/
-   /*  Private Methoden                                                    */
-   /*                                                                      */
-   void calculateValues();
-   /*======================================================================*/
+    /*======================================================================*/
+    /*  Private Methoden                                                    */
+    /*                                                                      */
+    void calculateValues();
+    /*======================================================================*/
 };
 /*=========================================================================*/
 #endif
-
-
-
-
-
-
diff --git a/src/basics/geometry3d/GbQuadFaceMesh3D.cpp b/src/basics/geometry3d/GbQuadFaceMesh3D.cpp
index 8c7ccb1a076555732e147b150afd7c3c93f9d3f6..e525d710e6bf9f6d44fcb57a41ea7579e0667dd4 100644
--- a/src/basics/geometry3d/GbQuadFaceMesh3D.cpp
+++ b/src/basics/geometry3d/GbQuadFaceMesh3D.cpp
@@ -1,101 +1,102 @@
 #include <geometry3d/GbQuadFaceMesh3D.h>
 
-#include <geometry3d/GbHalfSpace3D.h>
 #include <geometry3d/GbCuboid3D.h>
+#include <geometry3d/GbHalfSpace3D.h>
 
- 
 using namespace std;
 
 GbQuadFaceMesh3D::GbQuadFaceMesh3D() : GbObject3D()
 {
-   this->name             = "new GbMesh";
-   this->nodes            = new vector<Vertex>;           
-   this->quads            = new vector<QuadFace>;
-   this->consistent       = false;                                 
+    this->name       = "new GbMesh";
+    this->nodes      = new vector<Vertex>;
+    this->quads      = new vector<QuadFace>;
+    this->consistent = false;
 }
 
 GbQuadFaceMesh3D::GbQuadFaceMesh3D(string name, vector<Vertex> *nodes, vector<QuadFace> *quads) : GbObject3D()
 {
-   if(name.size()==0 ) throw UbException(UB_EXARGS,"no name specified");
-   if(!nodes         ) throw UbException(UB_EXARGS,"no nodes specified");
-   if(!quads         ) throw UbException(UB_EXARGS,"no quads specified");
-                                                         
-   this->name             = name;
-   this->nodes            = nodes;           
-   this->quads            = quads;     
-   this->consistent       = false;                                 
+    if (name.size() == 0)
+        throw UbException(UB_EXARGS, "no name specified");
+    if (!nodes)
+        throw UbException(UB_EXARGS, "no nodes specified");
+    if (!quads)
+        throw UbException(UB_EXARGS, "no quads specified");
+
+    this->name       = name;
+    this->nodes      = nodes;
+    this->quads      = quads;
+    this->consistent = false;
 }
 /*=============================================================================================*/
 
 GbQuadFaceMesh3D::~GbQuadFaceMesh3D()
 {
-	if(nodes)
-	{
-	//	for(unsigned u=0; u<nodes->size(); u++) delete (*nodes)[u];
-      delete nodes;
-	}
-   if(quads)
-   {
-      delete quads;
-   }
+    if (nodes) {
+        //	for(unsigned u=0; u<nodes->size(); u++) delete (*nodes)[u];
+        delete nodes;
+    }
+    if (quads) {
+        delete quads;
+    }
 }
 /*======================================================================*/
 
 void GbQuadFaceMesh3D::init()
 {
-   nodes      = NULL;
-   quads      = NULL;
-   x1min      = 0.0;
-   x1max      = 0.0;
-   x2min      = 0.0;
-   x2max      = 0.0;
-   x3min      = 0.0;
-   x3max      = 0.0;
-   consistent = false;
-}                                     
-   /**
-    * Returns a string representation of this triangular mesh.
-    * @return a string representation of this triangular mesh
-    */
+    nodes      = NULL;
+    quads      = NULL;
+    x1min      = 0.0;
+    x1max      = 0.0;
+    x2min      = 0.0;
+    x2max      = 0.0;
+    x3min      = 0.0;
+    x3max      = 0.0;
+    consistent = false;
+}
+/**
+ * Returns a string representation of this triangular mesh.
+ * @return a string representation of this triangular mesh
+ */
 string GbQuadFaceMesh3D::toString()
 {
-	stringstream ss;
-	ss<<"GbQuadFaceMesh3D[";
-	ss<<(int)this->quads->size()<<"-Quadangles, "<<(int)this->nodes->size()<<"-Nodes, "<<endl;
-	//ss<<"\""<<this->name<<", Area=sollt mal berechnet werden ;-)"<<"\"";
-   //ss<<", x1min="<<this->x1min;
-   //ss<<", x1max="<<this->x1max;
-   //ss<<", x2min="<<this->x2min;
-   //ss<<", x2max="<<this->x2max;
-   //ss<<", x3min="<<this->x3min;
-   //ss<<", x3max="<<this->x3max;
-   ss<<"]";
-   return(ss.str());
+    stringstream ss;
+    ss << "GbQuadFaceMesh3D[";
+    ss << (int)this->quads->size() << "-Quadangles, " << (int)this->nodes->size() << "-Nodes, " << endl;
+    // ss<<"\""<<this->name<<", Area=sollt mal berechnet werden ;-)"<<"\"";
+    // ss<<", x1min="<<this->x1min;
+    // ss<<", x1max="<<this->x1max;
+    // ss<<", x2min="<<this->x2min;
+    // ss<<", x2max="<<this->x2max;
+    // ss<<", x3min="<<this->x3min;
+    // ss<<", x3max="<<this->x3max;
+    ss << "]";
+    return (ss.str());
 }
 /**
  * Returns the name of this triangular mesh.
  * @return the name of this triangular mesh
  */
-string GbQuadFaceMesh3D::getName(){ return(this->name); }
+string GbQuadFaceMesh3D::getName() { return (this->name); }
 
 /**
  * Returns the nodes of this triangular mesh.
  * @return the nodes of this triangular mesh
  */
-vector<GbQuadFaceMesh3D::Vertex>* GbQuadFaceMesh3D::getNodes()   {  return(this->nodes);   }
+vector<GbQuadFaceMesh3D::Vertex> *GbQuadFaceMesh3D::getNodes() { return (this->nodes); }
 /**
  * Returns the quads of this triangular mesh.
  * @return the quads of this triangular mesh
  */
-vector<GbQuadFaceMesh3D::QuadFace>* GbQuadFaceMesh3D::getQuads()  { return(this->quads);  }
+vector<GbQuadFaceMesh3D::QuadFace> *GbQuadFaceMesh3D::getQuads() { return (this->quads); }
 /**
  * Returns the center x1 coordinate of this triangular mesh.
  * @return the center x1 coordinate of this triangular mesh
  */
 double GbQuadFaceMesh3D::getX1Centroid()
 {
-   if(!this->consistent) this->calculateValues();
-   return(0.5*(this->x1min+this->x1max));
+    if (!this->consistent)
+        this->calculateValues();
+    return (0.5 * (this->x1min + this->x1max));
 }
 /**
  * Returns the center x2 coordinate of this triangular mesh.
@@ -103,17 +104,19 @@ double GbQuadFaceMesh3D::getX1Centroid()
  */
 double GbQuadFaceMesh3D::getX2Centroid()
 {
-   if(!this->consistent) this->calculateValues();
-   return(0.5*(this->x2min+this->x2max));
+    if (!this->consistent)
+        this->calculateValues();
+    return (0.5 * (this->x2min + this->x2max));
 }
 /**
-* Returns the center x3 coordinate of this triangular mesh.
-	* @return the center x3 coordinate of this triangular mesh
-	*/
+ * Returns the center x3 coordinate of this triangular mesh.
+ * @return the center x3 coordinate of this triangular mesh
+ */
 double GbQuadFaceMesh3D::getX3Centroid()
 {
-	if(!this->consistent) this->calculateValues();
-	return(0.5*(this->x3min+this->x3max));
+    if (!this->consistent)
+        this->calculateValues();
+    return (0.5 * (this->x3min + this->x3max));
 }
 
 /**
@@ -122,8 +125,9 @@ double GbQuadFaceMesh3D::getX3Centroid()
  */
 double GbQuadFaceMesh3D::getX1Minimum()
 {
-   if(!this->consistent) this->calculateValues();
-   return(this->x1min);
+    if (!this->consistent)
+        this->calculateValues();
+    return (this->x1min);
 }
 /**
  * Returns the maximum x1 coordinate of this triangular mesh.
@@ -131,8 +135,9 @@ double GbQuadFaceMesh3D::getX1Minimum()
  */
 double GbQuadFaceMesh3D::getX1Maximum()
 {
-   if(!this->consistent) this->calculateValues();
-   return(this->x1max);
+    if (!this->consistent)
+        this->calculateValues();
+    return (this->x1max);
 }
 /**
  * Returns the minimum x2 coordinate of this triangular mesh.
@@ -140,8 +145,9 @@ double GbQuadFaceMesh3D::getX1Maximum()
  */
 double GbQuadFaceMesh3D::getX2Minimum()
 {
-   if(!this->consistent) this->calculateValues();
-   return(this->x2min);
+    if (!this->consistent)
+        this->calculateValues();
+    return (this->x2min);
 }
 /**
  * Returns the maximum x2 coordinate of this triangular mesh.
@@ -149,8 +155,9 @@ double GbQuadFaceMesh3D::getX2Minimum()
  */
 double GbQuadFaceMesh3D::getX2Maximum()
 {
-   if(!this->consistent) this->calculateValues();
-   return(this->x2max);
+    if (!this->consistent)
+        this->calculateValues();
+    return (this->x2max);
 }
 /**
  * Returns the minimum x3 coordinate of this triangular mesh.
@@ -158,8 +165,9 @@ double GbQuadFaceMesh3D::getX2Maximum()
  */
 double GbQuadFaceMesh3D::getX3Minimum()
 {
-   if(!this->consistent) this->calculateValues();
-   return(this->x3min);
+    if (!this->consistent)
+        this->calculateValues();
+    return (this->x3min);
 }
 /**
  * Returns the maximum x3 coordinate of this triangular mesh.
@@ -167,47 +175,52 @@ double GbQuadFaceMesh3D::getX3Minimum()
  */
 double GbQuadFaceMesh3D::getX3Maximum()
 {
-   if(!this->consistent) this->calculateValues();
-   return(this->x3max);
+    if (!this->consistent)
+        this->calculateValues();
+    return (this->x3max);
 }
 
 void GbQuadFaceMesh3D::calculateValues()
 {
-   double x1, x2, x3;
+    double x1, x2, x3;
 
-	this->x1min = (*this->nodes)[0].x;
-   this->x1max = (*this->nodes)[0].x;
-   this->x2min = (*this->nodes)[0].y;
-   this->x2max = (*this->nodes)[0].y;
-   this->x3min = (*this->nodes)[0].z;
-   this->x3max = (*this->nodes)[0].z;
+    this->x1min = (*this->nodes)[0].x;
+    this->x1max = (*this->nodes)[0].x;
+    this->x2min = (*this->nodes)[0].y;
+    this->x2max = (*this->nodes)[0].y;
+    this->x3min = (*this->nodes)[0].z;
+    this->x3max = (*this->nodes)[0].z;
 
-   for(int i=1; i<(int)this->nodes->size(); i++)
-   {
-		x1 = (*this->nodes)[i].x;
-		x2 = (*this->nodes)[i].y;
-		x3 = (*this->nodes)[i].z;
-		if(x1 < this->x1min) this->x1min = x1;
-		if(x1 > this->x1max) this->x1max = x1;
-		if(x2 < this->x2min) this->x2min = x2;
-		if(x2 > this->x2max) this->x2max = x2;
-		if(x3 < this->x3min) this->x3min = x3;
-		if(x3 > this->x3max) this->x3max = x3;
-   }
-   this->consistent = true;
+    for (int i = 1; i < (int)this->nodes->size(); i++) {
+        x1 = (*this->nodes)[i].x;
+        x2 = (*this->nodes)[i].y;
+        x3 = (*this->nodes)[i].z;
+        if (x1 < this->x1min)
+            this->x1min = x1;
+        if (x1 > this->x1max)
+            this->x1max = x1;
+        if (x2 < this->x2min)
+            this->x2min = x2;
+        if (x2 > this->x2max)
+            this->x2max = x2;
+        if (x3 < this->x3min)
+            this->x3min = x3;
+        if (x3 > this->x3max)
+            this->x3max = x3;
+    }
+    this->consistent = true;
 }
 
-
 /*======================================================================*/
-vector<GbTriangle3D*> GbQuadFaceMesh3D::getSurfaceTriangleSet()
+vector<GbTriangle3D *> GbQuadFaceMesh3D::getSurfaceTriangleSet()
 {
-   vector<GbTriangle3D*> triangles(0);
-   return triangles;
-	 //throw UbException(__FILE__, __LINE__, "GbQuadFaceMesh3D::getSurfaceTriangelSet - not implemented"); 
+    vector<GbTriangle3D *> triangles(0);
+    return triangles;
+    // throw UbException(__FILE__, __LINE__, "GbQuadFaceMesh3D::getSurfaceTriangelSet - not implemented");
 }
-//vector<GbQuad3D*> GbQuadFaceMesh3D::getSurfaceQuadSet()
+// vector<GbQuad3D*> GbQuadFaceMesh3D::getSurfaceQuadSet()
 //{
-//   throw UbException(__FILE__, __LINE__, "GbQuadFaceMesh3D::getSurfaceQuadSet - not implemented"); 
+//   throw UbException(__FILE__, __LINE__, "GbQuadFaceMesh3D::getSurfaceQuadSet - not implemented");
 //   //vector<GbQuadangle3D*> tris;
 //   //GbQuadangle3D* quad;
 //   //GbPoint3D* p1;
@@ -226,69 +239,72 @@ vector<GbTriangle3D*> GbQuadFaceMesh3D::getSurfaceTriangleSet()
 //}
 /*======================================================================*/
 /*
-* Function to determine if the point is inside the polyhedron defined as a 3D object
-* using the Halfspace algorithm
-* @param xp the x-coordinate of the point
-* @param yp the y-coordinate of the point
-* @param zp the z-coordinate of the point
-* @return true if point is inside else return false
-*/
-bool GbQuadFaceMesh3D::isPointInObject3DHalfSpace(const double&  /*xp*/, const double&  /*yp*/, const double&  /*zp*/)
-{ 
-   throw UbException(UB_EXARGS,"not implemented"); 
-   //vector<GbQuadangle3D*> *Quadangles = this->quads;
-   //int Quadanglesize = (int)Quadangles->size();
-   //GbPoint3D Point(xp,yp,zp);
-   //for (int i=0; i<Quadanglesize; i++)
-   //{
-   //   GbPoint3D* point1 = (*Quadangles)[i]->getPoint1();
-   //   GbPoint3D* point2 = (*Quadangles)[i]->getPoint2();
-   //   GbPoint3D* point3 = (*Quadangles)[i]->getPoint3();
+ * Function to determine if the point is inside the polyhedron defined as a 3D object
+ * using the Halfspace algorithm
+ * @param xp the x-coordinate of the point
+ * @param yp the y-coordinate of the point
+ * @param zp the z-coordinate of the point
+ * @return true if point is inside else return false
+ */
+bool GbQuadFaceMesh3D::isPointInObject3DHalfSpace(const double & /*xp*/, const double & /*yp*/, const double & /*zp*/)
+{
+    throw UbException(UB_EXARGS, "not implemented");
+    // vector<GbQuadangle3D*> *Quadangles = this->quads;
+    // int Quadanglesize = (int)Quadangles->size();
+    // GbPoint3D Point(xp,yp,zp);
+    // for (int i=0; i<Quadanglesize; i++)
+    //{
+    //   GbPoint3D* point1 = (*Quadangles)[i]->getPoint1();
+    //   GbPoint3D* point2 = (*Quadangles)[i]->getPoint2();
+    //   GbPoint3D* point3 = (*Quadangles)[i]->getPoint3();
 
-   //   GbHalfSpace3D halfspace(point1, point2, point3);
-   //   if (halfspace.ptInside(&Point)) return false;
-   //}
-   //return true;
+    //   GbHalfSpace3D halfspace(point1, point2, point3);
+    //   if (halfspace.ptInside(&Point)) return false;
+    //}
+    // return true;
 }
 /*======================================================================*/
 /*======================================================================*/
-bool GbQuadFaceMesh3D::isPointInGbObject3D(const double& x1, const double& x2, const double& x3)
+bool GbQuadFaceMesh3D::isPointInGbObject3D(const double &x1, const double &x2, const double &x3)
 {
 
-   double xmin=this->getX1Minimum();	double xmax=this->getX1Maximum();
-   double ymin=this->getX2Minimum();	double ymax=this->getX2Maximum();
-   double zmin=this->getX3Minimum();	double zmax=this->getX3Maximum();
-   double dX = (xmax-xmin)/100.;
-   double dY = (ymax-ymin)/100.;
-   double dZ = (zmax-zmin)/100.;
-   GbCuboid3D boundingCube(xmin-dX, ymin-dY, zmin-dZ, xmax+dX, ymax+dY, zmax+dZ);
-   if(!boundingCube.isPointInGbObject3D(x1, x2, x3)) 
-   {
-      boundingCube.finalize();
-      return false;
-   }
-   boundingCube.finalize();
+    double xmin = this->getX1Minimum();
+    double xmax = this->getX1Maximum();
+    double ymin = this->getX2Minimum();
+    double ymax = this->getX2Maximum();
+    double zmin = this->getX3Minimum();
+    double zmax = this->getX3Maximum();
+    double dX   = (xmax - xmin) / 100.;
+    double dY   = (ymax - ymin) / 100.;
+    double dZ   = (zmax - zmin) / 100.;
+    GbCuboid3D boundingCube(xmin - dX, ymin - dY, zmin - dZ, xmax + dX, ymax + dY, zmax + dZ);
+    if (!boundingCube.isPointInGbObject3D(x1, x2, x3)) {
+        boundingCube.finalize();
+        return false;
+    }
+    boundingCube.finalize();
 
-   // Halfspace algorithm, Area of spherical polygons algorithm or Ray crossing algorithm
-   GbVector3D bMin(boundingCube.getPoint1());
-   GbVector3D bMax(boundingCube.getPoint2());
-   bMin = bMax.Subtract(bMin);
-   //int radius = (int)bMin.Length();
+    // Halfspace algorithm, Area of spherical polygons algorithm or Ray crossing algorithm
+    GbVector3D bMin(boundingCube.getPoint1());
+    GbVector3D bMax(boundingCube.getPoint2());
+    bMin = bMax.Subtract(bMin);
+    // int radius = (int)bMin.Length();
 
-   //if(((GbQuadFaceMesh3D*)this->geoObject3D)->isPointInObject3DHalfSpace(x1,x2,x3) )
-   //if(((GbQuadFaceMesh3D*)this->geoObject3D)->isPointInObject3Darea(x11,x12,x13,numQuadangles))
-   //if(this->isPointInObject3DRayCrossing(x1,x2,x3,radius,(int)this->nodes->size(),(int)this->quads->size()))
-   //   return true;
-   //else 
-      return false;
+    // if(((GbQuadFaceMesh3D*)this->geoObject3D)->isPointInObject3DHalfSpace(x1,x2,x3) )
+    // if(((GbQuadFaceMesh3D*)this->geoObject3D)->isPointInObject3Darea(x11,x12,x13,numQuadangles))
+    // if(this->isPointInObject3DRayCrossing(x1,x2,x3,radius,(int)this->nodes->size(),(int)this->quads->size()))
+    //   return true;
+    // else
+    return false;
 }
 /*======================================================================*/
-bool GbQuadFaceMesh3D::isPointInGbObject3D(const double&  /*x1*/, const double&  /*x2*/, const double&  /*x3*/, bool&  /*pointIsOnBoundary*/)
+bool GbQuadFaceMesh3D::isPointInGbObject3D(const double & /*x1*/, const double & /*x2*/, const double & /*x3*/,
+                                           bool & /*pointIsOnBoundary*/)
 {
-    throw UbException(UB_EXARGS,"not implemented");
+    throw UbException(UB_EXARGS, "not implemented");
 }
 /*======================================================================*/
-GbLine3D* GbQuadFaceMesh3D::createClippedLine3D (GbPoint3D&  /*point1*/, GbPoint3D&  /*point2*/)
+GbLine3D *GbQuadFaceMesh3D::createClippedLine3D(GbPoint3D & /*point1*/, GbPoint3D & /*point2*/)
 {
-   throw UbException(UB_EXARGS,"not implemented");
+    throw UbException(UB_EXARGS, "not implemented");
 }
diff --git a/src/basics/geometry3d/GbQuadFaceMesh3D.h b/src/basics/geometry3d/GbQuadFaceMesh3D.h
index 4a623b0f767d36a01568d489c745d606449d790d..d4f1c1310a07b673e2aab6a7a0526ad5aa79d5bd 100644
--- a/src/basics/geometry3d/GbQuadFaceMesh3D.h
+++ b/src/basics/geometry3d/GbQuadFaceMesh3D.h
@@ -7,12 +7,11 @@
 #ifndef GBQUADFACEMESH3D_H
 #define GBQUADFACEMESH3D_H
 
-#include <sstream>
 #include <iostream>
+#include <sstream>
 
-
+#include <basics/utilities/UbException.h>
 #include <geometry3d/GbObject3D.h>
-#include <basics/utilities/UbException.h>  
 
 #include <PointerDefinitions.h>
 
@@ -25,97 +24,100 @@ class UbFileInput;
  * This Class provides the triangular meshes.
  * Note, that up to now no methods for checking consistency are included.
  * in this context this class describes facettes from an 3D-object !!!
-*/
-class GbQuadFaceMesh3D : public GbObject3D 
-{   
+ */
+class GbQuadFaceMesh3D : public GbObject3D
+{
 public:
-  // nested class start
-   class Vertex
-   {
-   public:
-      Vertex()= default;
-      Vertex(float x, float y, float z)
-      {
-         this->x=x;
-         this->y=y;
-         this->z=z;
-      }
-      float x, y, z;
-   };
-
-   class QuadFace
-   {
-   public:
-      QuadFace() = default;
-      QuadFace(int v1, int v2, int v3, int v4)
-      {
-         this->vertex1=v1;
-         this->vertex2=v2;
-         this->vertex3=v3;
-         this->vertex4=v4;
-      }
-
-      int vertex1, vertex2, vertex3, vertex4;
-   };
- // nested class end
+    // nested class start
+    class Vertex
+    {
+    public:
+        Vertex() = default;
+        Vertex(float x, float y, float z)
+        {
+            this->x = x;
+            this->y = y;
+            this->z = z;
+        }
+        float x, y, z;
+    };
+
+    class QuadFace
+    {
+    public:
+        QuadFace() = default;
+        QuadFace(int v1, int v2, int v3, int v4)
+        {
+            this->vertex1 = v1;
+            this->vertex2 = v2;
+            this->vertex3 = v3;
+            this->vertex4 = v4;
+        }
+
+        int vertex1, vertex2, vertex3, vertex4;
+    };
+    // nested class end
 
 public:
-   GbQuadFaceMesh3D();
-	GbQuadFaceMesh3D(std::string name, std::vector<Vertex> *nodes, std::vector<QuadFace> *quads);
-	~GbQuadFaceMesh3D() override;   
-   GbQuadFaceMesh3D* clone() override { throw UbException(UB_EXARGS,"clone() - not implemented"); }
-   void finalize() override           { throw UbException(UB_EXARGS,"finalize() - not implemented");}
-
-   std::string toString() override;
-   std::string getName() override;
-   std::vector<Vertex>*  getNodes();
-   std::vector<QuadFace>* getQuads();
-   double getX1Centroid() override;
-   double getX2Centroid() override;
-   double getX3Centroid() override;
-   double getX1Minimum() override;
-   double getX1Maximum() override;
-   double getX2Minimum() override;
-   double getX2Maximum() override;
-   double getX3Minimum() override;
-   double getX3Maximum() override;
-   void calculateValues();
-
-   bool isPointInGbObject3D(const double& x1, const double& x2, const double& x3) override;
-   bool isPointInGbObject3D(const double& x1, const double& x2, const double& x3, bool& pointIsOnBoundary) override;
-
-   bool isPointInObject3DHalfSpace(const double& xp, const double& yp, const double& zp);    //based on Halfspace algorithm
-   //bool isPointInObject3DSpherical(const double& xp, const double& yp, const double& zp, int numQuads);    //based on Spherical polygon area method        
-   //bool isPointInObject3DRayCrossing(const double& xp, const double& yp, const double& zp, int radius, int numVertices, int numQuads);  //based on Ray tracing algorithm
-   
-   //char SegPlaneInt(GbQuad3D *quad, GbVector3D  &PointQ, GbVector3D &PointR, GbVector3D &Point, int *m);
-   //char SegQuadCross(GbQuad3D *quad, GbVector3D  &PointQ, GbVector3D &PointR);
-   //till here !!!
-
-   GbLine3D* createClippedLine3D (GbPoint3D &point1,GbPoint3D &point2) override;
-   //virtual std::vector<GbQuad3D*> getSurfaceQuadSet();
-	std::vector<GbTriangle3D*> getSurfaceTriangleSet() override;
-
-   virtual void write(UbFileOutput*  /*out*/) { std::cout<<"GbQuadFaceMesh3D::write - sorry not implemented\n"; }
-   virtual void read(UbFileInput*  /*in*/)    { std::cout<<"GbQuadFaceMesh3D::read  - sorry not implemented\n"; }
-
-   void writeAVSMesh(UbFileOutput *out, bool normals=false);
-
-   /*======================================================================*/
-   using GbObject3D::isPointInGbObject3D; //Grund: dadurch muss man hier  isPointInGbObject3D(GbPoint3D*) nicht ausprogrammieren, welche sonst hier "ueberdeckt" waere
+    GbQuadFaceMesh3D();
+    GbQuadFaceMesh3D(std::string name, std::vector<Vertex> *nodes, std::vector<QuadFace> *quads);
+    ~GbQuadFaceMesh3D() override;
+    GbQuadFaceMesh3D *clone() override { throw UbException(UB_EXARGS, "clone() - not implemented"); }
+    void finalize() override { throw UbException(UB_EXARGS, "finalize() - not implemented"); }
+
+    std::string toString() override;
+    std::string getName() override;
+    std::vector<Vertex> *getNodes();
+    std::vector<QuadFace> *getQuads();
+    double getX1Centroid() override;
+    double getX2Centroid() override;
+    double getX3Centroid() override;
+    double getX1Minimum() override;
+    double getX1Maximum() override;
+    double getX2Minimum() override;
+    double getX2Maximum() override;
+    double getX3Minimum() override;
+    double getX3Maximum() override;
+    void calculateValues();
+
+    bool isPointInGbObject3D(const double &x1, const double &x2, const double &x3) override;
+    bool isPointInGbObject3D(const double &x1, const double &x2, const double &x3, bool &pointIsOnBoundary) override;
+
+    bool isPointInObject3DHalfSpace(const double &xp, const double &yp,
+                                    const double &zp); // based on Halfspace algorithm
+    // bool isPointInObject3DSpherical(const double& xp, const double& yp, const double& zp, int numQuads);    //based
+    // on Spherical polygon area method bool isPointInObject3DRayCrossing(const double& xp, const double& yp, const
+    // double& zp, int radius, int numVertices, int numQuads);  //based on Ray tracing algorithm
+
+    // char SegPlaneInt(GbQuad3D *quad, GbVector3D  &PointQ, GbVector3D &PointR, GbVector3D &Point, int *m);
+    // char SegQuadCross(GbQuad3D *quad, GbVector3D  &PointQ, GbVector3D &PointR);
+    // till here !!!
+
+    GbLine3D *createClippedLine3D(GbPoint3D &point1, GbPoint3D &point2) override;
+    // virtual std::vector<GbQuad3D*> getSurfaceQuadSet();
+    std::vector<GbTriangle3D *> getSurfaceTriangleSet() override;
+
+    virtual void write(UbFileOutput * /*out*/) { std::cout << "GbQuadFaceMesh3D::write - sorry not implemented\n"; }
+    virtual void read(UbFileInput * /*in*/) { std::cout << "GbQuadFaceMesh3D::read  - sorry not implemented\n"; }
+
+    void writeAVSMesh(UbFileOutput *out, bool normals = false);
+
+    /*======================================================================*/
+    using GbObject3D::isPointInGbObject3D; // Grund: dadurch muss man hier  isPointInGbObject3D(GbPoint3D*) nicht
+                                           // ausprogrammieren, welche sonst hier "ueberdeckt" waere
 private:
-   void init();
-   /*======================================================================*/
-   std::string name;
-   std::vector<Vertex>   *nodes;
-   std::vector<QuadFace> *quads;
-   double      x1min;
-   double      x1max;
-   double      x2min;
-   double      x2max;
-   double      x3min;
-   double      x3max;
-   bool        consistent;
+    void init();
+    /*======================================================================*/
+    std::string name;
+    std::vector<Vertex> *nodes;
+    std::vector<QuadFace> *quads;
+    double x1min;
+    double x1max;
+    double x2min;
+    double x2max;
+    double x3min;
+    double x3max;
+    bool consistent;
 };
 /*=========================================================================*/
 
diff --git a/src/basics/geometry3d/GbSphere3D.cpp b/src/basics/geometry3d/GbSphere3D.cpp
index 670b37f5a30f3b954c53a093d324f2b4b7301382..da8aba0cb44e6f447266335874811425e17c8ef3 100644
--- a/src/basics/geometry3d/GbSphere3D.cpp
+++ b/src/basics/geometry3d/GbSphere3D.cpp
@@ -1,71 +1,69 @@
+#include <geometry3d/GbLine3D.h>
+#include <geometry3d/GbPoint3D.h>
 #include <geometry3d/GbSphere3D.h>
 #include <geometry3d/GbSystem3D.h>
-#include <geometry3d/GbPoint3D.h>
-#include <geometry3d/GbLine3D.h>
 #include <geometry3d/GbTriangle3D.h>
 
 using namespace std;
 
 /*=====================================================*/
-GbSphere3D::GbSphere3D()
-  : GbObject3D(), UbObserver()
+GbSphere3D::GbSphere3D() : GbObject3D(), UbObserver()
 {
-   this->setName("sphere");
-   radius=0;
-   midPoint=new GbPoint3D(0,0,0);
+    this->setName("sphere");
+    radius   = 0;
+    midPoint = new GbPoint3D(0, 0, 0);
 }
 /*=====================================================*/
-GbSphere3D::GbSphere3D(const double& x1,const double& x2, const double& x3, const double& radius)
-  : GbObject3D(), UbObserver()
+GbSphere3D::GbSphere3D(const double &x1, const double &x2, const double &x3, const double &radius)
+    : GbObject3D(), UbObserver()
 {
-   this->setName("sphere");
-   midPoint = new GbPoint3D(x1,x2,x3);
-   midPoint->addObserver(this);
+    this->setName("sphere");
+    midPoint = new GbPoint3D(x1, x2, x3);
+    midPoint->addObserver(this);
 
-   this->radius   = radius;
-   triangulationMode = RAYPROJECTION;
-   //triangulationMode = CUBOIDPROJECTION;
+    this->radius      = radius;
+    triangulationMode = RAYPROJECTION;
+    // triangulationMode = CUBOIDPROJECTION;
 }
 /*=====================================================*/
-GbSphere3D::GbSphere3D(const GbSphere3D& sphere)
-  : GbObject3D(sphere), UbObserver()
+GbSphere3D::GbSphere3D(const GbSphere3D &sphere) : GbObject3D(sphere), UbObserver()
 {
-   this->setName("sphere");
+    this->setName("sphere");
 
-   this->midPoint    = sphere.midPoint->clone();
-   this->radius      = sphere.radius;
-   triangulationMode = RAYPROJECTION;
+    this->midPoint    = sphere.midPoint->clone();
+    this->radius      = sphere.radius;
+    triangulationMode = RAYPROJECTION;
 
-   this->midPoint->addObserver(this);
+    this->midPoint->addObserver(this);
 }
 /*=====================================================*/
-GbSphere3D::GbSphere3D(GbSphere3D* sphere)
-   : GbObject3D(), UbObserver()
+GbSphere3D::GbSphere3D(GbSphere3D *sphere) : GbObject3D(), UbObserver()
 {
-   this->setName(sphere->getName());
-   midPoint = sphere->midPoint->clone();
-   midPoint->addObserver(this);
+    this->setName(sphere->getName());
+    midPoint = sphere->midPoint->clone();
+    midPoint->addObserver(this);
 
-   this->radius   = sphere->getRadius();
-   triangulationMode = RAYPROJECTION;
+    this->radius      = sphere->getRadius();
+    triangulationMode = RAYPROJECTION;
 }
 /*=====================================================*/
 GbSphere3D::~GbSphere3D()
 {
-   if(this->midPoint) this->midPoint->removeObserver(this);
+    if (this->midPoint)
+        this->midPoint->removeObserver(this);
 }
 /*=====================================================*/
 void GbSphere3D::finalize()
 {
-   if(this->midPoint)
-   {
-      this->midPoint->removeObserver(this);
-      this->midPoint->finalize();
-      delete this->midPoint;
-      this->midPoint = NULL;
-   }
-
-   if(this->midPoint) this->midPoint->removeObserver(this);
+    if (this->midPoint) {
+        this->midPoint->removeObserver(this);
+        this->midPoint->finalize();
+        delete this->midPoint;
+        this->midPoint = NULL;
+    }
+
+    if (this->midPoint)
+        this->midPoint->removeObserver(this);
 }
 /*=====================================================*/
 bool GbSphere3D::intersects(SPtr<GbSphere3D> sphere)
@@ -73,819 +71,855 @@ bool GbSphere3D::intersects(SPtr<GbSphere3D> sphere)
     return this->getDistance(sphere->midPoint) < radius + sphere->radius;
 }
 /*=======================================================*/
-void GbSphere3D::setCenterCoordinates(const double& x1, const double& x2, const double& x3)
+void GbSphere3D::setCenterCoordinates(const double &x1, const double &x2, const double &x3)
 {
-   this->translate(x1-getX1Centroid(), x2-getX2Centroid(), x3-getX3Centroid() );
+    this->translate(x1 - getX1Centroid(), x2 - getX2Centroid(), x3 - getX3Centroid());
 }
 
-void GbSphere3D::setCenterCoordinates(const UbTupleDouble3& position)
+void GbSphere3D::setCenterCoordinates(const UbTupleDouble3 &position)
 {
     this->setCenterCoordinates(val<1>(position), val<2>(position), val<3>(position));
 }
 
 /*=====================================================*/
-double GbSphere3D::getDistance(GbPoint3D* p)
+double GbSphere3D::getDistance(GbPoint3D *p)
 {
-   return this->getDistance(p->getX1Centroid(),p->getX2Coordinate(),p->getX3Coordinate());
+    return this->getDistance(p->getX1Centroid(), p->getX2Coordinate(), p->getX3Coordinate());
 }
 /*=====================================================*/
-void GbSphere3D::setCenterX1Coordinate(const double& value)
+void GbSphere3D::setCenterX1Coordinate(const double &value)
 {
-   if(this->midPoint) this->midPoint->setX1(value);
-   else throw UbException(UB_EXARGS,"Sphere has no midPoint");
-   //kein notifyObserver(), da der knoten notifyObserver() ausfuehrt und die GbSphere dieses event
-   //abfaengt und dann selbst notifyObservers ausfuehrt ;-)
+    if (this->midPoint)
+        this->midPoint->setX1(value);
+    else
+        throw UbException(UB_EXARGS, "Sphere has no midPoint");
+    // kein notifyObserver(), da der knoten notifyObserver() ausfuehrt und die GbSphere dieses event
+    // abfaengt und dann selbst notifyObservers ausfuehrt ;-)
 }
 /*=====================================================*/
-void GbSphere3D::setCenterX2Coordinate(const double& value)
+void GbSphere3D::setCenterX2Coordinate(const double &value)
 {
-   if(this->midPoint) this->midPoint->setX2(value);
-   else  throw UbException(UB_EXARGS,"Sphere has no midPoint");
-   //kein notifyObserver(), da der knoten notifyObserver() ausfuehrt und die GbSphere dieses event
-   //abfaengt und dann selbst notifyObservers ausfuehrt ;-)
+    if (this->midPoint)
+        this->midPoint->setX2(value);
+    else
+        throw UbException(UB_EXARGS, "Sphere has no midPoint");
+    // kein notifyObserver(), da der knoten notifyObserver() ausfuehrt und die GbSphere dieses event
+    // abfaengt und dann selbst notifyObservers ausfuehrt ;-)
 }
 /*=====================================================*/
-void GbSphere3D::setCenterX3Coordinate(const double& value)
+void GbSphere3D::setCenterX3Coordinate(const double &value)
 {
-   if(this->midPoint) this->midPoint->setX3(value);
-   else  throw UbException(UB_EXARGS,"sphere has no midPoint");
-   //kein notifyObserver(), da der knoten notifyObserver() ausfuehrt und die GbSphere dieses event
-   //abfaengt und dann selbst notifyObservers ausfuehrt ;-)
+    if (this->midPoint)
+        this->midPoint->setX3(value);
+    else
+        throw UbException(UB_EXARGS, "sphere has no midPoint");
+    // kein notifyObserver(), da der knoten notifyObserver() ausfuehrt und die GbSphere dieses event
+    // abfaengt und dann selbst notifyObservers ausfuehrt ;-)
 }
 /*=====================================================*/
-void GbSphere3D::setRadius(const double& radius)
+void GbSphere3D::setRadius(const double &radius)
 {
-   if (radius != this->radius)
-   {
-   this->radius=radius;
-   this->notifyObserversObjectChanged();
-}
+    if (radius != this->radius) {
+        this->radius = radius;
+        this->notifyObserversObjectChanged();
+    }
 }
 /*=====================================================*/
-double GbSphere3D::getDistance(const double& x1p, const double& x2p, const double& x3p)
+double GbSphere3D::getDistance(const double &x1p, const double &x2p, const double &x3p)
 {
-   double deltaX1 = x1p - midPoint->getX1Coordinate();
-   double deltaX2 = x2p - midPoint->getX2Coordinate();
-   double deltaX3 = x3p - midPoint->getX3Coordinate();
-   return sqrt(deltaX1*deltaX1+deltaX2*deltaX2+deltaX3*deltaX3)-this->radius;
+    double deltaX1 = x1p - midPoint->getX1Coordinate();
+    double deltaX2 = x2p - midPoint->getX2Coordinate();
+    double deltaX3 = x3p - midPoint->getX3Coordinate();
+    return sqrt(deltaX1 * deltaX1 + deltaX2 * deltaX2 + deltaX3 * deltaX3) - this->radius;
 }
 /*=====================================================*/
-//true, wenn 'in Object' oder 'auf Boundary'!
-bool GbSphere3D::isPointInGbObject3D(const double& x1p, const double& x2p, const double& x3p)
+// true, wenn 'in Object' oder 'auf Boundary'!
+bool GbSphere3D::isPointInGbObject3D(const double &x1p, const double &x2p, const double &x3p)
 {
-   double deltaX1 = x1p - midPoint->getX1Coordinate();
-   double deltaX2 = x2p - midPoint->getX2Coordinate();
-   double deltaX3 = x3p - midPoint->getX3Coordinate();
+    double deltaX1 = x1p - midPoint->getX1Coordinate();
+    double deltaX2 = x2p - midPoint->getX2Coordinate();
+    double deltaX3 = x3p - midPoint->getX3Coordinate();
 
-   return UbMath::lessEqual(deltaX1*deltaX1+deltaX2*deltaX2+deltaX3*deltaX3, this->radius*this->radius);
+    return UbMath::lessEqual(deltaX1 * deltaX1 + deltaX2 * deltaX2 + deltaX3 * deltaX3, this->radius * this->radius);
 }
 /*=====================================================*/
-//true, wenn 'in Object' oder 'auf Boundary'!
-bool GbSphere3D::isPointInGbObject3D(const double& x1p, const double& x2p, const double& x3p, bool& pointIsOnBoundary)
+// true, wenn 'in Object' oder 'auf Boundary'!
+bool GbSphere3D::isPointInGbObject3D(const double &x1p, const double &x2p, const double &x3p, bool &pointIsOnBoundary)
 {
-   double deltaX1 = x1p - midPoint->getX1Coordinate();
-   double deltaX2 = x2p - midPoint->getX2Coordinate();
-   double deltaX3 = x3p - midPoint->getX3Coordinate();
+    double deltaX1 = x1p - midPoint->getX1Coordinate();
+    double deltaX2 = x2p - midPoint->getX2Coordinate();
+    double deltaX3 = x3p - midPoint->getX3Coordinate();
 
-   double distanceSquare = deltaX1*deltaX1+deltaX2*deltaX2+deltaX3*deltaX3;
-   double radiusSquare   = this->radius*this->radius;
+    double distanceSquare = deltaX1 * deltaX1 + deltaX2 * deltaX2 + deltaX3 * deltaX3;
+    double radiusSquare   = this->radius * this->radius;
 
-   pointIsOnBoundary = UbMath::equal(distanceSquare,radiusSquare);
+    pointIsOnBoundary = UbMath::equal(distanceSquare, radiusSquare);
 
-   return UbMath::lessEqual(distanceSquare,radiusSquare);
+    return UbMath::lessEqual(distanceSquare, radiusSquare);
 }
 /*=====================================================*/
-//bool GbSphere3D::crossCellCrossSection(double x11,double x21,double x12,double x22, double ra)
+// bool GbSphere3D::crossCellCrossSection(double x11,double x21,double x12,double x22, double ra)
 //{
-//   if(this->isPointInCrossection(x11, x12) || this->isPointInCrossection(x21, x22) || this->isPointInCrossection(x11, x22) || this->isPointInCrossection(x21, x12))
+//   if(this->isPointInCrossection(x11, x12) || this->isPointInCrossection(x21, x22) || this->isPointInCrossection(x11,
+//   x22) || this->isPointInCrossection(x21, x12))
 //   {
-//		if(!this->isPointInCrossection(x11, x12) || !this->isPointInCrossection(x21, x22) || !this->isPointInCrossection(x11, x22) || !this->isPointInCrossection(x21, x12)) return true;
+//		if(!this->isPointInCrossection(x11, x12) || !this->isPointInCrossection(x21, x22) ||
+//!this->isPointInCrossection(x11, x22) || !this->isPointInCrossection(x21, x12)) return true;
 //   }
 //   return false;
 //}
 //
 ///*=====================================================*/
-//bool GbSphere3D::cellCrossAndInsideCrossSection(double x11,double x21,double x12,double x22, double ra)
+// bool GbSphere3D::cellCrossAndInsideCrossSection(double x11,double x21,double x12,double x22, double ra)
 //{
-//   if(this->isPointInCrossection(x11, x12) || this->isPointInCrossection(x21, x22) || this->isPointInCrossection(x11, x22) || this->isPointInCrossection(x21, x12))  return true;
-//   return false;
+//   if(this->isPointInCrossection(x11, x12) || this->isPointInCrossection(x21, x22) || this->isPointInCrossection(x11,
+//   x22) || this->isPointInCrossection(x21, x12))  return true; return false;
 //}
 /*=====================================================*/
 string GbSphere3D::toString()
 {
-	stringstream ss;
-	ss<< "GbSphere3D[";
-	ss <<"mid="<<midPoint->toString()<<", r="<<radius<<"]";
-	return ss.str();
+    stringstream ss;
+    ss << "GbSphere3D[";
+    ss << "mid=" << midPoint->toString() << ", r=" << radius << "]";
+    return ss.str();
 }
 /*=====================================================*/
-GbLine3D* GbSphere3D::createClippedLine3D(GbPoint3D& point1, GbPoint3D& point2)
+GbLine3D *GbSphere3D::createClippedLine3D(GbPoint3D &point1, GbPoint3D &point2)
 {
-   double factor = 100.0; //um rundungsfehler beim wurzelterm zu minimieren
-   double xa = factor*point1.getX1Coordinate();
-   double ya = factor*point1.getX2Coordinate();
-   double za = factor*point1.getX3Coordinate();
-   double xb = factor*point2.getX1Coordinate();
-   double yb = factor*point2.getX2Coordinate();
-   double zb = factor*point2.getX3Coordinate();
-   double xm = factor*this->midPoint->getX1Coordinate();
-   double ym = factor*this->midPoint->getX2Coordinate();
-   double zm = factor*this->midPoint->getX3Coordinate();
-   double r  = factor*this->radius;
-
-   double xa2 = xa*xa;
-   double ya2 = ya*ya;
-   double za2 = za*za;
-   double xb2 = xb*xb;
-   double yb2 = yb*yb;
-   double zb2 = zb*zb;
-   double xm2 = xm*xm;
-   double ym2 = ym*ym;
-   double zm2 = zm*zm;
-   double r2  = r*r;
-
-   double wurzel =   2.0*xa*xb*ym2-2.0*ya*yb*r2+2.0*ya*ym*xb2+2.0*yb*ym*za2
-                    +2.0*ya*ym*zb2+2.0*xb*xm*za2+2.0*za*zb*ym2+2.0*xb*xm*ya2+2.0*xa*xm*yb2
-                    +2.0*yb*ym*xa2+2.0*zb*zm*ya2+2.0*xa*xm*zb2+2.0*za*zm*xb2+2.0*za*zm*yb2
-                    +2.0*xa*xb*zm2-2.0*xa*xb*r2-2.0*za*zb*r2+2.0*za*zb*xm2-2.0*ya*yb*xa*xm
-                    +2.0*ya*yb*xa*xb+2.0*zb*zm*xa2-2.0*ya*yb*xb*xm+2.0*ya*yb*xm2-2.0*ya*yb*zb*zm
-                    +2.0*ya*yb*zm2+2.0*zb*zm*yb*ym-2.0*zb*zm*ya*ym+2.0*zb*zm*xb*xm-2.0*xa*xm*yb*ym
-                    +2.0*xa*xm*za*zm+2.0*xa*xm*ya*ym-2.0*yb*ym*za*zm+2.0*yb*ym*xb*xm+2.0*za*zm*ya*ym
-                    -2.0*za*zm*xb*xm-2.0*ya*ym*xb*xm+2.0*za*zb*xa*xb-2.0*za*zb*xa*xm-2.0*za*zb*xb*xm
-                    +2.0*za*zb*ya*yb-2.0*za*zb*ya*ym-2.0*za*zb*yb*ym-2.0*ya*yb*za*zm-xa2*zb2
-                    -xa2*yb2-zb2*ya2-za2*xb2-za2*yb2-xb2*ya2-2.0*zb*zm*xa*xm
-                    -2.0*xa*xb*za*zm-2.0*xa*xb*zb*zm-2.0*xa*xb*ya*ym-2.0*xa*xb*yb*ym+za2*r2
-                    -za2*xm2-za2*ym2+zb2*r2-zb2*xm2-zb2*ym2+xa2*r2-xa2*zm2
-                    -xa2*ym2+xb2*r2-xb2*zm2-xb2*ym2+ya2*r2-ya2*zm2-ya2*xm2
-                    +yb2*r2-yb2*zm2-yb2*xm2;
-   double nenner  = -2.0*za*zb-2.0*ya*yb-2.0*xa*xb+za2+zb2+xa2+xb2+ya2+yb2;
-   double zaehler =  2.0*zb*zm-2.0*xa*xm+2.0*yb*ym-2.0*za*zm+xa2-2.0*ya*ym
-                    +2.0*xb*xm-zb2+za2-xb2+ya2-yb2;
-
-   vector<GbPoint3D*> schnittpunkte;
-
-   if(fabs(nenner)>1.E-13 && UbMath::greaterEqual(wurzel,0.0))
-   {
-      double t1 = (zaehler+2.0*sqrt(wurzel))/nenner;
-      double t2 = (zaehler-2.0*sqrt(wurzel))/nenner;
-
-      if(UbMath::inClosedInterval(t1,-1.0,1.0))
-      {
-         double x = ( xa*(0.5-0.5*t1)+xb*(0.5+0.5*t1) )/factor;
-         double y = ( ya*(0.5-0.5*t1)+yb*(0.5+0.5*t1) )/factor;
-         double z = ( za*(0.5-0.5*t1)+zb*(0.5+0.5*t1) )/factor;
-
-         schnittpunkte.push_back(new GbPoint3D(x,y,z));
-      }
-      if(fabs(t2-t1)>1.E-13 && UbMath::inClosedInterval(t2,-1.0,1.0))
-      {
-         double x = ( xa*(0.5-0.5*t2)+xb*(0.5+0.5*t2) )/factor;
-         double y = ( ya*(0.5-0.5*t2)+yb*(0.5+0.5*t2) )/factor;
-         double z = ( za*(0.5-0.5*t2)+zb*(0.5+0.5*t2) )/factor;
-
-         schnittpunkte.push_back(new GbPoint3D(x,y,z));
-      }
-   }
-
-   int nofSchnittpunkte = (int)schnittpunkte.size();
-   if(nofSchnittpunkte==1)
-   {
-      if     (this->isPointInGbObject3D(&point1)) return new GbLine3D(schnittpunkte[0],new GbPoint3D(point1));
-      else if(this->isPointInGbObject3D(&point2)) return new GbLine3D(schnittpunkte[0],new GbPoint3D(point2));
-      else //line beruehrt kugel! -> clippedLine reduziert sich zu einem Punkt!
-      {
-         if(std::fabs(this->getDistance(schnittpunkte[0])-this->radius)<1.E-13)
-            throw UbException(UB_EXARGS,"Beide LinenPunkte ausserhalb des Kreises, der berechnete Punkt ist jedoch KEIN Beruhrungspunkt der Sphere...");
-         return new GbLine3D(schnittpunkte[0],new GbPoint3D(*(schnittpunkte[0])));
-      }
-   }
-   else if(nofSchnittpunkte==2) return new GbLine3D(schnittpunkte[0],schnittpunkte[1]);
-
-   return NULL;
+    double factor = 100.0; // um rundungsfehler beim wurzelterm zu minimieren
+    double xa = factor * point1.getX1Coordinate();
+    double ya = factor * point1.getX2Coordinate();
+    double za = factor * point1.getX3Coordinate();
+    double xb = factor * point2.getX1Coordinate();
+    double yb = factor * point2.getX2Coordinate();
+    double zb = factor * point2.getX3Coordinate();
+    double xm = factor * this->midPoint->getX1Coordinate();
+    double ym = factor * this->midPoint->getX2Coordinate();
+    double zm = factor * this->midPoint->getX3Coordinate();
+    double r  = factor * this->radius;
+
+    double xa2 = xa * xa;
+    double ya2 = ya * ya;
+    double za2 = za * za;
+    double xb2 = xb * xb;
+    double yb2 = yb * yb;
+    double zb2 = zb * zb;
+    double xm2 = xm * xm;
+    double ym2 = ym * ym;
+    double zm2 = zm * zm;
+    double r2  = r * r;
+
+    double wurzel =
+        2.0 * xa * xb * ym2 - 2.0 * ya * yb * r2 + 2.0 * ya * ym * xb2 + 2.0 * yb * ym * za2 + 2.0 * ya * ym * zb2 +
+        2.0 * xb * xm * za2 + 2.0 * za * zb * ym2 + 2.0 * xb * xm * ya2 + 2.0 * xa * xm * yb2 + 2.0 * yb * ym * xa2 +
+        2.0 * zb * zm * ya2 + 2.0 * xa * xm * zb2 + 2.0 * za * zm * xb2 + 2.0 * za * zm * yb2 + 2.0 * xa * xb * zm2 -
+        2.0 * xa * xb * r2 - 2.0 * za * zb * r2 + 2.0 * za * zb * xm2 - 2.0 * ya * yb * xa * xm +
+        2.0 * ya * yb * xa * xb + 2.0 * zb * zm * xa2 - 2.0 * ya * yb * xb * xm + 2.0 * ya * yb * xm2 -
+        2.0 * ya * yb * zb * zm + 2.0 * ya * yb * zm2 + 2.0 * zb * zm * yb * ym - 2.0 * zb * zm * ya * ym +
+        2.0 * zb * zm * xb * xm - 2.0 * xa * xm * yb * ym + 2.0 * xa * xm * za * zm + 2.0 * xa * xm * ya * ym -
+        2.0 * yb * ym * za * zm + 2.0 * yb * ym * xb * xm + 2.0 * za * zm * ya * ym - 2.0 * za * zm * xb * xm -
+        2.0 * ya * ym * xb * xm + 2.0 * za * zb * xa * xb - 2.0 * za * zb * xa * xm - 2.0 * za * zb * xb * xm +
+        2.0 * za * zb * ya * yb - 2.0 * za * zb * ya * ym - 2.0 * za * zb * yb * ym - 2.0 * ya * yb * za * zm -
+        xa2 * zb2 - xa2 * yb2 - zb2 * ya2 - za2 * xb2 - za2 * yb2 - xb2 * ya2 - 2.0 * zb * zm * xa * xm -
+        2.0 * xa * xb * za * zm - 2.0 * xa * xb * zb * zm - 2.0 * xa * xb * ya * ym - 2.0 * xa * xb * yb * ym +
+        za2 * r2 - za2 * xm2 - za2 * ym2 + zb2 * r2 - zb2 * xm2 - zb2 * ym2 + xa2 * r2 - xa2 * zm2 - xa2 * ym2 +
+        xb2 * r2 - xb2 * zm2 - xb2 * ym2 + ya2 * r2 - ya2 * zm2 - ya2 * xm2 + yb2 * r2 - yb2 * zm2 - yb2 * xm2;
+    double nenner  = -2.0 * za * zb - 2.0 * ya * yb - 2.0 * xa * xb + za2 + zb2 + xa2 + xb2 + ya2 + yb2;
+    double zaehler = 2.0 * zb * zm - 2.0 * xa * xm + 2.0 * yb * ym - 2.0 * za * zm + xa2 - 2.0 * ya * ym +
+                     2.0 * xb * xm - zb2 + za2 - xb2 + ya2 - yb2;
+
+    vector<GbPoint3D *> schnittpunkte;
+
+    if (fabs(nenner) > 1.E-13 && UbMath::greaterEqual(wurzel, 0.0)) {
+        double t1 = (zaehler + 2.0 * sqrt(wurzel)) / nenner;
+        double t2 = (zaehler - 2.0 * sqrt(wurzel)) / nenner;
+
+        if (UbMath::inClosedInterval(t1, -1.0, 1.0)) {
+            double x = (xa * (0.5 - 0.5 * t1) + xb * (0.5 + 0.5 * t1)) / factor;
+            double y = (ya * (0.5 - 0.5 * t1) + yb * (0.5 + 0.5 * t1)) / factor;
+            double z = (za * (0.5 - 0.5 * t1) + zb * (0.5 + 0.5 * t1)) / factor;
+
+            schnittpunkte.push_back(new GbPoint3D(x, y, z));
+        }
+        if (fabs(t2 - t1) > 1.E-13 && UbMath::inClosedInterval(t2, -1.0, 1.0)) {
+            double x = (xa * (0.5 - 0.5 * t2) + xb * (0.5 + 0.5 * t2)) / factor;
+            double y = (ya * (0.5 - 0.5 * t2) + yb * (0.5 + 0.5 * t2)) / factor;
+            double z = (za * (0.5 - 0.5 * t2) + zb * (0.5 + 0.5 * t2)) / factor;
+
+            schnittpunkte.push_back(new GbPoint3D(x, y, z));
+        }
+    }
+
+    int nofSchnittpunkte = (int)schnittpunkte.size();
+    if (nofSchnittpunkte == 1) {
+        if (this->isPointInGbObject3D(&point1))
+            return new GbLine3D(schnittpunkte[0], new GbPoint3D(point1));
+        else if (this->isPointInGbObject3D(&point2))
+            return new GbLine3D(schnittpunkte[0], new GbPoint3D(point2));
+        else // line beruehrt kugel! -> clippedLine reduziert sich zu einem Punkt!
+        {
+            if (std::fabs(this->getDistance(schnittpunkte[0]) - this->radius) < 1.E-13)
+                throw UbException(UB_EXARGS, "Beide LinenPunkte ausserhalb des Kreises, der berechnete Punkt ist "
+                                             "jedoch KEIN Beruhrungspunkt der Sphere...");
+            return new GbLine3D(schnittpunkte[0], new GbPoint3D(*(schnittpunkte[0])));
+        }
+    } else if (nofSchnittpunkte == 2)
+        return new GbLine3D(schnittpunkte[0], schnittpunkte[1]);
+
+    return NULL;
 }
 /*=========================================================================*/
-vector<GbTriangle3D*> GbSphere3D::getSurfaceTriangleSet()
+vector<GbTriangle3D *> GbSphere3D::getSurfaceTriangleSet()
 {
-   if(triangulationMode==RAYPROJECTION)
-   {
-      double x1m = midPoint->getX1Coordinate();
-      double x2m = midPoint->getX2Coordinate();
-      double x3m = midPoint->getX3Coordinate();
-
-      vector<GbTriangle3D*> triangles;
-
-      int segments =30;
-      double deltaPhi = UbMath::PI/(double)segments;
-      double phiX1a,phiX1b,phiX3a,phiX3b;
-      double x1a,x2a,x3a,x1b,x2b,x3b,x1c,x2c,x3c,x1d,x2d,x3d;
-
-      for(phiX3a=0.5*UbMath::PI; phiX3a>-1.5*UbMath::PI; phiX3a-=deltaPhi)
-      {
-         for(phiX1a=0.0; phiX1a<UbMath::PI; phiX1a+=deltaPhi)
-         {
-            phiX1b = phiX1a+deltaPhi;
-            phiX3b = phiX3a+deltaPhi;
-
-            x1a =  x1m+radius*cos(phiX3a)*std::cos(phiX1a);
-            x2a =  x2m+radius*cos(phiX3a)*std::sin(phiX1a);
-            x3a =  x3m+radius*sin(phiX3a);
-            x1b =  x1m+radius*cos(phiX3a)*std::cos(phiX1b);
-            x2b =  x2m+radius*cos(phiX3a)*std::sin(phiX1b);
-            x3b =  x3m+radius*sin(phiX3a);
-            x1c =  x1m+radius*cos(phiX3b)*std::cos(phiX1b);
-            x2c =  x2m+radius*cos(phiX3b)*std::sin(phiX1b);
-            x3c =  x3m+radius*sin(phiX3b);
-            x1d =  x1m+radius*cos(phiX3b)*std::cos(phiX1a);
-            x2d =  x2m+radius*cos(phiX3b)*std::sin(phiX1a);
-            x3d =  x3m+radius*sin(phiX3b);
-
-            if(UbMath::greater(phiX3b,-0.5*UbMath::PI)  && UbMath::less(phiX3a,0.5*UbMath::PI))
-            {
-               triangles.push_back(new GbTriangle3D(new GbPoint3D(x1a,x2a,x3a),new GbPoint3D(x1b,x2b,x3b),new GbPoint3D(x1c,x2c,x3c)));
-               triangles.push_back(new GbTriangle3D(new GbPoint3D(x1a,x2a,x3a),new GbPoint3D(x1c,x2c,x3c),new GbPoint3D(x1d,x2d,x3d)));
+    if (triangulationMode == RAYPROJECTION) {
+        double x1m = midPoint->getX1Coordinate();
+        double x2m = midPoint->getX2Coordinate();
+        double x3m = midPoint->getX3Coordinate();
+
+        vector<GbTriangle3D *> triangles;
+
+        int segments    = 30;
+        double deltaPhi = UbMath::PI / (double)segments;
+        double phiX1a, phiX1b, phiX3a, phiX3b;
+        double x1a, x2a, x3a, x1b, x2b, x3b, x1c, x2c, x3c, x1d, x2d, x3d;
+
+        for (phiX3a = 0.5 * UbMath::PI; phiX3a > -1.5 * UbMath::PI; phiX3a -= deltaPhi) {
+            for (phiX1a = 0.0; phiX1a < UbMath::PI; phiX1a += deltaPhi) {
+                phiX1b = phiX1a + deltaPhi;
+                phiX3b = phiX3a + deltaPhi;
+
+                x1a = x1m + radius * cos(phiX3a) * std::cos(phiX1a);
+                x2a = x2m + radius * cos(phiX3a) * std::sin(phiX1a);
+                x3a = x3m + radius * sin(phiX3a);
+                x1b = x1m + radius * cos(phiX3a) * std::cos(phiX1b);
+                x2b = x2m + radius * cos(phiX3a) * std::sin(phiX1b);
+                x3b = x3m + radius * sin(phiX3a);
+                x1c = x1m + radius * cos(phiX3b) * std::cos(phiX1b);
+                x2c = x2m + radius * cos(phiX3b) * std::sin(phiX1b);
+                x3c = x3m + radius * sin(phiX3b);
+                x1d = x1m + radius * cos(phiX3b) * std::cos(phiX1a);
+                x2d = x2m + radius * cos(phiX3b) * std::sin(phiX1a);
+                x3d = x3m + radius * sin(phiX3b);
+
+                if (UbMath::greater(phiX3b, -0.5 * UbMath::PI) && UbMath::less(phiX3a, 0.5 * UbMath::PI)) {
+                    triangles.push_back(new GbTriangle3D(new GbPoint3D(x1a, x2a, x3a), new GbPoint3D(x1b, x2b, x3b),
+                                                         new GbPoint3D(x1c, x2c, x3c)));
+                    triangles.push_back(new GbTriangle3D(new GbPoint3D(x1a, x2a, x3a), new GbPoint3D(x1c, x2c, x3c),
+                                                         new GbPoint3D(x1d, x2d, x3d)));
+                } else {
+                    triangles.push_back(new GbTriangle3D(new GbPoint3D(x1d, x2d, x3d), new GbPoint3D(x1c, x2c, x3c),
+                                                         new GbPoint3D(x1a, x2a, x3a)));
+                    triangles.push_back(new GbTriangle3D(new GbPoint3D(x1c, x2c, x3c), new GbPoint3D(x1b, x2b, x3b),
+                                                         new GbPoint3D(x1a, x2a, x3a)));
+                }
             }
-            else
-            {
-               triangles.push_back(new GbTriangle3D(new GbPoint3D(x1d,x2d,x3d),new GbPoint3D(x1c,x2c,x3c),new GbPoint3D(x1a,x2a,x3a)));
-               triangles.push_back(new GbTriangle3D(new GbPoint3D(x1c,x2c,x3c),new GbPoint3D(x1b,x2b,x3b),new GbPoint3D(x1a,x2a,x3a)));
+        }
+        return triangles;
+    } else if (triangulationMode == CUBOIDPROJECTION) {
+        vector<GbTriangle3D *> triangles;
+        vector<GbPoint3D *> points;
+        double x1min = this->getX1Minimum();
+        double x2min = this->getX2Minimum();
+        double x3min = this->getX3Minimum();
+        double x1max = this->getX1Maximum();
+        double x2max = this->getX2Maximum();
+        double x3max = this->getX3Maximum();
+        double ax1   = x1min;
+        double bx2   = x2min;
+        double cx1   = x1min;
+        double ax2   = x2min;
+        double bx3   = x3min;
+        double cx3   = x3min;
+
+        int anzahl = 20;
+        double dx1 = (x1max - x1min) / (double)(anzahl - 1);
+        double dx2 = (x2max - x2min) / (double)(anzahl - 1);
+        double dx3 = (x3max - x3min) / (double)(anzahl - 1);
+
+        for (int u = 0; u < anzahl; u++) {
+            ax2 = x2min;
+            bx2 = x2min;
+            cx3 = x3min;
+            for (int v = 0; v < anzahl; v++) {
+                GbPoint3D p1 = GbPoint3D(ax1, ax2, x3max);
+                GbPoint3D p2 = GbPoint3D(ax1, ax2, x3min);
+                GbPoint3D p3 = GbPoint3D(cx1, x2min, cx3);
+                GbPoint3D p4 = GbPoint3D(cx1, x2max, cx3);
+                GbPoint3D p5 = GbPoint3D(x1min, bx2, bx3);
+                GbPoint3D p6 = GbPoint3D(x1max, bx2, bx3);
+
+                GbLine3D *clippedline1 = this->createClippedLine3D(*this->midPoint, p1);
+                GbLine3D *clippedline2 = this->createClippedLine3D(*this->midPoint, p2);
+                GbLine3D *clippedline3 = this->createClippedLine3D(*this->midPoint, p3);
+                GbLine3D *clippedline4 = this->createClippedLine3D(*this->midPoint, p4);
+                GbLine3D *clippedline5 = this->createClippedLine3D(*this->midPoint, p5);
+                GbLine3D *clippedline6 = this->createClippedLine3D(*this->midPoint, p6);
+                points.push_back(new GbPoint3D(clippedline1->getPoint1()));
+                points.push_back(new GbPoint3D(clippedline2->getPoint1()));
+                points.push_back(new GbPoint3D(clippedline3->getPoint1()));
+                points.push_back(new GbPoint3D(clippedline4->getPoint1()));
+                points.push_back(new GbPoint3D(clippedline5->getPoint1()));
+                points.push_back(new GbPoint3D(clippedline6->getPoint1()));
+                clippedline1->deletePoints();
+                delete clippedline1;
+                clippedline2->deletePoints();
+                delete clippedline2;
+                clippedline3->deletePoints();
+                delete clippedline3;
+                clippedline4->deletePoints();
+                delete clippedline4;
+                clippedline5->deletePoints();
+                delete clippedline5;
+                clippedline6->deletePoints();
+                delete clippedline6;
+                ax2 += dx2;
+                cx3 += dx3;
+                bx2 += dx2;
             }
-         }
-      }
-      return triangles;
-   }
-   else if(triangulationMode==CUBOIDPROJECTION)
-   {
-      vector<GbTriangle3D*> triangles;
-      vector<GbPoint3D*>   points;
-      double x1min = this->getX1Minimum();
-      double x2min = this->getX2Minimum();
-      double x3min = this->getX3Minimum();
-      double x1max = this->getX1Maximum();
-      double x2max = this->getX2Maximum();
-      double x3max = this->getX3Maximum();
-      double ax1 = x1min;    double bx2 = x2min;   double cx1 = x1min;
-      double ax2 = x2min;    double bx3 = x3min;   double cx3 = x3min;
-
-      int anzahl = 20;
-      double dx1 = (x1max-x1min)/(double)(anzahl-1);
-      double dx2 = (x2max-x2min)/(double)(anzahl-1);
-      double dx3 = (x3max-x3min)/(double)(anzahl-1);
-
-      for (int u=0; u<anzahl; u++)
-      {
-         ax2 = x2min;
-         bx2 = x2min;
-         cx3 = x3min;
-         for (int v=0; v<anzahl; v++)
-         {
-            GbPoint3D p1 = GbPoint3D(ax1, ax2, x3max);
-            GbPoint3D p2 = GbPoint3D(ax1, ax2, x3min);
-            GbPoint3D p3 = GbPoint3D(cx1, x2min, cx3);
-            GbPoint3D p4 = GbPoint3D(cx1, x2max, cx3);
-            GbPoint3D p5 = GbPoint3D(x1min, bx2, bx3);
-            GbPoint3D p6 = GbPoint3D(x1max, bx2, bx3);
-
-            GbLine3D* clippedline1 = this->createClippedLine3D(*this->midPoint, p1);
-            GbLine3D* clippedline2 = this->createClippedLine3D(*this->midPoint, p2);
-            GbLine3D* clippedline3 = this->createClippedLine3D(*this->midPoint, p3);
-            GbLine3D* clippedline4 = this->createClippedLine3D(*this->midPoint, p4);
-            GbLine3D* clippedline5 = this->createClippedLine3D(*this->midPoint, p5);
-            GbLine3D* clippedline6 = this->createClippedLine3D(*this->midPoint, p6);
-            points.push_back(new GbPoint3D(clippedline1->getPoint1()));
-            points.push_back(new GbPoint3D(clippedline2->getPoint1()));
-            points.push_back(new GbPoint3D(clippedline3->getPoint1()));
-            points.push_back(new GbPoint3D(clippedline4->getPoint1()));
-            points.push_back(new GbPoint3D(clippedline5->getPoint1()));
-            points.push_back(new GbPoint3D(clippedline6->getPoint1()));
-            clippedline1->deletePoints();    delete clippedline1;
-            clippedline2->deletePoints();    delete clippedline2;
-            clippedline3->deletePoints();    delete clippedline3;
-            clippedline4->deletePoints();    delete clippedline4;
-            clippedline5->deletePoints();    delete clippedline5;
-            clippedline6->deletePoints();    delete clippedline6;
-            ax2 +=dx2;
-            cx3 +=dx3;
-            bx2 +=dx2;
-         }
-         ax1 +=dx1;
-         cx1 +=dx1;
-         bx3 +=dx3;
-      }
-
-      int anz = anzahl*anzahl*6;
-      GbPoint3D* point1 = NULL;
-      GbPoint3D* point2 = NULL;
-      GbPoint3D* point3 = NULL;
-      int anzahl2 = anzahl*6;
-      int anzahl3 = anzahl2+6;
-      for (int u=0; u<anz-anzahl3; u++)
-      {
-         point1 = new GbPoint3D(points[u+6]);
-         point2 = new GbPoint3D(points[u]);
-         point3 = new GbPoint3D(points[u+anzahl2]);
-         if(u%2 == 0) triangles.push_back(new GbTriangle3D(point1, point2, point3));
-         else         triangles.push_back(new GbTriangle3D(point2, point1, point3));
-
-         point1 = new GbPoint3D(points[u+6]);
-         point2 = new GbPoint3D(points[u+anzahl2]);
-         point3 = new GbPoint3D(points[u+anzahl3]);
-         if(u%2 == 0) triangles.push_back(new GbTriangle3D(point1, point2, point3));
-         else         triangles.push_back(new GbTriangle3D(point2, point1, point3));
-      }
-      for (int u=0; u<anz; u++) delete points[u];
-
-      return triangles;
-   }
-   else throw UbException(UB_EXARGS,"undefined triangulationmode");
+            ax1 += dx1;
+            cx1 += dx1;
+            bx3 += dx3;
+        }
+
+        int anz           = anzahl * anzahl * 6;
+        GbPoint3D *point1 = NULL;
+        GbPoint3D *point2 = NULL;
+        GbPoint3D *point3 = NULL;
+        int anzahl2       = anzahl * 6;
+        int anzahl3       = anzahl2 + 6;
+        for (int u = 0; u < anz - anzahl3; u++) {
+            point1 = new GbPoint3D(points[u + 6]);
+            point2 = new GbPoint3D(points[u]);
+            point3 = new GbPoint3D(points[u + anzahl2]);
+            if (u % 2 == 0)
+                triangles.push_back(new GbTriangle3D(point1, point2, point3));
+            else
+                triangles.push_back(new GbTriangle3D(point2, point1, point3));
+
+            point1 = new GbPoint3D(points[u + 6]);
+            point2 = new GbPoint3D(points[u + anzahl2]);
+            point3 = new GbPoint3D(points[u + anzahl3]);
+            if (u % 2 == 0)
+                triangles.push_back(new GbTriangle3D(point1, point2, point3));
+            else
+                triangles.push_back(new GbTriangle3D(point2, point1, point3));
+        }
+        for (int u = 0; u < anz; u++)
+            delete points[u];
+
+        return triangles;
+    } else
+        throw UbException(UB_EXARGS, "undefined triangulationmode");
 }
 /*=======================================================*/
-void GbSphere3D::addSurfaceTriangleSet(vector<UbTupleFloat3>& nodes, vector<UbTupleInt3>& triangles)
+void GbSphere3D::addSurfaceTriangleSet(vector<UbTupleFloat3> &nodes, vector<UbTupleInt3> &triangles)
 {
-   //wenn ich viele Kugeln bei der PE rausschreibe sollten die vektoren nicht geresized werden
-   //nodes.resize(0);
-   //triangles.resize(0);
-
-   if(triangulationMode==RAYPROJECTION)
-   {
-      float x1m = (float)midPoint->getX1Coordinate();
-      float x2m = (float)midPoint->getX2Coordinate();
-      float x3m = (float)midPoint->getX3Coordinate();
-
-      int segments =30;
-      float deltaPhi = (float)UbMath::PI/(float)segments;
-      float phiX1a,phiX1b,phiX3a,phiX3b;
-      float x1a,x2a,x3a,x1b,x2b,x3b,x1c,x2c,x3c,x1d,x2d,x3d;
-      int nodeNr = int(nodes.size());
-      for(phiX3a=(float)(0.5*UbMath::PI); phiX3a > (float)(-1.5*UbMath::PI); phiX3a-=deltaPhi)
-      {
-         for(phiX1a=0.0; phiX1a<UbMath::PI; phiX1a+=deltaPhi)
-         {
-            phiX1b = phiX1a+deltaPhi;
-            phiX3b = phiX3a+deltaPhi;
-
-            x1a =  x1m+(float)(radius*cos(phiX3a)*std::cos(phiX1a));
-            x2a =  x2m+(float)(radius*cos(phiX3a)*std::sin(phiX1a));
-            x3a =  x3m+(float)(radius*sin(phiX3a));
-            x1b =  x1m+(float)(radius*cos(phiX3a)*std::cos(phiX1b));
-            x2b =  x2m+(float)(radius*cos(phiX3a)*std::sin(phiX1b));
-            x3b =  x3m+(float)(radius*sin(phiX3a));
-            x1c =  x1m+(float)(radius*cos(phiX3b)*std::cos(phiX1b));
-            x2c =  x2m+(float)(radius*cos(phiX3b)*std::sin(phiX1b));
-            x3c =  x3m+(float)(radius*sin(phiX3b));
-            x1d =  x1m+(float)(radius*cos(phiX3b)*std::cos(phiX1a));
-            x2d =  x2m+(float)(radius*cos(phiX3b)*std::sin(phiX1a));
-            x3d =  x3m+(float)(radius*sin(phiX3b));
-
-            if(UbMath::greater(phiX3b,-0.5*UbMath::PI) && UbMath::less(phiX3a,0.5*UbMath::PI))
-            {
-               nodes.push_back( makeUbTuple(x1a,x2a,x3a) );
-               nodes.push_back( makeUbTuple(x1b,x2b,x3b) );
-               nodes.push_back( makeUbTuple(x1c,x2c,x3c) );
-
-               nodes.push_back( makeUbTuple(x1a,x2a,x3a) );
-               nodes.push_back( makeUbTuple(x1c,x2c,x3c) );
-               nodes.push_back( makeUbTuple(x1d,x2d,x3d) );
+    // wenn ich viele Kugeln bei der PE rausschreibe sollten die vektoren nicht geresized werden
+    // nodes.resize(0);
+    // triangles.resize(0);
+
+    if (triangulationMode == RAYPROJECTION) {
+        float x1m = (float)midPoint->getX1Coordinate();
+        float x2m = (float)midPoint->getX2Coordinate();
+        float x3m = (float)midPoint->getX3Coordinate();
+
+        int segments   = 30;
+        float deltaPhi = (float)UbMath::PI / (float)segments;
+        float phiX1a, phiX1b, phiX3a, phiX3b;
+        float x1a, x2a, x3a, x1b, x2b, x3b, x1c, x2c, x3c, x1d, x2d, x3d;
+        int nodeNr = int(nodes.size());
+        for (phiX3a = (float)(0.5 * UbMath::PI); phiX3a > (float)(-1.5 * UbMath::PI); phiX3a -= deltaPhi) {
+            for (phiX1a = 0.0; phiX1a < UbMath::PI; phiX1a += deltaPhi) {
+                phiX1b = phiX1a + deltaPhi;
+                phiX3b = phiX3a + deltaPhi;
+
+                x1a = x1m + (float)(radius * cos(phiX3a) * std::cos(phiX1a));
+                x2a = x2m + (float)(radius * cos(phiX3a) * std::sin(phiX1a));
+                x3a = x3m + (float)(radius * sin(phiX3a));
+                x1b = x1m + (float)(radius * cos(phiX3a) * std::cos(phiX1b));
+                x2b = x2m + (float)(radius * cos(phiX3a) * std::sin(phiX1b));
+                x3b = x3m + (float)(radius * sin(phiX3a));
+                x1c = x1m + (float)(radius * cos(phiX3b) * std::cos(phiX1b));
+                x2c = x2m + (float)(radius * cos(phiX3b) * std::sin(phiX1b));
+                x3c = x3m + (float)(radius * sin(phiX3b));
+                x1d = x1m + (float)(radius * cos(phiX3b) * std::cos(phiX1a));
+                x2d = x2m + (float)(radius * cos(phiX3b) * std::sin(phiX1a));
+                x3d = x3m + (float)(radius * sin(phiX3b));
+
+                if (UbMath::greater(phiX3b, -0.5 * UbMath::PI) && UbMath::less(phiX3a, 0.5 * UbMath::PI)) {
+                    nodes.push_back(makeUbTuple(x1a, x2a, x3a));
+                    nodes.push_back(makeUbTuple(x1b, x2b, x3b));
+                    nodes.push_back(makeUbTuple(x1c, x2c, x3c));
+
+                    nodes.push_back(makeUbTuple(x1a, x2a, x3a));
+                    nodes.push_back(makeUbTuple(x1c, x2c, x3c));
+                    nodes.push_back(makeUbTuple(x1d, x2d, x3d));
+                } else {
+                    nodes.push_back(makeUbTuple(x1d, x2d, x3d));
+                    nodes.push_back(makeUbTuple(x1c, x2c, x3c));
+                    nodes.push_back(makeUbTuple(x1a, x2a, x3a));
+
+                    nodes.push_back(makeUbTuple(x1c, x2c, x3c));
+                    nodes.push_back(makeUbTuple(x1b, x2b, x3b));
+                    nodes.push_back(makeUbTuple(x1a, x2a, x3a));
+                }
+                triangles.push_back(makeUbTuple(nodeNr, nodeNr + 1, nodeNr + 2));
+                triangles.push_back(makeUbTuple(nodeNr + 3, nodeNr + 4, nodeNr + 5));
+                nodeNr += 6;
             }
-            else
-            {
-               nodes.push_back( makeUbTuple(x1d,x2d,x3d) );
-               nodes.push_back( makeUbTuple(x1c,x2c,x3c) );
-               nodes.push_back( makeUbTuple(x1a,x2a,x3a) );
-
-               nodes.push_back( makeUbTuple(x1c,x2c,x3c) );
-               nodes.push_back( makeUbTuple(x1b,x2b,x3b) );
-               nodes.push_back( makeUbTuple(x1a,x2a,x3a) );
+        }
+    } else if (triangulationMode == CUBOIDPROJECTION) {
+        vector<GbPoint3D *> points;
+        double x1min = this->getX1Minimum();
+        double x2min = this->getX2Minimum();
+        double x3min = this->getX3Minimum();
+        double x1max = this->getX1Maximum();
+        double x2max = this->getX2Maximum();
+        double x3max = this->getX3Maximum();
+        double ax1   = x1min;
+        double bx2   = x2min;
+        double cx1   = x1min;
+        double ax2   = x2min;
+        double bx3   = x3min;
+        double cx3   = x3min;
+
+        int anzahl = 20;
+        double dx1 = (x1max - x1min) / (double)(anzahl - 1);
+        double dx2 = (x2max - x2min) / (double)(anzahl - 1);
+        double dx3 = (x3max - x3min) / (double)(anzahl - 1);
+
+        for (int u = 0; u < anzahl; u++) {
+            ax2 = x2min;
+            bx2 = x2min;
+            cx3 = x3min;
+            for (int v = 0; v < anzahl; v++) {
+                GbPoint3D p1 = GbPoint3D(ax1, ax2, x3max);
+                GbPoint3D p2 = GbPoint3D(ax1, ax2, x3min);
+                GbPoint3D p3 = GbPoint3D(cx1, x2min, cx3);
+                GbPoint3D p4 = GbPoint3D(cx1, x2max, cx3);
+                GbPoint3D p5 = GbPoint3D(x1min, bx2, bx3);
+                GbPoint3D p6 = GbPoint3D(x1max, bx2, bx3);
+
+                GbLine3D *clippedline1 = this->createClippedLine3D(*this->midPoint, p1);
+                GbLine3D *clippedline2 = this->createClippedLine3D(*this->midPoint, p2);
+                GbLine3D *clippedline3 = this->createClippedLine3D(*this->midPoint, p3);
+                GbLine3D *clippedline4 = this->createClippedLine3D(*this->midPoint, p4);
+                GbLine3D *clippedline5 = this->createClippedLine3D(*this->midPoint, p5);
+                GbLine3D *clippedline6 = this->createClippedLine3D(*this->midPoint, p6);
+                points.push_back(new GbPoint3D(clippedline1->getPoint1()));
+                points.push_back(new GbPoint3D(clippedline2->getPoint1()));
+                points.push_back(new GbPoint3D(clippedline3->getPoint1()));
+                points.push_back(new GbPoint3D(clippedline4->getPoint1()));
+                points.push_back(new GbPoint3D(clippedline5->getPoint1()));
+                points.push_back(new GbPoint3D(clippedline6->getPoint1()));
+                clippedline1->deletePoints();
+                delete clippedline1;
+                clippedline2->deletePoints();
+                delete clippedline2;
+                clippedline3->deletePoints();
+                delete clippedline3;
+                clippedline4->deletePoints();
+                delete clippedline4;
+                clippedline5->deletePoints();
+                delete clippedline5;
+                clippedline6->deletePoints();
+                delete clippedline6;
+                ax2 += dx2;
+                cx3 += dx3;
+                bx2 += dx2;
             }
-            triangles.push_back( makeUbTuple(nodeNr, nodeNr+1, nodeNr+2) );
-            triangles.push_back( makeUbTuple(nodeNr+3, nodeNr+4, nodeNr+5) );
-            nodeNr+=6;
-         }
-      }
-   }
-   else if(triangulationMode==CUBOIDPROJECTION)
-   {
-      vector<GbPoint3D*>   points;
-      double x1min = this->getX1Minimum();
-      double x2min = this->getX2Minimum();
-      double x3min = this->getX3Minimum();
-      double x1max = this->getX1Maximum();
-      double x2max = this->getX2Maximum();
-      double x3max = this->getX3Maximum();
-      double ax1 = x1min;    double bx2 = x2min;   double cx1 = x1min;
-      double ax2 = x2min;    double bx3 = x3min;   double cx3 = x3min;
-
-      int anzahl = 20;
-      double dx1 = (x1max-x1min)/(double)(anzahl-1);
-      double dx2 = (x2max-x2min)/(double)(anzahl-1);
-      double dx3 = (x3max-x3min)/(double)(anzahl-1);
-
-      for (int u=0; u<anzahl; u++)
-      {
-         ax2 = x2min;
-         bx2 = x2min;
-         cx3 = x3min;
-         for (int v=0; v<anzahl; v++)
-         {
-            GbPoint3D p1 = GbPoint3D(ax1, ax2, x3max);
-            GbPoint3D p2 = GbPoint3D(ax1, ax2, x3min);
-            GbPoint3D p3 = GbPoint3D(cx1, x2min, cx3);
-            GbPoint3D p4 = GbPoint3D(cx1, x2max, cx3);
-            GbPoint3D p5 = GbPoint3D(x1min, bx2, bx3);
-            GbPoint3D p6 = GbPoint3D(x1max, bx2, bx3);
-
-            GbLine3D* clippedline1 = this->createClippedLine3D(*this->midPoint, p1);
-            GbLine3D* clippedline2 = this->createClippedLine3D(*this->midPoint, p2);
-            GbLine3D* clippedline3 = this->createClippedLine3D(*this->midPoint, p3);
-            GbLine3D* clippedline4 = this->createClippedLine3D(*this->midPoint, p4);
-            GbLine3D* clippedline5 = this->createClippedLine3D(*this->midPoint, p5);
-            GbLine3D* clippedline6 = this->createClippedLine3D(*this->midPoint, p6);
-            points.push_back(new GbPoint3D(clippedline1->getPoint1()));
-            points.push_back(new GbPoint3D(clippedline2->getPoint1()));
-            points.push_back(new GbPoint3D(clippedline3->getPoint1()));
-            points.push_back(new GbPoint3D(clippedline4->getPoint1()));
-            points.push_back(new GbPoint3D(clippedline5->getPoint1()));
-            points.push_back(new GbPoint3D(clippedline6->getPoint1()));
-            clippedline1->deletePoints();    delete clippedline1;
-            clippedline2->deletePoints();    delete clippedline2;
-            clippedline3->deletePoints();    delete clippedline3;
-            clippedline4->deletePoints();    delete clippedline4;
-            clippedline5->deletePoints();    delete clippedline5;
-            clippedline6->deletePoints();    delete clippedline6;
-            ax2 +=dx2;
-            cx3 +=dx3;
-            bx2 +=dx2;
-         }
-         ax1 +=dx1;
-         cx1 +=dx1;
-         bx3 +=dx3;
-      }
-
-      int anz = anzahl*anzahl*6;
-      int anzahl2 = anzahl*6;
-      int anzahl3 = anzahl2+6;
-      int nodeNr = 0;
-      for (int u=0; u<anz-anzahl3; u++)
-      {
-         nodes.push_back( makeUbTuple((float)points[u+6]->x1      , (float)points[u+6]->x2      , (float)points[u+6]->x3) );
-         nodes.push_back( makeUbTuple((float)points[u]->x1        , (float)points[u]->x2        , (float)points[u]->x3) );
-         nodes.push_back( makeUbTuple((float)points[u+anzahl2]->x1, (float)points[u+anzahl2]->x2, (float)points[u+anzahl2]->x3) );
-
-         if(u%2 == 0) triangles.push_back( makeUbTuple(nodeNr  , nodeNr+1, nodeNr+2) );
-         else         triangles.push_back( makeUbTuple(nodeNr  , nodeNr+1, nodeNr+2) );
-
-         nodes.push_back( makeUbTuple((float)points[u+6]->x1      , (float)points[u+6]->x2      , (float)points[u+6]->x3) );
-         nodes.push_back( makeUbTuple((float)points[u+anzahl2]->x1, (float)points[u+anzahl2]->x2, (float)points[u+anzahl2]->x3) );
-         nodes.push_back( makeUbTuple((float)points[u+anzahl3]->x1, (float)points[u+anzahl3]->x2, (float)points[u+anzahl3]->x3) );
-         if(u%2 == 0) triangles.push_back( makeUbTuple(nodeNr+3, nodeNr+4, nodeNr+5) );
-         else         triangles.push_back( makeUbTuple(nodeNr+3, nodeNr+4, nodeNr+5) );
-
-         nodeNr+=6;
-      }
-      for(int u=0; u<anz; u++) delete points[u];
-   }
-   else throw UbException(UB_EXARGS,"undefined triangulationmode");
+            ax1 += dx1;
+            cx1 += dx1;
+            bx3 += dx3;
+        }
+
+        int anz     = anzahl * anzahl * 6;
+        int anzahl2 = anzahl * 6;
+        int anzahl3 = anzahl2 + 6;
+        int nodeNr  = 0;
+        for (int u = 0; u < anz - anzahl3; u++) {
+            nodes.push_back(makeUbTuple((float)points[u + 6]->x1, (float)points[u + 6]->x2, (float)points[u + 6]->x3));
+            nodes.push_back(makeUbTuple((float)points[u]->x1, (float)points[u]->x2, (float)points[u]->x3));
+            nodes.push_back(makeUbTuple((float)points[u + anzahl2]->x1, (float)points[u + anzahl2]->x2,
+                                        (float)points[u + anzahl2]->x3));
+
+            if (u % 2 == 0)
+                triangles.push_back(makeUbTuple(nodeNr, nodeNr + 1, nodeNr + 2));
+            else
+                triangles.push_back(makeUbTuple(nodeNr, nodeNr + 1, nodeNr + 2));
+
+            nodes.push_back(makeUbTuple((float)points[u + 6]->x1, (float)points[u + 6]->x2, (float)points[u + 6]->x3));
+            nodes.push_back(makeUbTuple((float)points[u + anzahl2]->x1, (float)points[u + anzahl2]->x2,
+                                        (float)points[u + anzahl2]->x3));
+            nodes.push_back(makeUbTuple((float)points[u + anzahl3]->x1, (float)points[u + anzahl3]->x2,
+                                        (float)points[u + anzahl3]->x3));
+            if (u % 2 == 0)
+                triangles.push_back(makeUbTuple(nodeNr + 3, nodeNr + 4, nodeNr + 5));
+            else
+                triangles.push_back(makeUbTuple(nodeNr + 3, nodeNr + 4, nodeNr + 5));
+
+            nodeNr += 6;
+        }
+        for (int u = 0; u < anz; u++)
+            delete points[u];
+    } else
+        throw UbException(UB_EXARGS, "undefined triangulationmode");
 }
 /*=======================================================*/
 void GbSphere3D::transform(const double matrix[4][4])
 {
-   midPoint->transform(matrix);
-   this->setRadius(this->getRadius()*matrix[0][0]);
-   this->notifyObserversObjectChanged();
+    midPoint->transform(matrix);
+    this->setRadius(this->getRadius() * matrix[0][0]);
+    this->notifyObserversObjectChanged();
 }
 /*=======================================================*/
 bool GbSphere3D::hasIntersectionWithDirectedLine(GbPoint3D origin, GbPoint3D direction)
 {
-	GbVector3D vecOrigin(origin.getX1Coordinate(),origin.getX2Coordinate(), origin.getX3Coordinate()) ;
-	GbVector3D vecDirection(direction.getX1Coordinate(),direction.getX2Coordinate(), direction.getX3Coordinate());
-	GbVector3D vecSfereCenter(getX1Centroid(), getX2Centroid(), getX3Centroid());
-	GbVector3D diff = vecOrigin - vecSfereCenter;
-   float a = (float)(vecDirection.Dot(vecDirection));
-   float b = (float)(2.0 * vecDirection.Dot(diff));
-   float c = (float)(diff.Dot(diff) - this->getRadius()*this->getRadius());
-
-	// use 'abc'-formula for finding root t_1,2 = (-b +/- sqrt(b^2-4ac))/(2a)
-	float inRoot = (float)(b*b - 4.0*a*c);
-	if (inRoot < 0) return false;
-	float root = sqrt(inRoot);
-
-	float dist = (float)((-b - root)/(2.0*a));
-
-	double infinity = DBL_MAX;
-	double eps = 1E-4;
-
-   if (dist > infinity)
-		return false;
-
-	if (dist < eps)
-	{
-		dist = (float)((-b + root)/(2.0*a));
-		if (dist < eps || dist > infinity)
-			return false;
-	}
-	return true;
+    GbVector3D vecOrigin(origin.getX1Coordinate(), origin.getX2Coordinate(), origin.getX3Coordinate());
+    GbVector3D vecDirection(direction.getX1Coordinate(), direction.getX2Coordinate(), direction.getX3Coordinate());
+    GbVector3D vecSfereCenter(getX1Centroid(), getX2Centroid(), getX3Centroid());
+    GbVector3D diff = vecOrigin - vecSfereCenter;
+    float a         = (float)(vecDirection.Dot(vecDirection));
+    float b         = (float)(2.0 * vecDirection.Dot(diff));
+    float c         = (float)(diff.Dot(diff) - this->getRadius() * this->getRadius());
+
+    // use 'abc'-formula for finding root t_1,2 = (-b +/- sqrt(b^2-4ac))/(2a)
+    float inRoot = (float)(b * b - 4.0 * a * c);
+    if (inRoot < 0)
+        return false;
+    float root = sqrt(inRoot);
+
+    float dist = (float)((-b - root) / (2.0 * a));
+
+    double infinity = DBL_MAX;
+    double eps      = 1E-4;
+
+    if (dist > infinity)
+        return false;
+
+    if (dist < eps) {
+        dist = (float)((-b + root) / (2.0 * a));
+        if (dist < eps || dist > infinity)
+            return false;
+    }
+    return true;
 }
 /*=======================================================*/
-bool GbSphere3D::isCellCuttingGbObject3D(const double& x1a,const double& x2a,const double& x3a,const double& x1b,const double& x2b,const double& x3b)
-//Merksatz: cell oder deren Volumen schneidet oder beinhaltet komplette oder Teile der SphereUmrandung
-//returns true:
+bool GbSphere3D::isCellCuttingGbObject3D(const double &x1a, const double &x2a, const double &x3a, const double &x1b,
+                                         const double &x2b, const double &x3b)
+// Merksatz: cell oder deren Volumen schneidet oder beinhaltet komplette oder Teile der SphereUmrandung
+// returns true:
 //  - cell cuts  sphere3D
 //  - cell boxes sphere3D
-//returns false:
+// returns false:
 //  - cell completely inside sphere3D ( = sphere3D boxes cell)
 //  - cell und sphere3D haben kein gemeinsames Volumen
 {
-   double midX[] = {  this->getX1Centroid()
-                    , this->getX2Centroid()
-                    , this->getX3Centroid() };
-
-   double Bmin[] = {  UbMath::min(x1a, x1b)
-                    , UbMath::min(x2a, x2b)
-                    , UbMath::min(x3a, x3b) };
-
-   double Bmax[] = {  UbMath::max(x1a, x1b)
-                    , UbMath::max(x2a, x2b)
-                    , UbMath::max(x3a, x3b) };
-
-   /* Solid Box - Hollow Sphere */
-   double dmin = 0.0;
-   double dmax = 0.0;
-   double r2   = radius*radius;
-
-   for( int i=0; i<3; i++ )
-   {
-      double a = pow( midX[i] - Bmin[i], 2.0 );
-      double b = pow( midX[i] - Bmax[i], 2.0 );
-      dmax += UbMath::max( a, b );
-      if     ( UbMath::less   ( midX[i], Bmin[i] ) ) dmin += a;
-      else if( UbMath::greater( midX[i], Bmax[i] ) ) dmin += b;
-   }
-   if(   UbMath::lessEqual(dmin, r2   )
-      && UbMath::lessEqual(r2  , dmax ) )
-   {
-      return true;
-   }
-   return false;
+    double midX[] = { this->getX1Centroid(), this->getX2Centroid(), this->getX3Centroid() };
+
+    double Bmin[] = { UbMath::min(x1a, x1b), UbMath::min(x2a, x2b), UbMath::min(x3a, x3b) };
+
+    double Bmax[] = { UbMath::max(x1a, x1b), UbMath::max(x2a, x2b), UbMath::max(x3a, x3b) };
+
+    /* Solid Box - Hollow Sphere */
+    double dmin = 0.0;
+    double dmax = 0.0;
+    double r2   = radius * radius;
+
+    for (int i = 0; i < 3; i++) {
+        double a = pow(midX[i] - Bmin[i], 2.0);
+        double b = pow(midX[i] - Bmax[i], 2.0);
+        dmax += UbMath::max(a, b);
+        if (UbMath::less(midX[i], Bmin[i]))
+            dmin += a;
+        else if (UbMath::greater(midX[i], Bmax[i]))
+            dmin += b;
+    }
+    if (UbMath::lessEqual(dmin, r2) && UbMath::lessEqual(r2, dmax)) {
+        return true;
+    }
+    return false;
 }
 /*=======================================================*/
-bool GbSphere3D::isCellInsideOrCuttingGbObject3D(const double& x1a,const double& x2a,const double& x3a,const double& x1b,const double& x2b,const double& x3b)
-//returns true:
+bool GbSphere3D::isCellInsideOrCuttingGbObject3D(const double &x1a, const double &x2a, const double &x3a,
+                                                 const double &x1b, const double &x2b, const double &x3b)
+// returns true:
 //  - cell completely inside sphere3D ( = sphere3D boxes cell)
 //  - cell cuts  sphere3D
 //  - cell boxes sphere3D
-//returns false:
+// returns false:
 //  - cell und sphere3D haben kein gemeinsames Volumen
 {
-   //URL: http://tog.acm.org/GraphicsGems/gems/BoxSphere.c (mode=4, beides solids!!!)
-   // solid - solid
-   //this routine tests for intersection between an 3-dimensional
-   //axis-aligned box and an 3-dimensional sphere.
-
-   //true:
-   //  - wenn Schnitt
-   //  - Cell komplett innerhalb GbSphere3D
-   //  - Cell umhuellt GbSphere3D
-
-
-   double midX1 = this->getX1Centroid();
-   double midX2 = this->getX2Centroid();
-   double midX3 = this->getX3Centroid();
-
-   double dmin  = 0.0;
-
-   if     ( UbMath::less   ( midX1, x1a ) ) dmin += std::pow( midX1 - x1a, 2.0 );
-   else if( UbMath::greater( midX1, x1b ) ) dmin += std::pow( midX1 - x1b, 2.0 );
-
-   if     ( UbMath::less   ( midX2, x2a ) ) dmin += std::pow( midX2 - x2a, 2.0 );
-   else if( UbMath::greater( midX2, x2b ) ) dmin += std::pow( midX2 - x2b, 2.0 );
-
-   if     ( UbMath::less   ( midX3, x3a ) ) dmin += std::pow( midX3 - x3a, 2.0 );
-   else if( UbMath::greater( midX3, x3b ) ) dmin += std::pow( midX3 - x3b, 2.0 );
-
-   if( UbMath::lessEqual( dmin, radius*radius ) )
-   {
-      return true;
-   }
-
-   return false;
+    // URL: http://tog.acm.org/GraphicsGems/gems/BoxSphere.c (mode=4, beides solids!!!)
+    // solid - solid
+    // this routine tests for intersection between an 3-dimensional
+    // axis-aligned box and an 3-dimensional sphere.
+
+    // true:
+    //  - wenn Schnitt
+    //  - Cell komplett innerhalb GbSphere3D
+    //  - Cell umhuellt GbSphere3D
+
+    double midX1 = this->getX1Centroid();
+    double midX2 = this->getX2Centroid();
+    double midX3 = this->getX3Centroid();
+
+    double dmin = 0.0;
+
+    if (UbMath::less(midX1, x1a))
+        dmin += std::pow(midX1 - x1a, 2.0);
+    else if (UbMath::greater(midX1, x1b))
+        dmin += std::pow(midX1 - x1b, 2.0);
+
+    if (UbMath::less(midX2, x2a))
+        dmin += std::pow(midX2 - x2a, 2.0);
+    else if (UbMath::greater(midX2, x2b))
+        dmin += std::pow(midX2 - x2b, 2.0);
+
+    if (UbMath::less(midX3, x3a))
+        dmin += std::pow(midX3 - x3a, 2.0);
+    else if (UbMath::greater(midX3, x3b))
+        dmin += std::pow(midX3 - x3b, 2.0);
+
+    if (UbMath::lessEqual(dmin, radius * radius)) {
+        return true;
+    }
+
+    return false;
 }
 /*==========================================================*/
-double GbSphere3D::getCellVolumeInsideGbObject3D(const double& x1a,const double& x2a,const double& x3a,const double& x1b,const double& x2b,const double& x3b)
+double GbSphere3D::getCellVolumeInsideGbObject3D(const double &x1a, const double &x2a, const double &x3a,
+                                                 const double &x1b, const double &x2b, const double &x3b)
 {
-	double deltaX1 = (x1b-x1a);
-	double deltaX2 = (x2b-x2a);
-	double deltaX3 = (x3b-x3a);
-	  
-	if( this->isCellInsideGbObject3D(x1a,x2a,x3a,x1b,x2b,x3b) )       return 1.0*deltaX1*deltaX2*deltaX3; 
-	if( !(this->isCellCuttingGbObject3D(x1a,x2a,x3a,x1b,x2b,x3b)) )   return 0.0;
-
-	double tempResult = 0.0;
-
-	int iMax = 10;
-	int jMax = 10;
-	int kMax = 10;
-
-	for(         int i=0; i<iMax; i++){
-		for(     int j=0; j<jMax; j++){
-			for( int k=0; k<kMax; k++){
-				
-				tempResult += getCellVolumeInsideGbObject3DHelperFunction(
-					x1a+((double) i   )*deltaX1/((double)iMax), x2a+((double) j   )*deltaX2/((double)jMax), x3a+((double) k   )*deltaX3/((double)kMax),
-					x1a+((double)(i+1))*deltaX1/((double)iMax), x2a+((double)(j+1))*deltaX2/((double)jMax), x3a+((double)(k+1))*deltaX3/((double)kMax) );
-			}
-		}
-	}
-
-
-	// double resultWithOneCell = getCellVolumeInsideGbObject3DHelperFunction( x1a, x2a, x3a, x1b, x2b, x3b );
-	// cout << tempResult << " vs. " << resultWithOneCell << endl;
+    double deltaX1 = (x1b - x1a);
+    double deltaX2 = (x2b - x2a);
+    double deltaX3 = (x3b - x3a);
+
+    if (this->isCellInsideGbObject3D(x1a, x2a, x3a, x1b, x2b, x3b))
+        return 1.0 * deltaX1 * deltaX2 * deltaX3;
+    if (!(this->isCellCuttingGbObject3D(x1a, x2a, x3a, x1b, x2b, x3b)))
+        return 0.0;
+
+    double tempResult = 0.0;
+
+    int iMax = 10;
+    int jMax = 10;
+    int kMax = 10;
+
+    for (int i = 0; i < iMax; i++) {
+        for (int j = 0; j < jMax; j++) {
+            for (int k = 0; k < kMax; k++) {
+
+                tempResult += getCellVolumeInsideGbObject3DHelperFunction(
+                    x1a + ((double)i) * deltaX1 / ((double)iMax), x2a + ((double)j) * deltaX2 / ((double)jMax),
+                    x3a + ((double)k) * deltaX3 / ((double)kMax), x1a + ((double)(i + 1)) * deltaX1 / ((double)iMax),
+                    x2a + ((double)(j + 1)) * deltaX2 / ((double)jMax),
+                    x3a + ((double)(k + 1)) * deltaX3 / ((double)kMax));
+            }
+        }
+    }
 
-	return tempResult;
+    // double resultWithOneCell = getCellVolumeInsideGbObject3DHelperFunction( x1a, x2a, x3a, x1b, x2b, x3b );
+    // cout << tempResult << " vs. " << resultWithOneCell << endl;
 
+    return tempResult;
 }
 /*==========================================================*/
-double GbSphere3D::getCellVolumeInsideGbObject3DHelperFunction(const double& x1a,const double& x2a,const double& x3a,const double& x1b,const double& x2b,const double& x3b)
+double GbSphere3D::getCellVolumeInsideGbObject3DHelperFunction(const double &x1a, const double &x2a, const double &x3a,
+                                                               const double &x1b, const double &x2b, const double &x3b)
 {
 
-	double deltaX1 = x1b-x1a;
-   double deltaX2 = x2b-x2a;
-   double deltaX3 = x3b-x3a;
-
-   if(   this->isCellInsideGbObject3D(x1a,x2a,x3a,x1b,x2b,x3b) )     return 1.0*deltaX1*deltaX2*deltaX3;
-   if( !(this->isCellCuttingGbObject3D(x1a,x2a,x3a,x1b,x2b,x3b)) )   return 0.0;
-
-   double alpha=0.0;
-   double internX1,internX2,internX3;
-
-   for(int x1vers=0;x1vers<2;x1vers++){
-      for(int x2vers=0;x2vers<2;x2vers++){
-         for(int x3vers=0;x3vers<2;x3vers++){
-            internX1 = x1a + (x1b-x1a)*x1vers;
-            internX2 = x2a + (x2b-x2a)*x2vers;
-            internX3 = x3a + (x3b-x3a)*x3vers;
-
-            if( UbMath::lessEqual(this->getDistance(internX1,internX2,internX3),alpha) )
-               alpha = this->getDistance(internX1,internX2,internX3);
-            //cout<<zelltyp<<" "<<kugel->getDistance(internX1,internX2,internX3)<<" "<<alpha<<endl;
-         }//end first for
-      }//end second for
-   }//end third for
-
-   alpha = (-1)*alpha;
-
-
-
-   double n[3];
-   n[0] = 0.5*(x1b+x1a) - this->getX1Centroid();
-   n[1] = 0.5*(x2b+x2a) - this->getX2Centroid();
-   n[2] = 0.5*(x3b+x3a) - this->getX3Centroid();
-
-   //cout << "Koordinaten:  "<<x1<<" "<<x2<<" "<<x3<<endl;
-   //cout << "Deltas:       "<<deltaX1<<" "<<deltaX2<<" "<<deltaX3<<endl;
-   //cout << "Halbe Zelle:  "<<halfcelldelta<<endl;
-
-   //cout<<"Centroid:  "<<kugel->getX1Centroid()<<" "<<kugel->getX2Centroid()<<" "<<kugel->getX3Centroid()<<endl;
-
-   //cout<<"Normals: "<<n[0]<<" "<<n[1]<<" "<<n[2]<<endl;
-
-   double normLength;
-   normLength = sqrt(n[0]*n[0] + n[1]*n[1] + n[2]*n[2]);
-   n[0] /= normLength;
-   n[1] /= normLength;
-   n[2] /= normLength;
-
-   if( UbMath::less(n[0],0.0) ) n[0] = -n[0];
-   if( UbMath::less(n[1],0.0) ) n[1] = -n[1];
-   if( UbMath::less(n[2],0.0) ) n[2] = -n[2];
-
-   //cout<<"Normals: "<<n[0]<<" "<<n[1]<<" "<<n[2]<<endl;
-
-   double dummy;
-   if( UbMath::greater(n[0],n[1])) {dummy=n[1]; n[1]=n[0]; n[0]=dummy;}
-   if( UbMath::greater(n[1],n[2])) {dummy=n[2]; n[2]=n[1]; n[1]=dummy;}
-   if( UbMath::greater(n[0],n[1])) {dummy=n[1]; n[1]=n[0]; n[0]=dummy;}
-
-   //cout<<"Normals: "<<n[0]<<" "<<n[1]<<" "<<n[2]<<endl;
-
-   double n1,n2,n3;
-   n1=n[0];
-   n2=n[1];
-   n3=n[2];
-
-	double maxVol =  deltaX1*deltaX2*deltaX3;
-
-	double result = 0.0, preresult = 0.0;
-
-   if( UbMath::lessEqual( maxVol, 0.000001 ) )
-      return 0.0;
-
-   // 1D Check
-   if ( UbMath::lessEqual(n1,0.001)&&UbMath::lessEqual(n2,0.001) )
-	{
-		result = alpha*deltaX1*deltaX2;
-   }
-   // 2D Check
-   else if ( UbMath::lessEqual(n1,0.001) )
-	{
-		preresult = (2*n2*n3);
-		result = (alpha*alpha)/preresult;
-		
-		if( UbMath::greater(alpha,n2*deltaX2) )
-		{
-			result += -(alpha-n2*deltaX2)*(alpha-n2*deltaX2)/preresult;
-		}
-		if( UbMath::greater(alpha,n3*deltaX3) )
-		{
-			result += -(alpha-n3*deltaX3)*(alpha-n3*deltaX3)/preresult;
-		}
-		if( UbMath::greater(alpha,n2*deltaX2+n3*deltaX3) )
-		{
-			result +=  (alpha-n2*deltaX2-n3*deltaX3)*(alpha-n2*deltaX2-n3*deltaX3)/preresult;
-		}
-
-		// tiefenrichtung mit einmultiplizieren...
-		result *= deltaX1;
-	}	
-   // 3D Check
-   else	
-	{ 	
-		preresult =6*n1*n2*n3;
-
-		result = alpha*alpha*alpha;
-
-		if ( UbMath::greaterEqual(alpha,n1*deltaX1))
-		{
-			result+=-((alpha-n1*deltaX1)*(alpha-n1*deltaX1)*(alpha-n1*deltaX1));
-		}
-		if (UbMath::greaterEqual(alpha,n2*deltaX2))
-		{
-			result+=-((alpha-n2*deltaX2)*(alpha-n2*deltaX2)*(alpha-n2*deltaX2));
-		}
-		if (UbMath::greaterEqual(alpha,n3*deltaX3))
-		{
-			result+=-((alpha-n3*deltaX3)*(alpha-n3*deltaX3)*(alpha-n3*deltaX3));
-		}
-		if (UbMath::greaterEqual(alpha,(n1*deltaX1+n2*deltaX2)))
-		{
-			result+=((alpha-(n1*deltaX1+n2*deltaX2))*(alpha-(n1*deltaX1+n2*deltaX2))*(alpha-(n1*deltaX1+n2*deltaX2)));
-		}
-		if (UbMath::greaterEqual(alpha,(n1*deltaX1+n3*deltaX3)))
-		{
-			result+=((alpha-(n1*deltaX1+n3*deltaX3))*(alpha-(n1*deltaX1+n3*deltaX3))*(alpha-(n1*deltaX1+n3*deltaX3)));
-		}
-		if (UbMath::greaterEqual(alpha,(n2*deltaX2+n3*deltaX3)))
-		{
-			result+=((alpha-(n2*deltaX2+n3*deltaX3))*(alpha-(n2*deltaX2+n3*deltaX3))*(alpha-(n2*deltaX2+n3*deltaX3)));
-		}
-
-		//NEW
-		if (UbMath::greaterEqual(alpha,(n1*deltaX1+n2*deltaX2+n3*deltaX3)))
-		{
-			result+= -((alpha-(n1*deltaX1+n2*deltaX2+n3*deltaX3))*(alpha-(n1*deltaX1+n2*deltaX2+n3*deltaX3))*(alpha-(n1*deltaX1+n2*deltaX2+n3*deltaX3)));
-		}
-
-		result = result / preresult;
-
-   }
-   return(result) ;
-
-   //cout << "alpha ist " << alpha << endl;
-   //cout << "fillLevel ist " << eps << endl;
+    double deltaX1 = x1b - x1a;
+    double deltaX2 = x2b - x2a;
+    double deltaX3 = x3b - x3a;
+
+    if (this->isCellInsideGbObject3D(x1a, x2a, x3a, x1b, x2b, x3b))
+        return 1.0 * deltaX1 * deltaX2 * deltaX3;
+    if (!(this->isCellCuttingGbObject3D(x1a, x2a, x3a, x1b, x2b, x3b)))
+        return 0.0;
+
+    double alpha = 0.0;
+    double internX1, internX2, internX3;
+
+    for (int x1vers = 0; x1vers < 2; x1vers++) {
+        for (int x2vers = 0; x2vers < 2; x2vers++) {
+            for (int x3vers = 0; x3vers < 2; x3vers++) {
+                internX1 = x1a + (x1b - x1a) * x1vers;
+                internX2 = x2a + (x2b - x2a) * x2vers;
+                internX3 = x3a + (x3b - x3a) * x3vers;
+
+                if (UbMath::lessEqual(this->getDistance(internX1, internX2, internX3), alpha))
+                    alpha = this->getDistance(internX1, internX2, internX3);
+                // cout<<zelltyp<<" "<<kugel->getDistance(internX1,internX2,internX3)<<" "<<alpha<<endl;
+            } // end first for
+        }     // end second for
+    }         // end third for
+
+    alpha = (-1) * alpha;
+
+    double n[3];
+    n[0] = 0.5 * (x1b + x1a) - this->getX1Centroid();
+    n[1] = 0.5 * (x2b + x2a) - this->getX2Centroid();
+    n[2] = 0.5 * (x3b + x3a) - this->getX3Centroid();
+
+    // cout << "Koordinaten:  "<<x1<<" "<<x2<<" "<<x3<<endl;
+    // cout << "Deltas:       "<<deltaX1<<" "<<deltaX2<<" "<<deltaX3<<endl;
+    // cout << "Halbe Zelle:  "<<halfcelldelta<<endl;
+
+    // cout<<"Centroid:  "<<kugel->getX1Centroid()<<" "<<kugel->getX2Centroid()<<" "<<kugel->getX3Centroid()<<endl;
+
+    // cout<<"Normals: "<<n[0]<<" "<<n[1]<<" "<<n[2]<<endl;
+
+    double normLength;
+    normLength = sqrt(n[0] * n[0] + n[1] * n[1] + n[2] * n[2]);
+    n[0] /= normLength;
+    n[1] /= normLength;
+    n[2] /= normLength;
+
+    if (UbMath::less(n[0], 0.0))
+        n[0] = -n[0];
+    if (UbMath::less(n[1], 0.0))
+        n[1] = -n[1];
+    if (UbMath::less(n[2], 0.0))
+        n[2] = -n[2];
+
+    // cout<<"Normals: "<<n[0]<<" "<<n[1]<<" "<<n[2]<<endl;
+
+    double dummy;
+    if (UbMath::greater(n[0], n[1])) {
+        dummy = n[1];
+        n[1]  = n[0];
+        n[0]  = dummy;
+    }
+    if (UbMath::greater(n[1], n[2])) {
+        dummy = n[2];
+        n[2]  = n[1];
+        n[1]  = dummy;
+    }
+    if (UbMath::greater(n[0], n[1])) {
+        dummy = n[1];
+        n[1]  = n[0];
+        n[0]  = dummy;
+    }
+
+    // cout<<"Normals: "<<n[0]<<" "<<n[1]<<" "<<n[2]<<endl;
+
+    double n1, n2, n3;
+    n1 = n[0];
+    n2 = n[1];
+    n3 = n[2];
+
+    double maxVol = deltaX1 * deltaX2 * deltaX3;
+
+    double result = 0.0, preresult = 0.0;
+
+    if (UbMath::lessEqual(maxVol, 0.000001))
+        return 0.0;
+
+    // 1D Check
+    if (UbMath::lessEqual(n1, 0.001) && UbMath::lessEqual(n2, 0.001)) {
+        result = alpha * deltaX1 * deltaX2;
+    }
+    // 2D Check
+    else if (UbMath::lessEqual(n1, 0.001)) {
+        preresult = (2 * n2 * n3);
+        result    = (alpha * alpha) / preresult;
+
+        if (UbMath::greater(alpha, n2 * deltaX2)) {
+            result += -(alpha - n2 * deltaX2) * (alpha - n2 * deltaX2) / preresult;
+        }
+        if (UbMath::greater(alpha, n3 * deltaX3)) {
+            result += -(alpha - n3 * deltaX3) * (alpha - n3 * deltaX3) / preresult;
+        }
+        if (UbMath::greater(alpha, n2 * deltaX2 + n3 * deltaX3)) {
+            result += (alpha - n2 * deltaX2 - n3 * deltaX3) * (alpha - n2 * deltaX2 - n3 * deltaX3) / preresult;
+        }
+
+        // tiefenrichtung mit einmultiplizieren...
+        result *= deltaX1;
+    }
+    // 3D Check
+    else {
+        preresult = 6 * n1 * n2 * n3;
+
+        result = alpha * alpha * alpha;
+
+        if (UbMath::greaterEqual(alpha, n1 * deltaX1)) {
+            result += -((alpha - n1 * deltaX1) * (alpha - n1 * deltaX1) * (alpha - n1 * deltaX1));
+        }
+        if (UbMath::greaterEqual(alpha, n2 * deltaX2)) {
+            result += -((alpha - n2 * deltaX2) * (alpha - n2 * deltaX2) * (alpha - n2 * deltaX2));
+        }
+        if (UbMath::greaterEqual(alpha, n3 * deltaX3)) {
+            result += -((alpha - n3 * deltaX3) * (alpha - n3 * deltaX3) * (alpha - n3 * deltaX3));
+        }
+        if (UbMath::greaterEqual(alpha, (n1 * deltaX1 + n2 * deltaX2))) {
+            result += ((alpha - (n1 * deltaX1 + n2 * deltaX2)) * (alpha - (n1 * deltaX1 + n2 * deltaX2)) *
+                       (alpha - (n1 * deltaX1 + n2 * deltaX2)));
+        }
+        if (UbMath::greaterEqual(alpha, (n1 * deltaX1 + n3 * deltaX3))) {
+            result += ((alpha - (n1 * deltaX1 + n3 * deltaX3)) * (alpha - (n1 * deltaX1 + n3 * deltaX3)) *
+                       (alpha - (n1 * deltaX1 + n3 * deltaX3)));
+        }
+        if (UbMath::greaterEqual(alpha, (n2 * deltaX2 + n3 * deltaX3))) {
+            result += ((alpha - (n2 * deltaX2 + n3 * deltaX3)) * (alpha - (n2 * deltaX2 + n3 * deltaX3)) *
+                       (alpha - (n2 * deltaX2 + n3 * deltaX3)));
+        }
+
+        // NEW
+        if (UbMath::greaterEqual(alpha, (n1 * deltaX1 + n2 * deltaX2 + n3 * deltaX3))) {
+            result += -((alpha - (n1 * deltaX1 + n2 * deltaX2 + n3 * deltaX3)) *
+                        (alpha - (n1 * deltaX1 + n2 * deltaX2 + n3 * deltaX3)) *
+                        (alpha - (n1 * deltaX1 + n2 * deltaX2 + n3 * deltaX3)));
+        }
+
+        result = result / preresult;
+    }
+    return (result);
+
+    // cout << "alpha ist " << alpha << endl;
+    // cout << "fillLevel ist " << eps << endl;
 }
 /*==========================================================*/
-double GbSphere3D::getIntersectionRaytraceFactor(const double& x1, const double& x2, const double& x3, const double& rx1, const double& rx2, const double& rx3)
+double GbSphere3D::getIntersectionRaytraceFactor(const double &x1, const double &x2, const double &x3,
+                                                 const double &rx1, const double &rx2, const double &rx3)
 {
-   double lx1  = midPoint->x1 - x1;
-   double lx2  = midPoint->x2 - x2;
-   double lx3  = midPoint->x3 - x3;
-   double l_sq = lx1*lx1 + lx2*lx2 + lx3*lx3;  //l = abstand Punkt(x1,x2,x3)<->kreismittelpunkt
-
-   double s    = lx1*rx1 + lx2*rx2 + lx3*rx3;  //s= l*ray_dir)
-   double r_sq = this->radius * this->radius;  // r� =r*r
-   //if (d<0 (fuer die Richtung falls sie gegen das Kreis dann haben wir ein negativer Zahl)
-   //     && l� > r� (point outside ))
-   //wenn s<0->Punkt liegt rechts vom mittelpunkt, wenn nun punkt ausserhalb des kreises liegt, kann es keinen SP mehr geben
-   if( s<-1.E-10 && l_sq>r_sq+1.E-10 )
-      return -1.0;
-   //Pythagor on Triangle Rectangle (point, center of the cercle, intersection of the direction on point and m)
-   // l� = m� + d�
-   double m_sq = l_sq - s*s;
-   // if (m� > r� (dann gibt es kein schnittpunt zwischen direction und circle))
-   if( m_sq > r_sq+1.E-10 )  return -1.0;
-   // Pythagoras on Triangle Rectangle in cercle (direction , m, r)
-   // r� = m� + h�
-
-   //patch: rundungsfehler bei kleinen delta!!!
-   //-> wenn wurzel minimal null->
-   double wurzelTerm = r_sq - m_sq;
-   if(wurzelTerm<0.0)
-   {
-      if(wurzelTerm<-1E-10) return -1.0; //definitiv kein SP
-      else                  return s;   //im rundungsfehler-bereich. SP liegt dierkt auf sphere umrandung
-   }
-
-   //if point outside of the circle
-   if(l_sq>r_sq) return s-sqrt(wurzelTerm);
-
-   return s+sqrt(wurzelTerm);
+    double lx1  = midPoint->x1 - x1;
+    double lx2  = midPoint->x2 - x2;
+    double lx3  = midPoint->x3 - x3;
+    double l_sq = lx1 * lx1 + lx2 * lx2 + lx3 * lx3; // l = abstand Punkt(x1,x2,x3)<->kreismittelpunkt
+
+    double s    = lx1 * rx1 + lx2 * rx2 + lx3 * rx3; // s= l*ray_dir)
+    double r_sq = this->radius * this->radius;       // r� =r*r
+    // if (d<0 (fuer die Richtung falls sie gegen das Kreis dann haben wir ein negativer Zahl)
+    //     && l� > r� (point outside ))
+    // wenn s<0->Punkt liegt rechts vom mittelpunkt, wenn nun punkt ausserhalb des kreises liegt, kann es keinen SP mehr
+    // geben
+    if (s < -1.E-10 && l_sq > r_sq + 1.E-10)
+        return -1.0;
+    // Pythagor on Triangle Rectangle (point, center of the cercle, intersection of the direction on point and m)
+    // l� = m� + d�
+    double m_sq = l_sq - s * s;
+    // if (m� > r� (dann gibt es kein schnittpunt zwischen direction und circle))
+    if (m_sq > r_sq + 1.E-10)
+        return -1.0;
+    // Pythagoras on Triangle Rectangle in cercle (direction , m, r)
+    // r� = m� + h�
+
+    // patch: rundungsfehler bei kleinen delta!!!
+    //-> wenn wurzel minimal null->
+    double wurzelTerm = r_sq - m_sq;
+    if (wurzelTerm < 0.0) {
+        if (wurzelTerm < -1E-10)
+            return -1.0; // definitiv kein SP
+        else
+            return s; // im rundungsfehler-bereich. SP liegt dierkt auf sphere umrandung
+    }
+
+    // if point outside of the circle
+    if (l_sq > r_sq)
+        return s - sqrt(wurzelTerm);
+
+    return s + sqrt(wurzelTerm);
 }
 /*=======================================================*/
diff --git a/src/basics/geometry3d/GbSphere3D.h b/src/basics/geometry3d/GbSphere3D.h
index 9fb4ae98aa278ea5256d3695c8a4feb04e876e9c..738a122a185f8a10eddce64d035cea73b96e8b07 100644
--- a/src/basics/geometry3d/GbSphere3D.h
+++ b/src/basics/geometry3d/GbSphere3D.h
@@ -8,11 +8,11 @@
 #define GBSPHERE3D_H
 
 #ifdef CAB_CTL
-   #include <ctl.h>
-#endif //CAB_CTL
+#include <ctl.h>
+#endif // CAB_CTL
 
-#include <vector>
 #include <cmath>
+#include <vector>
 
 #include <basics/utilities/UbObserver.h>
 
@@ -26,115 +26,121 @@ class GbTriangle3D;
 class GbObject3DCreator;
 
 class GbSphere3D : public GbObject3D, public UbObserver
-{                                              
+{
 public:
-   enum TRIANGULATIONMODE { CUBOIDPROJECTION ,RAYPROJECTION };
-   
-   //////////////////////////////////////////////////////////////////////////
-   // Konstruktoren
-   GbSphere3D(); 
-   GbSphere3D(const double& x1,const double& x2, const double& x3, const double& radius);            
-   GbSphere3D(const GbSphere3D& sphere);            
-   GbSphere3D(GbSphere3D* sphere); //<-unschoen!
-   
-   ~GbSphere3D() override;
-
-   GbSphere3D* clone() override { return new GbSphere3D(*this);}
-   void finalize() override;
-
-
-   bool intersects(SPtr<GbSphere3D> sphere);
-
-   double getRadius() const	{	return this->radius;	}
-
-   double getX1Centroid() override  { return midPoint->getX1Coordinate();}
-   double getX1Minimum() override   { return midPoint->getX1Coordinate()-radius;}
-   double getX1Maximum() override   { return midPoint->getX1Coordinate()+radius;}
-   double getX2Centroid() override  { return midPoint->getX2Coordinate();}
-   double getX2Minimum() override   { return midPoint->getX2Coordinate()-radius;}
-   double getX2Maximum() override   { return midPoint->getX2Coordinate()+radius;}
-   double getX3Centroid() override  { return midPoint->getX3Coordinate();}
-   double getX3Minimum() override   { return midPoint->getX3Coordinate()-radius;}
-   double getX3Maximum() override   { return midPoint->getX3Coordinate()+radius;}
-
-   void setCenterX1Coordinate(const double& value) override;
-   void setCenterX2Coordinate(const double& value) override;
-   void setCenterX3Coordinate(const double& value) override;
-   void setCenterCoordinates(const double& x1, const double& x2, const double& x3) override;
-   void setCenterCoordinates(const UbTupleDouble3& position) override;
-   void setRadius(const double& radius);
-
-   GbLine3D* createClippedLine3D(GbPoint3D& point1, GbPoint3D& point2) override;
-   double getDistance(GbPoint3D* p); 
-   double getDistance(const double& x1p, const double& x2p, const double& x3p);
-
-   bool isPointInGbObject3D(const double& x1, const double& x2, const double& x3) override;
-   bool isPointInGbObject3D(const double& x1p, const double& x2p, const double& x3p, bool& pointIsOnBoundary) override;
-
-   bool isCellCuttingGbObject3D(const double& x1a,const double& x2a,const double& x3a,const double& x1b,const double& x2b,const double& x3b) override;
-   bool isCellInsideOrCuttingGbObject3D(const double& x1a,const double& x2a,const double& x3a,const double& x1b,const double& x2b,const double& x3b) override;
-   double getCellVolumeInsideGbObject3D(const double& x1a,const double& x2a,const double& x3a,const double& x1b,const double& x2b,const double& x3b) override;
-   double getCellVolumeInsideGbObject3DHelperFunction(const double& x1a,const double& x2a,const double& x3a,const double& x1b,const double& x2b,const double& x3b);
-
-   std::vector<GbTriangle3D*> getSurfaceTriangleSet() override;
-   void addSurfaceTriangleSet(std::vector<UbTupleFloat3>& nodes, std::vector<UbTupleInt3>& triangles) override;
-
-   bool hasRaytracing() override { return true; }
-   /*|r| must be 1! einheitsvector!!*/
-   double getIntersectionRaytraceFactor(const double& x1, const double& x2, const double& x3, const double& rx1, const double& rx2, const double& rx3) override;
-
-   bool hasIntersectionWithDirectedLine(GbPoint3D origin, GbPoint3D direction);
-
-	std::string toString() override;
-
-   void translate(const double& x1, const double& x2, const double& x3) override 
-   {
-      this->midPoint->translate(x1, x2, x3); 
-      this->notifyObserversObjectChanged();
-   }
-   void rotate(const double& rx1, const double& rx2, const double& rx3) override {/* rotation makes no sense*/ }
-   void scale(const double& sx1, const double&  /*sx2*/, const double&  /*sx3*/) override 
-   { 
-      this->radius *= sx1; 
-      this->notifyObserversObjectChanged();
-   }
-
-   void transform(const double matrix[4][4]);
-
-   TRIANGULATIONMODE getTriangulationMode() {return triangulationMode;}
-   void setTriangulationMode(TRIANGULATIONMODE mode) { this->triangulationMode = mode; }
-   
-   //virtuelle Methoden von UbObserver
-   void objectChanged(UbObservable*  /*changedObject*/) override
-   {
-      this->notifyObserversObjectChanged();
-      //std::cout<<"GbSphere:objectChanged() - toDo-);";
-   }
-   void objectWillBeDeleted(UbObservable*  /*objectForDeletion*/) override
-   {
-	   throw UbException(UB_EXARGS,"not implemented");
-   }
-
-   using GbObject3D::isPointInGbObject3D; //Grund: dadurch muss man hier  isPointInGbObject3D(GbPoint3D*) nicht ausprogrammieren, welche sonst hier "ueberdeckt" waere, weil man eine
+    enum TRIANGULATIONMODE { CUBOIDPROJECTION, RAYPROJECTION };
+
+    //////////////////////////////////////////////////////////////////////////
+    // Konstruktoren
+    GbSphere3D();
+    GbSphere3D(const double &x1, const double &x2, const double &x3, const double &radius);
+    GbSphere3D(const GbSphere3D &sphere);
+    GbSphere3D(GbSphere3D *sphere); //<-unschoen!
+
+    ~GbSphere3D() override;
+
+    GbSphere3D *clone() override { return new GbSphere3D(*this); }
+    void finalize() override;
+
+    bool intersects(SPtr<GbSphere3D> sphere);
+
+    double getRadius() const { return this->radius; }
+
+    double getX1Centroid() override { return midPoint->getX1Coordinate(); }
+    double getX1Minimum() override { return midPoint->getX1Coordinate() - radius; }
+    double getX1Maximum() override { return midPoint->getX1Coordinate() + radius; }
+    double getX2Centroid() override { return midPoint->getX2Coordinate(); }
+    double getX2Minimum() override { return midPoint->getX2Coordinate() - radius; }
+    double getX2Maximum() override { return midPoint->getX2Coordinate() + radius; }
+    double getX3Centroid() override { return midPoint->getX3Coordinate(); }
+    double getX3Minimum() override { return midPoint->getX3Coordinate() - radius; }
+    double getX3Maximum() override { return midPoint->getX3Coordinate() + radius; }
+
+    void setCenterX1Coordinate(const double &value) override;
+    void setCenterX2Coordinate(const double &value) override;
+    void setCenterX3Coordinate(const double &value) override;
+    void setCenterCoordinates(const double &x1, const double &x2, const double &x3) override;
+    void setCenterCoordinates(const UbTupleDouble3 &position) override;
+    void setRadius(const double &radius);
+
+    GbLine3D *createClippedLine3D(GbPoint3D &point1, GbPoint3D &point2) override;
+    double getDistance(GbPoint3D *p);
+    double getDistance(const double &x1p, const double &x2p, const double &x3p);
+
+    bool isPointInGbObject3D(const double &x1, const double &x2, const double &x3) override;
+    bool isPointInGbObject3D(const double &x1p, const double &x2p, const double &x3p, bool &pointIsOnBoundary) override;
+
+    bool isCellCuttingGbObject3D(const double &x1a, const double &x2a, const double &x3a, const double &x1b,
+                                 const double &x2b, const double &x3b) override;
+    bool isCellInsideOrCuttingGbObject3D(const double &x1a, const double &x2a, const double &x3a, const double &x1b,
+                                         const double &x2b, const double &x3b) override;
+    double getCellVolumeInsideGbObject3D(const double &x1a, const double &x2a, const double &x3a, const double &x1b,
+                                         const double &x2b, const double &x3b) override;
+    double getCellVolumeInsideGbObject3DHelperFunction(const double &x1a, const double &x2a, const double &x3a,
+                                                       const double &x1b, const double &x2b, const double &x3b);
+
+    std::vector<GbTriangle3D *> getSurfaceTriangleSet() override;
+    void addSurfaceTriangleSet(std::vector<UbTupleFloat3> &nodes, std::vector<UbTupleInt3> &triangles) override;
+
+    bool hasRaytracing() override { return true; }
+    /*|r| must be 1! einheitsvector!!*/
+    double getIntersectionRaytraceFactor(const double &x1, const double &x2, const double &x3, const double &rx1,
+                                         const double &rx2, const double &rx3) override;
+
+    bool hasIntersectionWithDirectedLine(GbPoint3D origin, GbPoint3D direction);
+
+    std::string toString() override;
+
+    void translate(const double &x1, const double &x2, const double &x3) override
+    {
+        this->midPoint->translate(x1, x2, x3);
+        this->notifyObserversObjectChanged();
+    }
+    void rotate(const double &rx1, const double &rx2, const double &rx3) override
+    { /* rotation makes no sense*/
+    }
+    void scale(const double &sx1, const double & /*sx2*/, const double & /*sx3*/) override
+    {
+        this->radius *= sx1;
+        this->notifyObserversObjectChanged();
+    }
+
+    void transform(const double matrix[4][4]);
+
+    TRIANGULATIONMODE getTriangulationMode() { return triangulationMode; }
+    void setTriangulationMode(TRIANGULATIONMODE mode) { this->triangulationMode = mode; }
+
+    // virtuelle Methoden von UbObserver
+    void objectChanged(UbObservable * /*changedObject*/) override
+    {
+        this->notifyObserversObjectChanged();
+        // std::cout<<"GbSphere:objectChanged() - toDo-);";
+    }
+    void objectWillBeDeleted(UbObservable * /*objectForDeletion*/) override
+    {
+        throw UbException(UB_EXARGS, "not implemented");
+    }
+
+    using GbObject3D::isPointInGbObject3D; // Grund: dadurch muss man hier  isPointInGbObject3D(GbPoint3D*) nicht
+                                           // ausprogrammieren, welche sonst hier "ueberdeckt" waere, weil man eine
 
 #ifdef CAB_CTL
-   ctl::oStream &write(ctl::oStream &os) const
-   { 
-      midPoint->write(os);
-      return os<<radius; 
-   }
-   ctl::iStream &read(ctl::iStream &is) 
-   { 
-      midPoint->read(is);
-      return is>>radius;
-   }
-#endif //CAB_CTL
+    ctl::oStream &write(ctl::oStream &os) const
+    {
+        midPoint->write(os);
+        return os << radius;
+    }
+    ctl::iStream &read(ctl::iStream &is)
+    {
+        midPoint->read(is);
+        return is >> radius;
+    }
+#endif // CAB_CTL
 
 private:
-   GbPoint3D* midPoint;
-   double radius;  // Radius des Kreises
-   TRIANGULATIONMODE triangulationMode;
+    GbPoint3D *midPoint;
+    double radius; // Radius des Kreises
+    TRIANGULATIONMODE triangulationMode;
 };
 
-
-#endif //GBSPHERE3D_H
+#endif // GBSPHERE3D_H
diff --git a/src/basics/geometry3d/GbSystem3D.cpp b/src/basics/geometry3d/GbSystem3D.cpp
index 142b584f36e441ae7d668b0b153704563ce8d93e..2a49aff7d55cb3f18ff316eb6310c96b92bbc721 100644
--- a/src/basics/geometry3d/GbSystem3D.cpp
+++ b/src/basics/geometry3d/GbSystem3D.cpp
@@ -1,28 +1,28 @@
 //=======================================================================================
-// ____          ____    __    ______     __________   __      __       __        __         
-// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |        
-//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |        
-//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |        
-//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____    
-//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|   
-//      \    \  |    |   ________________________________________________________________    
-//       \    \ |    |  |  ______________________________________________________________|   
-//        \    \|    |  |  |         __          __     __     __     ______      _______    
-//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)   
-//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______    
+// ____          ____    __    ______     __________   __      __       __        __
+// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |
+//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |
+//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |
+//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____
+//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|
+//      \    \  |    |   ________________________________________________________________
+//       \    \ |    |  |  ______________________________________________________________|
+//        \    \|    |  |  |         __          __     __     __     ______      _______
+//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)
+//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______
 //           \       |  |  |        |  |_____   |   \_/   |   |  |   |  |_/  /    _____  |
-//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/   
+//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/
 //
-//  This file is part of VirtualFluids. VirtualFluids is free software: you can 
+//  This file is part of VirtualFluids. VirtualFluids is free software: you can
 //  redistribute it and/or modify it under the terms of the GNU General Public
-//  License as published by the Free Software Foundation, either version 3 of 
+//  License as published by the Free Software Foundation, either version 3 of
 //  the License, or (at your option) any later version.
-//  
-//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT 
-//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
-//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License 
+//
+//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT
+//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 //  for more details.
-//  
+//
 //  You should have received a copy of the GNU General Public License along
 //  with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>.
 //
@@ -30,143 +30,161 @@
 //! \ingroup geometry3d
 //! \author Soeren Freudiger, Sebastian Geller
 //=======================================================================================
-#include <GbSystem3D.h>
-#include <GbPolygon3D.h>
 #include <GbCuboid3D.h>
+#include <GbPolygon3D.h>
+#include <GbSystem3D.h>
 
 using namespace std;
 
-double GbSystem3D::getDistance(const GbPoint3D& p11, const GbPoint3D& p12)
+double GbSystem3D::getDistance(const GbPoint3D &p11, const GbPoint3D &p12)
 {
-   double dx1 = p11.x1 - p12.x1;
-   double dx2 = p11.x2 - p12.x2;
-   double dx3 = p11.x3 - p12.x3;
-   return std::sqrt(dx1*dx1+dx2*dx2+dx3*dx3);
+    double dx1 = p11.x1 - p12.x1;
+    double dx2 = p11.x2 - p12.x2;
+    double dx3 = p11.x3 - p12.x3;
+    return std::sqrt(dx1 * dx1 + dx2 * dx2 + dx3 * dx3);
 }
 
-GbPoint3D* GbSystem3D::calculateIntersectionPoint3D(GbPoint3D& p11, GbPoint3D& p12, GbPoint3D& p21, GbPoint3D& p22)
+GbPoint3D *GbSystem3D::calculateIntersectionPoint3D(GbPoint3D &p11, GbPoint3D &p12, GbPoint3D &p21, GbPoint3D &p22)
 {
-   if(UbMath::less2(p11.x1, p12.x1, p21.x1, p22.x1))    return NULL;
-   if(UbMath::less2(p11.x2, p12.x2, p21.x2, p22.x2))    return NULL;
-   if(UbMath::less2(p11.x3, p12.x3, p21.x3, p22.x3))    return NULL;
-   if(UbMath::greater2(p11.x1, p12.x1, p21.x1, p22.x1)) return NULL;
-   if(UbMath::greater2(p11.x2, p12.x2, p21.x2, p22.x2)) return NULL;
-   if(UbMath::greater2(p11.x3, p12.x3, p21.x3, p22.x3)) return NULL;
-
-   double a11 = p12.x1 - p11.x1;                       //..HOW PARAMETERS ARE USED.........
-   double a12 = p12.x2 - p11.x2;                       //
-   double a13 = p12.x3 - p11.x3;                       //  p11 and p12 represent line 1
-   double a21 = p21.x1 - p22.x1;                       //  p21 and p22 represent line 2
-   double a22 = p21.x2 - p22.x2;                       //
-   double a23 = p21.x3 - p22.x3;                       //..................................
-   double b1  = p21.x1 - p11.x1;
-   double b2  = p21.x2 - p11.x2;
-   double b3  = p21.x3 - p11.x3;
-   double d1  = a11*a22 - a12*a21;
-   double d2  = a11*a23 - a13*a21;
-   double d3  = a12*a23 - a13*a22;
-   double t;
-
-   if(UbMath::zero(d1) && UbMath::zero(d2) && UbMath::zero(d3)) return NULL;
-   if(UbMath::zero(d1))
-   {
-   	if(!UbMath::zero(d2)) t = (a23*b1-a21*b3)/d2;
-      else          t = (a23*b2-a22*b3)/d3;
-   }
-   else if(UbMath::zero(d2))
-   {
-   	if(!UbMath::zero(d1)) t = (a22*b1-a21*b2)/d1;
-      else          t = (a23*b2-a22*b3)/d3;
-   }
-   else if(UbMath::zero(d3))
-   {
-   	if(!UbMath::zero(d1)) t = (a22*b1-a21*b2)/d1;
-      else          t = (a23*b1-a21*b3)/d2;
-   }
-   else return NULL;
-
-   double x1 = p11.x1 + t*a11;
-   double x2 = p11.x2 + t*a12;
-   double x3 = p11.x3 + t*a13;
-
-   if(UbMath::inClosedInterval(x1, p11.x1, p12.x1) && UbMath::inClosedInterval(x1, p21.x1, p22.x1) &&
-      UbMath::inClosedInterval(x2, p11.x2, p12.x2) && UbMath::inClosedInterval(x2, p21.x2, p22.x2) &&
-      UbMath::inClosedInterval(x3, p11.x3, p12.x3) && UbMath::inClosedInterval(x3, p21.x3, p22.x3)    ) return new GbPoint3D(x1, x2, x3);
-
-   return NULL;
+    if (UbMath::less2(p11.x1, p12.x1, p21.x1, p22.x1))
+        return NULL;
+    if (UbMath::less2(p11.x2, p12.x2, p21.x2, p22.x2))
+        return NULL;
+    if (UbMath::less2(p11.x3, p12.x3, p21.x3, p22.x3))
+        return NULL;
+    if (UbMath::greater2(p11.x1, p12.x1, p21.x1, p22.x1))
+        return NULL;
+    if (UbMath::greater2(p11.x2, p12.x2, p21.x2, p22.x2))
+        return NULL;
+    if (UbMath::greater2(p11.x3, p12.x3, p21.x3, p22.x3))
+        return NULL;
+
+    double a11 = p12.x1 - p11.x1; //..HOW PARAMETERS ARE USED.........
+    double a12 = p12.x2 - p11.x2; //
+    double a13 = p12.x3 - p11.x3; //  p11 and p12 represent line 1
+    double a21 = p21.x1 - p22.x1; //  p21 and p22 represent line 2
+    double a22 = p21.x2 - p22.x2; //
+    double a23 = p21.x3 - p22.x3; //..................................
+    double b1  = p21.x1 - p11.x1;
+    double b2  = p21.x2 - p11.x2;
+    double b3  = p21.x3 - p11.x3;
+    double d1  = a11 * a22 - a12 * a21;
+    double d2  = a11 * a23 - a13 * a21;
+    double d3  = a12 * a23 - a13 * a22;
+    double t;
+
+    if (UbMath::zero(d1) && UbMath::zero(d2) && UbMath::zero(d3))
+        return NULL;
+    if (UbMath::zero(d1)) {
+        if (!UbMath::zero(d2))
+            t = (a23 * b1 - a21 * b3) / d2;
+        else
+            t = (a23 * b2 - a22 * b3) / d3;
+    } else if (UbMath::zero(d2)) {
+        if (!UbMath::zero(d1))
+            t = (a22 * b1 - a21 * b2) / d1;
+        else
+            t = (a23 * b2 - a22 * b3) / d3;
+    } else if (UbMath::zero(d3)) {
+        if (!UbMath::zero(d1))
+            t = (a22 * b1 - a21 * b2) / d1;
+        else
+            t = (a23 * b1 - a21 * b3) / d2;
+    } else
+        return NULL;
+
+    double x1 = p11.x1 + t * a11;
+    double x2 = p11.x2 + t * a12;
+    double x3 = p11.x3 + t * a13;
+
+    if (UbMath::inClosedInterval(x1, p11.x1, p12.x1) && UbMath::inClosedInterval(x1, p21.x1, p22.x1) &&
+        UbMath::inClosedInterval(x2, p11.x2, p12.x2) && UbMath::inClosedInterval(x2, p21.x2, p22.x2) &&
+        UbMath::inClosedInterval(x3, p11.x3, p12.x3) && UbMath::inClosedInterval(x3, p21.x3, p22.x3))
+        return new GbPoint3D(x1, x2, x3);
+
+    return NULL;
 }
 /*=================================================================*/
-//Line1: p11 -> p12 and Line2: p21 -> p22
-bool GbSystem3D::hasIntersectionPoint3D(GbPoint3D& p11, GbPoint3D& p12, GbPoint3D& p21, GbPoint3D& p22)
+// Line1: p11 -> p12 and Line2: p21 -> p22
+bool GbSystem3D::hasIntersectionPoint3D(GbPoint3D &p11, GbPoint3D &p12, GbPoint3D &p21, GbPoint3D &p22)
 {
-   if(UbMath::less2(p11.x1, p12.x1, p21.x1, p22.x1))    return false; 
-   if(UbMath::less2(p11.x2, p12.x2, p21.x2, p22.x2))    return false; 
-   if(UbMath::less2(p11.x3, p12.x3, p21.x3, p22.x3))    return false; 
-   if(UbMath::greater2(p11.x1, p12.x1, p21.x1, p22.x1)) return false; 
-   if(UbMath::greater2(p11.x2, p12.x2, p21.x2, p22.x2)) return false; 
-   if(UbMath::greater2(p11.x3, p12.x3, p21.x3, p22.x3)) return false; 
-
-   double a11 = p12.x1 - p11.x1;                       //..HOW PARAMETERS ARE USED.........
-   double a12 = p12.x2 - p11.x2;                       //
-   double a13 = p12.x3 - p11.x3;                       //  p11 and p12 represent line 1
-   double a21 = p21.x1 - p22.x1;                       //  p21 and p22 represent line 2
-   double a22 = p21.x2 - p22.x2;                       //
-   double a23 = p21.x3 - p22.x3;                       //..................................
-   double b1  = p21.x1 - p11.x1;
-   double b2  = p21.x2 - p11.x2;
-   double b3  = p21.x3 - p11.x3;
-   double d1  = a11*a22 - a12*a21;
-   double d2  = a11*a23 - a13*a21;
-   double d3  = a12*a23 - a13*a22;
-   double t;
-
-   if(UbMath::zero(d1) && UbMath::zero(d2) && UbMath::zero(d3)) return false; 
-   if(UbMath::zero(d1))
-   {
-      if(!UbMath::zero(d2)) t = (a23*b1-a21*b3)/d2;
-      else          t = (a23*b2-a22*b3)/d3;
-   }
-   else if(UbMath::zero(d2))
-   {
-      if(!UbMath::zero(d1)) t = (a22*b1-a21*b2)/d1;
-	   else          t = (a23*b2-a22*b3)/d3;
-   }
-   else if(UbMath::zero(d3))
-   {
-      if(!UbMath::zero(d1)) t = (a22*b1-a21*b2)/d1;
-      else          t = (a23*b1-a21*b3)/d2;
-   }
-   else return false; 
-
-   double x1 = p11.x1 + t*a11;
-   double x2 = p11.x2 + t*a12;
-   double x3 = p11.x3 + t*a13;
-
-   if(UbMath::inClosedInterval(x1, p11.x1, p12.x1) && UbMath::inClosedInterval(x1, p21.x1, p22.x1) &&
-	   UbMath::inClosedInterval(x2, p11.x2, p12.x2) && UbMath::inClosedInterval(x2, p21.x2, p22.x2) &&
-	   UbMath::inClosedInterval(x3, p11.x3, p12.x3) && UbMath::inClosedInterval(x3, p21.x3, p22.x3)) return true; 
-   return false; 
+    if (UbMath::less2(p11.x1, p12.x1, p21.x1, p22.x1))
+        return false;
+    if (UbMath::less2(p11.x2, p12.x2, p21.x2, p22.x2))
+        return false;
+    if (UbMath::less2(p11.x3, p12.x3, p21.x3, p22.x3))
+        return false;
+    if (UbMath::greater2(p11.x1, p12.x1, p21.x1, p22.x1))
+        return false;
+    if (UbMath::greater2(p11.x2, p12.x2, p21.x2, p22.x2))
+        return false;
+    if (UbMath::greater2(p11.x3, p12.x3, p21.x3, p22.x3))
+        return false;
+
+    double a11 = p12.x1 - p11.x1; //..HOW PARAMETERS ARE USED.........
+    double a12 = p12.x2 - p11.x2; //
+    double a13 = p12.x3 - p11.x3; //  p11 and p12 represent line 1
+    double a21 = p21.x1 - p22.x1; //  p21 and p22 represent line 2
+    double a22 = p21.x2 - p22.x2; //
+    double a23 = p21.x3 - p22.x3; //..................................
+    double b1  = p21.x1 - p11.x1;
+    double b2  = p21.x2 - p11.x2;
+    double b3  = p21.x3 - p11.x3;
+    double d1  = a11 * a22 - a12 * a21;
+    double d2  = a11 * a23 - a13 * a21;
+    double d3  = a12 * a23 - a13 * a22;
+    double t;
+
+    if (UbMath::zero(d1) && UbMath::zero(d2) && UbMath::zero(d3))
+        return false;
+    if (UbMath::zero(d1)) {
+        if (!UbMath::zero(d2))
+            t = (a23 * b1 - a21 * b3) / d2;
+        else
+            t = (a23 * b2 - a22 * b3) / d3;
+    } else if (UbMath::zero(d2)) {
+        if (!UbMath::zero(d1))
+            t = (a22 * b1 - a21 * b2) / d1;
+        else
+            t = (a23 * b2 - a22 * b3) / d3;
+    } else if (UbMath::zero(d3)) {
+        if (!UbMath::zero(d1))
+            t = (a22 * b1 - a21 * b2) / d1;
+        else
+            t = (a23 * b1 - a21 * b3) / d2;
+    } else
+        return false;
+
+    double x1 = p11.x1 + t * a11;
+    double x2 = p11.x2 + t * a12;
+    double x3 = p11.x3 + t * a13;
+
+    if (UbMath::inClosedInterval(x1, p11.x1, p12.x1) && UbMath::inClosedInterval(x1, p21.x1, p22.x1) &&
+        UbMath::inClosedInterval(x2, p11.x2, p12.x2) && UbMath::inClosedInterval(x2, p21.x2, p22.x2) &&
+        UbMath::inClosedInterval(x3, p11.x3, p12.x3) && UbMath::inClosedInterval(x3, p21.x3, p22.x3))
+        return true;
+    return false;
 }
- /*======================================================================*/
+/*======================================================================*/
 //
 //
 //   /*======================================================================*/
 //   /*  Private Methoden (Parallelism)                                      */
 //   /*                                                                      */
-bool GbSystem3D::isParallelIn3D(GbPoint3D& p11, GbPoint3D& p12, GbPoint3D& p21, GbPoint3D& p22)
+bool GbSystem3D::isParallelIn3D(GbPoint3D &p11, GbPoint3D &p12, GbPoint3D &p21, GbPoint3D &p22)
 {
-   double a11 = p12.x1 - p11.x1;                       //..HOW PARAMETERS ARE USED.........
-   double a12 = p12.x2 - p11.x2;                       //
-   double a13 = p12.x3 - p11.x3;                       //  p11 and p12 represent line 1
-   double a21 = p21.x1 - p22.x1;                       //  p21 and p22 represent line 2
-   double a22 = p21.x2 - p22.x2;                       //
-   double a23 = p21.x3 - p22.x3;                       //..................................
-
-   return (UbMath::zero(a11*a22 - a12*a21) && UbMath::zero(a11*a23 - a13*a21) && UbMath::zero(a12*a23 - a13*a22));
+    double a11 = p12.x1 - p11.x1; //..HOW PARAMETERS ARE USED.........
+    double a12 = p12.x2 - p11.x2; //
+    double a13 = p12.x3 - p11.x3; //  p11 and p12 represent line 1
+    double a21 = p21.x1 - p22.x1; //  p21 and p22 represent line 2
+    double a22 = p21.x2 - p22.x2; //
+    double a23 = p21.x3 - p22.x3; //..................................
+
+    return (UbMath::zero(a11 * a22 - a12 * a21) && UbMath::zero(a11 * a23 - a13 * a21) &&
+            UbMath::zero(a12 * a23 - a13 * a22));
 }
 /*======================================================================*/
 
-
 /*======================================================================*/
 /*  General Clipping Methods                                            */
 //......................................................................*/
@@ -181,134 +199,152 @@ bool GbSystem3D::isParallelIn3D(GbPoint3D& p11, GbPoint3D& p12, GbPoint3D& p21,
 /*======================================================================*/
 /*  Private Methoden (Clipping Lines)                                   */
 /*                                                                      */
-GbLine3D* GbSystem3D::createClipLine3D(GbPoint3D &pA, GbPoint3D &pB, double x1a, double x2a, double x3a, double x1b, double x2b, double x3b)
+GbLine3D *GbSystem3D::createClipLine3D(GbPoint3D &pA, GbPoint3D &pB, double x1a, double x2a, double x3a, double x1b,
+                                       double x2b, double x3b)
 {
-   GbPoint3D *p1 = new GbPoint3D(pA);
-   GbPoint3D *p2 = new GbPoint3D(pB);
-
-   if(UbMath::greater(x1a, x1b)) { double x1 = x1a; x1a = x1b; x1b = x1; }
-   if(UbMath::greater(x2a, x2b)) { double x2 = x2a; x2a = x2b; x2b = x2; }
-   if(UbMath::greater(x3a, x3b)) { double x3 = x3a; x3a = x3b; x3b = x3; }
-
-   double f;
-
-   /*-------------------------------------------------------------------*/
-   /*  Schneiden an vorderer Kante                                      */
-   /*                                                                   */
-   if(UbMath::less(p1->x3, x3a))
-   {
-      if(UbMath::less(p2->x3, x3a)) { delete p1; delete p2; return NULL; }
-
-      f       = (x3a-p1->x3)/(p1->x3-p2->x3);
-      p1->x1 += (p1->x1-p2->x1)*f;
-      p1->x2 += (p1->x2-p2->x2)*f;
-      p1->x3  = x3a;
-   }
-   else if(UbMath::less(p2->x3, x3a))
-   {
-      f      = (x3a-p2->x3)/(p2->x3-p1->x3);
-      p2->x1 += (p2->x1-p1->x1)*f;
-      p2->x2 += (p2->x2-p1->x2)*f;
-      p2->x3  = x3a;
-   }     
-   /*-------------------------------------------------------------------*/
-   /*  Schneiden an unterer Kante                                       */
-   /*                                                                   */
-   if(UbMath::less(p1->x2, x2a))
-   {
-      if(UbMath::less(p2->x2, x2a)) { delete p1; delete p2; return NULL;
-      }
-
-      f      = (x2a-p1->x2)/(p1->x2-p2->x2);
-      p1->x1 += (p1->x1-p2->x1)*f;
-      p1->x3 += (p1->x3-p2->x3)*f;
-      p1->x2  = x2a;
-   }
-   else if(UbMath::less(p2->x2, x2a))
-   {
-      f      = (x2a-p2->x2)/(p2->x2-p1->x2);
-      p2->x1 += (p2->x1-p1->x1)*f;
-      p2->x3 += (p2->x3-p1->x3)*f;
-      p2->x2  = x2a;
-   }
-   /*-------------------------------------------------------------------*/
-   /*  Schneiden an rechter Kante                                       */
-   /*                                                                   */
-   if(UbMath::greater(p1->x1, x1b))
-   {
-      if(UbMath::greater(p2->x1, x1b))  { delete p1;delete p2; return NULL;}
-
-      f      = (x1b-p1->x1)/(p1->x1-p2->x1);
-      p1->x2 += (p1->x2-p2->x2)*f;
-      p1->x3 += (p1->x3-p2->x3)*f;
-      p1->x1  = x1b;
-   }
-   else if(UbMath::greater(p2->x1, x1b))
-   {
-      f      = (x1b-p2->x1)/(p2->x1-p1->x1);
-      p2->x2 += (p2->x2-p1->x2)*f;
-      p2->x3 += (p2->x3-p1->x3)*f;
-      p2->x1  = x1b;
-   }
-   /*-------------------------------------------------------------------*/
-   /*  Schneiden an hinterer Kante                                      */
-   /*                                                                   */
-   if(UbMath::greater(p1->x3, x3b))
-   {
-      if(UbMath::greater(p2->x3, x3b))  { delete p1;delete p2; return NULL;}
-
-      f      = (x3b-p1->x3)/(p1->x3-p2->x3);
-      p1->x1 += (p1->x1-p2->x1)*f;
-      p1->x2 += (p1->x2-p2->x2)*f;
-      p1->x3  = x3b;
-   }
-   else if(UbMath::greater(p2->x3, x3b))
-   {
-      f      = (x3b-p2->x3)/(p2->x3-p1->x3);
-      p2->x1 += (p2->x1-p1->x1)*f;
-      p2->x2 += (p2->x2-p1->x2)*f;
-      p2->x3  = x3b;
-   }
-   /*-------------------------------------------------------------------*/
-   /*  Schneiden an oberer Kante                                        */
-   /*                                                                   */
-   if(UbMath::greater(p1->x2, x2b))
-   {
-      if(UbMath::greater(p2->x2, x2b))  { delete p1;delete p2; return NULL;}
-
-      f      = (x2b-p1->x2)/(p1->x2-p2->x2);
-      p1->x1 += (p1->x1-p2->x1)*f;
-      p1->x3 += (p1->x3-p2->x3)*f;
-      p1->x2  = x2b;
-   }
-   else if(UbMath::greater(p2->x2, x2b))
-   {
-      f      = (x2b-p2->x2)/(p2->x2-p1->x2);
-      p2->x1 += (p2->x1-p1->x1)*f;
-      p2->x3 += (p2->x3-p1->x3)*f;
-      p2->x2  = x2b;
-   }
-   /*-------------------------------------------------------------------*/
-   /*  Schneiden an linker Kante                                        */
-   /*                                                                   */
-   if(UbMath::less(p1->x1, x1a))
-   {
-      if(UbMath::less(p2->x1, x1a))  { delete p1;delete p2; return NULL;}
-
-      f      = (x1a-p1->x1)/(p1->x1-p2->x1);
-      p1->x2 += (p1->x2-p2->x2)*f;
-      p1->x3 += (p1->x3-p2->x3)*f;
-      p1->x1  = x1a;
-   }
-   else if(UbMath::less(p2->x1, x1a))
-   {
-      f      = (x1a-p2->x1)/(p2->x1-p1->x1);
-      p2->x2 += (p2->x2-p1->x2)*f;
-      p2->x3 += (p2->x3-p1->x3)*f;
-      p2->x1  = x1a;
-   }
-   /*-------------------------------------------------------------------*/
-   return new GbLine3D(p1, p2);
+    GbPoint3D *p1 = new GbPoint3D(pA);
+    GbPoint3D *p2 = new GbPoint3D(pB);
+
+    if (UbMath::greater(x1a, x1b)) {
+        double x1 = x1a;
+        x1a       = x1b;
+        x1b       = x1;
+    }
+    if (UbMath::greater(x2a, x2b)) {
+        double x2 = x2a;
+        x2a       = x2b;
+        x2b       = x2;
+    }
+    if (UbMath::greater(x3a, x3b)) {
+        double x3 = x3a;
+        x3a       = x3b;
+        x3b       = x3;
+    }
+
+    double f;
+
+    /*-------------------------------------------------------------------*/
+    /*  Schneiden an vorderer Kante                                      */
+    /*                                                                   */
+    if (UbMath::less(p1->x3, x3a)) {
+        if (UbMath::less(p2->x3, x3a)) {
+            delete p1;
+            delete p2;
+            return NULL;
+        }
+
+        f = (x3a - p1->x3) / (p1->x3 - p2->x3);
+        p1->x1 += (p1->x1 - p2->x1) * f;
+        p1->x2 += (p1->x2 - p2->x2) * f;
+        p1->x3 = x3a;
+    } else if (UbMath::less(p2->x3, x3a)) {
+        f = (x3a - p2->x3) / (p2->x3 - p1->x3);
+        p2->x1 += (p2->x1 - p1->x1) * f;
+        p2->x2 += (p2->x2 - p1->x2) * f;
+        p2->x3 = x3a;
+    }
+    /*-------------------------------------------------------------------*/
+    /*  Schneiden an unterer Kante                                       */
+    /*                                                                   */
+    if (UbMath::less(p1->x2, x2a)) {
+        if (UbMath::less(p2->x2, x2a)) {
+            delete p1;
+            delete p2;
+            return NULL;
+        }
+
+        f = (x2a - p1->x2) / (p1->x2 - p2->x2);
+        p1->x1 += (p1->x1 - p2->x1) * f;
+        p1->x3 += (p1->x3 - p2->x3) * f;
+        p1->x2 = x2a;
+    } else if (UbMath::less(p2->x2, x2a)) {
+        f = (x2a - p2->x2) / (p2->x2 - p1->x2);
+        p2->x1 += (p2->x1 - p1->x1) * f;
+        p2->x3 += (p2->x3 - p1->x3) * f;
+        p2->x2 = x2a;
+    }
+    /*-------------------------------------------------------------------*/
+    /*  Schneiden an rechter Kante                                       */
+    /*                                                                   */
+    if (UbMath::greater(p1->x1, x1b)) {
+        if (UbMath::greater(p2->x1, x1b)) {
+            delete p1;
+            delete p2;
+            return NULL;
+        }
+
+        f = (x1b - p1->x1) / (p1->x1 - p2->x1);
+        p1->x2 += (p1->x2 - p2->x2) * f;
+        p1->x3 += (p1->x3 - p2->x3) * f;
+        p1->x1 = x1b;
+    } else if (UbMath::greater(p2->x1, x1b)) {
+        f = (x1b - p2->x1) / (p2->x1 - p1->x1);
+        p2->x2 += (p2->x2 - p1->x2) * f;
+        p2->x3 += (p2->x3 - p1->x3) * f;
+        p2->x1 = x1b;
+    }
+    /*-------------------------------------------------------------------*/
+    /*  Schneiden an hinterer Kante                                      */
+    /*                                                                   */
+    if (UbMath::greater(p1->x3, x3b)) {
+        if (UbMath::greater(p2->x3, x3b)) {
+            delete p1;
+            delete p2;
+            return NULL;
+        }
+
+        f = (x3b - p1->x3) / (p1->x3 - p2->x3);
+        p1->x1 += (p1->x1 - p2->x1) * f;
+        p1->x2 += (p1->x2 - p2->x2) * f;
+        p1->x3 = x3b;
+    } else if (UbMath::greater(p2->x3, x3b)) {
+        f = (x3b - p2->x3) / (p2->x3 - p1->x3);
+        p2->x1 += (p2->x1 - p1->x1) * f;
+        p2->x2 += (p2->x2 - p1->x2) * f;
+        p2->x3 = x3b;
+    }
+    /*-------------------------------------------------------------------*/
+    /*  Schneiden an oberer Kante                                        */
+    /*                                                                   */
+    if (UbMath::greater(p1->x2, x2b)) {
+        if (UbMath::greater(p2->x2, x2b)) {
+            delete p1;
+            delete p2;
+            return NULL;
+        }
+
+        f = (x2b - p1->x2) / (p1->x2 - p2->x2);
+        p1->x1 += (p1->x1 - p2->x1) * f;
+        p1->x3 += (p1->x3 - p2->x3) * f;
+        p1->x2 = x2b;
+    } else if (UbMath::greater(p2->x2, x2b)) {
+        f = (x2b - p2->x2) / (p2->x2 - p1->x2);
+        p2->x1 += (p2->x1 - p1->x1) * f;
+        p2->x3 += (p2->x3 - p1->x3) * f;
+        p2->x2 = x2b;
+    }
+    /*-------------------------------------------------------------------*/
+    /*  Schneiden an linker Kante                                        */
+    /*                                                                   */
+    if (UbMath::less(p1->x1, x1a)) {
+        if (UbMath::less(p2->x1, x1a)) {
+            delete p1;
+            delete p2;
+            return NULL;
+        }
+
+        f = (x1a - p1->x1) / (p1->x1 - p2->x1);
+        p1->x2 += (p1->x2 - p2->x2) * f;
+        p1->x3 += (p1->x3 - p2->x3) * f;
+        p1->x1 = x1a;
+    } else if (UbMath::less(p2->x1, x1a)) {
+        f = (x1a - p2->x1) / (p2->x1 - p1->x1);
+        p2->x2 += (p2->x2 - p1->x2) * f;
+        p2->x3 += (p2->x3 - p1->x3) * f;
+        p2->x1 = x1a;
+    }
+    /*-------------------------------------------------------------------*/
+    return new GbLine3D(p1, p2);
 }
 //   /*======================================================================*/
 //   /*  Private Methoden (Clipping Rectangles)                              */
@@ -346,7 +382,8 @@ GbLine3D* GbSystem3D::createClipLine3D(GbPoint3D &pA, GbPoint3D &pB, double x1a,
 //	       if(flag)
 //	       {
 //	          f = (x12-(*points)[i]->x2)/((*points)[i]->x2-last->x2);
-//	          ps.add(new GbPoint3D((*points)[i]->x1 + ((*points)[i]->x1-last->x1)*f, x12, (*points)[i]->x3 + ((*points)[i]->x3-last->x3)*f));
+//	          ps.add(new GbPoint3D((*points)[i]->x1 + ((*points)[i]->x1-last->x1)*f, x12, (*points)[i]->x3 +
+//((*points)[i]->x3-last->x3)*f));
 //	       }
 //	       flag = false;
 //	    }
@@ -355,7 +392,8 @@ GbLine3D* GbSystem3D::createClipLine3D(GbPoint3D &pA, GbPoint3D &pB, double x1a,
 //	       if(!flag)
 //	       {
 //	          f = (x12-(*points)[i]->x2)/((*points)[i]->x2-last->x2);
-//	          ps.add(new GbPoint3D((*points)[i]->x1 + ((*points)[i]->x1-last->x1)*f, x12, (*points)[i]->x3 + ((*points)[i]->x3-last->x3)*f));
+//	          ps.add(new GbPoint3D((*points)[i]->x1 + ((*points)[i]->x1-last->x1)*f, x12, (*points)[i]->x3 +
+//((*points)[i]->x3-last->x3)*f));
 //	       }
 //	       ps.add((*points)[i]);
 //	       flag = true;
@@ -393,7 +431,8 @@ GbLine3D* GbSystem3D::createClipLine3D(GbPoint3D &pA, GbPoint3D &pB, double x1a,
 //	       if(flag)
 //	       {
 //	          f = (x21-(*points)[i]->x1)/((*points)[i]->x1-last->x1);
-//	          ps.add(new GbPoint3D(x21, (*points)[i]->x2 + ((*points)[i]->x2-last->x2)*f, (*points)[i]->x3 + ((*points)[i]->x3-last->x3)*f));
+//	          ps.add(new GbPoint3D(x21, (*points)[i]->x2 + ((*points)[i]->x2-last->x2)*f, (*points)[i]->x3 +
+//((*points)[i]->x3-last->x3)*f));
 //	       }
 //	       flag = false;
 //	    }
@@ -402,7 +441,8 @@ GbLine3D* GbSystem3D::createClipLine3D(GbPoint3D &pA, GbPoint3D &pB, double x1a,
 //	       if(!flag)
 //	       {
 //	          f = (x21-(*points)[i]->x1)/((*points)[i]->x1-last->x1);
-//	          ps.add(new GbPoint3D(x21, (*points)[i]->x2 + ((*points)[i]->x2-last->x2)*f, (*points)[i]->x3 + ((*points)[i]->x3-last->x3)*f));
+//	          ps.add(new GbPoint3D(x21, (*points)[i]->x2 + ((*points)[i]->x2-last->x2)*f, (*points)[i]->x3 +
+//((*points)[i]->x3-last->x3)*f));
 //	       }
 //	       ps.add(points[i]);
 //	       flag = true;
@@ -440,7 +480,8 @@ GbLine3D* GbSystem3D::createClipLine3D(GbPoint3D &pA, GbPoint3D &pB, double x1a,
 //	       if(flag)
 //	       {
 //	          f = (x22-(*points)[i]->x2)/(points[i].x2-last.x2);
-//	          ps.add(new GbPoint3D(points[i].x1 + (points[i].x1-last.x1)*f, x22, points[i].x3 + (points[i].x3-last.x3)*f));
+//	          ps.add(new GbPoint3D(points[i].x1 + (points[i].x1-last.x1)*f, x22, points[i].x3 +
+//(points[i].x3-last.x3)*f));
 //	       }
 //	       flag = false;
 //	    }
@@ -449,7 +490,8 @@ GbLine3D* GbSystem3D::createClipLine3D(GbPoint3D &pA, GbPoint3D &pB, double x1a,
 //	       if(!flag)
 //	       {
 //	          f = (x22-points[i].x2)/(points[i].x2-last.x2);
-//	          ps.add(new GbPoint3D(points[i].x1 + (points[i].x1-last.x1)*f, x22, points[i].x3 + (points[i].x3-last.x3)*f));
+//	          ps.add(new GbPoint3D(points[i].x1 + (points[i].x1-last.x1)*f, x22, points[i].x3 +
+//(points[i].x3-last.x3)*f));
 //	       }
 //	       ps.add(points[i]);
 //	       flag = true;
@@ -487,7 +529,8 @@ GbLine3D* GbSystem3D::createClipLine3D(GbPoint3D &pA, GbPoint3D &pB, double x1a,
 //	       if(flag)
 //	       {
 //	          f = (x11-points[i].x1)/(points[i].x1-last.x1);
-//	          ps.add(new GbPoint3D(x11, points[i].x2 + (points[i].x2-last.x2)*f, points[i].x3 + (points[i].x3-last.x3)*f));
+//	          ps.add(new GbPoint3D(x11, points[i].x2 + (points[i].x2-last.x2)*f, points[i].x3 +
+//(points[i].x3-last.x3)*f));
 //	       }
 //	       flag = false;
 //	    }
@@ -496,7 +539,8 @@ GbLine3D* GbSystem3D::createClipLine3D(GbPoint3D &pA, GbPoint3D &pB, double x1a,
 //	       if(!flag)
 //	       {
 //	          f = (x11-points[i].x1)/(points[i].x1-last.x1);
-//	          ps.add(new GbPoint3D(x11, points[i].x2 + (points[i].x2-last.x2)*f, points[i].x3 + (points[i].x3-last.x3)*f));
+//	          ps.add(new GbPoint3D(x11, points[i].x2 + (points[i].x2-last.x2)*f, points[i].x3 +
+//(points[i].x3-last.x3)*f));
 //	       }
 //	       ps.add(points[i]);
 //	       flag = true;
@@ -557,7 +601,8 @@ GbLine3D* GbSystem3D::createClipLine3D(GbPoint3D &pA, GbPoint3D &pB, double x1a,
 //	       if(flag)
 //	       {
 //	          f = (x13-points[i].x3)/(points[i].x3-last.x3);
-//	          ps.add(new GbPoint3D(points[i].x1 + (points[i].x1-last.x1)*f, points[i].x2 + (points[i].x2-last.x2)*f, x13));
+//	          ps.add(new GbPoint3D(points[i].x1 + (points[i].x1-last.x1)*f, points[i].x2 + (points[i].x2-last.x2)*f,
+//x13));
 //	       }
 //	       flag = false;
 //	    }
@@ -566,7 +611,8 @@ GbLine3D* GbSystem3D::createClipLine3D(GbPoint3D &pA, GbPoint3D &pB, double x1a,
 //	       if(!flag)
 //	       {
 //	          f = (x13-points[i].x3)/(points[i].x3-last.x3);
-//	          ps.add(new GbPoint3D(points[i].x1 + (points[i].x1-last.x1)*f, points[i].x2 + (points[i].x2-last.x2)*f, x13));
+//	          ps.add(new GbPoint3D(points[i].x1 + (points[i].x1-last.x1)*f, points[i].x2 + (points[i].x2-last.x2)*f,
+//x13));
 //	       }
 //	       ps.add(points[i]);
 //	       flag = true;
@@ -604,7 +650,8 @@ GbLine3D* GbSystem3D::createClipLine3D(GbPoint3D &pA, GbPoint3D &pB, double x1a,
 //	       if(flag)
 //	       {
 //	          f = (x23-points[i].x3)/(points[i].x3-last.x3);
-//	          ps.add(new GbPoint3D(points[i].x1 + (points[i].x1-last.x1)*f, points[i].x2 + (points[i].x2-last.x2)*f, x23));
+//	          ps.add(new GbPoint3D(points[i].x1 + (points[i].x1-last.x1)*f, points[i].x2 + (points[i].x2-last.x2)*f,
+//x23));
 //	       }
 //	       flag = false;
 //	    }
@@ -613,7 +660,8 @@ GbLine3D* GbSystem3D::createClipLine3D(GbPoint3D &pA, GbPoint3D &pB, double x1a,
 //	       if(!flag)
 //	       {
 //	          f = (x23-points[i].x3)/(points[i].x3-last.x3);
-//	          ps.add(new GbPoint3D(points[i].x1 + ((*points)[i]->x1-last.x1)*f, (*points)[i]->x2 + ((*points)[i]->x2-last.x2)*f, x23));
+//	          ps.add(new GbPoint3D(points[i].x1 + ((*points)[i]->x1-last.x1)*f, (*points)[i]->x2 +
+//((*points)[i]->x2-last.x2)*f, x23));
 //	       }
 //	       ps.add(points[i]);
 //	       flag = true;
@@ -636,404 +684,420 @@ GbLine3D* GbSystem3D::createClipLine3D(GbPoint3D &pA, GbPoint3D &pB, double x1a,
 //
 //      return(polygon);
 //   }
-GbPolygon3D* GbSystem3D::clipPolygon3D(vector<GbPoint3D> points, double x11, double x12, double x13, double x21, double x22, double x23)
+GbPolygon3D *GbSystem3D::clipPolygon3D(vector<GbPoint3D> points, double x11, double x12, double x13, double x21,
+                                       double x22, double x23)
 {
-   GbPoint3D last;
-   PointSet3 ps(points);
-   bool   flag = false;
-   int    n    = (int)points.size();
-	int       i;
-   double    f;
-
-   if(n == 0)              return NULL;
-   if(UbMath::greater(x11, x21)) { double ax = x11; x11 = x21; x21 = ax; }
-   if(UbMath::greater(x12, x22)) { double ay = x12; x12 = x22; x22 = ay; }
-   if(UbMath::greater(x13, x23)) { double az = x13; x13 = x23; x23 = az; }
-
-   /*-------------------------------------------------------------------*/
-   /*  Schneiden an vorderer Kante                                      */
-   /*                                                                   */
-   if(UbMath::less(ps.getX3Minimum(), x13))
-   {
-		ps.clear();
-		last = (points)[0];
-		if(UbMath::less((points)[0].x3, x13)) flag = false;
-		else
-		{
-			ps.add((points)[0]);
-			flag = true;
-		}
-		for(i=1; i<n; i++)
-		{
-			if(UbMath::less((points)[i].x3, x13))
-			{
-				if(flag)
-				{
-					f = (x13-(points)[i].x3)/((points)[i].x3-last.x3);
-					ps.add(GbPoint3D((points)[i].x1 + ((points)[i].x1-last.x1)*f, (points)[i].x2 + ((points)[i].x2-last.x2)*f, x13));
-				}
-				flag = false;
-			}
-			else
-			{
-				if(!flag)
-				{
-					f = (x13-(points)[i].x3)/((points)[i].x3-last.x3);
-					ps.add(GbPoint3D((points)[i].x1 + ((points)[i].x1-last.x1)*f, (points)[i].x2 + ((points)[i].x2-last.x2)*f, x13));
-				}
-				ps.add((points)[i]);
-				flag = true;
-			}
-			last = (points)[i];
-		}
-		if(!((UbMath::less((points)[0].x3, x13)) ^ flag))
-		{
-			f = (x13-(points)[0].x3)/((points)[0].x3-last.x3);
-			ps.add(GbPoint3D((points)[0].x1 + ((points)[0].x1-last.x1)*f, (points)[0].x2 + ((points)[0].x2-last.x2)*f, x13));
-		}
-
-		points = ps.getPoints();
-		n      = (int)points.size();
-
-		if(n == 0) return NULL;
-   }
-	
-	/*-------------------------------------------------------------------*/
-   /*  Schneiden an unterer Kante                                       */
-   /*                                                                   */
-   if(UbMath::less(ps.getX2Minimum(), x12))
-   {
-		ps.clear();
-		last = (points)[0];
-		if(UbMath::less((points)[0].x2, x12)) flag = false;
-		else
-		{
-			ps.add((points)[0]);
-			flag = true;
-		}
-		for(i=1; i<n; i++)
-		{
-			if(UbMath::less((points)[i].x2, x12))
-			{
-				if(flag)
-				{
-					f = (x12-(points)[i].x2)/((points)[i].x2-last.x2);
-					ps.add(GbPoint3D((points)[i].x1 + ((points)[i].x1-last.x1)*f, x12, (points)[i].x3 + ((points)[i].x3-last.x3)*f));
-				}
-				flag = false;
-			}
-		   else
-			{
-				if(!flag)
-				{
-					f = (x12-(points)[i].x2)/((points)[i].x2-last.x2);
-					ps.add(GbPoint3D((points)[i].x1 + ((points)[i].x1-last.x1)*f, x12, (points)[i].x3 + ((points)[i].x3-last.x3)*f));
-				}
-				ps.add((points)[i]);
-				flag = true;
-			}
-			last = (points)[i];
-		}
-		if(!((UbMath::less((points)[0].x2, x12)) ^ flag))
-		{
-			f = (x12-(points)[0].x2)/((points)[0].x2-last.x2);
-			ps.add(GbPoint3D((points)[0].x1 + ((points)[0].x1-last.x1)*f, x12, (points)[0].x3 + ((points)[0].x3-last.x3)*f));
-		}
-
-		points = ps.getPoints();
-		n      = (int)points.size();
-
-		if(n == 0) return NULL;
-   }
-   /*-------------------------------------------------------------------*/
-   /*  Schneiden an rechter Kante                                       */
-   /*                                                                   */
-	
-	if(UbMath::greater(ps.getX1Maximum(), x21))
-   {
-		ps.clear();
-		last = (points)[0];
-		if(UbMath::greater((points)[0].x1, x21)) flag = false;
-		else
-		{
-			ps.add((points)[0]);
-			flag = true;
-		}
-		for(i=1; i<n; i++)
-		{
-			if(UbMath::greater((points)[i].x1, x21))
-			{
-				if(flag)
-				{
-					f = (x21-(points)[i].x1)/((points)[i].x1-last.x1);
-					ps.add(GbPoint3D(x21, (points)[i].x2 + ((points)[i].x2-last.x2)*f, (points)[i].x3 + ((points)[i].x3-last.x3)*f));
-				}
-				flag = false;
-			}
-			else
-			{
-				if(!flag)
-				{
-					f = (x21-(points)[i].x1)/((points)[i].x1-last.x1);
-					ps.add(GbPoint3D(x21, (points)[i].x2 + ((points)[i].x2-last.x2)*f, (points)[i].x3 + ((points)[i].x3-last.x3)*f));
-				}
-				ps.add((points)[i]);
-				flag = true;
-			}
-			last = (points)[i];
-		}
-		if(!((UbMath::greater((points)[0].x1, x21)) ^ flag))
-		{
-			f = (x21-(points)[0].x1)/((points)[0].x1-last.x1);
-			ps.add(GbPoint3D(x21, (points)[0].x2 + ((points)[0].x2-last.x2)*f, (points)[0].x3 + ((points)[0].x3-last.x3)*f));
-		}
-
-		points = ps.getPoints();
-		n      = (int)points.size();
-
-		if(n == 0) return NULL;
-   }
-   /*-------------------------------------------------------------------*/
-   /*  Schneiden an hinterer Kante                                      */
-   /*                                                                   */
-   if(UbMath::greater(ps.getX3Maximum(), x23))
-   {
-		ps.clear();
-		last = (points)[0];
-		if(UbMath::greater((points)[0].x3, x23)) flag = false;
-		else
-		{
-			ps.add((points)[0]);
-			flag = true;
-		}
-		for(i=1; i<n; i++)
-		{
-			if(UbMath::greater((points)[i].x3, x23))
-			{
-				if(flag)
-				{
-					f = (x23-(points)[i].x3)/((points)[i].x3-last.x3);
-					ps.add(GbPoint3D((points)[i].x1 + ((points)[i].x1-last.x1)*f, (points)[i].x2 + ((points)[i].x2-last.x2)*f, x23));
-				}
-				flag = false;
-			}
-			else
-			{
-				if(!flag)
-				{
-					f = (x23-(points)[i].x3)/((points)[i].x3-last.x3);
-					ps.add(GbPoint3D((points)[i].x1 + ((points)[i].x1-last.x1)*f, (points)[i].x2 + ((points)[i].x2-last.x2)*f, x23));
-				}
-				ps.add((points)[i]);
-				flag = true;
-			}
-			last = (points)[i];
-		}
-		if(!((UbMath::greater((points)[0].x3, x23)) ^ flag))
-		{
-			f = (x23-(points)[0].x3)/((points)[0].x3-last.x3);
-			ps.add(GbPoint3D((points)[0].x1 + ((points)[0].x1-last.x1)*f, (points)[0].x2 + ((points)[0].x2-last.x2)*f, x23));
-		}
-
-		points = ps.getPoints();
-		n      = (int)points.size();
-
-		if(n == 0) return NULL;
-	}
-   /*-------------------------------------------------------------------*/
-   /*  Schneiden an oberer Kante                                        */
-   /*                                                                   */
-
-	if(UbMath::greater(ps.getX2Maximum(), x22))
-   {
-		ps.clear();
-		last = (points)[0];
-		if(UbMath::greater((points)[0].x2, x22)) flag = false;
-		else
-		{
-			ps.add((points)[0]);
-			flag = true;
-		}
-		for(i=1; i<n; i++)
-		{
-			if(UbMath::greater((points)[i].x2, x22))
-			{
-				if(flag)
-				{
-					f = (x22-(points)[i].x2)/((points)[i].x2-last.x2);
-					ps.add(GbPoint3D((points)[i].x1 + ((points)[i].x1-last.x1)*f, x22, (points)[i].x3 + ((points)[i].x3-last.x3)*f));
-				}
-				flag = false;
-			}
-			else
-			{
-				if(!flag)
-				{
-					f = (x22-(points)[i].x2)/((points)[i].x2-last.x2);
-					ps.add(GbPoint3D((points)[i].x1 + ((points)[i].x1-last.x1)*f, x22, (points)[i].x3 + ((points)[i].x3-last.x3)*f));
-				}
-				ps.add((points)[i]);
-				flag = true;
-			}
-			last = (points)[i];
-		}
-		if(!((UbMath::greater((points)[0].x2, x22)) ^ flag))
-		{
-			f = (x22-(points)[0].x2)/((points)[0].x2-last.x2);
-			ps.add(GbPoint3D((points)[0].x1 + ((points)[0].x1-last.x1)*f, x22, (points)[0].x3 + ((points)[0].x3-last.x3)*f));
-		}
-
-		points = ps.getPoints();
-		n      = (int)points.size();
-
-		if(n == 0) return NULL;
-   }
-   /*-------------------------------------------------------------------*/
-   /*  Schneiden an linker Kante                                        */
-   /*                                                                   */
-	if(UbMath::less(ps.getX1Minimum(), x11))
-   {
-		ps.clear();
-		last = (points)[0];
-		if(UbMath::less((points)[0].x1, x11)) flag = false;
-		else
-		{
-			ps.add((points)[0]);
-			flag = true;
-		}
-		for(i=1; i<n; i++)
-		{
-			if(UbMath::less((points)[i].x1, x11))
-			{
-				if(flag)
-				{
-					f = (x11-(points)[i].x1)/((points)[i].x1-last.x1);
-					ps.add(GbPoint3D(x11, (points)[i].x2 + ((points)[i].x2-last.x2)*f, (points)[i].x3 + ((points)[i].x3-last.x3)*f));
-
-				}
-				flag = false;
-			}
-			else
-			{
-				if(!flag)
-				{
-					f = (x11-(points)[i].x1)/((points)[i].x1-last.x1);
-					ps.add(GbPoint3D(x11, (points)[i].x2 + ((points)[i].x2-last.x2)*f, (points)[i].x3 + ((points)[i].x3-last.x3)*f));
-				}
-				ps.add((points)[i]);
-				flag = true;
-			}
-			last = (points)[i];
-		}
-		if(!((UbMath::less((points)[0].x1, x11)) ^ flag))
-		{
-			f = (x11-(points)[0].x1)/((points)[0].x1-last.x1);
-			ps.add(GbPoint3D(x11, (points)[0].x2 + ((points)[0].x2-last.x2)*f, (points)[0].x3 + ((points)[0].x3-last.x3)*f));
-		}
-
-		points = ps.getPoints();
-		n      = (int)points.size();
-		
-		if(n == 0) return NULL;
-   }
-   /*-------------------------------------------------------------------*/
-	return new GbPolygon3D(points);
+    GbPoint3D last;
+    PointSet3 ps(points);
+    bool flag = false;
+    int n     = (int)points.size();
+    int i;
+    double f;
+
+    if (n == 0)
+        return NULL;
+    if (UbMath::greater(x11, x21)) {
+        double ax = x11;
+        x11       = x21;
+        x21       = ax;
+    }
+    if (UbMath::greater(x12, x22)) {
+        double ay = x12;
+        x12       = x22;
+        x22       = ay;
+    }
+    if (UbMath::greater(x13, x23)) {
+        double az = x13;
+        x13       = x23;
+        x23       = az;
+    }
+
+    /*-------------------------------------------------------------------*/
+    /*  Schneiden an vorderer Kante                                      */
+    /*                                                                   */
+    if (UbMath::less(ps.getX3Minimum(), x13)) {
+        ps.clear();
+        last = (points)[0];
+        if (UbMath::less((points)[0].x3, x13))
+            flag = false;
+        else {
+            ps.add((points)[0]);
+            flag = true;
+        }
+        for (i = 1; i < n; i++) {
+            if (UbMath::less((points)[i].x3, x13)) {
+                if (flag) {
+                    f = (x13 - (points)[i].x3) / ((points)[i].x3 - last.x3);
+                    ps.add(GbPoint3D((points)[i].x1 + ((points)[i].x1 - last.x1) * f,
+                                     (points)[i].x2 + ((points)[i].x2 - last.x2) * f, x13));
+                }
+                flag = false;
+            } else {
+                if (!flag) {
+                    f = (x13 - (points)[i].x3) / ((points)[i].x3 - last.x3);
+                    ps.add(GbPoint3D((points)[i].x1 + ((points)[i].x1 - last.x1) * f,
+                                     (points)[i].x2 + ((points)[i].x2 - last.x2) * f, x13));
+                }
+                ps.add((points)[i]);
+                flag = true;
+            }
+            last = (points)[i];
+        }
+        if (!((UbMath::less((points)[0].x3, x13)) ^ flag)) {
+            f = (x13 - (points)[0].x3) / ((points)[0].x3 - last.x3);
+            ps.add(GbPoint3D((points)[0].x1 + ((points)[0].x1 - last.x1) * f,
+                             (points)[0].x2 + ((points)[0].x2 - last.x2) * f, x13));
+        }
+
+        points = ps.getPoints();
+        n      = (int)points.size();
+
+        if (n == 0)
+            return NULL;
+    }
+
+    /*-------------------------------------------------------------------*/
+    /*  Schneiden an unterer Kante                                       */
+    /*                                                                   */
+    if (UbMath::less(ps.getX2Minimum(), x12)) {
+        ps.clear();
+        last = (points)[0];
+        if (UbMath::less((points)[0].x2, x12))
+            flag = false;
+        else {
+            ps.add((points)[0]);
+            flag = true;
+        }
+        for (i = 1; i < n; i++) {
+            if (UbMath::less((points)[i].x2, x12)) {
+                if (flag) {
+                    f = (x12 - (points)[i].x2) / ((points)[i].x2 - last.x2);
+                    ps.add(GbPoint3D((points)[i].x1 + ((points)[i].x1 - last.x1) * f, x12,
+                                     (points)[i].x3 + ((points)[i].x3 - last.x3) * f));
+                }
+                flag = false;
+            } else {
+                if (!flag) {
+                    f = (x12 - (points)[i].x2) / ((points)[i].x2 - last.x2);
+                    ps.add(GbPoint3D((points)[i].x1 + ((points)[i].x1 - last.x1) * f, x12,
+                                     (points)[i].x3 + ((points)[i].x3 - last.x3) * f));
+                }
+                ps.add((points)[i]);
+                flag = true;
+            }
+            last = (points)[i];
+        }
+        if (!((UbMath::less((points)[0].x2, x12)) ^ flag)) {
+            f = (x12 - (points)[0].x2) / ((points)[0].x2 - last.x2);
+            ps.add(GbPoint3D((points)[0].x1 + ((points)[0].x1 - last.x1) * f, x12,
+                             (points)[0].x3 + ((points)[0].x3 - last.x3) * f));
+        }
+
+        points = ps.getPoints();
+        n      = (int)points.size();
+
+        if (n == 0)
+            return NULL;
+    }
+    /*-------------------------------------------------------------------*/
+    /*  Schneiden an rechter Kante                                       */
+    /*                                                                   */
+
+    if (UbMath::greater(ps.getX1Maximum(), x21)) {
+        ps.clear();
+        last = (points)[0];
+        if (UbMath::greater((points)[0].x1, x21))
+            flag = false;
+        else {
+            ps.add((points)[0]);
+            flag = true;
+        }
+        for (i = 1; i < n; i++) {
+            if (UbMath::greater((points)[i].x1, x21)) {
+                if (flag) {
+                    f = (x21 - (points)[i].x1) / ((points)[i].x1 - last.x1);
+                    ps.add(GbPoint3D(x21, (points)[i].x2 + ((points)[i].x2 - last.x2) * f,
+                                     (points)[i].x3 + ((points)[i].x3 - last.x3) * f));
+                }
+                flag = false;
+            } else {
+                if (!flag) {
+                    f = (x21 - (points)[i].x1) / ((points)[i].x1 - last.x1);
+                    ps.add(GbPoint3D(x21, (points)[i].x2 + ((points)[i].x2 - last.x2) * f,
+                                     (points)[i].x3 + ((points)[i].x3 - last.x3) * f));
+                }
+                ps.add((points)[i]);
+                flag = true;
+            }
+            last = (points)[i];
+        }
+        if (!((UbMath::greater((points)[0].x1, x21)) ^ flag)) {
+            f = (x21 - (points)[0].x1) / ((points)[0].x1 - last.x1);
+            ps.add(GbPoint3D(x21, (points)[0].x2 + ((points)[0].x2 - last.x2) * f,
+                             (points)[0].x3 + ((points)[0].x3 - last.x3) * f));
+        }
+
+        points = ps.getPoints();
+        n      = (int)points.size();
+
+        if (n == 0)
+            return NULL;
+    }
+    /*-------------------------------------------------------------------*/
+    /*  Schneiden an hinterer Kante                                      */
+    /*                                                                   */
+    if (UbMath::greater(ps.getX3Maximum(), x23)) {
+        ps.clear();
+        last = (points)[0];
+        if (UbMath::greater((points)[0].x3, x23))
+            flag = false;
+        else {
+            ps.add((points)[0]);
+            flag = true;
+        }
+        for (i = 1; i < n; i++) {
+            if (UbMath::greater((points)[i].x3, x23)) {
+                if (flag) {
+                    f = (x23 - (points)[i].x3) / ((points)[i].x3 - last.x3);
+                    ps.add(GbPoint3D((points)[i].x1 + ((points)[i].x1 - last.x1) * f,
+                                     (points)[i].x2 + ((points)[i].x2 - last.x2) * f, x23));
+                }
+                flag = false;
+            } else {
+                if (!flag) {
+                    f = (x23 - (points)[i].x3) / ((points)[i].x3 - last.x3);
+                    ps.add(GbPoint3D((points)[i].x1 + ((points)[i].x1 - last.x1) * f,
+                                     (points)[i].x2 + ((points)[i].x2 - last.x2) * f, x23));
+                }
+                ps.add((points)[i]);
+                flag = true;
+            }
+            last = (points)[i];
+        }
+        if (!((UbMath::greater((points)[0].x3, x23)) ^ flag)) {
+            f = (x23 - (points)[0].x3) / ((points)[0].x3 - last.x3);
+            ps.add(GbPoint3D((points)[0].x1 + ((points)[0].x1 - last.x1) * f,
+                             (points)[0].x2 + ((points)[0].x2 - last.x2) * f, x23));
+        }
+
+        points = ps.getPoints();
+        n      = (int)points.size();
+
+        if (n == 0)
+            return NULL;
+    }
+    /*-------------------------------------------------------------------*/
+    /*  Schneiden an oberer Kante                                        */
+    /*                                                                   */
+
+    if (UbMath::greater(ps.getX2Maximum(), x22)) {
+        ps.clear();
+        last = (points)[0];
+        if (UbMath::greater((points)[0].x2, x22))
+            flag = false;
+        else {
+            ps.add((points)[0]);
+            flag = true;
+        }
+        for (i = 1; i < n; i++) {
+            if (UbMath::greater((points)[i].x2, x22)) {
+                if (flag) {
+                    f = (x22 - (points)[i].x2) / ((points)[i].x2 - last.x2);
+                    ps.add(GbPoint3D((points)[i].x1 + ((points)[i].x1 - last.x1) * f, x22,
+                                     (points)[i].x3 + ((points)[i].x3 - last.x3) * f));
+                }
+                flag = false;
+            } else {
+                if (!flag) {
+                    f = (x22 - (points)[i].x2) / ((points)[i].x2 - last.x2);
+                    ps.add(GbPoint3D((points)[i].x1 + ((points)[i].x1 - last.x1) * f, x22,
+                                     (points)[i].x3 + ((points)[i].x3 - last.x3) * f));
+                }
+                ps.add((points)[i]);
+                flag = true;
+            }
+            last = (points)[i];
+        }
+        if (!((UbMath::greater((points)[0].x2, x22)) ^ flag)) {
+            f = (x22 - (points)[0].x2) / ((points)[0].x2 - last.x2);
+            ps.add(GbPoint3D((points)[0].x1 + ((points)[0].x1 - last.x1) * f, x22,
+                             (points)[0].x3 + ((points)[0].x3 - last.x3) * f));
+        }
+
+        points = ps.getPoints();
+        n      = (int)points.size();
+
+        if (n == 0)
+            return NULL;
+    }
+    /*-------------------------------------------------------------------*/
+    /*  Schneiden an linker Kante                                        */
+    /*                                                                   */
+    if (UbMath::less(ps.getX1Minimum(), x11)) {
+        ps.clear();
+        last = (points)[0];
+        if (UbMath::less((points)[0].x1, x11))
+            flag = false;
+        else {
+            ps.add((points)[0]);
+            flag = true;
+        }
+        for (i = 1; i < n; i++) {
+            if (UbMath::less((points)[i].x1, x11)) {
+                if (flag) {
+                    f = (x11 - (points)[i].x1) / ((points)[i].x1 - last.x1);
+                    ps.add(GbPoint3D(x11, (points)[i].x2 + ((points)[i].x2 - last.x2) * f,
+                                     (points)[i].x3 + ((points)[i].x3 - last.x3) * f));
+                }
+                flag = false;
+            } else {
+                if (!flag) {
+                    f = (x11 - (points)[i].x1) / ((points)[i].x1 - last.x1);
+                    ps.add(GbPoint3D(x11, (points)[i].x2 + ((points)[i].x2 - last.x2) * f,
+                                     (points)[i].x3 + ((points)[i].x3 - last.x3) * f));
+                }
+                ps.add((points)[i]);
+                flag = true;
+            }
+            last = (points)[i];
+        }
+        if (!((UbMath::less((points)[0].x1, x11)) ^ flag)) {
+            f = (x11 - (points)[0].x1) / ((points)[0].x1 - last.x1);
+            ps.add(GbPoint3D(x11, (points)[0].x2 + ((points)[0].x2 - last.x2) * f,
+                             (points)[0].x3 + ((points)[0].x3 - last.x3) * f));
+        }
+
+        points = ps.getPoints();
+        n      = (int)points.size();
+
+        if (n == 0)
+            return NULL;
+    }
+    /*-------------------------------------------------------------------*/
+    return new GbPolygon3D(points);
 }
 /*=========================================================================*/
-GbCuboid3D* GbSystem3D::clipRectangle3D(GbPoint3D& p1, GbPoint3D& p2, double x11, double x12, double x13, double x21, double x22, double x23)
+GbCuboid3D *GbSystem3D::clipRectangle3D(GbPoint3D &p1, GbPoint3D &p2, double x11, double x12, double x13, double x21,
+                                        double x22, double x23)
 {
-   double r11 = p1.x1;
-   double r12 = p1.x2;
-   double r13 = p1.x3;
-   double r21 = p2.x1;
-   double r22 = p2.x2;
-   double r23 = p2.x3;
-
-   if(UbMath::greater(x11, x21)) { double ax = x11; x11 = x21; x21 = ax; }
-   if(UbMath::greater(x12, x22)) { double ay = x12; x12 = x22; x22 = ay; }
-   if(UbMath::greater(x13, x23)) { double az = x13; x13 = x23; x23 = az; }
-   if(UbMath::greater(r11, r21)) { double bx = r11; r11 = r21; r21 = bx; }
-   if(UbMath::greater(r12, r22)) { double by = r12; r12 = r22; r22 = by; }
-   if(UbMath::greater(r13, r23)) { double bz = r13; r13 = r23; r23 = bz; }
-
-   double m11 = UbMath::greater(x11, r11) ? x11 : r11;
-   double m12 = UbMath::greater(x12, r12) ? x12 : r12;
-   double m13 = UbMath::greater(x13, r13) ? x13 : r13;
-   double m21 = UbMath::greater(x21, r21) ? r21 : x21;
-   double m22 = UbMath::greater(x22, r22) ? r22 : x22;
-   double m23 = UbMath::greater(x23, r23) ? r23 : x23;
-
-   if(UbMath::lessEqual(m11, m21) && UbMath::lessEqual(m12, m22) && UbMath::lessEqual(m13, m23)) 
-      return(new GbCuboid3D(new GbPoint3D(m11, m12, m13), new GbPoint3D(m21, m22, m23)));
-   else  
-      return(NULL);
+    double r11 = p1.x1;
+    double r12 = p1.x2;
+    double r13 = p1.x3;
+    double r21 = p2.x1;
+    double r22 = p2.x2;
+    double r23 = p2.x3;
+
+    if (UbMath::greater(x11, x21)) {
+        double ax = x11;
+        x11       = x21;
+        x21       = ax;
+    }
+    if (UbMath::greater(x12, x22)) {
+        double ay = x12;
+        x12       = x22;
+        x22       = ay;
+    }
+    if (UbMath::greater(x13, x23)) {
+        double az = x13;
+        x13       = x23;
+        x23       = az;
+    }
+    if (UbMath::greater(r11, r21)) {
+        double bx = r11;
+        r11       = r21;
+        r21       = bx;
+    }
+    if (UbMath::greater(r12, r22)) {
+        double by = r12;
+        r12       = r22;
+        r22       = by;
+    }
+    if (UbMath::greater(r13, r23)) {
+        double bz = r13;
+        r13       = r23;
+        r23       = bz;
+    }
+
+    double m11 = UbMath::greater(x11, r11) ? x11 : r11;
+    double m12 = UbMath::greater(x12, r12) ? x12 : r12;
+    double m13 = UbMath::greater(x13, r13) ? x13 : r13;
+    double m21 = UbMath::greater(x21, r21) ? r21 : x21;
+    double m22 = UbMath::greater(x22, r22) ? r22 : x22;
+    double m23 = UbMath::greater(x23, r23) ? r23 : x23;
+
+    if (UbMath::lessEqual(m11, m21) && UbMath::lessEqual(m12, m22) && UbMath::lessEqual(m13, m23))
+        return (new GbCuboid3D(new GbPoint3D(m11, m12, m13), new GbPoint3D(m21, m22, m23)));
+    else
+        return (NULL);
 }
 
 /*=========================================================================*/
 /*=========================================================================*/
 /*=========================================================================*/
 
-
 GbSystem3D::PointSet3::PointSet3(int n)
 {
-   this->init();
-   this->points.reserve(n); //reserves n elements! but the size of the vector ist still "0"
+    this->init();
+    this->points.reserve(n); // reserves n elements! but the size of the vector ist still "0"
 }
 /*=======================================================*/
-GbSystem3D::PointSet3::PointSet3(const vector<GbPoint3D>& points)
+GbSystem3D::PointSet3::PointSet3(const vector<GbPoint3D> &points)
 {
-   this->init();
-   this->add(points);
+    this->init();
+    this->add(points);
 }
 /*=======================================================*/
-void GbSystem3D::PointSet3::add(const GbPoint3D& point)
+void GbSystem3D::PointSet3::add(const GbPoint3D &point)
 {
-   //is point equal to last point in points then return
-   if(!this->points.empty() && point.equals(&this->points.back())) return;    //WHY???
+    // is point equal to last point in points then return
+    if (!this->points.empty() && point.equals(&this->points.back()))
+        return; // WHY???
 
-   //push point to vector
-   this->points.push_back(point);
+    // push point to vector
+    this->points.push_back(point);
 
-   this->consistent = false;
+    this->consistent = false;
 }
 /*=======================================================*/
-void GbSystem3D::PointSet3::addUnequal(const GbPoint3D& point)
+void GbSystem3D::PointSet3::addUnequal(const GbPoint3D &point)
 {
-   if(this->containsEqual(point) > 0) return;
-   
-   this->points.push_back(point);
-   this->consistent = false;
+    if (this->containsEqual(point) > 0)
+        return;
+
+    this->points.push_back(point);
+    this->consistent = false;
 }
 /*=======================================================*/
-void GbSystem3D::PointSet3::add(const vector<GbPoint3D>& pointVector)
+void GbSystem3D::PointSet3::add(const vector<GbPoint3D> &pointVector)
 {
-   for(int pos=0; pos<(int)pointVector.size(); pos++ )
-      this->points.push_back(pointVector[pos]);
+    for (int pos = 0; pos < (int)pointVector.size(); pos++)
+        this->points.push_back(pointVector[pos]);
 
-   this->consistent = false;
+    this->consistent = false;
 }
 /*=======================================================*/
-void GbSystem3D::PointSet3::insert(const GbPoint3D& point, int index)
+void GbSystem3D::PointSet3::insert(const GbPoint3D &point, int index)
 {
-   if(index<0 || index>=(int)this->points.size()) 
-      throw UbException(UB_EXARGS,"index out of range");
+    if (index < 0 || index >= (int)this->points.size())
+        throw UbException(UB_EXARGS, "index out of range");
 
-   //get iterator for index-position
-   vector<GbPoint3D>::iterator pos=this->points.begin();
-   for(int i=1; i<=index; i++) ++pos;
+    // get iterator for index-position
+    vector<GbPoint3D>::iterator pos = this->points.begin();
+    for (int i = 1; i <= index; i++)
+        ++pos;
 
-   //insert point
-   this->points.insert(pos,point);
+    // insert point
+    this->points.insert(pos, point);
 
-   this->consistent    = false;
+    this->consistent = false;
 }
 /*=======================================================*/
-//void delete(GbPoint3D point)
+// void delete(GbPoint3D point)
 //{
 //   for(int i=this.size-1; i>=0; i--) if(this.points[i] == point) this.delete(i);
 //}
 /*=======================================================*/
-//void delete(int index)
+// void delete(int index)
 //{
 //   int j = this.size - index - 1;
 //   if(j > 0) System.arraycopy(this.points, index + 1, this.points, index, j);
@@ -1043,176 +1107,177 @@ void GbSystem3D::PointSet3::insert(const GbPoint3D& point, int index)
 /*=======================================================*/
 void GbSystem3D::PointSet3::clear()
 {
-   //clears points (size==0 but capacity is the old c1)
-   this->points.clear();
-   this->consistent = false;
+    // clears points (size==0 but capacity is the old c1)
+    this->points.clear();
+    this->consistent = false;
 }
 /*=======================================================*/
 void GbSystem3D::PointSet3::clearAndTrim()
 {
-   //clears points (size==0 AND capacity==0)
-   this->points.resize(0);
-   this->consistent = false;
+    // clears points (size==0 AND capacity==0)
+    this->points.resize(0);
+    this->consistent = false;
 }
 /*=======================================================*/
 double GbSystem3D::PointSet3::getX1Minimum()
 {
-   if(!this->consistent) this->calculateValues();
-   return this->x1min;
+    if (!this->consistent)
+        this->calculateValues();
+    return this->x1min;
 }
 /*=======================================================*/
 double GbSystem3D::PointSet3::getX1Maximum()
 {
-   if(!this->consistent) this->calculateValues();
-   return this->x1max;
+    if (!this->consistent)
+        this->calculateValues();
+    return this->x1max;
 }
 /*=======================================================*/
 double GbSystem3D::PointSet3::getX2Minimum()
 {
-   if(!this->consistent) this->calculateValues();
-   return this->x2min;
+    if (!this->consistent)
+        this->calculateValues();
+    return this->x2min;
 }
 /*=======================================================*/
 double GbSystem3D::PointSet3::getX2Maximum()
 {
-   if(!this->consistent) this->calculateValues();
-   return this->x2max;
+    if (!this->consistent)
+        this->calculateValues();
+    return this->x2max;
 }
 /*=======================================================*/
 double GbSystem3D::PointSet3::getX3Minimum()
 {
-   if(!this->consistent) this->calculateValues();
-   return this->x3min;
+    if (!this->consistent)
+        this->calculateValues();
+    return this->x3min;
 }
 /*=======================================================*/
 double GbSystem3D::PointSet3::getX3Maximum()
 {
-   if(!this->consistent) this->calculateValues();
-   return this->x3max;
+    if (!this->consistent)
+        this->calculateValues();
+    return this->x3max;
 }
 /*=======================================================*/
-int GbSystem3D::PointSet3::contains(GbPoint3D* point)
+int GbSystem3D::PointSet3::contains(GbPoint3D *point)
 {
-   //returns number of points which has the same adress (this should be 0 or 1!!!)
-   int n=0;
+    // returns number of points which has the same adress (this should be 0 or 1!!!)
+    int n = 0;
 
-   for(int pos=(int)this->points.size()-1; pos>=0; pos--) 
-      if(&this->points[pos]==point) n++;
+    for (int pos = (int)this->points.size() - 1; pos >= 0; pos--)
+        if (&this->points[pos] == point)
+            n++;
 
-   return n;
+    return n;
 }
 /*=======================================================*/
-int GbSystem3D::PointSet3::containsEqual(const GbPoint3D& point)
+int GbSystem3D::PointSet3::containsEqual(const GbPoint3D &point)
 {
-   //returns number of points which have the same coordinates with point (could be 0,1 or even more)
-   int n=0;
+    // returns number of points which have the same coordinates with point (could be 0,1 or even more)
+    int n = 0;
 
-   for(int pos=(int)this->points.size()-1; pos>=0; pos--) 
-      if(this->points[pos].equals(&point)) n++;
+    for (int pos = (int)this->points.size() - 1; pos >= 0; pos--)
+        if (this->points[pos].equals(&point))
+            n++;
 
-   return n;
+    return n;
 }
 /*=======================================================*/
 bool GbSystem3D::PointSet3::containsLine(GbPoint3D *point1, GbPoint3D *point2)
 {
-   //returns true if pointset has c2 in "this->points"vector  neighboured points 
-   //wich have the same adress as point1 or point2
-   vector<GbPoint3D>::iterator pos1=this->points.begin();
-   vector<GbPoint3D>::iterator pos2;
+    // returns true if pointset has c2 in "this->points"vector  neighboured points
+    // wich have the same adress as point1 or point2
+    vector<GbPoint3D>::iterator pos1 = this->points.begin();
+    vector<GbPoint3D>::iterator pos2;
 
-   for(pos2=pos1++; pos2!=this->points.end(); ++pos2) 
-   {
-      if     (&(*pos1)==point1 && &(*pos2)==point2) return true;
-      else if(&(*pos1)==point2 && &(*pos2)==point1) return true;
+    for (pos2 = pos1++; pos2 != this->points.end(); ++pos2) {
+        if (&(*pos1) == point1 && &(*pos2) == point2)
+            return true;
+        else if (&(*pos1) == point2 && &(*pos2) == point1)
+            return true;
 
-      pos1=pos2;
-   }
+        pos1 = pos2;
+    }
 
-   return false;
+    return false;
 }
 /*=======================================================*/
-bool GbSystem3D::PointSet3::containsEqualLine(const GbPoint3D& point1, const GbPoint3D& point2)
+bool GbSystem3D::PointSet3::containsEqualLine(const GbPoint3D &point1, const GbPoint3D &point2)
 {
-   //returns true if pointset has c2 in "this->points"vector  neighboured points 
-   //wich have the same coordinates as point1 or point2
-   vector<GbPoint3D>::iterator pos1=this->points.begin();
-   vector<GbPoint3D>::iterator pos2;
+    // returns true if pointset has c2 in "this->points"vector  neighboured points
+    // wich have the same coordinates as point1 or point2
+    vector<GbPoint3D>::iterator pos1 = this->points.begin();
+    vector<GbPoint3D>::iterator pos2;
 
-   for(pos2=pos1++; pos2!=this->points.end(); ++pos2) 
-   {
-      if     ((*pos1).equals(&point1) && (*pos2).equals(&point2)) return true;
-      else if((*pos1).equals(&point2) && (*pos2).equals(&point1)) return true;
+    for (pos2 = pos1++; pos2 != this->points.end(); ++pos2) {
+        if ((*pos1).equals(&point1) && (*pos2).equals(&point2))
+            return true;
+        else if ((*pos1).equals(&point2) && (*pos2).equals(&point1))
+            return true;
 
-      pos1=pos2;
-   }
+        pos1 = pos2;
+    }
 
-   return false;
+    return false;
 }
 /*=======================================================*/
-GbPoint3D* GbSystem3D::PointSet3::getPoint(int index)
+GbPoint3D *GbSystem3D::PointSet3::getPoint(int index)
 {
-   if(index<0 || index>=(int)this->points.size()) throw UbException(UB_EXARGS,"index out of range");
-   return &(this->points)[index];
+    if (index < 0 || index >= (int)this->points.size())
+        throw UbException(UB_EXARGS, "index out of range");
+    return &(this->points)[index];
 }
 /*=======================================================*/
-GbPoint3D* GbSystem3D::PointSet3::getFirstPoint()
-{
-   return &(this->points.front());
-}
+GbPoint3D *GbSystem3D::PointSet3::getFirstPoint() { return &(this->points.front()); }
 /*=======================================================*/
-GbPoint3D* GbSystem3D::PointSet3::getLastPoint() 
-{ 
-   return &(this->points.back()); 
-}
+GbPoint3D *GbSystem3D::PointSet3::getLastPoint() { return &(this->points.back()); }
 /*=======================================================*/
-int GbSystem3D::PointSet3::size()
-{ 
-   return (int)this->points.size();      
-}
+int GbSystem3D::PointSet3::size() { return (int)this->points.size(); }
 /*=======================================================*/
 vector<GbPoint3D> GbSystem3D::PointSet3::getPoints()
 {
-   //is this right? it's another effect as at GbPoint3D* getNode(index)!!!
-   //or do we want to have the next uncommented getPoints() funktion
-   return this->points;
+    // is this right? it's another effect as at GbPoint3D* getNode(index)!!!
+    // or do we want to have the next uncommented getPoints() funktion
+    return this->points;
 }
 ///*=======================================================*/
-//vector<GbPoint3D*> GbSystem3D::PointSet3::getPoints()
+// vector<GbPoint3D*> GbSystem3D::PointSet3::getPoints()
 //{
 //   vector<GbPoint3D*> tmp;
 //   for(int pos=0; pos<(int)this->points.size();pos++) tmp.push_back(&this->points[pos]);
-//   
+//
 //   return tmp;
 //}
 /*=======================================================*/
 void GbSystem3D::PointSet3::calculateValues()
 {
-   if(this->points.empty()) 
-   {
-      this->x1min = this->x2min = this->x3min = 0.0;
-      this->x1max = this->x2max = this->x3max = 0.0;
-   }
-   else
-   {
-      this->x1min = (this->points)[0].x1;
-      this->x1max = (this->points)[0].x1;
-      this->x2min = (this->points)[0].x2;
-      this->x2max = (this->points)[0].x2;
-      this->x3min = (this->points)[0].x3;
-      this->x3max = (this->points)[0].x3;
-
-      for(int i=(int)this->points.size()-1; i>0; --i)
-      {
-         if((this->points)[i].x1 < this->x1min) this->x1min = (this->points)[i].x1;
-         if((this->points)[i].x1 > this->x1max) this->x1max = (this->points)[i].x1;
-         if((this->points)[i].x2 < this->x2min) this->x2min = (this->points)[i].x2;
-         if((this->points)[i].x2 > this->x2max) this->x2max = (this->points)[i].x2;
-         if((this->points)[i].x3 < this->x3min) this->x3min = (this->points)[i].x3;
-         if((this->points)[i].x3 > this->x3max) this->x3max = (this->points)[i].x3;
-      }
-   }
-   this->consistent = true;
+    if (this->points.empty()) {
+        this->x1min = this->x2min = this->x3min = 0.0;
+        this->x1max = this->x2max = this->x3max = 0.0;
+    } else {
+        this->x1min = (this->points)[0].x1;
+        this->x1max = (this->points)[0].x1;
+        this->x2min = (this->points)[0].x2;
+        this->x2max = (this->points)[0].x2;
+        this->x3min = (this->points)[0].x3;
+        this->x3max = (this->points)[0].x3;
+
+        for (int i = (int)this->points.size() - 1; i > 0; --i) {
+            if ((this->points)[i].x1 < this->x1min)
+                this->x1min = (this->points)[i].x1;
+            if ((this->points)[i].x1 > this->x1max)
+                this->x1max = (this->points)[i].x1;
+            if ((this->points)[i].x2 < this->x2min)
+                this->x2min = (this->points)[i].x2;
+            if ((this->points)[i].x2 > this->x2max)
+                this->x2max = (this->points)[i].x2;
+            if ((this->points)[i].x3 < this->x3min)
+                this->x3min = (this->points)[i].x3;
+            if ((this->points)[i].x3 > this->x3max)
+                this->x3max = (this->points)[i].x3;
+        }
+    }
+    this->consistent = true;
 }
-
-
-
diff --git a/src/basics/geometry3d/GbSystem3D.h b/src/basics/geometry3d/GbSystem3D.h
index b448335caafc372bdca7ab103b213a631afa8442..239a4c30da2c15d3a07355716c1160e79016f128 100644
--- a/src/basics/geometry3d/GbSystem3D.h
+++ b/src/basics/geometry3d/GbSystem3D.h
@@ -1,28 +1,28 @@
 //=======================================================================================
-// ____          ____    __    ______     __________   __      __       __        __         
-// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |        
-//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |        
-//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |        
-//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____    
-//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|   
-//      \    \  |    |   ________________________________________________________________    
-//       \    \ |    |  |  ______________________________________________________________|   
-//        \    \|    |  |  |         __          __     __     __     ______      _______    
-//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)   
-//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______    
+// ____          ____    __    ______     __________   __      __       __        __
+// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |
+//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |
+//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |
+//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____
+//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|
+//      \    \  |    |   ________________________________________________________________
+//       \    \ |    |  |  ______________________________________________________________|
+//        \    \|    |  |  |         __          __     __     __     ______      _______
+//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)
+//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______
 //           \       |  |  |        |  |_____   |   \_/   |   |  |   |  |_/  /    _____  |
-//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/   
+//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/
 //
-//  This file is part of VirtualFluids. VirtualFluids is free software: you can 
+//  This file is part of VirtualFluids. VirtualFluids is free software: you can
 //  redistribute it and/or modify it under the terms of the GNU General Public
-//  License as published by the Free Software Foundation, either version 3 of 
+//  License as published by the Free Software Foundation, either version 3 of
 //  the License, or (at your option) any later version.
-//  
-//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT 
-//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
-//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License 
+//
+//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT
+//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 //  for more details.
-//  
+//
 //  You should have received a copy of the GNU General Public License along
 //  with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>.
 //
@@ -33,12 +33,12 @@
 #ifndef GBSYSTEM3D_H
 #define GBSYSTEM3D_H
 
-#include <iostream>
 #include <cmath>
+#include <iostream>
 #include <vector>
 
-#include <GbPoint3D.h>
 #include <GbObject3D.h>
+#include <GbPoint3D.h>
 #include <basics/utilities/UbMath.h>
 #include <basics/writer/WbWriter.h>
 
@@ -48,372 +48,393 @@ class GbLine3D;
 
 namespace GbSystem3D
 {
-   extern double       getDistance(const GbPoint3D& p11, const GbPoint3D& p12);
-   extern GbPoint3D*   calculateIntersectionPoint3D(GbPoint3D& p11, GbPoint3D& p12, GbPoint3D& p21, GbPoint3D& p22);
-   extern GbPolygon3D* clipPolygon3D(std::vector<GbPoint3D> points, double x11, double x12, double x13, double x21, double x22, double x23);
-   extern GbLine3D*    createClipLine3D(GbPoint3D& p1, GbPoint3D& p2, double x11, double x12, double x13, double x21, double x22, double x23);
-   extern bool         hasIntersectionPoint3D(GbPoint3D& p11, GbPoint3D& p12, GbPoint3D& p21, GbPoint3D& p22);
-   extern bool         isParallelIn3D(GbPoint3D& p11, GbPoint3D& p12, GbPoint3D& p21, GbPoint3D& p22);
-   extern GbCuboid3D*  clipRectangle3D(GbPoint3D& p1, GbPoint3D& p2, double x11, double x12, double x13, double x21, double x22, double x23);
+extern double getDistance(const GbPoint3D &p11, const GbPoint3D &p12);
+extern GbPoint3D *calculateIntersectionPoint3D(GbPoint3D &p11, GbPoint3D &p12, GbPoint3D &p21, GbPoint3D &p22);
+extern GbPolygon3D *clipPolygon3D(std::vector<GbPoint3D> points, double x11, double x12, double x13, double x21,
+                                  double x22, double x23);
+extern GbLine3D *createClipLine3D(GbPoint3D &p1, GbPoint3D &p2, double x11, double x12, double x13, double x21,
+                                  double x22, double x23);
+extern bool hasIntersectionPoint3D(GbPoint3D &p11, GbPoint3D &p12, GbPoint3D &p21, GbPoint3D &p22);
+extern bool isParallelIn3D(GbPoint3D &p11, GbPoint3D &p12, GbPoint3D &p21, GbPoint3D &p22);
+extern GbCuboid3D *clipRectangle3D(GbPoint3D &p1, GbPoint3D &p2, double x11, double x12, double x13, double x21,
+                                   double x22, double x23);
 
-   /*========================================================================================*/
-   inline static std::string writeGeoObject(GbObject3D* gbobject, const std::string& filename, WbWriter* writer)
-   {
-      std::vector<UbTupleFloat3> nodes;
-      std::vector<UbTupleInt3>   triangles;
-      gbobject->addSurfaceTriangleSet(nodes, triangles);
+/*========================================================================================*/
+inline static std::string writeGeoObject(GbObject3D *gbobject, const std::string &filename, WbWriter *writer)
+{
+    std::vector<UbTupleFloat3> nodes;
+    std::vector<UbTupleInt3> triangles;
+    gbobject->addSurfaceTriangleSet(nodes, triangles);
 
-      std::string outFilename = writer->writeTriangles(filename,nodes,triangles);
-      return outFilename;
-   }
-   //the same as before
-   /*========================================================================================*/
-   inline static std::string writeGeoObject(SPtr<GbObject3D> gbobject, const std::string& filename, WbWriter* writer)
-   {
-      std::vector<UbTupleFloat3> nodes;
-      std::vector<UbTupleInt3>   triangles;
-      gbobject->addSurfaceTriangleSet(nodes, triangles);
+    std::string outFilename = writer->writeTriangles(filename, nodes, triangles);
+    return outFilename;
+}
+// the same as before
+/*========================================================================================*/
+inline static std::string writeGeoObject(SPtr<GbObject3D> gbobject, const std::string &filename, WbWriter *writer)
+{
+    std::vector<UbTupleFloat3> nodes;
+    std::vector<UbTupleInt3> triangles;
+    gbobject->addSurfaceTriangleSet(nodes, triangles);
 
-      std::string outFilename = writer->writeTriangles(filename,nodes,triangles);
-      return outFilename;
-   }
-   /*========================================================================================*/
-   inline static std::vector< std::string > writeGeoObject(GbObject3D*  gbobject, const std::string& filename, std::vector< WbWriter* > writer )
-   {
-      std::vector<UbTupleFloat3> nodes;
-      std::vector<UbTupleInt3>   triangles;
-      gbobject->addSurfaceTriangleSet(nodes, triangles);
+    std::string outFilename = writer->writeTriangles(filename, nodes, triangles);
+    return outFilename;
+}
+/*========================================================================================*/
+inline static std::vector<std::string> writeGeoObject(GbObject3D *gbobject, const std::string &filename,
+                                                      std::vector<WbWriter *> writer)
+{
+    std::vector<UbTupleFloat3> nodes;
+    std::vector<UbTupleInt3> triangles;
+    gbobject->addSurfaceTriangleSet(nodes, triangles);
 
-      std::vector< std::string > outFilenames;
-      for(std::size_t i=0; i<writer.size(); ++i)
-         outFilenames.push_back( writer[i]->writeTriangles(filename,nodes,triangles) );
-      return outFilenames;
-   }
-   /*========================================================================================*/
-   inline static std::string writeGeoObjects(std::vector< GbObject3D* > gbobjects, const std::string& filename, WbWriter* writer)
-   {
-      std::vector<UbTupleFloat3> nodes;
-      std::vector<UbTupleInt3>   triangles;
+    std::vector<std::string> outFilenames;
+    for (std::size_t i = 0; i < writer.size(); ++i)
+        outFilenames.push_back(writer[i]->writeTriangles(filename, nodes, triangles));
+    return outFilenames;
+}
+/*========================================================================================*/
+inline static std::string writeGeoObjects(std::vector<GbObject3D *> gbobjects, const std::string &filename,
+                                          WbWriter *writer)
+{
+    std::vector<UbTupleFloat3> nodes;
+    std::vector<UbTupleInt3> triangles;
 
-      for(std::size_t i=0; i<gbobjects.size(); ++i)
-      {
-         //std::cout<<i<<", "<<gbobjects[i]<<std::endl;
-         gbobjects[i]->addSurfaceTriangleSet(nodes, triangles);
-      }
+    for (std::size_t i = 0; i < gbobjects.size(); ++i) {
+        // std::cout<<i<<", "<<gbobjects[i]<<std::endl;
+        gbobjects[i]->addSurfaceTriangleSet(nodes, triangles);
+    }
 
-      std::string outFilename = writer->writeTriangles(filename,nodes,triangles);
-      return outFilename;
-   }
-   /*========================================================================================*/
+    std::string outFilename = writer->writeTriangles(filename, nodes, triangles);
+    return outFilename;
+}
+/*========================================================================================*/
 
-   //////////////////////////////////////////////////////////////////////////
-   class PointSet3
-   {
-   public:
-      PointSet3(int n);
-      PointSet3(const std::vector<GbPoint3D>& points);
-      ~PointSet3()= default;
-      void   add(const GbPoint3D& point);
-      void   addUnequal(const GbPoint3D& point);
-      void   add(const std::vector<GbPoint3D>& p);
-      int    contains(GbPoint3D* point);
-      void   insert(const GbPoint3D& point, int index);
-      void   clear();
-      void   clearAndTrim();
-      int    containsEqual(const GbPoint3D& point);
-      bool   containsLine(GbPoint3D* point1, GbPoint3D* point2);
-      bool   containsEqualLine(const GbPoint3D& point1, const GbPoint3D& point2);
-      double getX1Minimum();
-      double getX1Maximum();
-      double getX2Minimum();
-      double getX2Maximum();
-      double getX3Minimum();
-      double getX3Maximum();
-      void   calculateValues();
-      int    size();
-      GbPoint3D* getPoint(int index);
-      GbPoint3D* getFirstPoint();
-      GbPoint3D* getLastPoint() ;
-      std::vector<GbPoint3D> getPoints();
+//////////////////////////////////////////////////////////////////////////
+class PointSet3
+{
+public:
+    PointSet3(int n);
+    PointSet3(const std::vector<GbPoint3D> &points);
+    ~PointSet3() = default;
+    void add(const GbPoint3D &point);
+    void addUnequal(const GbPoint3D &point);
+    void add(const std::vector<GbPoint3D> &p);
+    int contains(GbPoint3D *point);
+    void insert(const GbPoint3D &point, int index);
+    void clear();
+    void clearAndTrim();
+    int containsEqual(const GbPoint3D &point);
+    bool containsLine(GbPoint3D *point1, GbPoint3D *point2);
+    bool containsEqualLine(const GbPoint3D &point1, const GbPoint3D &point2);
+    double getX1Minimum();
+    double getX1Maximum();
+    double getX2Minimum();
+    double getX2Maximum();
+    double getX3Minimum();
+    double getX3Maximum();
+    void calculateValues();
+    int size();
+    GbPoint3D *getPoint(int index);
+    GbPoint3D *getFirstPoint();
+    GbPoint3D *getLastPoint();
+    std::vector<GbPoint3D> getPoints();
 
-   private:
-      double    x1min;
-      double    x1max;
-      double    x2min;
-      double    x2max;
-      double    x3min;
-      double    x3max;
-      bool      consistent;
-      std::vector<GbPoint3D> points;
+private:
+    double x1min;
+    double x1max;
+    double x2min;
+    double x2max;
+    double x3min;
+    double x3max;
+    bool consistent;
+    std::vector<GbPoint3D> points;
 
-      void init()
-      {
-         consistent = false;
-         x1min = x2min = x3min = 0.0;
-         x1max = x2max = x3max = 0.0;
-      }
-   };
-   /*=================================================================*/
-   class OldPointSet3
-   {
-   private:
-      int       sizet;
-      double    x1min;
-      double    x1max;
-      double    x2min;
-      double    x2max;
-      double    x3min;
-      double    x3max;
-      bool      consistent;
-      std::vector<GbPoint3D> points;
+    void init()
+    {
+        consistent = false;
+        x1min = x2min = x3min = 0.0;
+        x1max = x2max = x3max = 0.0;
+    }
+};
+/*=================================================================*/
+class OldPointSet3
+{
+private:
+    int sizet;
+    double x1min;
+    double x1max;
+    double x2min;
+    double x2max;
+    double x3min;
+    double x3max;
+    bool consistent;
+    std::vector<GbPoint3D> points;
 
-      void init()
-      {
-         sizet      = 0;
-         x1min      = 0.0;
-         x1max      = 0.0;
-         x2min      = 0.0;
-         x2max      = 0.0;
-         x3min		  = 0.0;
-         x3max      = 0.0;
-         consistent = false;
-         //points   = NULL;
-      };
+    void init()
+    {
+        sizet      = 0;
+        x1min      = 0.0;
+        x1max      = 0.0;
+        x2min      = 0.0;
+        x2max      = 0.0;
+        x3min      = 0.0;
+        x3max      = 0.0;
+        consistent = false;
+        // points   = NULL;
+    };
 
-   public:
-      OldPointSet3(int n)
-      {
-         this->init();
-         this->points.resize(n);
-      }
-      OldPointSet3(std::vector<GbPoint3D> &points)
-      {
-         this->init();
-         this->points.resize(0);//, NULL);
-         this->add(points);
-      };
-      ~OldPointSet3() = default;
-      void add(GbPoint3D point)
-         {
-            if(this->sizet>0 && point.equals(&(this->points)[this->sizet-1])) return;
-            if(this->sizet == (int)this->points.size())
-            {
-               std::vector<GbPoint3D> a;
-               a.resize(1+(this->sizet<<1));
-               for(int u=0; u<this->sizet; u++)  { (a)[u] = (points)[u];	}
-               this->points = a;
+public:
+    OldPointSet3(int n)
+    {
+        this->init();
+        this->points.resize(n);
+    }
+    OldPointSet3(std::vector<GbPoint3D> &points)
+    {
+        this->init();
+        this->points.resize(0); //, NULL);
+        this->add(points);
+    };
+    ~OldPointSet3() = default;
+    void add(GbPoint3D point)
+    {
+        if (this->sizet > 0 && point.equals(&(this->points)[this->sizet - 1]))
+            return;
+        if (this->sizet == (int)this->points.size()) {
+            std::vector<GbPoint3D> a;
+            a.resize(1 + (this->sizet << 1));
+            for (int u = 0; u < this->sizet; u++) {
+                (a)[u] = (points)[u];
             }
-            (this->points)[this->sizet] = point;
-            this->consistent				= false;
-            this->sizet++;
-         }
-         void addUnequal(GbPoint3D *point)
-         {
-            if(this->containsEqual(point) > 0) return;
-            if(this->sizet == (int)this->points.size())
-            {
-               std::vector<GbPoint3D> a;
-               a.resize(1+(this->sizet<<1));
-               for(int u=0; u<this->sizet; u++)  { (a)[u] = (points)[u];	}
-               this->points = a;
+            this->points = a;
+        }
+        (this->points)[this->sizet] = point;
+        this->consistent            = false;
+        this->sizet++;
+    }
+    void addUnequal(GbPoint3D *point)
+    {
+        if (this->containsEqual(point) > 0)
+            return;
+        if (this->sizet == (int)this->points.size()) {
+            std::vector<GbPoint3D> a;
+            a.resize(1 + (this->sizet << 1));
+            for (int u = 0; u < this->sizet; u++) {
+                (a)[u] = (points)[u];
             }
-            (this->points)[this->sizet] = point;
-            this->consistent        = false;
-            this->sizet++;
-         }
-         void add(std::vector<GbPoint3D> &p)
-         {
-            if(this->sizet+p.size() >= this->points.size())
-            {
-               std::vector<GbPoint3D> a;
-               a.resize(this->sizet+p.size());
-               for(int u=0; u<(int)this->points.size(); u++)  { (a)[u] = (this->points)[u];	}
-               this->points = a;
+            this->points = a;
+        }
+        (this->points)[this->sizet] = point;
+        this->consistent            = false;
+        this->sizet++;
+    }
+    void add(std::vector<GbPoint3D> &p)
+    {
+        if (this->sizet + p.size() >= this->points.size()) {
+            std::vector<GbPoint3D> a;
+            a.resize(this->sizet + p.size());
+            for (int u = 0; u < (int)this->points.size(); u++) {
+                (a)[u] = (this->points)[u];
             }
-            int u = this->sizet;// (int)this->points->size();
-            for(int b=0; b<(int)p.size(); b++)			(this->points)[u++] = (p)[b];
-            //u = this->sizet;
-            //for(int b=0; b<(int)p->size(); b++)
-            //	cout<<(this->points)[u++].toString()<<endl;
-            this->consistent  = false;
-            this->sizet      += (int)p.size();
-         };
-         //		void insert(GbPoint3D *point, int index)
-         //      {
-         //	 if(this.size == this.points.length)
-         //	 {
-         //	    GbPoint3D a[] = new GbPoint3D[1+(this.size<<1)];
-         //	    System.arraycopy(this.points, 0, a, 0, this.size);
-         //	    this.points = a;
-         //	 }
-         //	 System.arraycopy(this.points, index, this.points, index+1, this.size-index);
-         //	 this.points[index] = point;
-         //	 this.consistent    = false;
-         //	 this.size++;
-         //      }
-         //      void delete(GbPoint3D point)
-         //      {
-         //	 for(int i=this.size-1; i>=0; i--) if(this.points[i] == point) this.delete(i);
-         //      }
-         //      void delete(int index)
-         //      {
-         //	 int j = this.size - index - 1;
-         //	 if(j > 0) System.arraycopy(this.points, index + 1, this.points, index, j);
-         //	 this.consistent = false;
-         //	 this.size--;
-         //      }
-         void clear()
-         {
-            this->sizet    = 0;
-            this->consistent = false;
-         }
-         void clearAndTrim()
-         {
-            this->sizet       = 0;
-            this->points.resize(0);
-            this->consistent = false;
-         }
+            this->points = a;
+        }
+        int u = this->sizet; // (int)this->points->size();
+        for (int b = 0; b < (int)p.size(); b++)
+            (this->points)[u++] = (p)[b];
+        // u = this->sizet;
+        // for(int b=0; b<(int)p->size(); b++)
+        //	cout<<(this->points)[u++].toString()<<endl;
+        this->consistent = false;
+        this->sizet += (int)p.size();
+    };
+    //		void insert(GbPoint3D *point, int index)
+    //      {
+    //	 if(this.size == this.points.length)
+    //	 {
+    //	    GbPoint3D a[] = new GbPoint3D[1+(this.size<<1)];
+    //	    System.arraycopy(this.points, 0, a, 0, this.size);
+    //	    this.points = a;
+    //	 }
+    //	 System.arraycopy(this.points, index, this.points, index+1, this.size-index);
+    //	 this.points[index] = point;
+    //	 this.consistent    = false;
+    //	 this.size++;
+    //      }
+    //      void delete(GbPoint3D point)
+    //      {
+    //	 for(int i=this.size-1; i>=0; i--) if(this.points[i] == point) this.delete(i);
+    //      }
+    //      void delete(int index)
+    //      {
+    //	 int j = this.size - index - 1;
+    //	 if(j > 0) System.arraycopy(this.points, index + 1, this.points, index, j);
+    //	 this.consistent = false;
+    //	 this.size--;
+    //      }
+    void clear()
+    {
+        this->sizet      = 0;
+        this->consistent = false;
+    }
+    void clearAndTrim()
+    {
+        this->sizet = 0;
+        this->points.resize(0);
+        this->consistent = false;
+    }
 
-         double getX1Minimum()
-         {
-            if(!this->consistent) this->calculateValues();
-            return(this->x1min);
-         }
-         double getX1Maximum()
-         {
-            if(!this->consistent) this->calculateValues();
-            return(this->x1max);
-         }
-         double getX2Minimum()
-         {
-            if(!this->consistent) this->calculateValues();
-            return(this->x2min);
-         }
-         double getX2Maximum()
-         {
-            if(!this->consistent) this->calculateValues();
-            return(this->x2max);
-         }
-         double getX3Minimum()
-         {
-            if(!this->consistent) this->calculateValues();
-            return(this->x3min);
-         }
-         double getX3Maximum()
-         {
-            if(!this->consistent) this->calculateValues();
-            return(this->x3max);
-         }
-         void calculateValues()
-         {
-            this->x1min      = 0.0;
-            this->x1max      = 0.0;
-            this->x2min      = 0.0;
-            this->x2max      = 0.0;
-            this->x3min      = 0.0;
-            this->x3max      = 0.0;
-            this->consistent = true;
+    double getX1Minimum()
+    {
+        if (!this->consistent)
+            this->calculateValues();
+        return (this->x1min);
+    }
+    double getX1Maximum()
+    {
+        if (!this->consistent)
+            this->calculateValues();
+        return (this->x1max);
+    }
+    double getX2Minimum()
+    {
+        if (!this->consistent)
+            this->calculateValues();
+        return (this->x2min);
+    }
+    double getX2Maximum()
+    {
+        if (!this->consistent)
+            this->calculateValues();
+        return (this->x2max);
+    }
+    double getX3Minimum()
+    {
+        if (!this->consistent)
+            this->calculateValues();
+        return (this->x3min);
+    }
+    double getX3Maximum()
+    {
+        if (!this->consistent)
+            this->calculateValues();
+        return (this->x3max);
+    }
+    void calculateValues()
+    {
+        this->x1min      = 0.0;
+        this->x1max      = 0.0;
+        this->x2min      = 0.0;
+        this->x2max      = 0.0;
+        this->x3min      = 0.0;
+        this->x3max      = 0.0;
+        this->consistent = true;
 
-            if(this->sizet == 0) return;
+        if (this->sizet == 0)
+            return;
 
-            this->x1min = (this->points)[0].x1;
-            this->x1max = (this->points)[0].x1;
-            this->x2min = (this->points)[0].x2;
-            this->x2max = (this->points)[0].x2;
-            this->x3min = (this->points)[0].x3;
-            this->x3max = (this->points)[0].x3;
+        this->x1min = (this->points)[0].x1;
+        this->x1max = (this->points)[0].x1;
+        this->x2min = (this->points)[0].x2;
+        this->x2max = (this->points)[0].x2;
+        this->x3min = (this->points)[0].x3;
+        this->x3max = (this->points)[0].x3;
 
-            for(int i=this->sizet-1; i>0; i--)
-            {
-               if((this->points)[i].x1 < this->x1min) this->x1min = (this->points)[i].x1;
-               if((this->points)[i].x1 > this->x1max) this->x1max = (this->points)[i].x1;
-               if((this->points)[i].x2 < this->x2min) this->x2min = (this->points)[i].x2;
-               if((this->points)[i].x2 > this->x2max) this->x2max = (this->points)[i].x2;
-               if((this->points)[i].x3 < this->x3min) this->x3min = (this->points)[i].x3;
-               if((this->points)[i].x3 > this->x3max) this->x3max = (this->points)[i].x3;
-            }
-         };
+        for (int i = this->sizet - 1; i > 0; i--) {
+            if ((this->points)[i].x1 < this->x1min)
+                this->x1min = (this->points)[i].x1;
+            if ((this->points)[i].x1 > this->x1max)
+                this->x1max = (this->points)[i].x1;
+            if ((this->points)[i].x2 < this->x2min)
+                this->x2min = (this->points)[i].x2;
+            if ((this->points)[i].x2 > this->x2max)
+                this->x2max = (this->points)[i].x2;
+            if ((this->points)[i].x3 < this->x3min)
+                this->x3min = (this->points)[i].x3;
+            if ((this->points)[i].x3 > this->x3max)
+                this->x3max = (this->points)[i].x3;
+        }
+    };
 
-         int contains(GbPoint3D *point)
-         {
-            int n = 0;
-            for(int i=this->sizet-1; i>=0; i--) if(&(this->points)[i] == point) n++;
-            return(n);
-         };
-         int containsEqual(GbPoint3D *point)
-         {
-            int n = 0;
-            for(int i=this->sizet-1; i>=0; i--) if((this->points)[i].equals(point)) n++;
-            return(n);
-         }
-         bool containsLine(GbPoint3D *point1, GbPoint3D *point2)
-         {
-            for(int i=this->sizet-1; i>=0; i--) if(&(this->points)[i] == point1)
-            {
-               if(i == 0)
-               {
-                  if(&(this->points)[i+1]           == point2) return(true);
-                  if(&(this->points)[this->sizet-1] == point2) return(true);
-               }
-               else if(i == this->sizet-1)
-               {
-                  if(&(this->points)[0]   == point2) return(true);
-                  if(&(this->points)[i-1] == point2) return(true);
-               }
-               else
-               {
-                  if(&(this->points)[i+1] == point2) return(true);
-                  if(&(this->points)[i-1] == point2) return(true);
-               }
+    int contains(GbPoint3D *point)
+    {
+        int n = 0;
+        for (int i = this->sizet - 1; i >= 0; i--)
+            if (&(this->points)[i] == point)
+                n++;
+        return (n);
+    };
+    int containsEqual(GbPoint3D *point)
+    {
+        int n = 0;
+        for (int i = this->sizet - 1; i >= 0; i--)
+            if ((this->points)[i].equals(point))
+                n++;
+        return (n);
+    }
+    bool containsLine(GbPoint3D *point1, GbPoint3D *point2)
+    {
+        for (int i = this->sizet - 1; i >= 0; i--)
+            if (&(this->points)[i] == point1) {
+                if (i == 0) {
+                    if (&(this->points)[i + 1] == point2)
+                        return (true);
+                    if (&(this->points)[this->sizet - 1] == point2)
+                        return (true);
+                } else if (i == this->sizet - 1) {
+                    if (&(this->points)[0] == point2)
+                        return (true);
+                    if (&(this->points)[i - 1] == point2)
+                        return (true);
+                } else {
+                    if (&(this->points)[i + 1] == point2)
+                        return (true);
+                    if (&(this->points)[i - 1] == point2)
+                        return (true);
+                }
             }
-            return(false);
-         };
-         //      boolean containsEqualLine(GbPoint2D point1, GbPoint2D point2)
-         //      {
-         //	 for(int i=this.size-1; i>=0; i--) if(this.points[i].equals(point1))
-         //	 {
-         //	    if(i == 0)
-         //	    {
-         //	       if(this.points[i+1].equals(point2))         return(true);
-         //	       if(this.points[this.size-1].equals(point2)) return(true);
-         //	    }
-         //	    else if(i == this.size-1)
-         //	    {
-         //	       if(this.points[0].equals(point2))   return(true);
-         //	       if(this.points[i-1].equals(point2)) return(true);
-         //	    }
-         //	    else
-         //	    {
-         //	       if(this.points[i+1].equals(point2)) return(true);
-         //	       if(this.points[i-1].equals(point2)) return(true);
-         //	    }
-         //	 }
-         //	 return(false);
-         //      }
-         GbPoint3D *getPoint(int index)
-         {
-            return(&(this->points)[index]);
-         }
-         GbPoint3D *getFirstPoint()
-         {
-            return(&(this->points)[0]);
-         }
-         GbPoint3D *getLastPoint() { return(&(this->points)[this->sizet-1]); }
-         int size()                { return(this->sizet);      }
-         std::vector<GbPoint3D> getPoints()
-         {
-            points.resize(sizet);
-            return points;
-            //int l = this->sizet;
-            //if(l > 1 && (this->points)[0].equals(&(this->points)[l-1])) l--;
+        return (false);
+    };
+    //      boolean containsEqualLine(GbPoint2D point1, GbPoint2D point2)
+    //      {
+    //	 for(int i=this.size-1; i>=0; i--) if(this.points[i].equals(point1))
+    //	 {
+    //	    if(i == 0)
+    //	    {
+    //	       if(this.points[i+1].equals(point2))         return(true);
+    //	       if(this.points[this.size-1].equals(point2)) return(true);
+    //	    }
+    //	    else if(i == this.size-1)
+    //	    {
+    //	       if(this.points[0].equals(point2))   return(true);
+    //	       if(this.points[i-1].equals(point2)) return(true);
+    //	    }
+    //	    else
+    //	    {
+    //	       if(this.points[i+1].equals(point2)) return(true);
+    //	       if(this.points[i-1].equals(point2)) return(true);
+    //	    }
+    //	 }
+    //	 return(false);
+    //      }
+    GbPoint3D *getPoint(int index) { return (&(this->points)[index]); }
+    GbPoint3D *getFirstPoint() { return (&(this->points)[0]); }
+    GbPoint3D *getLastPoint() { return (&(this->points)[this->sizet - 1]); }
+    int size() { return (this->sizet); }
+    std::vector<GbPoint3D> getPoints()
+    {
+        points.resize(sizet);
+        return points;
+        // int l = this->sizet;
+        // if(l > 1 && (this->points)[0].equals(&(this->points)[l-1])) l--;
 
-            //vector<GbPoint3D*> *a = new vector<GbPoint3D*>;
-            //a->resize(l, NULL);
-            //for(int u=0; u<l; u++)  { (*a)[u] = &((points)[u]);	}
-            //return(a);
-         }
-      };
-      /*=================================================================*/
-}
+        // vector<GbPoint3D*> *a = new vector<GbPoint3D*>;
+        // a->resize(l, NULL);
+        // for(int u=0; u<l; u++)  { (*a)[u] = &((points)[u]);	}
+        // return(a);
+    }
+};
+/*=================================================================*/
+} // namespace GbSystem3D
 
-#endif //GBSYSTEM3D_H
+#endif // GBSYSTEM3D_H
diff --git a/src/basics/geometry3d/GbTriFaceMesh3D.cpp b/src/basics/geometry3d/GbTriFaceMesh3D.cpp
index e883f59564efb02bfc9729e04d7652da55eb2002..61940c0d7a4bfaaf62ac51556ead5ca1573383fe 100644
--- a/src/basics/geometry3d/GbTriFaceMesh3D.cpp
+++ b/src/basics/geometry3d/GbTriFaceMesh3D.cpp
@@ -1,176 +1,178 @@
 
 #include <geometry3d/GbTriFaceMesh3D.h>
 
-#include <geometry3d/GbCuboid3D.h>
-#include <geometry3d/GbHalfSpace3D.h>
-#include <geometry3d/CoordinateTransformation3D.h>
+#include <basics/utilities/UbFileInputASCII.h>
+#include <basics/utilities/UbLogger.h>
 #include <basics/utilities/UbRandom.h>
 #include <basics/utilities/UbTiming.h>
-#include <basics/utilities/UbLogger.h>
-#include <basics/utilities/UbFileInputASCII.h>
 #include <basics/writer/WbWriter.h>
+#include <geometry3d/CoordinateTransformation3D.h>
+#include <geometry3d/GbCuboid3D.h>
+#include <geometry3d/GbHalfSpace3D.h>
 
 #include <geometry3d/KdTree/KdTree.h>
-#include <geometry3d/KdTree/splitalgorithms/KdSpatiallMedianSplit.h>
-#include <geometry3d/KdTree/splitalgorithms/KdSAHSplit.h>
 #include <geometry3d/KdTree/intersectionhandler/KdCountLineIntersectionHandler.h>
 #include <geometry3d/KdTree/intersectionhandler/KdCountRayIntersectionHandler.h>
+#include <geometry3d/KdTree/splitalgorithms/KdSAHSplit.h>
+#include <geometry3d/KdTree/splitalgorithms/KdSpatiallMedianSplit.h>
 
 #define MAX_ITER 10
 
 using namespace std;
 
-GbTriFaceMesh3D::GbTriFaceMesh3D() 
-   :   GbObject3D()
+GbTriFaceMesh3D::GbTriFaceMesh3D() : GbObject3D()
 {
-   this->setName("CAB_GbTriFaceMesh3D");
-   this->nodes          = new vector<Vertex>;
-   this->triangles      = new vector<TriFace>;
-   this->consistent     = false;
-   this->kdtreeSplitAlg = KDTREE_SAHPLIT;
+    this->setName("CAB_GbTriFaceMesh3D");
+    this->nodes          = new vector<Vertex>;
+    this->triangles      = new vector<TriFace>;
+    this->consistent     = false;
+    this->kdtreeSplitAlg = KDTREE_SAHPLIT;
 }
 /*=======================================================================*/
-GbTriFaceMesh3D::GbTriFaceMesh3D(string name, vector<Vertex>* nodes, vector<TriFace>* triangles, KDTREE_SPLITAGORITHM splitAlg, bool removeRedundantNodes)
-   :  GbObject3D()
-    , nodes(nodes)
-    , triangles(triangles)
-    , kdtreeSplitAlg(splitAlg)
+GbTriFaceMesh3D::GbTriFaceMesh3D(string name, vector<Vertex> *nodes, vector<TriFace> *triangles,
+                                 KDTREE_SPLITAGORITHM splitAlg, bool removeRedundantNodes)
+    : GbObject3D(), nodes(nodes), triangles(triangles), kdtreeSplitAlg(splitAlg)
 {
-   if( name.empty() ) throw UbException(UB_EXARGS,"no name specified");
-   if( !nodes       ) throw UbException(UB_EXARGS,"no nodes specified");
-   if( !triangles   ) throw UbException(UB_EXARGS,"no triangles specified");
-
-   this->setName(name);
-
-   if(removeRedundantNodes)
-   {
-      this->deleteRedundantNodes(); //dort wird autoamtisch calculateValues() aufgerufen
-   }
-   else
-   {
-      this->calculateValues();
-   }
+    if (name.empty())
+        throw UbException(UB_EXARGS, "no name specified");
+    if (!nodes)
+        throw UbException(UB_EXARGS, "no nodes specified");
+    if (!triangles)
+        throw UbException(UB_EXARGS, "no triangles specified");
+
+    this->setName(name);
+
+    if (removeRedundantNodes) {
+        this->deleteRedundantNodes(); // dort wird autoamtisch calculateValues() aufgerufen
+    } else {
+        this->calculateValues();
+    }
 }
 /*=======================================================================*/
 GbTriFaceMesh3D::~GbTriFaceMesh3D()
 {
-   if( nodes     ) { delete nodes;     nodes     = NULL; }
-   if( triangles ) { delete triangles; triangles = NULL; }
-   if( kdTree    ) { delete kdTree;    kdTree    = NULL; }
+    if (nodes) {
+        delete nodes;
+        nodes = NULL;
+    }
+    if (triangles) {
+        delete triangles;
+        triangles = NULL;
+    }
+    if (kdTree) {
+        delete kdTree;
+        kdTree = NULL;
+    }
 }
 /*======================================================================*/
 void GbTriFaceMesh3D::init()
 {
-   nodes      = NULL;
-   triangles  = NULL;
-   x1min      = 0.0;
-   x1max      = 0.0;
-   x1center   = 0.0;
-   x2min      = 0.0;
-   x2max      = 0.0;
-   x2center   = 0.0;
-   x3min      = 0.0;
-   x3max      = 0.0;
-   x3center   = 0.0;
-   consistent = false;
+    nodes      = NULL;
+    triangles  = NULL;
+    x1min      = 0.0;
+    x1max      = 0.0;
+    x1center   = 0.0;
+    x2min      = 0.0;
+    x2max      = 0.0;
+    x2center   = 0.0;
+    x3min      = 0.0;
+    x3max      = 0.0;
+    x3center   = 0.0;
+    consistent = false;
 }
 /*======================================================================*/
-GbTriFaceMesh3D* GbTriFaceMesh3D::clone()
+GbTriFaceMesh3D *GbTriFaceMesh3D::clone()
 {
-   vector<GbTriFaceMesh3D::Vertex>    *newNodes     = new vector<GbTriFaceMesh3D::Vertex>;
-   vector<GbTriFaceMesh3D::TriFace>   *newTriangles = new vector<GbTriFaceMesh3D::TriFace>;
-
-   int numberNodes = (int)this->nodes->size();
-
-   double x,y,z;
-   for(int u=0;u<numberNodes;u++)
-   {
-      x=(*nodes)[u].x;
-      y=(*nodes)[u].y;
-      z=(*nodes)[u].z;
-      newNodes->push_back(GbTriFaceMesh3D::Vertex((float)x,(float)y,(float)z));
-   }
-   int numberTris  = (int)this->triangles->size();
-   UBLOG(logDEBUG1,"numberTris:"<<numberTris);
-
-   int id1,id2,id3;
-   for(int u=0;u<numberTris;u++)
-   {
-      id1 = (*this->triangles)[u].v1;
-      id2 = (*this->triangles)[u].v2;
-      id3 = (*this->triangles)[u].v3;
-      newTriangles->push_back(GbTriFaceMesh3D::TriFace(id1,id2,id3));
-      //cout<<u<<" - id1,id2,id3:"<<id1<<","<<id2<<","<<id3<<endl;
-   }
-   UBLOG(logDEBUG1,"Tris gelesen");
-
-   GbTriFaceMesh3D* mesh = new GbTriFaceMesh3D("no name", newNodes, newTriangles);
-   UBLOG(logDEBUG1,"mesh cloned ...");
-
-   return mesh;
+    vector<GbTriFaceMesh3D::Vertex> *newNodes      = new vector<GbTriFaceMesh3D::Vertex>;
+    vector<GbTriFaceMesh3D::TriFace> *newTriangles = new vector<GbTriFaceMesh3D::TriFace>;
+
+    int numberNodes = (int)this->nodes->size();
+
+    double x, y, z;
+    for (int u = 0; u < numberNodes; u++) {
+        x = (*nodes)[u].x;
+        y = (*nodes)[u].y;
+        z = (*nodes)[u].z;
+        newNodes->push_back(GbTriFaceMesh3D::Vertex((float)x, (float)y, (float)z));
+    }
+    int numberTris = (int)this->triangles->size();
+    UBLOG(logDEBUG1, "numberTris:" << numberTris);
+
+    int id1, id2, id3;
+    for (int u = 0; u < numberTris; u++) {
+        id1 = (*this->triangles)[u].v1;
+        id2 = (*this->triangles)[u].v2;
+        id3 = (*this->triangles)[u].v3;
+        newTriangles->push_back(GbTriFaceMesh3D::TriFace(id1, id2, id3));
+        // cout<<u<<" - id1,id2,id3:"<<id1<<","<<id2<<","<<id3<<endl;
+    }
+    UBLOG(logDEBUG1, "Tris gelesen");
+
+    GbTriFaceMesh3D *mesh = new GbTriFaceMesh3D("no name", newNodes, newTriangles);
+    UBLOG(logDEBUG1, "mesh cloned ...");
+
+    return mesh;
 }
 
 /*======================================================================*/
-//checks for doppelt nodes und fixed Dreicke die zweimal denselben Knoten haben
+// checks for doppelt nodes und fixed Dreicke die zweimal denselben Knoten haben
 void GbTriFaceMesh3D::deleteRedundantNodes()
 {
-    UBLOG(logDEBUG1,"GbTriFaceMesh3D::deleteRedundantNodes - Nodes before deleting redundant: "<<this->nodes->size());
-
-    map<Vertex,size_t/*new vecIndex*/> vertexMap;
-    map<Vertex,size_t/*new vecIndex*/>::iterator pos;
-    map<Vertex,size_t/*new vecIndex*/>::iterator it;
-    
-    vector<TriFace>& tris     = *this->triangles;
-    vector<Vertex>&  oldNodes = *this->nodes;
-    vector<Vertex>   newNodes;
-
-    for(size_t t=0; t<tris.size(); t++)
-    {
-       if(t%100==0) { UBLOG(logDEBUG5,"GbTriFaceMesh3D::deleteRedundantNodes - tri: "<<(t)<<" von "<<tris.size()); }
-       TriFace& tri = tris[t];
-       //Knoten bereits in neuem node vector?
-       for(int v=0; v<=2; v++)
-       {
-          Vertex& vert = tri.getNode(v,oldNodes);
-          //pos=vertexMap.find( vert );
-          //if( pos==vertexMap.end() )
-          {
-             for(pos=vertexMap.begin();pos!=vertexMap.end();pos++)
-             {
-               Vertex rhs = pos->first;
-             //if(UbMath::inClosedInterval(vert.z,0.01999, 0.02001))
-               if ( fabs(vert.x-rhs.x)<1.E-5 && fabs(vert.y-rhs.y)<1.E-5 && fabs(vert.z-rhs.z)<1.E-5 )
-               {
-                  break;
-               }
-             }
-          }
-          if( pos!=vertexMap.end() ) tri.setNode(v, (int)pos->second);
-          else
-          {
-             newNodes.push_back(vert);
-             int index = (int)newNodes.size()-1;
-             vertexMap[vert] = index;                       
-             tri.setNode(v,index);
-          }
-       }
+    UBLOG(logDEBUG1,
+          "GbTriFaceMesh3D::deleteRedundantNodes - Nodes before deleting redundant: " << this->nodes->size());
+
+    map<Vertex, size_t /*new vecIndex*/> vertexMap;
+    map<Vertex, size_t /*new vecIndex*/>::iterator pos;
+    map<Vertex, size_t /*new vecIndex*/>::iterator it;
+
+    vector<TriFace> &tris    = *this->triangles;
+    vector<Vertex> &oldNodes = *this->nodes;
+    vector<Vertex> newNodes;
+
+    for (size_t t = 0; t < tris.size(); t++) {
+        if (t % 100 == 0) {
+            UBLOG(logDEBUG5, "GbTriFaceMesh3D::deleteRedundantNodes - tri: " << (t) << " von " << tris.size());
+        }
+        TriFace &tri = tris[t];
+        // Knoten bereits in neuem node vector?
+        for (int v = 0; v <= 2; v++) {
+            Vertex &vert = tri.getNode(v, oldNodes);
+            // pos=vertexMap.find( vert );
+            // if( pos==vertexMap.end() )
+            {
+                for (pos = vertexMap.begin(); pos != vertexMap.end(); pos++) {
+                    Vertex rhs = pos->first;
+                    // if(UbMath::inClosedInterval(vert.z,0.01999, 0.02001))
+                    if (fabs(vert.x - rhs.x) < 1.E-5 && fabs(vert.y - rhs.y) < 1.E-5 && fabs(vert.z - rhs.z) < 1.E-5) {
+                        break;
+                    }
+                }
+            }
+            if (pos != vertexMap.end())
+                tri.setNode(v, (int)pos->second);
+            else {
+                newNodes.push_back(vert);
+                int index       = (int)newNodes.size() - 1;
+                vertexMap[vert] = index;
+                tri.setNode(v, index);
+            }
+        }
     }
 
-    std::swap(*nodes,newNodes);
+    std::swap(*nodes, newNodes);
 
-    UBLOG(logDEBUG1,"GbTriFaceMesh3D::deleteRedundantNodes - Nodes after deleting redundant:"<<this->nodes->size());
+    UBLOG(logDEBUG1, "GbTriFaceMesh3D::deleteRedundantNodes - Nodes after deleting redundant:" << this->nodes->size());
     //
-    //Das geht irgendwie nicht ...
+    // Das geht irgendwie nicht ...
     //
-    //UBLOG(logDEBUG1,"GbTriFaceMesh3D::deleteRedundantNodes - checking for double triangles !!!");
-    //UBLOG(logDEBUG1,"GbTriFaceMesh3D::deleteRedundantNodes - Triangles before deleting redundant: "<<this->triangles->size());
-    //vector<TriFace> newSingleTris;
-    //newSingleTris.reserve( this->triangles->size() );
-    //for(size_t t=0; t<tris.size(); t++)
+    // UBLOG(logDEBUG1,"GbTriFaceMesh3D::deleteRedundantNodes - checking for double triangles !!!");
+    // UBLOG(logDEBUG1,"GbTriFaceMesh3D::deleteRedundantNodes - Triangles before deleting redundant:
+    // "<<this->triangles->size()); vector<TriFace> newSingleTris; newSingleTris.reserve( this->triangles->size() );
+    // for(size_t t=0; t<tris.size(); t++)
     //{
-    //   Vertex& v1 = tris[t].getNode(0,*nodes); 
-    //   Vertex& v2 = tris[t].getNode(1,*nodes); 
-    //   Vertex& v3 = tris[t].getNode(2,*nodes); 
+    //   Vertex& v1 = tris[t].getNode(0,*nodes);
+    //   Vertex& v2 = tris[t].getNode(1,*nodes);
+    //   Vertex& v3 = tris[t].getNode(2,*nodes);
 
     //   if(UbMath::greater(std::fabs(v1.x), 0.0634) && UbMath::inClosedInterval(v1.z, 0.01999, 0.02001))
     //   {
@@ -188,9 +190,9 @@ void GbTriFaceMesh3D::deleteRedundantNodes()
     //   bool inList = false;
     //   for(size_t u=0; u<newSingleTris.size(); u++)
     //   {
-    //      Vertex& vn1 = newSingleTris[t].getNode(0,*nodes); 
-    //      Vertex& vn2 = newSingleTris[t].getNode(1,*nodes); 
-    //      Vertex& vn3 = newSingleTris[t].getNode(2,*nodes); 
+    //      Vertex& vn1 = newSingleTris[t].getNode(0,*nodes);
+    //      Vertex& vn2 = newSingleTris[t].getNode(1,*nodes);
+    //      Vertex& vn3 = newSingleTris[t].getNode(2,*nodes);
 
     //      if(v1==vn1 && v2==vn2 && v3==vn3)      inList = true;
     //      else if(v1==vn1 && v2==vn3 && v3==vn2) inList = true;
@@ -200,393 +202,409 @@ void GbTriFaceMesh3D::deleteRedundantNodes()
     //      else if(v1==vn3 && v2==vn2 && v3==vn1) inList = true;
     //   }
     //   if(!inList) newSingleTris.push_back(tris[t]);
-    //   else 
+    //   else
     //      UBLOG(logDEBUG1,"GbTriFaceMesh3D::deleteRedundantNodes - inList !!!!");
-    
+
     //}
-    //swap(tris,newSingleTris);
+    // swap(tris,newSingleTris);
 
-    //UBLOG(logDEBUG1,"GbTriFaceMesh3D::deleteRedundantNodes - Triangles after deleting redundant:"<<this->triangles->size());
-    UBLOG(logDEBUG1,"GbTriFaceMesh3D::deleteRedundantNodes - checking for triangles that have same node several times or are lines!!!");
+    // UBLOG(logDEBUG1,"GbTriFaceMesh3D::deleteRedundantNodes - Triangles after deleting
+    // redundant:"<<this->triangles->size());
+    UBLOG(logDEBUG1, "GbTriFaceMesh3D::deleteRedundantNodes - checking for triangles that have same node several times "
+                     "or are lines!!!");
     int counter1 = 0;
     int counter2 = 0;
     vector<TriFace> newTris;
-    newTris.reserve( this->triangles->size() );
-    for(size_t t=0; t<tris.size(); t++)
-    {
-       Vertex& v1 = tris[t].getNode(0,*nodes); 
-       Vertex& v2 = tris[t].getNode(1,*nodes); 
-       Vertex& v3 = tris[t].getNode(2,*nodes); 
-       if( v1==v2 || v1==v3 || v2==v3 )
-       {
-          counter1++;
-       }
-       else if( tris[t].getArea(*nodes)<1.0E-8 )
-       {
-          counter2++;
-       }
-       else newTris.push_back(tris[t]);
+    newTris.reserve(this->triangles->size());
+    for (size_t t = 0; t < tris.size(); t++) {
+        Vertex &v1 = tris[t].getNode(0, *nodes);
+        Vertex &v2 = tris[t].getNode(1, *nodes);
+        Vertex &v3 = tris[t].getNode(2, *nodes);
+        if (v1 == v2 || v1 == v3 || v2 == v3) {
+            counter1++;
+        } else if (tris[t].getArea(*nodes) < 1.0E-8) {
+            counter2++;
+        } else
+            newTris.push_back(tris[t]);
     }
-    if(counter1)
-    {
-       UBLOG(logDEBUG1,"GbTriFaceMesh3D::deleteRedundantNodes - ### Warning ###: found and removed  "<<counter1<<" triangle with double nodes!");
+    if (counter1) {
+        UBLOG(logDEBUG1, "GbTriFaceMesh3D::deleteRedundantNodes - ### Warning ###: found and removed  "
+                             << counter1 << " triangle with double nodes!");
     }
-    if(counter2)
-    {
-       UBLOG(logDEBUG1,"GbTriFaceMesh3D::deleteRedundantNodes - ### Warning ###: found and removed  "<<counter2<<" triangle that are lines!") ;
+    if (counter2) {
+        UBLOG(logDEBUG1, "GbTriFaceMesh3D::deleteRedundantNodes - ### Warning ###: found and removed  "
+                             << counter2 << " triangle that are lines!");
     }
-    if(!counter1 && !counter2) { UBLOG(logDEBUG1,"GbTriFaceMesh3D::deleteRedundantNodes - alles gut... nix doppelt"); }
-    else swap(tris,newTris);
-    
-    UBLOG(logDEBUG1,"GbTriFaceMesh3D::deleteRedundantNodes - done" );
+    if (!counter1 && !counter2) {
+        UBLOG(logDEBUG1, "GbTriFaceMesh3D::deleteRedundantNodes - alles gut... nix doppelt");
+    } else
+        swap(tris, newTris);
+
+    UBLOG(logDEBUG1, "GbTriFaceMesh3D::deleteRedundantNodes - done");
     this->calculateValues();
 }
 /*======================================================================*/
-void GbTriFaceMesh3D::setKdTreeSplitAlgorithm(KDTREE_SPLITAGORITHM mode) 
-{ 
-   if(kdTree && mode != this->kdtreeSplitAlg) { delete kdTree; kdTree = NULL; }
-   this->kdtreeSplitAlg = mode; 
+void GbTriFaceMesh3D::setKdTreeSplitAlgorithm(KDTREE_SPLITAGORITHM mode)
+{
+    if (kdTree && mode != this->kdtreeSplitAlg) {
+        delete kdTree;
+        kdTree = NULL;
+    }
+    this->kdtreeSplitAlg = mode;
 }
 /*======================================================================*/
-   /**
-    * Returns a string representation of this triangular mesh.
-    * @return a string representation of this triangular mesh
-    */
+/**
+ * Returns a string representation of this triangular mesh.
+ * @return a string representation of this triangular mesh
+ */
 string GbTriFaceMesh3D::toString()
 {
-	stringstream ss;
-	ss<<"GbTriFaceMesh3D[";
-	ss<<(int)this->triangles->size()<<"-Triangles, "<<(int)this->nodes->size()<<"-Nodes, "<<endl;
-   ss<<"]";
-   return(ss.str());
+    stringstream ss;
+    ss << "GbTriFaceMesh3D[";
+    ss << (int)this->triangles->size() << "-Triangles, " << (int)this->nodes->size() << "-Nodes, " << endl;
+    ss << "]";
+    return (ss.str());
 }
 /**
  * Returns the nodes of this triangular mesh.
  * @return the nodes of this triangular mesh
  */
-vector<GbTriFaceMesh3D::Vertex>* GbTriFaceMesh3D::getNodes()       {  return this->nodes;   }
+vector<GbTriFaceMesh3D::Vertex> *GbTriFaceMesh3D::getNodes() { return this->nodes; }
 /**
  * Returns the triangles of this triangular mesh.
  * @return the triangles of this triangular mesh
  */
-vector<GbTriFaceMesh3D::TriFace>* GbTriFaceMesh3D::getTriangles()  { return this->triangles;  }
+vector<GbTriFaceMesh3D::TriFace> *GbTriFaceMesh3D::getTriangles() { return this->triangles; }
 /**
  * Returns the center x1 coordinate of this triangular mesh.
  * @return the center x1 coordinate of this triangular mesh
  */
 double GbTriFaceMesh3D::getVolume()
 {
-   vector<Vertex>&  vertices = *nodes;
-   vector<TriFace>& tris     = *triangles;
-
-   double x1,x2,x3,y1,y2,y3,z1,z2,z3, G3i;
-   //double rSP1 = 0.0;double rSP2 = 0.0;double rSP3 = 0.0;
-   double volume = 0.0;
-   for(size_t t=0; t<tris.size(); t++)
-   {
-      TriFace& triangle = tris[t];
-      x1     = triangle.getV1x(vertices); y1 = triangle.getV1y(vertices); z1 = triangle.getV1z(vertices);
-      x2     = triangle.getV2x(vertices); y2 = triangle.getV2y(vertices); z2 = triangle.getV2z(vertices);
-      x3     = triangle.getV3x(vertices); y3 = triangle.getV3y(vertices); z3 = triangle.getV3z(vertices);
-      G3i    = x1*(y2*z3-z2*y3)+y1*(z2*x3-x2*z3)+z1*(x2*y3-y2*x3);
-      volume = volume+G3i/6.0;
-   }
-   return volume;
+    vector<Vertex> &vertices = *nodes;
+    vector<TriFace> &tris    = *triangles;
+
+    double x1, x2, x3, y1, y2, y3, z1, z2, z3, G3i;
+    // double rSP1 = 0.0;double rSP2 = 0.0;double rSP3 = 0.0;
+    double volume = 0.0;
+    for (size_t t = 0; t < tris.size(); t++) {
+        TriFace &triangle = tris[t];
+        x1                = triangle.getV1x(vertices);
+        y1                = triangle.getV1y(vertices);
+        z1                = triangle.getV1z(vertices);
+        x2                = triangle.getV2x(vertices);
+        y2                = triangle.getV2y(vertices);
+        z2                = triangle.getV2z(vertices);
+        x3                = triangle.getV3x(vertices);
+        y3                = triangle.getV3y(vertices);
+        z3                = triangle.getV3z(vertices);
+        G3i               = x1 * (y2 * z3 - z2 * y3) + y1 * (z2 * x3 - x2 * z3) + z1 * (x2 * y3 - y2 * x3);
+        volume            = volume + G3i / 6.0;
+    }
+    return volume;
 }
 /*===============================================*/
 UbTupleDouble3 GbTriFaceMesh3D::calculateCenterOfGravity()
 {
-   vector<Vertex>&  vertices = *nodes;
-   vector<TriFace>& tris     = *triangles;
-   
-   double x1,x2,x3,y1,y2,y3,z1,z2,z3;
-   double G3i;
-   double rSP1 = 0.0, rSP2 = 0.0, rSP3 = 0.0, volume = 0.0;
-   
-   for(size_t t=0; t<tris.size(); t++)
-   {
-      TriFace& triangle = tris[t];
-      x1     = triangle.getV1x(vertices); y1 = triangle.getV1y(vertices); z1 = triangle.getV1z(vertices);
-      x2     = triangle.getV2x(vertices); y2 = triangle.getV2y(vertices); z2 = triangle.getV2z(vertices);
-      x3     = triangle.getV3x(vertices); y3 = triangle.getV3y(vertices); z3 = triangle.getV3z(vertices);
-      G3i    = x1*(y2*z3-z2*y3)+y1*(z2*x3-x2*z3)+z1*(x2*y3-y2*x3);
-      volume = volume+G3i/6.0;
-      rSP1   = rSP1+G3i*(x1+x2+x3);
-      rSP2   = rSP2+G3i*(y1+y2+y3);
-      rSP3   = rSP3+G3i*(z1+z2+z3);
-   }
-   rSP1 = rSP1/(24.0*volume);
-   rSP2 = rSP2/(24.0*volume);
-   rSP3 = rSP3/(24.0*volume);
-
-   return  {rSP1, rSP2, rSP3};
+    vector<Vertex> &vertices = *nodes;
+    vector<TriFace> &tris    = *triangles;
+
+    double x1, x2, x3, y1, y2, y3, z1, z2, z3;
+    double G3i;
+    double rSP1 = 0.0, rSP2 = 0.0, rSP3 = 0.0, volume = 0.0;
+
+    for (size_t t = 0; t < tris.size(); t++) {
+        TriFace &triangle = tris[t];
+        x1                = triangle.getV1x(vertices);
+        y1                = triangle.getV1y(vertices);
+        z1                = triangle.getV1z(vertices);
+        x2                = triangle.getV2x(vertices);
+        y2                = triangle.getV2y(vertices);
+        z2                = triangle.getV2z(vertices);
+        x3                = triangle.getV3x(vertices);
+        y3                = triangle.getV3y(vertices);
+        z3                = triangle.getV3z(vertices);
+        G3i               = x1 * (y2 * z3 - z2 * y3) + y1 * (z2 * x3 - x2 * z3) + z1 * (x2 * y3 - y2 * x3);
+        volume            = volume + G3i / 6.0;
+        rSP1              = rSP1 + G3i * (x1 + x2 + x3);
+        rSP2              = rSP2 + G3i * (y1 + y2 + y3);
+        rSP3              = rSP3 + G3i * (z1 + z2 + z3);
+    }
+    rSP1 = rSP1 / (24.0 * volume);
+    rSP2 = rSP2 / (24.0 * volume);
+    rSP3 = rSP3 / (24.0 * volume);
+
+    return { rSP1, rSP2, rSP3 };
 }
 /*===============================================*/
 UbTupleDouble6 GbTriFaceMesh3D::calculateMomentOfInertia(double rhoP)
 {
-   vector<Vertex>& vertices = *nodes;
-
-   double x1,x2,x3,y1,y2,y3,z1,z2,z3;
-   double G3i;
-   double xx,yy,zz,xy,yz,zx;
-   double rSP1 = 0.0;double rSP2 = 0.0;double rSP3 = 0.0;
-   double volume = 0.0;
-   double top11 = 0.0;double top22 = 0.0;double top33 = 0.0;
-   double top12 = 0.0;double top23 = 0.0;double top13 = 0.0;
-   int size = (int)this->triangles->size();
-   for(int u=0; u<size;u++)
-   {
-      TriFace& triangle = (*this->triangles)[u];
-      x1 = triangle.getV1x(vertices); y1 = triangle.getV1y(vertices); z1 = triangle.getV1z(vertices);
-      x2 = triangle.getV2x(vertices); y2 = triangle.getV2y(vertices); z2 = triangle.getV2z(vertices);
-      x3 = triangle.getV3x(vertices); y3 = triangle.getV3y(vertices); z3 = triangle.getV3z(vertices);
-      G3i = x1*(y2*z3-z2*y3)+y1*(z2*x3-x2*z3)+z1*(x2*y3-y2*x3);
-      volume = volume+G3i/6.0;
-      rSP1 = rSP1+G3i*(x1+x2+x3);
-      rSP2 = rSP2+G3i*(y1+y2+y3);
-      rSP3 = rSP3+G3i*(z1+z2+z3);
-   }
-   rSP1 = rSP1/(24.0*volume);
-   rSP2 = rSP2/(24.0*volume);
-   rSP3 = rSP3/(24.0*volume);
-
-   double x1s = 0.0;//rSP1;//0.0;//
-   double x2s = 0.0;//rSP2;//0.0;//
-   double x3s = 0.0;//rSP3;//0.0;//
-
-   for(int u=0; u<size;u++)
-   {
-      TriFace& triangle = (*this->triangles)[u];
-      x1 = triangle.getV1x(vertices)-x1s;
-      y1 = triangle.getV1y(vertices)-x2s;
-      z1 = triangle.getV1z(vertices)-x3s;
-      x2 = triangle.getV2x(vertices)-x1s;
-      y2 = triangle.getV2y(vertices)-x2s;
-      z2 = triangle.getV2z(vertices)-x3s;
-      x3 = triangle.getV3x(vertices)-x1s;
-      y3 = triangle.getV3y(vertices)-x2s;
-      z3 = triangle.getV3z(vertices)-x3s;
-      G3i = x1*(y2*z3-z2*y3)+y1*(z2*x3-x2*z3)+z1*(x2*y3-y2*x3);
-      //rSP1 = rSP1+G3i*(x1+x2+x3)/(24.0*volume);
-      //rSP2 = rSP2+G3i*(y1+y2+y3)/(24.0*volume);
-      //rSP3 = rSP3+G3i*(z1+z2+z3)/(24.0*volume);
-      xx = x1*x1+x2*x2+x3*x3+x1*x2+x2*x3+x3*x1;
-      yy = y1*y1+y2*y2+y3*y3+y1*y2+y2*y3+y3*y1;
-      zz = z1*z1+z2*z2+z3*z3+z1*z2+z2*z3+z3*z1;
-      top11 = top11+(yy+zz)*rhoP*G3i/60.;
-      top22 = top22+(xx+zz)*rhoP*G3i/60.;
-      top33 = top33+(yy+xx)*rhoP*G3i/60.;
-      xy = 2.0*(x1*y1+x2*y2+x3*y3)+x2*y3+x3*y1+x1*y2+x3*y2+x1*y3+x2*y1;
-      yz = 2.0*(y1*z1+y2*z2+y3*z3)+y2*z3+y3*z1+y1*z2+y3*z2+y1*z3+y2*z1;
-      zx = 2.0*(z1*x1+z2*x2+z3*x3)+z2*x3+z3*x1+z1*x2+z3*x2+z1*x3+z2*x1;
-      top12 = top12-xy*rhoP*G3i/120.;
-      top23 = top23-yz*rhoP*G3i/120.;
-      top13 = top13-zx*rhoP*G3i/120.;
-   }
-   //Satz von Steiner ...
-   top11 = top11-rhoP*volume*(rSP2*rSP2+rSP3+rSP3);
-   top22 = top22-rhoP*volume*(rSP3*rSP3+rSP1*rSP1);
-   top33 = top33-rhoP*volume*(rSP1*rSP1+rSP2*rSP2);
-   top12 = top12+rhoP*volume*rSP1*rSP2;
-   top23 = top23+rhoP*volume*rSP2*rSP3;
-   top13 = top13+rhoP*volume*rSP3*rSP1;
-
-   cout<<"Volume:"<<volume<<"\n Traegheitsmomente:\n";
-   cout<<" top11:"<<top11<<" top22:"<<top22<<" top33:"<<top33<<endl;
-   cout<<" top12:"<<top12<<" top23:"<<top23<<" top13:"<<top13<<endl;
-
-   return {top11,top22,top33,top12,top23,top13};
+    vector<Vertex> &vertices = *nodes;
+
+    double x1, x2, x3, y1, y2, y3, z1, z2, z3;
+    double G3i;
+    double xx, yy, zz, xy, yz, zx;
+    double rSP1   = 0.0;
+    double rSP2   = 0.0;
+    double rSP3   = 0.0;
+    double volume = 0.0;
+    double top11  = 0.0;
+    double top22  = 0.0;
+    double top33  = 0.0;
+    double top12  = 0.0;
+    double top23  = 0.0;
+    double top13  = 0.0;
+    int size      = (int)this->triangles->size();
+    for (int u = 0; u < size; u++) {
+        TriFace &triangle = (*this->triangles)[u];
+        x1                = triangle.getV1x(vertices);
+        y1                = triangle.getV1y(vertices);
+        z1                = triangle.getV1z(vertices);
+        x2                = triangle.getV2x(vertices);
+        y2                = triangle.getV2y(vertices);
+        z2                = triangle.getV2z(vertices);
+        x3                = triangle.getV3x(vertices);
+        y3                = triangle.getV3y(vertices);
+        z3                = triangle.getV3z(vertices);
+        G3i               = x1 * (y2 * z3 - z2 * y3) + y1 * (z2 * x3 - x2 * z3) + z1 * (x2 * y3 - y2 * x3);
+        volume            = volume + G3i / 6.0;
+        rSP1              = rSP1 + G3i * (x1 + x2 + x3);
+        rSP2              = rSP2 + G3i * (y1 + y2 + y3);
+        rSP3              = rSP3 + G3i * (z1 + z2 + z3);
+    }
+    rSP1 = rSP1 / (24.0 * volume);
+    rSP2 = rSP2 / (24.0 * volume);
+    rSP3 = rSP3 / (24.0 * volume);
+
+    double x1s = 0.0; // rSP1;//0.0;//
+    double x2s = 0.0; // rSP2;//0.0;//
+    double x3s = 0.0; // rSP3;//0.0;//
+
+    for (int u = 0; u < size; u++) {
+        TriFace &triangle = (*this->triangles)[u];
+        x1                = triangle.getV1x(vertices) - x1s;
+        y1                = triangle.getV1y(vertices) - x2s;
+        z1                = triangle.getV1z(vertices) - x3s;
+        x2                = triangle.getV2x(vertices) - x1s;
+        y2                = triangle.getV2y(vertices) - x2s;
+        z2                = triangle.getV2z(vertices) - x3s;
+        x3                = triangle.getV3x(vertices) - x1s;
+        y3                = triangle.getV3y(vertices) - x2s;
+        z3                = triangle.getV3z(vertices) - x3s;
+        G3i               = x1 * (y2 * z3 - z2 * y3) + y1 * (z2 * x3 - x2 * z3) + z1 * (x2 * y3 - y2 * x3);
+        // rSP1 = rSP1+G3i*(x1+x2+x3)/(24.0*volume);
+        // rSP2 = rSP2+G3i*(y1+y2+y3)/(24.0*volume);
+        // rSP3 = rSP3+G3i*(z1+z2+z3)/(24.0*volume);
+        xx    = x1 * x1 + x2 * x2 + x3 * x3 + x1 * x2 + x2 * x3 + x3 * x1;
+        yy    = y1 * y1 + y2 * y2 + y3 * y3 + y1 * y2 + y2 * y3 + y3 * y1;
+        zz    = z1 * z1 + z2 * z2 + z3 * z3 + z1 * z2 + z2 * z3 + z3 * z1;
+        top11 = top11 + (yy + zz) * rhoP * G3i / 60.;
+        top22 = top22 + (xx + zz) * rhoP * G3i / 60.;
+        top33 = top33 + (yy + xx) * rhoP * G3i / 60.;
+        xy    = 2.0 * (x1 * y1 + x2 * y2 + x3 * y3) + x2 * y3 + x3 * y1 + x1 * y2 + x3 * y2 + x1 * y3 + x2 * y1;
+        yz    = 2.0 * (y1 * z1 + y2 * z2 + y3 * z3) + y2 * z3 + y3 * z1 + y1 * z2 + y3 * z2 + y1 * z3 + y2 * z1;
+        zx    = 2.0 * (z1 * x1 + z2 * x2 + z3 * x3) + z2 * x3 + z3 * x1 + z1 * x2 + z3 * x2 + z1 * x3 + z2 * x1;
+        top12 = top12 - xy * rhoP * G3i / 120.;
+        top23 = top23 - yz * rhoP * G3i / 120.;
+        top13 = top13 - zx * rhoP * G3i / 120.;
+    }
+    // Satz von Steiner ...
+    top11 = top11 - rhoP * volume * (rSP2 * rSP2 + rSP3 + rSP3);
+    top22 = top22 - rhoP * volume * (rSP3 * rSP3 + rSP1 * rSP1);
+    top33 = top33 - rhoP * volume * (rSP1 * rSP1 + rSP2 * rSP2);
+    top12 = top12 + rhoP * volume * rSP1 * rSP2;
+    top23 = top23 + rhoP * volume * rSP2 * rSP3;
+    top13 = top13 + rhoP * volume * rSP3 * rSP1;
+
+    cout << "Volume:" << volume << "\n Traegheitsmomente:\n";
+    cout << " top11:" << top11 << " top22:" << top22 << " top33:" << top33 << endl;
+    cout << " top12:" << top12 << " top23:" << top23 << " top13:" << top13 << endl;
+
+    return { top11, top22, top33, top12, top23, top13 };
 }
 /*==============================================================*/
 void GbTriFaceMesh3D::calculateValues()
 {
-   relationVertTris.clear();
-
-   if( nodes->empty() )
-   {
-      x1min = x1max = x2min = x2max = x3min = x3max = 0.0;
-   }
-   else
-   {
-      Vertex& v = (*nodes)[0];
-      x1min = x1max = v.x;
-      x2min = x2max = v.y;
-      x3min = x3max = v.z;
-
-      for(size_t i=1; i<this->nodes->size(); i++)
-      {
-         Vertex& v1 = (*nodes)[i];
-         
-         x1min = UbMath::min<double>(x1min,v1.x);
-         x2min = UbMath::min<double>(x2min,v1.y);
-         x3min = UbMath::min<double>(x3min,v1.z);
-         
-         x1max = UbMath::max<double>(x1max,v1.x);
-         x2max = UbMath::max<double>(x2max,v1.y);
-         x3max = UbMath::max<double>(x3max,v1.z);
-      }
-      x1center = 0.5 * (x1min + x1max );
-      x2center = 0.5 * (x2min + x2max );
-      x3center = 0.5 * (x3min + x3max );
-      
-      vector<TriFace>& tris  = *this->triangles;
-      vector<Vertex>&  verts = *this->nodes;
-      for(size_t i=0; i<this->triangles->size(); i++)
-      {
-         tris[i].calculateNormal(verts);
-      }
-      //relation Vertex <-> Triangle ermitteln
-      if(buildVertTriRelationMap)
-      {
-         for(size_t t=0; t<tris.size(); t++)
-         {
-            TriFace& tri = tris[t];
-            relationVertTris.insert( make_pair( &verts[tri.v1], &tri) );
-            relationVertTris.insert( make_pair( &verts[tri.v2], &tri) );
-            relationVertTris.insert( make_pair( &verts[tri.v3], &tri) );
-         }
-      }
-   }
-   if(kdTree)
-   { 
-      delete kdTree; 
-      kdTree=NULL; 
-   }
-   
-   this->consistent = true;
+    relationVertTris.clear();
+
+    if (nodes->empty()) {
+        x1min = x1max = x2min = x2max = x3min = x3max = 0.0;
+    } else {
+        Vertex &v = (*nodes)[0];
+        x1min = x1max = v.x;
+        x2min = x2max = v.y;
+        x3min = x3max = v.z;
+
+        for (size_t i = 1; i < this->nodes->size(); i++) {
+            Vertex &v1 = (*nodes)[i];
+
+            x1min = UbMath::min<double>(x1min, v1.x);
+            x2min = UbMath::min<double>(x2min, v1.y);
+            x3min = UbMath::min<double>(x3min, v1.z);
+
+            x1max = UbMath::max<double>(x1max, v1.x);
+            x2max = UbMath::max<double>(x2max, v1.y);
+            x3max = UbMath::max<double>(x3max, v1.z);
+        }
+        x1center = 0.5 * (x1min + x1max);
+        x2center = 0.5 * (x2min + x2max);
+        x3center = 0.5 * (x3min + x3max);
+
+        vector<TriFace> &tris = *this->triangles;
+        vector<Vertex> &verts = *this->nodes;
+        for (size_t i = 0; i < this->triangles->size(); i++) {
+            tris[i].calculateNormal(verts);
+        }
+        // relation Vertex <-> Triangle ermitteln
+        if (buildVertTriRelationMap) {
+            for (size_t t = 0; t < tris.size(); t++) {
+                TriFace &tri = tris[t];
+                relationVertTris.insert(make_pair(&verts[tri.v1], &tri));
+                relationVertTris.insert(make_pair(&verts[tri.v2], &tri));
+                relationVertTris.insert(make_pair(&verts[tri.v3], &tri));
+            }
+        }
+    }
+    if (kdTree) {
+        delete kdTree;
+        kdTree = NULL;
+    }
+
+    this->consistent = true;
 }
 /*=========================================================================*/
-std::vector<GbTriFaceMesh3D::TriFace*> GbTriFaceMesh3D::getTrianglesForVertex(Vertex* vertex)
+std::vector<GbTriFaceMesh3D::TriFace *> GbTriFaceMesh3D::getTrianglesForVertex(Vertex *vertex)
 {
-   if(!buildVertTriRelationMap) { buildVertTriRelationMap=true; consistent = false;}
-   if(!consistent) this->calculateValues();
+    if (!buildVertTriRelationMap) {
+        buildVertTriRelationMap = true;
+        consistent              = false;
+    }
+    if (!consistent)
+        this->calculateValues();
 
-   typedef std::multimap<Vertex*,TriFace*>::iterator Iterator;
-   pair<Iterator,Iterator> objRange = relationVertTris.equal_range(vertex);
+    typedef std::multimap<Vertex *, TriFace *>::iterator Iterator;
+    pair<Iterator, Iterator> objRange = relationVertTris.equal_range(vertex);
 
-   std::vector<TriFace*> tmpTris;
-   for(Iterator pos=objRange.first; pos!=objRange.second; ++pos) 
-      tmpTris.push_back( pos->second );
+    std::vector<TriFace *> tmpTris;
+    for (Iterator pos = objRange.first; pos != objRange.second; ++pos)
+        tmpTris.push_back(pos->second);
 
-   return tmpTris;
+    return tmpTris;
 }
 /*=======================================================*/
-void GbTriFaceMesh3D::setCenterCoordinates(const double& x1, const double& x2, const double& x3) 
+void GbTriFaceMesh3D::setCenterCoordinates(const double &x1, const double &x2, const double &x3)
 {
-   this->translate(x1-getX1Centroid(), x2-getX2Centroid(), x3-getX3Centroid() );
+    this->translate(x1 - getX1Centroid(), x2 - getX2Centroid(), x3 - getX3Centroid());
 }
 
 /*======================================================================*/
-void GbTriFaceMesh3D::scale(const double& sx1, const double& sx2, const double& sx3)
+void GbTriFaceMesh3D::scale(const double &sx1, const double &sx2, const double &sx3)
 {
-   CoordinateTransformation3D trafoForw(this->getX1Centroid(), this->getX2Centroid(), this->getX3Centroid(), 1.0, 1.0, 1.0, 0.0, 0.0, 0.0);
-   CoordinateTransformation3D trafoBack(this->getX1Centroid(), this->getX2Centroid(), this->getX3Centroid(), sx1, sx2, sx3, 0, 0, 0);
-
-   vector<Vertex>& vertices = *nodes;
-   for(size_t i=0; i<vertices.size(); i++)
-   {
-      Vertex& v = vertices[i];
-      double p1x1 = trafoForw.transformForwardToX1Coordinate(v.x, v.y, v.z);
-      double p1x2 = trafoForw.transformForwardToX2Coordinate(v.x, v.y, v.z);
-      double p1x3 = trafoForw.transformForwardToX3Coordinate(v.x, v.y, v.z);
-      v.x = (float)trafoBack.transformBackwardToX1Coordinate(p1x1, p1x2, p1x3);
-      v.y = (float)trafoBack.transformBackwardToX2Coordinate(p1x1, p1x2, p1x3);
-      v.z = (float)trafoBack.transformBackwardToX3Coordinate(p1x1, p1x2, p1x3);
-   }
-   this->calculateValues();
+    CoordinateTransformation3D trafoForw(this->getX1Centroid(), this->getX2Centroid(), this->getX3Centroid(), 1.0, 1.0,
+                                         1.0, 0.0, 0.0, 0.0);
+    CoordinateTransformation3D trafoBack(this->getX1Centroid(), this->getX2Centroid(), this->getX3Centroid(), sx1, sx2,
+                                         sx3, 0, 0, 0);
+
+    vector<Vertex> &vertices = *nodes;
+    for (size_t i = 0; i < vertices.size(); i++) {
+        Vertex &v   = vertices[i];
+        double p1x1 = trafoForw.transformForwardToX1Coordinate(v.x, v.y, v.z);
+        double p1x2 = trafoForw.transformForwardToX2Coordinate(v.x, v.y, v.z);
+        double p1x3 = trafoForw.transformForwardToX3Coordinate(v.x, v.y, v.z);
+        v.x         = (float)trafoBack.transformBackwardToX1Coordinate(p1x1, p1x2, p1x3);
+        v.y         = (float)trafoBack.transformBackwardToX2Coordinate(p1x1, p1x2, p1x3);
+        v.z         = (float)trafoBack.transformBackwardToX3Coordinate(p1x1, p1x2, p1x3);
+    }
+    this->calculateValues();
 }
 /*======================================================================*/
-void GbTriFaceMesh3D::rotate(const double& alpha, const double& beta, const double& gamma)
+void GbTriFaceMesh3D::rotate(const double &alpha, const double &beta, const double &gamma)
 {
-   CoordinateTransformation3D trafoForw(this->getX1Centroid(), this->getX2Centroid(), this->getX3Centroid(), 1.0, 1.0, 1.0, 0.0, 0.0, 0.0);
-   CoordinateTransformation3D trafoBack(this->getX1Centroid(), this->getX2Centroid(), this->getX3Centroid(), 1.0, 1.0, 1.0, alpha, beta, gamma);
-
-   vector<Vertex>& vertices = *nodes;
-   for(size_t i=0; i<vertices.size(); i++)
-   {
-      Vertex& v = vertices[i];
-      double p1x1 = trafoForw.transformForwardToX1Coordinate(v.x, v.y, v.z);
-      double p1x2 = trafoForw.transformForwardToX2Coordinate(v.x, v.y, v.z);
-      double p1x3 = trafoForw.transformForwardToX3Coordinate(v.x, v.y, v.z);
-      v.x = (float)trafoBack.transformBackwardToX1Coordinate(p1x1, p1x2, p1x3);
-      v.y = (float)trafoBack.transformBackwardToX2Coordinate(p1x1, p1x2, p1x3);
-      v.z = (float)trafoBack.transformBackwardToX3Coordinate(p1x1, p1x2, p1x3);
-   }
-   this->calculateValues();
+    CoordinateTransformation3D trafoForw(this->getX1Centroid(), this->getX2Centroid(), this->getX3Centroid(), 1.0, 1.0,
+                                         1.0, 0.0, 0.0, 0.0);
+    CoordinateTransformation3D trafoBack(this->getX1Centroid(), this->getX2Centroid(), this->getX3Centroid(), 1.0, 1.0,
+                                         1.0, alpha, beta, gamma);
+
+    vector<Vertex> &vertices = *nodes;
+    for (size_t i = 0; i < vertices.size(); i++) {
+        Vertex &v   = vertices[i];
+        double p1x1 = trafoForw.transformForwardToX1Coordinate(v.x, v.y, v.z);
+        double p1x2 = trafoForw.transformForwardToX2Coordinate(v.x, v.y, v.z);
+        double p1x3 = trafoForw.transformForwardToX3Coordinate(v.x, v.y, v.z);
+        v.x         = (float)trafoBack.transformBackwardToX1Coordinate(p1x1, p1x2, p1x3);
+        v.y         = (float)trafoBack.transformBackwardToX2Coordinate(p1x1, p1x2, p1x3);
+        v.z         = (float)trafoBack.transformBackwardToX3Coordinate(p1x1, p1x2, p1x3);
+    }
+    this->calculateValues();
 }
 /*======================================================================*/
-void GbTriFaceMesh3D::rotateAroundPoint(const double& px1, const double& px2, const double& px3, const double& alpha, const double& beta, const double& gamma)
+void GbTriFaceMesh3D::rotateAroundPoint(const double &px1, const double &px2, const double &px3, const double &alpha,
+                                        const double &beta, const double &gamma)
 {
-   CoordinateTransformation3D trafoForw(px1, px2, px3, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0);
-   CoordinateTransformation3D trafoBack(px1, px2, px3, 1.0, 1.0, 1.0, alpha, beta, gamma);
-
-   vector<Vertex>& vertices = *nodes;
-   for(size_t i=0; i<vertices.size(); i++)
-   {
-      Vertex& v = vertices[i];
-      double p1x1 = trafoForw.transformForwardToX1Coordinate(v.x, v.y, v.z);
-      double p1x2 = trafoForw.transformForwardToX2Coordinate(v.x, v.y, v.z);
-      double p1x3 = trafoForw.transformForwardToX3Coordinate(v.x, v.y, v.z);
-      v.x = (float)trafoBack.transformBackwardToX1Coordinate(p1x1, p1x2, p1x3);
-      v.y = (float)trafoBack.transformBackwardToX2Coordinate(p1x1, p1x2, p1x3);
-      v.z = (float)trafoBack.transformBackwardToX3Coordinate(p1x1, p1x2, p1x3);
-   }
-   this->calculateValues();
+    CoordinateTransformation3D trafoForw(px1, px2, px3, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0);
+    CoordinateTransformation3D trafoBack(px1, px2, px3, 1.0, 1.0, 1.0, alpha, beta, gamma);
+
+    vector<Vertex> &vertices = *nodes;
+    for (size_t i = 0; i < vertices.size(); i++) {
+        Vertex &v   = vertices[i];
+        double p1x1 = trafoForw.transformForwardToX1Coordinate(v.x, v.y, v.z);
+        double p1x2 = trafoForw.transformForwardToX2Coordinate(v.x, v.y, v.z);
+        double p1x3 = trafoForw.transformForwardToX3Coordinate(v.x, v.y, v.z);
+        v.x         = (float)trafoBack.transformBackwardToX1Coordinate(p1x1, p1x2, p1x3);
+        v.y         = (float)trafoBack.transformBackwardToX2Coordinate(p1x1, p1x2, p1x3);
+        v.z         = (float)trafoBack.transformBackwardToX3Coordinate(p1x1, p1x2, p1x3);
+    }
+    this->calculateValues();
 }
 
-
 /*======================================================================*/
-void GbTriFaceMesh3D::translate(const double& x1, const double& x2, const double& x3)
+void GbTriFaceMesh3D::translate(const double &x1, const double &x2, const double &x3)
 {
-   vector<Vertex>& vertices = *nodes;
-   for(size_t i=0; i<vertices.size(); i++)
-   {
-      Vertex& v = vertices[i];
-      v.x += static_cast<float>(x1);
-      v.y += static_cast<float>(x2);
-      v.z += static_cast<float>(x3);
-   }
-   this->calculateValues();
+    vector<Vertex> &vertices = *nodes;
+    for (size_t i = 0; i < vertices.size(); i++) {
+        Vertex &v = vertices[i];
+        v.x += static_cast<float>(x1);
+        v.y += static_cast<float>(x2);
+        v.z += static_cast<float>(x3);
+    }
+    this->calculateValues();
 }
 /*======================================================================*/
-vector<GbTriangle3D*> GbTriFaceMesh3D::getSurfaceTriangleSet()
+vector<GbTriangle3D *> GbTriFaceMesh3D::getSurfaceTriangleSet()
 {
-   //SirAnn: eine miese Speicherlochmethode
-   //        hier werden dynmamische Objekte angelegt 
-   //        mit sowas rechnet von aussen kein Mensch!!!
-   vector<GbTriangle3D*> tris( triangles->size() );
-
-   for(size_t i=0; i<this->triangles->size(); i++)
-   {
-      Vertex& v1 = (*nodes)[(*triangles)[i].v1];
-      Vertex& v2 = (*nodes)[(*triangles)[i].v2];
-      Vertex& v3 = (*nodes)[(*triangles)[i].v3];
-
-      tris[i] = new GbTriangle3D(  new GbPoint3D(v1.x,v1.y,v1.z)
-                                 , new GbPoint3D(v2.x,v2.y,v2.z)
-                                 , new GbPoint3D(v3.x,v3.y,v3.z) );
-   }
-   return tris;
+    // SirAnn: eine miese Speicherlochmethode
+    //        hier werden dynmamische Objekte angelegt
+    //        mit sowas rechnet von aussen kein Mensch!!!
+    vector<GbTriangle3D *> tris(triangles->size());
+
+    for (size_t i = 0; i < this->triangles->size(); i++) {
+        Vertex &v1 = (*nodes)[(*triangles)[i].v1];
+        Vertex &v2 = (*nodes)[(*triangles)[i].v2];
+        Vertex &v3 = (*nodes)[(*triangles)[i].v3];
+
+        tris[i] = new GbTriangle3D(new GbPoint3D(v1.x, v1.y, v1.z), new GbPoint3D(v2.x, v2.y, v2.z),
+                                   new GbPoint3D(v3.x, v3.y, v3.z));
+    }
+    return tris;
 }
 /*=======================================================*/
-void GbTriFaceMesh3D::addSurfaceTriangleSet(vector<UbTupleFloat3>& pts, vector<UbTupleInt3>& tris)
+void GbTriFaceMesh3D::addSurfaceTriangleSet(vector<UbTupleFloat3> &pts, vector<UbTupleInt3> &tris)
 {
-   int nodeNr = int(pts.size());
-   for(int i=0; i<(int)this->triangles->size(); i++)
-   {
-      Vertex& v1 = (*nodes)[(*triangles)[i].v1];
-      Vertex& v2 = (*nodes)[(*triangles)[i].v2];
-      Vertex& v3 = (*nodes)[(*triangles)[i].v3];
-      pts.push_back( makeUbTuple(v1.x,v1.y,v1.z));
-      pts.push_back( makeUbTuple(v2.x,v2.y,v2.z));
-      pts.push_back( makeUbTuple(v3.x,v3.y,v3.z));
-
-      tris.push_back( makeUbTuple( nodeNr, nodeNr+1, nodeNr+2 ) );
-      nodeNr+=3;
-   } 
+    int nodeNr = int(pts.size());
+    for (int i = 0; i < (int)this->triangles->size(); i++) {
+        Vertex &v1 = (*nodes)[(*triangles)[i].v1];
+        Vertex &v2 = (*nodes)[(*triangles)[i].v2];
+        Vertex &v3 = (*nodes)[(*triangles)[i].v3];
+        pts.push_back(makeUbTuple(v1.x, v1.y, v1.z));
+        pts.push_back(makeUbTuple(v2.x, v2.y, v2.z));
+        pts.push_back(makeUbTuple(v3.x, v3.y, v3.z));
+
+        tris.push_back(makeUbTuple(nodeNr, nodeNr + 1, nodeNr + 2));
+        nodeNr += 3;
+    }
 }
 /*======================================================================*/
-//bool GbTriFaceMesh3D::isPointInGbObject3D(const double& x1, const double& x2, const double& x3, int counter)
+// bool GbTriFaceMesh3D::isPointInGbObject3D(const double& x1, const double& x2, const double& x3, int counter)
 //{
 //
 //
@@ -597,7 +615,7 @@ void GbTriFaceMesh3D::addSurfaceTriangleSet(vector<UbTupleFloat3>& pts, vector<U
 //      {
 //         UBLOG(logDEBUG3, "GbTriFaceMesh3D::calculateValues - build KdTree start");
 //         UbTimer timer; timer.start();
-//         if(kdtreeSplitAlg == KDTREE_SAHPLIT     ) 
+//         if(kdtreeSplitAlg == KDTREE_SAHPLIT     )
 //         {
 //            UBLOG(logDEBUG3, "GbTriFaceMesh3D::calculateValues - build KdTree with SAHSplit");
 //            this->kdTree = new Kd::Tree<double>( *this, Kd::SAHSplit<double>()            );
@@ -605,7 +623,7 @@ void GbTriFaceMesh3D::addSurfaceTriangleSet(vector<UbTupleFloat3>& pts, vector<U
 //         else if(kdtreeSplitAlg == KDTREE_SPATIALSPLIT)
 //         {
 //            UBLOG(logDEBUG3, "GbTriFaceMesh3D::calculateValues - build KdTree with SpatialMedianSplit");
-//            this->kdTree = new Kd::Tree<double>( *this, Kd::SpatialMedianSplit<double>() ); 
+//            this->kdTree = new Kd::Tree<double>( *this, Kd::SpatialMedianSplit<double>() );
 //         }
 //         else throw UbException(UB_EXARGS, "unknown kdtree split option)" );
 //         UBLOG(logDEBUG3, "GbTriFaceMesh3D::calculateValues - built kdTree in "<<timer.stop()<<"seconds");
@@ -618,10 +636,11 @@ void GbTriFaceMesh3D::addSurfaceTriangleSet(vector<UbTupleFloat3>& pts, vector<U
 //      //   Kd::Ray<double> ray(  x1, x2, x3  //, 1, 0 ,0 );
 //      //                        , ( x1 < x1center ? UbRandom::rand(-1.0,-0.001, 10) : UbRandom::rand(0.001, 1.0, 10) )
 //      //                        , ( x2 < x2center ? UbRandom::rand(-1.0,-0.001, 10) : UbRandom::rand(0.001, 1.0, 10) )
-//      //                        , ( x3 < x3center ? UbRandom::rand(-1.0,-0.001, 10) : UbRandom::rand(0.001, 1.0, 10) ) );
-//      //                        
+//      //                        , ( x3 < x3center ? UbRandom::rand(-1.0,-0.001, 10) : UbRandom::rand(0.001, 1.0, 10) )
+//      );
+//      //
 //      //   iSec = kdTree->intersectRay( ray, Kd::CountRayIntersectionHandler<double>() );
-//      //     
+//      //
 //      //   if( iSec != Kd::Intersection::INTERSECT_EDGE ) //KEINE Kante getroffen
 //      //   {
 //      //      if(iSec == Kd::Intersection::ON_BOUNDARY )
@@ -634,7 +653,7 @@ void GbTriFaceMesh3D::addSurfaceTriangleSet(vector<UbTupleFloat3>& pts, vector<U
 //      //}
 //      //throw UbException(UB_EXARGS, "ups, nach 100 Strahlen immer noch kein Ergebnis");
 //      int iSec1,iSec2;
-//         
+//
 //      Kd::Ray<double> ray1(  x1, x2, x3, 1.0, 0.0 ,0.0 );
 //      iSec1 = kdTree->intersectRay( ray1, Kd::CountRayIntersectionHandler<double>() );
 //      Kd::Ray<double> ray2(  x1, x2, x3, -1.0, 0.0 ,0.0 );
@@ -644,20 +663,20 @@ void GbTriFaceMesh3D::addSurfaceTriangleSet(vector<UbTupleFloat3>& pts, vector<U
 //      {
 //         return true;
 //      }
-//      if( iSec1 == Kd::Intersection::INTERSECT_EDGE && iSec2 == Kd::Intersection::INTERSECT_EDGE) 
+//      if( iSec1 == Kd::Intersection::INTERSECT_EDGE && iSec2 == Kd::Intersection::INTERSECT_EDGE)
 //      {
 //         UBLOG(logINFO, "GbTriFaceMesh3D.isPointInGbObject3D.INTERSECT_EDGE");
 //         double eps = UbMath::getEqualityEpsilon<float>()*1000.0;
 //         if (counter>100) {return(iSec1&1);  UBLOG(logINFO, "NACH 100 Iterationen Eps umsetzen aufgegeben!");}
-//         return this->isPointInGbObject3D(x1+eps, x2+eps, x3+eps,(counter+1)); 
+//         return this->isPointInGbObject3D(x1+eps, x2+eps, x3+eps,(counter+1));
 //      }
 //      else if( iSec1 == Kd::Intersection::INTERSECT_EDGE)
 //      {
-//         return (iSec2&1);  
+//         return (iSec2&1);
 //      }
 //      else if( iSec2 == Kd::Intersection::INTERSECT_EDGE)
 //      {
-//         return (iSec1&1);  
+//         return (iSec1&1);
 //      }
 //      else
 //      {
@@ -675,394 +694,367 @@ void GbTriFaceMesh3D::addSurfaceTriangleSet(vector<UbTupleFloat3>& pts, vector<U
 //   }
 //   return false;
 //}
-bool GbTriFaceMesh3D::isPointInGbObject3D(const double& x1, const double& x2, const double& x3, int counter)
+bool GbTriFaceMesh3D::isPointInGbObject3D(const double &x1, const double &x2, const double &x3, int counter)
 {
 
-   if( !nodes->empty() )
-   {
-      //Baum erstellen, wen noch keiner vorhanden
-      if( !kdTree)
-      {
-         UBLOG(logDEBUG3, "GbTriFaceMesh3D::calculateValues - build KdTree start");
-         UbTimer timer; timer.start();
-         if(kdtreeSplitAlg == KDTREE_SAHPLIT     ) 
-         {
-            UBLOG(logDEBUG3, "GbTriFaceMesh3D::calculateValues - build KdTree with SAHSplit");
-            this->kdTree = new Kd::Tree<double>( *this, Kd::SAHSplit<double>()            );
-         }
-         else if(kdtreeSplitAlg == KDTREE_SPATIALSPLIT)
-         {
-            UBLOG(logDEBUG3, "GbTriFaceMesh3D::calculateValues - build KdTree with SpatialMedianSplit");
-            this->kdTree = new Kd::Tree<double>( *this, Kd::SpatialMedianSplit<double>() ); 
-         }
-         else throw UbException(UB_EXARGS, "unknown kdtree split option)" );
-         UBLOG(logDEBUG3, "GbTriFaceMesh3D::calculateValues - built kdTree in "<<timer.stop()<<"seconds");
-      }
-
-      //eigentlicher PIO-Test
-      //int iSec;
-      //for(int i=0; i<100; i++)
-      //{
-      //   Kd::Ray<double> ray(  x1, x2, x3  //, 1, 0 ,0 );
-      //                        , ( x1 < x1center ? UbRandom::rand(-1.0,-0.001, 10) : UbRandom::rand(0.001, 1.0, 10) )
-      //                        , ( x2 < x2center ? UbRandom::rand(-1.0,-0.001, 10) : UbRandom::rand(0.001, 1.0, 10) )
-      //                        , ( x3 < x3center ? UbRandom::rand(-1.0,-0.001, 10) : UbRandom::rand(0.001, 1.0, 10) ) );
-      //                        
-      //   iSec = kdTree->intersectRay( ray, Kd::CountRayIntersectionHandler<double>() );
-      //     
-      //   if( iSec != Kd::Intersection::INTERSECT_EDGE ) //KEINE Kante getroffen
-      //   {
-      //      if(iSec == Kd::Intersection::ON_BOUNDARY )
-      //      {
-      //         return true;
-      //      }
-      //      return (iSec&1);  //ungerade anzahl an schnitten --> drinnen
-      //   }
-      //   UBLOG(logDEBUG3, "GbTriFaceMesh3D.isPointInGbObject3D.if  - an edge was hit ");
-      //}
-      //throw UbException(UB_EXARGS, "ups, nach 100 Strahlen immer noch kein Ergebnis");
-      int iSec1,iSec2;
-      double eps = 0.05;        
-      Kd::Ray<double> ray1(  x1, x2, x3, 1.0+eps*((double)counter), eps*((double)counter) ,eps*((double)counter) );
-      iSec1 = kdTree->intersectRay( ray1, Kd::CountRayIntersectionHandler<double>() );
-      Kd::Ray<double> ray2(  x1, x2, x3, -1.0-eps*((double)counter), -eps*((double)counter) ,-eps*((double)counter) );
- 
-      iSec2 = kdTree->intersectRay( ray2, Kd::CountRayIntersectionHandler<double>() );
-
-      if(iSec1 == Kd::Intersection::ON_BOUNDARY || iSec2 == Kd::Intersection::ON_BOUNDARY)
-      {
-         return true;
-      }
-      if( iSec1 == Kd::Intersection::INTERSECT_EDGE && iSec2 == Kd::Intersection::INTERSECT_EDGE) 
-      {
-         //UBLOG(logINFO, "GbTriFaceMesh3D.isPointInGbObject3D.INTERSECT_EDGE");
-
-         if (counter>20) {return(iSec1&1);  /*UBLOG(logINFO, "NACH 100 Iterationen Eps umsetzen aufgegeben!");*/}
-         return this->isPointInGbObject3D(x1, x2, x3,(counter+1)); 
-      }
-      else if( iSec1 == Kd::Intersection::INTERSECT_EDGE)
-      {
-         return (iSec2&1);  
-      }
-      else if( iSec2 == Kd::Intersection::INTERSECT_EDGE)
-      {
-         return (iSec1&1);  
-      }
-      else
-      {
-         if((iSec1&1) != (iSec2&1))
-         {
-            //UBLOG(logINFO, "GbTriFaceMesh3D.isPointInGbObject3D.iSec1&1 != iSec2&1");
-
-            if (counter>20) {return(iSec1&1); /* UBLOG(logINFO, "NACH 100 Iterationen Eps umsetzen aufgegeben!");*/}
-            return this->isPointInGbObject3D(x1, x2, x3,(counter+1));
-         }
-         return iSec1&1;
-      }
-      //throw UbException(UB_EXARGS, "ups, nach 100 Strahlen immer noch kein Ergebnis");
-
-   }
-   return false;
+    if (!nodes->empty()) {
+        // Baum erstellen, wen noch keiner vorhanden
+        if (!kdTree) {
+            UBLOG(logDEBUG3, "GbTriFaceMesh3D::calculateValues - build KdTree start");
+            UbTimer timer;
+            timer.start();
+            if (kdtreeSplitAlg == KDTREE_SAHPLIT) {
+                UBLOG(logDEBUG3, "GbTriFaceMesh3D::calculateValues - build KdTree with SAHSplit");
+                this->kdTree = new Kd::Tree<double>(*this, Kd::SAHSplit<double>());
+            } else if (kdtreeSplitAlg == KDTREE_SPATIALSPLIT) {
+                UBLOG(logDEBUG3, "GbTriFaceMesh3D::calculateValues - build KdTree with SpatialMedianSplit");
+                this->kdTree = new Kd::Tree<double>(*this, Kd::SpatialMedianSplit<double>());
+            } else
+                throw UbException(UB_EXARGS, "unknown kdtree split option)");
+            UBLOG(logDEBUG3, "GbTriFaceMesh3D::calculateValues - built kdTree in " << timer.stop() << "seconds");
+        }
+
+        // eigentlicher PIO-Test
+        // int iSec;
+        // for(int i=0; i<100; i++)
+        //{
+        //   Kd::Ray<double> ray(  x1, x2, x3  //, 1, 0 ,0 );
+        //                        , ( x1 < x1center ? UbRandom::rand(-1.0,-0.001, 10) : UbRandom::rand(0.001, 1.0, 10) )
+        //                        , ( x2 < x2center ? UbRandom::rand(-1.0,-0.001, 10) : UbRandom::rand(0.001, 1.0, 10) )
+        //                        , ( x3 < x3center ? UbRandom::rand(-1.0,-0.001, 10) : UbRandom::rand(0.001, 1.0, 10) )
+        //                        );
+        //
+        //   iSec = kdTree->intersectRay( ray, Kd::CountRayIntersectionHandler<double>() );
+        //
+        //   if( iSec != Kd::Intersection::INTERSECT_EDGE ) //KEINE Kante getroffen
+        //   {
+        //      if(iSec == Kd::Intersection::ON_BOUNDARY )
+        //      {
+        //         return true;
+        //      }
+        //      return (iSec&1);  //ungerade anzahl an schnitten --> drinnen
+        //   }
+        //   UBLOG(logDEBUG3, "GbTriFaceMesh3D.isPointInGbObject3D.if  - an edge was hit ");
+        //}
+        // throw UbException(UB_EXARGS, "ups, nach 100 Strahlen immer noch kein Ergebnis");
+        int iSec1, iSec2;
+        double eps = 0.05;
+        Kd::Ray<double> ray1(x1, x2, x3, 1.0 + eps * ((double)counter), eps * ((double)counter),
+                             eps * ((double)counter));
+        iSec1 = kdTree->intersectRay(ray1, Kd::CountRayIntersectionHandler<double>());
+        Kd::Ray<double> ray2(x1, x2, x3, -1.0 - eps * ((double)counter), -eps * ((double)counter),
+                             -eps * ((double)counter));
+
+        iSec2 = kdTree->intersectRay(ray2, Kd::CountRayIntersectionHandler<double>());
+
+        if (iSec1 == Kd::Intersection::ON_BOUNDARY || iSec2 == Kd::Intersection::ON_BOUNDARY) {
+            return true;
+        }
+        if (iSec1 == Kd::Intersection::INTERSECT_EDGE && iSec2 == Kd::Intersection::INTERSECT_EDGE) {
+            // UBLOG(logINFO, "GbTriFaceMesh3D.isPointInGbObject3D.INTERSECT_EDGE");
+
+            if (counter > 20) {
+                return (iSec1 & 1); /*UBLOG(logINFO, "NACH 100 Iterationen Eps umsetzen aufgegeben!");*/
+            }
+            return this->isPointInGbObject3D(x1, x2, x3, (counter + 1));
+        } else if (iSec1 == Kd::Intersection::INTERSECT_EDGE) {
+            return (iSec2 & 1);
+        } else if (iSec2 == Kd::Intersection::INTERSECT_EDGE) {
+            return (iSec1 & 1);
+        } else {
+            if ((iSec1 & 1) != (iSec2 & 1)) {
+                // UBLOG(logINFO, "GbTriFaceMesh3D.isPointInGbObject3D.iSec1&1 != iSec2&1");
+
+                if (counter > 20) {
+                    return (iSec1 & 1); /* UBLOG(logINFO, "NACH 100 Iterationen Eps umsetzen aufgegeben!");*/
+                }
+                return this->isPointInGbObject3D(x1, x2, x3, (counter + 1));
+            }
+            return iSec1 & 1;
+        }
+        // throw UbException(UB_EXARGS, "ups, nach 100 Strahlen immer noch kein Ergebnis");
+    }
+    return false;
 }
 /*======================================================================*/
-bool GbTriFaceMesh3D::isPointInGbObject3D(const double& x1, const double& x2, const double& x3)
+bool GbTriFaceMesh3D::isPointInGbObject3D(const double &x1, const double &x2, const double &x3)
 {
-   if( !nodes->empty() )
-   {
-      //Baum erstellen, wen noch keiner vorhanden
-      if( !kdTree)
-      {
-         UBLOG(logDEBUG3, "GbTriFaceMesh3D::calculateValues - build KdTree start");
-         UbTimer timer; timer.start();
-         if(kdtreeSplitAlg == KDTREE_SAHPLIT     ) 
-         {
-            UBLOG(logDEBUG3, "GbTriFaceMesh3D::calculateValues - build KdTree with SAHSplit");
-            cout << "GbTriFaceMesh3D::calculateValues - build KdTree with SAHSplit" << std::endl;
-            this->kdTree = new Kd::Tree<double>( *this, Kd::SAHSplit<double>()            );
-         }
-         else if(kdtreeSplitAlg == KDTREE_SPATIALSPLIT)
-         {
-            UBLOG(logDEBUG3, "GbTriFaceMesh3D::calculateValues - build KdTree with SpatialMedianSplit");
-            this->kdTree = new Kd::Tree<double>( *this, Kd::SpatialMedianSplit<double>() ); 
-         }
-         else throw UbException(UB_EXARGS, "unknown kdtree split option)" );
-         UBLOG(logDEBUG3, "GbTriFaceMesh3D::calculateValues - built kdTree in "<<timer.stop()<<"seconds");
-         cout << "GbTriFaceMesh3D::calculateValues - built kdTree in " << timer.stop() << "seconds" << std::endl;
-      }
-
-      //eigentlicher PIO-Test
-      int iSec;
-      for(int i=0; i<MAX_ITER; i++)
-      {
-         Kd::Ray<double> ray(  x1, x2, x3  //, 1, 0 ,0 );
-                              , ( x1 < x1center ? UbRandom::rand(-1.0,-0.001, 10) : UbRandom::rand(0.001, 1.0, 10) )
-                              , ( x2 < x2center ? UbRandom::rand(-1.0,-0.001, 10) : UbRandom::rand(0.001, 1.0, 10) )
-                              , ( x3 < x3center ? UbRandom::rand(-1.0,-0.001, 10) : UbRandom::rand(0.001, 1.0, 10) ) );
-                              
-         iSec = kdTree->intersectRay( ray, Kd::CountRayIntersectionHandler<double>() );
-           
-         if( iSec != Kd::Intersection::INTERSECT_EDGE ) //KEINE Kante getroffen
-         {
-            if(iSec == Kd::Intersection::ON_BOUNDARY )
+    if (!nodes->empty()) {
+        // Baum erstellen, wen noch keiner vorhanden
+        if (!kdTree) {
+            UBLOG(logDEBUG3, "GbTriFaceMesh3D::calculateValues - build KdTree start");
+            UbTimer timer;
+            timer.start();
+            if (kdtreeSplitAlg == KDTREE_SAHPLIT) {
+                UBLOG(logDEBUG3, "GbTriFaceMesh3D::calculateValues - build KdTree with SAHSplit");
+                cout << "GbTriFaceMesh3D::calculateValues - build KdTree with SAHSplit" << std::endl;
+                this->kdTree = new Kd::Tree<double>(*this, Kd::SAHSplit<double>());
+            } else if (kdtreeSplitAlg == KDTREE_SPATIALSPLIT) {
+                UBLOG(logDEBUG3, "GbTriFaceMesh3D::calculateValues - build KdTree with SpatialMedianSplit");
+                this->kdTree = new Kd::Tree<double>(*this, Kd::SpatialMedianSplit<double>());
+            } else
+                throw UbException(UB_EXARGS, "unknown kdtree split option)");
+            UBLOG(logDEBUG3, "GbTriFaceMesh3D::calculateValues - built kdTree in " << timer.stop() << "seconds");
+            cout << "GbTriFaceMesh3D::calculateValues - built kdTree in " << timer.stop() << "seconds" << std::endl;
+        }
+
+        // eigentlicher PIO-Test
+        int iSec;
+        for (int i = 0; i < MAX_ITER; i++) {
+            Kd::Ray<double> ray(x1, x2, x3 //, 1, 0 ,0 );
+                                ,
+                                (x1 < x1center ? UbRandom::rand(-1.0, -0.001, 10) : UbRandom::rand(0.001, 1.0, 10)),
+                                (x2 < x2center ? UbRandom::rand(-1.0, -0.001, 10) : UbRandom::rand(0.001, 1.0, 10)),
+                                (x3 < x3center ? UbRandom::rand(-1.0, -0.001, 10) : UbRandom::rand(0.001, 1.0, 10)));
+
+            iSec = kdTree->intersectRay(ray, Kd::CountRayIntersectionHandler<double>());
+
+            if (iSec != Kd::Intersection::INTERSECT_EDGE) // KEINE Kante getroffen
             {
-               return true;
+                if (iSec == Kd::Intersection::ON_BOUNDARY) {
+                    return true;
+                }
+                return (iSec & 1); // ungerade anzahl an schnitten --> drinnen
             }
-            return (iSec&1);  //ungerade anzahl an schnitten --> drinnen
-         }
-         UBLOG(logDEBUG3, "GbTriFaceMesh3D.isPointInGbObject3D.if  - an edge was hit ");
-      }
-      throw UbException(UB_EXARGS, "ups, nach 100 Strahlen immer noch kein Ergebnis");
-
-   //   int iSec1,iSec2;
-   //      
-   //   Kd::Ray<double> ray1(  x1, x2, x3, 1.0, 0.0 ,0.0 );
-   //   iSec1 = kdTree->intersectRay( ray1, Kd::CountRayIntersectionHandler<double>() );
-   //   Kd::Ray<double> ray2(  x1, x2, x3, -1.0, 0.0 ,0.0 );
-   //   iSec2 = kdTree->intersectRay( ray2, Kd::CountRayIntersectionHandler<double>() );
-
-   //   if(iSec1 == Kd::Intersection::ON_BOUNDARY || iSec2 == Kd::Intersection::ON_BOUNDARY)
-   //   {
-   //      return true;
-   //   }
-   //   if( iSec1 == Kd::Intersection::INTERSECT_EDGE && iSec2 == Kd::Intersection::INTERSECT_EDGE) 
-   //   {
-   //      //UBLOG(logINFO, "GbTriFaceMesh3D.isPointInGbObject3D.INTERSECT_EDGE");
-   //      double eps = UbMath::getEqualityEpsilon<double>();
-   //      if (counter>100) {return(iSec1&1);  UBLOG(logINFO, "NACH 100 Iterationen Eps umsetzen aufgegeben!");}
-   //      return this->isPointInGbObject3D(x1+eps, x2+eps, x3+eps,(counter+1)); 
-   //   }
-   //   else if( iSec1 == Kd::Intersection::INTERSECT_EDGE)
-   //   {
-   //      return (iSec2&1);  
-   //   }
-   //   else if( iSec2 == Kd::Intersection::INTERSECT_EDGE)
-   //   {
-   //      return (iSec1&1);  
-   //   }
-   //   else
-   //   {
-   //      if((iSec1&1) != (iSec2&1))
-   //      {
-   //         UBLOG(logINFO, "GbTriFaceMesh3D.isPointInGbObject3D.iSec1&1 != iSec2&1");
-   //         double eps = UbMath::getEqualityEpsilon<double>();
-   //         if (counter>100) {return(iSec1&1);  UBLOG(logINFO, "NACH 100 Iterationen Eps umsetzen aufgegeben!");}
-   //         return this->isPointInGbObject3D(x1+eps, x2+eps, x3+eps,(counter+1));
-   //      }
-   //      return iSec1&1;
-   //   }
-   //   //throw UbException(UB_EXARGS, "ups, nach 100 Strahlen immer noch kein Ergebnis");
-
-   }
-   return false;
+            UBLOG(logDEBUG3, "GbTriFaceMesh3D.isPointInGbObject3D.if  - an edge was hit ");
+        }
+        throw UbException(UB_EXARGS, "ups, nach 100 Strahlen immer noch kein Ergebnis");
+
+        //   int iSec1,iSec2;
+        //
+        //   Kd::Ray<double> ray1(  x1, x2, x3, 1.0, 0.0 ,0.0 );
+        //   iSec1 = kdTree->intersectRay( ray1, Kd::CountRayIntersectionHandler<double>() );
+        //   Kd::Ray<double> ray2(  x1, x2, x3, -1.0, 0.0 ,0.0 );
+        //   iSec2 = kdTree->intersectRay( ray2, Kd::CountRayIntersectionHandler<double>() );
+
+        //   if(iSec1 == Kd::Intersection::ON_BOUNDARY || iSec2 == Kd::Intersection::ON_BOUNDARY)
+        //   {
+        //      return true;
+        //   }
+        //   if( iSec1 == Kd::Intersection::INTERSECT_EDGE && iSec2 == Kd::Intersection::INTERSECT_EDGE)
+        //   {
+        //      //UBLOG(logINFO, "GbTriFaceMesh3D.isPointInGbObject3D.INTERSECT_EDGE");
+        //      double eps = UbMath::getEqualityEpsilon<double>();
+        //      if (counter>100) {return(iSec1&1);  UBLOG(logINFO, "NACH 100 Iterationen Eps umsetzen aufgegeben!");}
+        //      return this->isPointInGbObject3D(x1+eps, x2+eps, x3+eps,(counter+1));
+        //   }
+        //   else if( iSec1 == Kd::Intersection::INTERSECT_EDGE)
+        //   {
+        //      return (iSec2&1);
+        //   }
+        //   else if( iSec2 == Kd::Intersection::INTERSECT_EDGE)
+        //   {
+        //      return (iSec1&1);
+        //   }
+        //   else
+        //   {
+        //      if((iSec1&1) != (iSec2&1))
+        //      {
+        //         UBLOG(logINFO, "GbTriFaceMesh3D.isPointInGbObject3D.iSec1&1 != iSec2&1");
+        //         double eps = UbMath::getEqualityEpsilon<double>();
+        //         if (counter>100) {return(iSec1&1);  UBLOG(logINFO, "NACH 100 Iterationen Eps umsetzen aufgegeben!");}
+        //         return this->isPointInGbObject3D(x1+eps, x2+eps, x3+eps,(counter+1));
+        //      }
+        //      return iSec1&1;
+        //   }
+        //   //throw UbException(UB_EXARGS, "ups, nach 100 Strahlen immer noch kein Ergebnis");
+    }
+    return false;
 }
 /*======================================================================*/
-bool GbTriFaceMesh3D::isPointInGbObject3D(const double& x1, const double& x2, const double& x3, bool& pointIsOnBoundary)
+bool GbTriFaceMesh3D::isPointInGbObject3D(const double &x1, const double &x2, const double &x3, bool &pointIsOnBoundary)
 {
-   if( !nodes->empty() )
-   {
-      //Baum erstellen, wen noch keiner vorhanden
-      if( !kdTree)
-      {
-         UBLOG(logDEBUG3, "GbTriFaceMesh3D::calculateValues - build KdTree start");
-         UbTimer timer; timer.start();
-         if(kdtreeSplitAlg == KDTREE_SAHPLIT     ) 
-         {
-            UBLOG(logDEBUG3, "GbTriFaceMesh3D::calculateValues - build KdTree with SAHSplit");
-            this->kdTree = new Kd::Tree<double>( *this, Kd::SAHSplit<double>()            );
-         }
-         else if(kdtreeSplitAlg == KDTREE_SPATIALSPLIT)
-         {
-            UBLOG(logDEBUG3, "GbTriFaceMesh3D::calculateValues - build KdTree with SpatialMedianSplit");
-            this->kdTree = new Kd::Tree<double>( *this, Kd::SpatialMedianSplit<double>() ); 
-         }
-         else throw UbException(UB_EXARGS, "unknown kdtree split option)" );
-         UBLOG(logDEBUG3, "GbTriFaceMesh3D::calculateValues - built kdTree in "<<timer.stop()<<"seconds");
-      }
-
-      //eigentlicher PIO-Test
-      int iSec;
-      for(int i=0; i<MAX_ITER; i++)
-      {
-         Kd::Ray<double> ray(  x1, x2, x3 
-                            , float( ( x1 < x1center ? UbRandom::rand(-1.0,-0.001, 10) : UbRandom::rand(0.001, 1.0, 10) ) )
-                            , float( ( x2 < x2center ? UbRandom::rand(-1.0,-0.001, 10) : UbRandom::rand(0.001, 1.0, 10) ) )
-                            , float( ( x3 < x3center ? UbRandom::rand(-1.0,-0.001, 10) : UbRandom::rand(0.001, 1.0, 10) ) ) );
-
-         iSec = kdTree->intersectRay( ray, Kd::CountRayIntersectionHandler<double>()    );
-
-         if( iSec != Kd::Intersection::INTERSECT_EDGE ) //KEINE Kante getroffen
-         {
-            if(iSec == Kd::Intersection::ON_BOUNDARY )
+    if (!nodes->empty()) {
+        // Baum erstellen, wen noch keiner vorhanden
+        if (!kdTree) {
+            UBLOG(logDEBUG3, "GbTriFaceMesh3D::calculateValues - build KdTree start");
+            UbTimer timer;
+            timer.start();
+            if (kdtreeSplitAlg == KDTREE_SAHPLIT) {
+                UBLOG(logDEBUG3, "GbTriFaceMesh3D::calculateValues - build KdTree with SAHSplit");
+                this->kdTree = new Kd::Tree<double>(*this, Kd::SAHSplit<double>());
+            } else if (kdtreeSplitAlg == KDTREE_SPATIALSPLIT) {
+                UBLOG(logDEBUG3, "GbTriFaceMesh3D::calculateValues - build KdTree with SpatialMedianSplit");
+                this->kdTree = new Kd::Tree<double>(*this, Kd::SpatialMedianSplit<double>());
+            } else
+                throw UbException(UB_EXARGS, "unknown kdtree split option)");
+            UBLOG(logDEBUG3, "GbTriFaceMesh3D::calculateValues - built kdTree in " << timer.stop() << "seconds");
+        }
+
+        // eigentlicher PIO-Test
+        int iSec;
+        for (int i = 0; i < MAX_ITER; i++) {
+            Kd::Ray<double> ray(
+                x1, x2, x3, float((x1 < x1center ? UbRandom::rand(-1.0, -0.001, 10) : UbRandom::rand(0.001, 1.0, 10))),
+                float((x2 < x2center ? UbRandom::rand(-1.0, -0.001, 10) : UbRandom::rand(0.001, 1.0, 10))),
+                float((x3 < x3center ? UbRandom::rand(-1.0, -0.001, 10) : UbRandom::rand(0.001, 1.0, 10))));
+
+            iSec = kdTree->intersectRay(ray, Kd::CountRayIntersectionHandler<double>());
+
+            if (iSec != Kd::Intersection::INTERSECT_EDGE) // KEINE Kante getroffen
             {
-               pointIsOnBoundary = true;
-               return true;
+                if (iSec == Kd::Intersection::ON_BOUNDARY) {
+                    pointIsOnBoundary = true;
+                    return true;
+                }
+                pointIsOnBoundary = false;
+                return (iSec & 1); // ungerade anzahl an schnitten --> drinnen
             }
-            pointIsOnBoundary = false;
-            return (iSec&1);  //ungerade anzahl an schnitten --> drinnen
-         }
-      }
-
-      throw UbException(UB_EXARGS, "ups, nach 100 Strahlen immer noch kein Ergebnis");
-   }
-   
-   return false;
+        }
+
+        throw UbException(UB_EXARGS, "ups, nach 100 Strahlen immer noch kein Ergebnis");
+    }
+
+    return false;
 }
 /*======================================================================*/
-bool GbTriFaceMesh3D::intersectLine(const double& p1_x1, const double& p1_x2, const double& p1_x3, const double& p2_x1, const double& p2_x2, const double& p2_x3)
+bool GbTriFaceMesh3D::intersectLine(const double &p1_x1, const double &p1_x2, const double &p1_x3, const double &p2_x1,
+                                    const double &p2_x2, const double &p2_x3)
 {
-    //Baum erstellen, wen noch keiner vorhanden
-    if (!kdTree)
-    {
+    // Baum erstellen, wen noch keiner vorhanden
+    if (!kdTree) {
         UBLOG(logDEBUG3, "GbTriFaceMesh3D::calculateValues - build KdTree start");
-        UbTimer timer; timer.start();
-        if (kdtreeSplitAlg == KDTREE_SAHPLIT)
-        {
+        UbTimer timer;
+        timer.start();
+        if (kdtreeSplitAlg == KDTREE_SAHPLIT) {
             UBLOG(logDEBUG3, "GbTriFaceMesh3D::calculateValues - build KdTree with SAHSplit");
             this->kdTree = new Kd::Tree<double>(*this, Kd::SAHSplit<double>());
-        }
-        else if (kdtreeSplitAlg == KDTREE_SPATIALSPLIT)
-        {
+        } else if (kdtreeSplitAlg == KDTREE_SPATIALSPLIT) {
             UBLOG(logDEBUG3, "GbTriFaceMesh3D::calculateValues - build KdTree with SpatialMedianSplit");
             this->kdTree = new Kd::Tree<double>(*this, Kd::SpatialMedianSplit<double>());
-        }
-        else throw UbException(UB_EXARGS, "unknown kdtree split option)");
+        } else
+            throw UbException(UB_EXARGS, "unknown kdtree split option)");
         UBLOG(logDEBUG3, "GbTriFaceMesh3D::calculateValues - built kdTree in " << timer.stop() << "seconds");
     }
 
-    int iSec = kdTree->intersectLine(UbTupleDouble3(p1_x1, p1_x2, p1_x3), UbTupleDouble3(p2_x1, p2_x2, p2_x3), Kd::CountLineIntersectionHandler<double>());
+    int iSec = kdTree->intersectLine(UbTupleDouble3(p1_x1, p1_x2, p1_x3), UbTupleDouble3(p2_x1, p2_x2, p2_x3),
+                                     Kd::CountLineIntersectionHandler<double>());
 
     return (iSec != Kd::Intersection::NO_INTERSECTION);
 }
 /*======================================================================*/
-GbLine3D* GbTriFaceMesh3D::createClippedLine3D (GbPoint3D&  /*point1*/, GbPoint3D&  /*point2*/)
+GbLine3D *GbTriFaceMesh3D::createClippedLine3D(GbPoint3D & /*point1*/, GbPoint3D & /*point2*/)
 {
-   throw UbException(UB_EXARGS,"not implemented");
+    throw UbException(UB_EXARGS, "not implemented");
 }
 
 /*======================================================================*/
-UbTuple<string, string> GbTriFaceMesh3D::writeMesh(string filename, WbWriter* writer, bool writeNormals, vector< string >* datanames, std::vector< std::vector < double > >* nodedata )
+UbTuple<string, string> GbTriFaceMesh3D::writeMesh(string filename, WbWriter *writer, bool writeNormals,
+                                                   vector<string> *datanames,
+                                                   std::vector<std::vector<double>> *nodedata)
 {
-   UBLOG(logINFO, "GbTriFaceMesh3D::writeMesh ");
-
-   vector<UbTupleFloat3 > triNodes(nodes->size());
-   vector<UbTupleInt3 >   tris(triangles->size());
-
-   for(size_t i=0; i<nodes->size(); i++)
-      triNodes[i] = makeUbTuple( (*nodes)[i].x, (*nodes)[i].y, (*nodes)[i].z );
-
-   for(size_t i=0; i<triangles->size(); i++)
-      tris[i] = makeUbTuple( (*triangles)[i].v1, (*triangles)[i].v2, (*triangles)[i].v3 ) ;
-
-   UbTuple<string, string> filenames("","");
-
-   if( !datanames || datanames->empty() || !nodedata  )
-   {
-      val<1>(filenames) = writer->writeTriangles(filename,triNodes,tris);
-   }
-   else
-   {
-      val<1>(filenames) = writer->writeTrianglesWithNodeData(filename,triNodes,tris,*datanames,*nodedata);
-   }
-
-   if(writeNormals)
-   {
-      vector<UbTupleFloat3 > lineNodes(triangles->size()*2);
-      vector<UbTupleInt2 >   lines(triangles->size());
-      for(size_t i=0; i<triangles->size(); i++)
-      {
-         TriFace& triangle = (*triangles)[i];
-         lineNodes[i*2  ] = makeUbTuple( triangle.getX1Centroid(*nodes)
-                                        ,triangle.getX2Centroid(*nodes)
-                                        ,triangle.getX3Centroid(*nodes));
-
-         lineNodes[i*2+1] = makeUbTuple( (float)(triangle.getX1Centroid(*nodes)+1.0*triangle.nx)
-                                        ,(float)(triangle.getX2Centroid(*nodes)+1.0*triangle.ny)
-                                        ,(float)(triangle.getX3Centroid(*nodes)+1.0*triangle.nz));
-
-         lines[i] = makeUbTuple((int)i*2,(int)i*2+1);
-      }
-      val<2>(filenames) = writer->writeLines(filename+"_normals",lineNodes,lines);
-   }
-
-   return filenames;
+    UBLOG(logINFO, "GbTriFaceMesh3D::writeMesh ");
+
+    vector<UbTupleFloat3> triNodes(nodes->size());
+    vector<UbTupleInt3> tris(triangles->size());
+
+    for (size_t i = 0; i < nodes->size(); i++)
+        triNodes[i] = makeUbTuple((*nodes)[i].x, (*nodes)[i].y, (*nodes)[i].z);
+
+    for (size_t i = 0; i < triangles->size(); i++)
+        tris[i] = makeUbTuple((*triangles)[i].v1, (*triangles)[i].v2, (*triangles)[i].v3);
+
+    UbTuple<string, string> filenames("", "");
+
+    if (!datanames || datanames->empty() || !nodedata) {
+        val<1>(filenames) = writer->writeTriangles(filename, triNodes, tris);
+    } else {
+        val<1>(filenames) = writer->writeTrianglesWithNodeData(filename, triNodes, tris, *datanames, *nodedata);
+    }
+
+    if (writeNormals) {
+        vector<UbTupleFloat3> lineNodes(triangles->size() * 2);
+        vector<UbTupleInt2> lines(triangles->size());
+        for (size_t i = 0; i < triangles->size(); i++) {
+            TriFace &triangle = (*triangles)[i];
+            lineNodes[i * 2]  = makeUbTuple(triangle.getX1Centroid(*nodes), triangle.getX2Centroid(*nodes),
+                                           triangle.getX3Centroid(*nodes));
+
+            lineNodes[i * 2 + 1] = makeUbTuple((float)(triangle.getX1Centroid(*nodes) + 1.0 * triangle.nx),
+                                               (float)(triangle.getX2Centroid(*nodes) + 1.0 * triangle.ny),
+                                               (float)(triangle.getX3Centroid(*nodes) + 1.0 * triangle.nz));
+
+            lines[i] = makeUbTuple((int)i * 2, (int)i * 2 + 1);
+        }
+        val<2>(filenames) = writer->writeLines(filename + "_normals", lineNodes, lines);
+    }
+
+    return filenames;
 }
 /*======================================================================*/
-void GbTriFaceMesh3D::writeMeshPly( const std::string& filename)
+void GbTriFaceMesh3D::writeMeshPly(const std::string &filename)
 {
-   ofstream out(filename.c_str() );
-   if( !out )
-      throw UbException(UB_EXARGS, "couldn't open " + filename);
-
-   out << "ply" << endl;
-   out << "format ascii 1.0" << endl;
-   out << "element vertex " << (int)nodes->size() << endl;
-   out << "property float x" << endl;
-   out << "property float y" << endl;
-   out << "property float z" << endl;
-   out << "element face " << (int)triangles->size() << endl;
-   out << "property list uchar int vertex_indices" << endl;
-   out << "end_header" << endl;
-
-   for(size_t i=0; i<nodes->size(); i++)
-      out << (*nodes)[i].x << " " << (*nodes)[i].y << " " << (*nodes)[i].z << endl;
-
-   for(size_t i=0; i<triangles->size(); i++)
-      out << "3 " << (*triangles)[i].v1 << " " << (*triangles)[i].v2 << " " << (*triangles)[i].v3 << endl;
+    ofstream out(filename.c_str());
+    if (!out)
+        throw UbException(UB_EXARGS, "couldn't open " + filename);
+
+    out << "ply" << endl;
+    out << "format ascii 1.0" << endl;
+    out << "element vertex " << (int)nodes->size() << endl;
+    out << "property float x" << endl;
+    out << "property float y" << endl;
+    out << "property float z" << endl;
+    out << "element face " << (int)triangles->size() << endl;
+    out << "property list uchar int vertex_indices" << endl;
+    out << "end_header" << endl;
+
+    for (size_t i = 0; i < nodes->size(); i++)
+        out << (*nodes)[i].x << " " << (*nodes)[i].y << " " << (*nodes)[i].z << endl;
+
+    for (size_t i = 0; i < triangles->size(); i++)
+        out << "3 " << (*triangles)[i].v1 << " " << (*triangles)[i].v2 << " " << (*triangles)[i].v3 << endl;
 }
 /*======================================================================*/
 void GbTriFaceMesh3D::readMeshFromSTLFile(string filename, bool removeRedundantNodes)
 {
-   UBLOG(logDEBUG1,"GbTriFaceMesh3DCreator::readMeshFromSTLFile !!! Dieses Format hat leider redundante Knoten ...");
-
-   UbFileInputASCII in(filename);
-   //this->nodes     = new vector<GbTriFaceMesh3D::Vertex>;
-   //this->triangles = new vector<GbTriFaceMesh3D::TriFace>;
-   string dummy;
-
-   double x, y, z;
-   int nr=0;
-
-   in.readLine();
-   while(dummy!="endsolid")
-   {
-      in.readLine();
-      in.readLine();
-      dummy = in.readString();
-      if(dummy!="vertex") throw UbException(UB_EXARGS,"no vertex format");
-      x=in.readDouble();
-      y=in.readDouble();
-      z=in.readDouble();
-      nodes->push_back(GbTriFaceMesh3D::Vertex((float)x,(float)y,(float)z));
-      in.readLine();
-      in.readString();
-      x=in.readDouble();
-      y=in.readDouble();
-      z=in.readDouble();
-      nodes->push_back(GbTriFaceMesh3D::Vertex((float)x,(float)y,(float)z));
-      in.readLine();
-      in.readString();
-      x=in.readDouble();
-      y=in.readDouble();
-      z=in.readDouble();
-      nodes->push_back(GbTriFaceMesh3D::Vertex((float)x,(float)y,(float)z));
-      triangles->push_back(GbTriFaceMesh3D::TriFace(nr,nr+1,nr+2));
-      in.readLine();
-      in.readLine();
-      in.readLine();
-      dummy = in.readString();
-      nr+=3;
-   }
-   if(removeRedundantNodes)
-   {
-      this->deleteRedundantNodes(); //dort wird autoamtisch calculateValues() aufgerufen
-   }
-   else
-   {
-      this->calculateValues();
-   }
+    UBLOG(logDEBUG1, "GbTriFaceMesh3DCreator::readMeshFromSTLFile !!! Dieses Format hat leider redundante Knoten ...");
+
+    UbFileInputASCII in(filename);
+    // this->nodes     = new vector<GbTriFaceMesh3D::Vertex>;
+    // this->triangles = new vector<GbTriFaceMesh3D::TriFace>;
+    string dummy;
+
+    double x, y, z;
+    int nr = 0;
+
+    in.readLine();
+    while (dummy != "endsolid") {
+        in.readLine();
+        in.readLine();
+        dummy = in.readString();
+        if (dummy != "vertex")
+            throw UbException(UB_EXARGS, "no vertex format");
+        x = in.readDouble();
+        y = in.readDouble();
+        z = in.readDouble();
+        nodes->push_back(GbTriFaceMesh3D::Vertex((float)x, (float)y, (float)z));
+        in.readLine();
+        in.readString();
+        x = in.readDouble();
+        y = in.readDouble();
+        z = in.readDouble();
+        nodes->push_back(GbTriFaceMesh3D::Vertex((float)x, (float)y, (float)z));
+        in.readLine();
+        in.readString();
+        x = in.readDouble();
+        y = in.readDouble();
+        z = in.readDouble();
+        nodes->push_back(GbTriFaceMesh3D::Vertex((float)x, (float)y, (float)z));
+        triangles->push_back(GbTriFaceMesh3D::TriFace(nr, nr + 1, nr + 2));
+        in.readLine();
+        in.readLine();
+        in.readLine();
+        dummy = in.readString();
+        nr += 3;
+    }
+    if (removeRedundantNodes) {
+        this->deleteRedundantNodes(); // dort wird autoamtisch calculateValues() aufgerufen
+    } else {
+        this->calculateValues();
+    }
 }
 //////////////////////////////////////////////////////////////////////////
-//void GbTriFaceMesh3D::writeMeshToSTLFile(string filename, bool isBinaryFormat)
+// void GbTriFaceMesh3D::writeMeshToSTLFile(string filename, bool isBinaryFormat)
 //{
 //   vector<GbTriFaceMesh3D::Vertex>    *nodes     = new vector<GbTriFaceMesh3D::Vertex>;
 //   vector<GbTriFaceMesh3D::TriFace>   *triangles = new vector<GbTriFaceMesh3D::TriFace>;
diff --git a/src/basics/geometry3d/GbTriFaceMesh3D.h b/src/basics/geometry3d/GbTriFaceMesh3D.h
index ec69a7b375b451de3ead1ef99bfbaaffd9226767..5fd77cecac566c143cdc4e692389596c5a86dcac 100644
--- a/src/basics/geometry3d/GbTriFaceMesh3D.h
+++ b/src/basics/geometry3d/GbTriFaceMesh3D.h
@@ -7,10 +7,10 @@
 #ifndef GBTRIFACEMESH3D_H
 #define GBTRIFACEMESH3D_H
 
-#include <sstream>
 #include <iostream>
-#include <vector>
 #include <map>
+#include <sstream>
+#include <vector>
 
 #include <basics/utilities/UbException.h>
 #include <basics/utilities/UbMath.h>
@@ -22,12 +22,15 @@
 
 #include <basics_export.h>
 
-namespace Kd 
-{ 
-   template< typename T>  class Tree; 
-   template< typename T > class SplitAlgorithm;
-   template< typename T > class RayIntersectionHandler;
-}
+namespace Kd
+{
+template <typename T>
+class Tree;
+template <typename T>
+class SplitAlgorithm;
+template <typename T>
+class RayIntersectionHandler;
+} // namespace Kd
 
 class WbWriter;
 
@@ -38,289 +41,367 @@ class WbWriter;
  * This Class provides the triangular meshes.
  * Note, that up to now no methods for checking consistency are included.
  * in this context this class describes facettes from an 3D-object !!!
-*/
+ */
 class BASICS_EXPORT GbTriFaceMesh3D : public GbObject3D
 {
 public:
-  // nested class start
-   class Vertex
-   {
-   public:
-      Vertex()  = default;
-      Vertex(const float& x, const float& y, const float& z) : x(x), y(y),z(z) { }
-      Vertex(Vertex* vert)
-      {
-         this->x = vert->x;
-         this->y = vert->y;
-         this->z = vert->z;
-      }
-      float operator[] (const int&i) const
-      {
-         if     (i==0) return x;
-         else if(i==1) return y;
-         else if(i==2) return z;
-
-         throw UbException(UB_EXARGS,"i not in [0;2]");
-      }
-      float& operator[] (const int& i)
-      {
-         if     (i==0) return x;
-         else if(i==1) return y;
-         else if(i==2) return z;
-
-         throw UbException(UB_EXARGS,"not in [0;2]");
-      }
-      bool operator== (const Vertex& rhs)
-      {
-         return ( fabs(x-rhs.x)<1.E-8 && fabs(y-rhs.y)<1.E-8 && fabs(z-rhs.z)<1.E-8 );
-      }
-      friend inline bool operator<(const Vertex & lhsVert,const Vertex & rhsVert)
-      {
-         if( lhsVert.x < rhsVert.x ) return true;
-         if( lhsVert.x > rhsVert.x ) return false;
-         if( lhsVert.y < rhsVert.y ) return true;
-         if( lhsVert.y > rhsVert.y ) return false;
-         if( lhsVert.z < rhsVert.z ) return true;
-
-         return false;
-      }
-      friend std::ostream& operator<<( std::ostream& os, const Vertex& node )
-      {
-         return os<<node.x<<","<<node.y<<","<<node.z;
-      }
-      Vertex* clone()
-      {
-         return(new Vertex(this));
-      }
-
-   public:
-      float x{0.0}, y{0.0}, z{0.0};
-   };
-   //////////////////////////////////////////////////////////////////////////
-   class TriFace
-   {
-   public:
-      TriFace()
-          
-      = default;
-      TriFace(const int& v1, const int& v2, const int& v3)
-         : v1(v1), v2(v2), v3(v3)
-      {
-      }
-
-      const int& getIndexVertex1() const { return v1; }
-      const int& getIndexVertex2() const { return v2; }
-      const int& getIndexVertex3() const { return v3; }
-
-      Vertex& getNode(const int& i, std::vector<Vertex>& nodes)
-      {
-         if(i==0) return nodes[v1];
-         if(i==1) return nodes[v2];
-         if(i==2) return nodes[v3];
-         throw UbException(UB_EXARGS,"invalid i - not in range [0;2]");
-      }
-      void setNode(const int& i, const int& index)
-      {
-         if     (i==0) v1=index;
-         else if(i==1) v2=index;
-         else if(i==2) v3=index;
-         else throw UbException(UB_EXARGS,"invalid i - not in range [0;2]");
-      }
-
-      int operator[] (int index)
-      { 
-         if(index==0) return v1;
-         if(index==1) return v2;
-         if(index==2) return v3;
-         throw UbException(UB_EXARGS,"invalid i - not in range [0;2]");
-      }
-
-      float& getV1x(std::vector<Vertex>& nodes) { return nodes[v1].x; }
-      float& getV1y(std::vector<Vertex>& nodes) { return nodes[v1].y; }
-      float& getV1z(std::vector<Vertex>& nodes) { return nodes[v1].z; }
-
-      float& getV2x(std::vector<Vertex>& nodes) { return nodes[v2].x; }
-      float& getV2y(std::vector<Vertex>& nodes) { return nodes[v2].y; }
-      float& getV2z(std::vector<Vertex>& nodes) { return nodes[v2].z; }
-
-      float& getV3x(std::vector<Vertex>& nodes) { return nodes[v3].x; }
-      float& getV3y(std::vector<Vertex>& nodes) { return nodes[v3].y; }
-      float& getV3z(std::vector<Vertex>& nodes) { return nodes[v3].z; }
-
-      float getMinX(std::vector<Vertex>& nodes) { return (float)UbMath::min(nodes[v1].x,nodes[v2].x,nodes[v3].x); }
-      float getMinY(std::vector<Vertex>& nodes) { return (float)UbMath::min(nodes[v1].y,nodes[v2].y,nodes[v3].y); }
-      float getMinZ(std::vector<Vertex>& nodes) { return (float)UbMath::min(nodes[v1].z,nodes[v2].z,nodes[v3].z); }
-
-      float getMaxX(std::vector<Vertex>& nodes) { return (float)UbMath::max(nodes[v1].x,nodes[v2].x,nodes[v3].x); }
-      float getMaxY(std::vector<Vertex>& nodes) { return (float)UbMath::max(nodes[v1].y,nodes[v2].y,nodes[v3].y); }
-      float getMaxZ(std::vector<Vertex>& nodes) { return (float)UbMath::max(nodes[v1].z,nodes[v2].z,nodes[v3].z); }
-
-      float getX1Centroid(std::vector<Vertex>& nodes) {return (float)UbMath::c1o3 * (getV1x(nodes)+getV2x(nodes)+getV3x(nodes)); }
-      float getX2Centroid(std::vector<Vertex>& nodes) {return (float)UbMath::c1o3 * (getV1y(nodes)+getV2y(nodes)+getV3y(nodes)); }
-      float getX3Centroid(std::vector<Vertex>& nodes) {return (float)UbMath::c1o3 * (getV1z(nodes)+getV2z(nodes)+getV3z(nodes)); }
-
-      double calculateDistanceToPoint3D(const double& x1, const double& x2, const double& x3, std::vector<Vertex>& nodes);
-
-      double getArea(std::vector<Vertex>& nodes)
-      {
-         //GbVector3D A(nodes[v1].x, nodes[v1].y, nodes[v1].z);
-         //GbVector3D B(nodes[v2].x, nodes[v2].y, nodes[v2].z);
-         //GbVector3D C(nodes[v3].x, nodes[v3].y, nodes[v3].z);
-         //GbVector3D AB = B-A;
-         //GbVector3D AC = C-A;
-         //GbVector3D N = AB.Cross(AC);
-         //return 0.5*N.Length();
-         Vector3D A(nodes[v1].x, nodes[v1].y, nodes[v1].z);
-         Vector3D B(nodes[v2].x, nodes[v2].y, nodes[v2].z);
-         Vector3D C(nodes[v3].x, nodes[v3].y, nodes[v3].z);
-         Vector3D AB = B-A;
-         Vector3D AC = C-A;
-         Vector3D N = AB.Cross(AC);
-         return 0.5*N.Length();
-      }
-      void calculateNormal(std::vector<Vertex>& nodes)
-      {
-         const float& v1x = nodes[v1].x; const float& v1y = nodes[v1].y; const float& v1z = nodes[v1].z;
-         const float& v2x = nodes[v2].x; const float& v2y = nodes[v2].y; const float& v2z = nodes[v2].z;
-         const float& v3x = nodes[v3].x; const float& v3y = nodes[v3].y; const float& v3z = nodes[v3].z;
-
-         nx = ( v3z - v1z) * ( v2y - v1y ) - ( v2z - v1z) * ( v3y - v1y );
-         ny = ( v2z - v1z) * ( v3x - v1x ) - ( v2x - v1x) * ( v3z - v1z );
-         nz = ( v2x - v1x) * ( v3y - v1y ) - ( v2y - v1y) * ( v3x - v1x );
-
-         float length = std::sqrt( nx*nx + ny*ny + nz*nz );
-         if(length>1.E-10)
-         {
-            length = 1.0f/length;
-            nx *= length;
-            ny *= length;
-            nz *= length;
-         }
-         else 
-         {
-            std::cerr<<"GbTriFaceMesh3D::TriFace - calculateNormal: nx=ny=nz=0 -> kann nich sein "
-                     <<"(dreieck hat evtl knoten doppelt oder ist ne Linie)"
-                     <<"->removeRedunantNodes"<<std::endl;
-         }
-      }
-
-   public:
-      int   v1{-1}, v2{-1}, v3{-1};
-      float nx{0.0}, ny{0.0}, nz{0.0};
-   };
+    // nested class start
+    class Vertex
+    {
+    public:
+        Vertex() = default;
+        Vertex(const float &x, const float &y, const float &z) : x(x), y(y), z(z) {}
+        Vertex(Vertex *vert)
+        {
+            this->x = vert->x;
+            this->y = vert->y;
+            this->z = vert->z;
+        }
+        float operator[](const int &i) const
+        {
+            if (i == 0)
+                return x;
+            else if (i == 1)
+                return y;
+            else if (i == 2)
+                return z;
+
+            throw UbException(UB_EXARGS, "i not in [0;2]");
+        }
+        float &operator[](const int &i)
+        {
+            if (i == 0)
+                return x;
+            else if (i == 1)
+                return y;
+            else if (i == 2)
+                return z;
+
+            throw UbException(UB_EXARGS, "not in [0;2]");
+        }
+        bool operator==(const Vertex &rhs)
+        {
+            return (fabs(x - rhs.x) < 1.E-8 && fabs(y - rhs.y) < 1.E-8 && fabs(z - rhs.z) < 1.E-8);
+        }
+        friend inline bool operator<(const Vertex &lhsVert, const Vertex &rhsVert)
+        {
+            if (lhsVert.x < rhsVert.x)
+                return true;
+            if (lhsVert.x > rhsVert.x)
+                return false;
+            if (lhsVert.y < rhsVert.y)
+                return true;
+            if (lhsVert.y > rhsVert.y)
+                return false;
+            if (lhsVert.z < rhsVert.z)
+                return true;
+
+            return false;
+        }
+        friend std::ostream &operator<<(std::ostream &os, const Vertex &node)
+        {
+            return os << node.x << "," << node.y << "," << node.z;
+        }
+        Vertex *clone() { return (new Vertex(this)); }
+
+    public:
+        float x{ 0.0 }, y{ 0.0 }, z{ 0.0 };
+    };
+    //////////////////////////////////////////////////////////////////////////
+    class TriFace
+    {
+    public:
+        TriFace()
+
+            = default;
+        TriFace(const int &v1, const int &v2, const int &v3) : v1(v1), v2(v2), v3(v3) {}
+
+        const int &getIndexVertex1() const { return v1; }
+        const int &getIndexVertex2() const { return v2; }
+        const int &getIndexVertex3() const { return v3; }
+
+        Vertex &getNode(const int &i, std::vector<Vertex> &nodes)
+        {
+            if (i == 0)
+                return nodes[v1];
+            if (i == 1)
+                return nodes[v2];
+            if (i == 2)
+                return nodes[v3];
+            throw UbException(UB_EXARGS, "invalid i - not in range [0;2]");
+        }
+        void setNode(const int &i, const int &index)
+        {
+            if (i == 0)
+                v1 = index;
+            else if (i == 1)
+                v2 = index;
+            else if (i == 2)
+                v3 = index;
+            else
+                throw UbException(UB_EXARGS, "invalid i - not in range [0;2]");
+        }
+
+        int operator[](int index)
+        {
+            if (index == 0)
+                return v1;
+            if (index == 1)
+                return v2;
+            if (index == 2)
+                return v3;
+            throw UbException(UB_EXARGS, "invalid i - not in range [0;2]");
+        }
+
+        float &getV1x(std::vector<Vertex> &nodes) { return nodes[v1].x; }
+        float &getV1y(std::vector<Vertex> &nodes) { return nodes[v1].y; }
+        float &getV1z(std::vector<Vertex> &nodes) { return nodes[v1].z; }
+
+        float &getV2x(std::vector<Vertex> &nodes) { return nodes[v2].x; }
+        float &getV2y(std::vector<Vertex> &nodes) { return nodes[v2].y; }
+        float &getV2z(std::vector<Vertex> &nodes) { return nodes[v2].z; }
+
+        float &getV3x(std::vector<Vertex> &nodes) { return nodes[v3].x; }
+        float &getV3y(std::vector<Vertex> &nodes) { return nodes[v3].y; }
+        float &getV3z(std::vector<Vertex> &nodes) { return nodes[v3].z; }
+
+        float getMinX(std::vector<Vertex> &nodes) { return (float)UbMath::min(nodes[v1].x, nodes[v2].x, nodes[v3].x); }
+        float getMinY(std::vector<Vertex> &nodes) { return (float)UbMath::min(nodes[v1].y, nodes[v2].y, nodes[v3].y); }
+        float getMinZ(std::vector<Vertex> &nodes) { return (float)UbMath::min(nodes[v1].z, nodes[v2].z, nodes[v3].z); }
+
+        float getMaxX(std::vector<Vertex> &nodes) { return (float)UbMath::max(nodes[v1].x, nodes[v2].x, nodes[v3].x); }
+        float getMaxY(std::vector<Vertex> &nodes) { return (float)UbMath::max(nodes[v1].y, nodes[v2].y, nodes[v3].y); }
+        float getMaxZ(std::vector<Vertex> &nodes) { return (float)UbMath::max(nodes[v1].z, nodes[v2].z, nodes[v3].z); }
+
+        float getX1Centroid(std::vector<Vertex> &nodes)
+        {
+            return (float)UbMath::c1o3 * (getV1x(nodes) + getV2x(nodes) + getV3x(nodes));
+        }
+        float getX2Centroid(std::vector<Vertex> &nodes)
+        {
+            return (float)UbMath::c1o3 * (getV1y(nodes) + getV2y(nodes) + getV3y(nodes));
+        }
+        float getX3Centroid(std::vector<Vertex> &nodes)
+        {
+            return (float)UbMath::c1o3 * (getV1z(nodes) + getV2z(nodes) + getV3z(nodes));
+        }
+
+        double calculateDistanceToPoint3D(const double &x1, const double &x2, const double &x3,
+                                          std::vector<Vertex> &nodes);
+
+        double getArea(std::vector<Vertex> &nodes)
+        {
+            // GbVector3D A(nodes[v1].x, nodes[v1].y, nodes[v1].z);
+            // GbVector3D B(nodes[v2].x, nodes[v2].y, nodes[v2].z);
+            // GbVector3D C(nodes[v3].x, nodes[v3].y, nodes[v3].z);
+            // GbVector3D AB = B-A;
+            // GbVector3D AC = C-A;
+            // GbVector3D N = AB.Cross(AC);
+            // return 0.5*N.Length();
+            Vector3D A(nodes[v1].x, nodes[v1].y, nodes[v1].z);
+            Vector3D B(nodes[v2].x, nodes[v2].y, nodes[v2].z);
+            Vector3D C(nodes[v3].x, nodes[v3].y, nodes[v3].z);
+            Vector3D AB = B - A;
+            Vector3D AC = C - A;
+            Vector3D N  = AB.Cross(AC);
+            return 0.5 * N.Length();
+        }
+        void calculateNormal(std::vector<Vertex> &nodes)
+        {
+            const float &v1x = nodes[v1].x;
+            const float &v1y = nodes[v1].y;
+            const float &v1z = nodes[v1].z;
+            const float &v2x = nodes[v2].x;
+            const float &v2y = nodes[v2].y;
+            const float &v2z = nodes[v2].z;
+            const float &v3x = nodes[v3].x;
+            const float &v3y = nodes[v3].y;
+            const float &v3z = nodes[v3].z;
+
+            nx = (v3z - v1z) * (v2y - v1y) - (v2z - v1z) * (v3y - v1y);
+            ny = (v2z - v1z) * (v3x - v1x) - (v2x - v1x) * (v3z - v1z);
+            nz = (v2x - v1x) * (v3y - v1y) - (v2y - v1y) * (v3x - v1x);
+
+            float length = std::sqrt(nx * nx + ny * ny + nz * nz);
+            if (length > 1.E-10) {
+                length = 1.0f / length;
+                nx *= length;
+                ny *= length;
+                nz *= length;
+            } else {
+                std::cerr << "GbTriFaceMesh3D::TriFace - calculateNormal: nx=ny=nz=0 -> kann nich sein "
+                          << "(dreieck hat evtl knoten doppelt oder ist ne Linie)"
+                          << "->removeRedunantNodes" << std::endl;
+            }
+        }
+
+    public:
+        int v1{ -1 }, v2{ -1 }, v3{ -1 };
+        float nx{ 0.0 }, ny{ 0.0 }, nz{ 0.0 };
+    };
 
 public:
-  enum KDTREE_SPLITAGORITHM { KDTREE_SAHPLIT, KDTREE_SPATIALSPLIT };
+    enum KDTREE_SPLITAGORITHM { KDTREE_SAHPLIT, KDTREE_SPATIALSPLIT };
 
 public:
-   GbTriFaceMesh3D();
-   GbTriFaceMesh3D(std::string name, std::vector<Vertex>* nodes, std::vector<TriFace>* triangles, KDTREE_SPLITAGORITHM splitAlg = KDTREE_SAHPLIT, bool removeRedundantNodes=true);
-	~GbTriFaceMesh3D() override;
-
-   GbTriFaceMesh3D* clone() override;// { throw UbException(UB_EXARGS,"not implemented"); }
-   void finalize() override {}
-
-   //void setRegardPointInPolyhedronTest(bool value) { this->regardPiO=value; }
-
-   std::string toString() override;
-
-   //std::string getName();
-   std::vector<Vertex>*  getNodes();
-   std::vector<TriFace>* getTriangles();
-   
-   void setTransferViaFilename(bool transferViaFilename, std::string filename, double transX1, double transX2, double transX3)
-   {
-      this->filename = filename;
-      this->transferViaFilename = transferViaFilename;
-      this->transX1 = transX1;
-      this->transX2 = transX2;
-      this->transX3 = transX3;
-   }
-   void readMeshFromSTLFile(std::string filename, bool removeRedundantNodes);
-
-   double getX1Minimum() override  { if(!this->consistent) this->calculateValues(); return this->x1min;    }
-   double getX1Maximum() override  { if(!this->consistent) this->calculateValues(); return this->x1max;    }
-   double getX1Centroid() override { if(!this->consistent) this->calculateValues(); return this->x1center; }
-
-   double getX2Minimum() override  { if(!this->consistent) this->calculateValues(); return this->x2min;    }
-   double getX2Maximum() override  { if(!this->consistent) this->calculateValues(); return this->x2max;    }
-   double getX2Centroid() override { if(!this->consistent) this->calculateValues(); return this->x2center; }
-   
-   double getX3Minimum() override  { if(!this->consistent) this->calculateValues(); return this->x3min;    }
-   double getX3Centroid() override { if(!this->consistent) this->calculateValues(); return this->x3center; }
-   double getX3Maximum() override  { if(!this->consistent) this->calculateValues(); return this->x3max;    }
-
-   void   calculateValues();
-
-   double getVolume();
-   void   deleteRedundantNodes();
-
-   UbTupleDouble6 calculateMomentOfInertia(double rhoP);
-   UbTupleDouble3 calculateCenterOfGravity();
-
-   void setCenterCoordinates(const double& x1, const double& x2, const double& x3) override;
-
-
-   void scale(const double& sx1, const double& sx2, const double& sx3) override;
-   void rotate(const double& alpha, const double& beta, const double& gamma) override;
-   void rotateAroundPoint(const double& px1, const double& px2, const double& px3, const double& alpha, const double& beta, const double& gamma);
-   void translate(const double& x1, const double& x2, const double& x3) override;
-   void reflectAcrossXYLine(const double& alpha);
-
-   bool isPointInGbObject3D(const double& x1, const double& x2, const double& x3) override;
-   bool isPointInGbObject3D(const double& x1, const double& x2, const double& x3, int counter);
-   bool isPointInGbObject3D(const double& x1, const double& x2, const double& x3, bool& pointIsOnBoundary) override;
-
-   GbLine3D* createClippedLine3D (GbPoint3D &point1,GbPoint3D &point2) override;
-
-   std::vector<GbTriangle3D*> getSurfaceTriangleSet() override;
-   void addSurfaceTriangleSet(std::vector<UbTupleFloat3>& nodes, std::vector<UbTupleInt3>& triangles) override;
-
-   std::vector<GbTriFaceMesh3D::TriFace*> getTrianglesForVertex(Vertex* vertex);
-
-   void setKdTreeSplitAlgorithm(KDTREE_SPLITAGORITHM mode); 
-   KDTREE_SPLITAGORITHM getKdTreeSplitAlgorithm() { return this->kdtreeSplitAlg; }
-   Kd::Tree<double>* getKdTree() { return this->kdTree; }
-
-   virtual UbTuple<std::string, std::string> writeMesh(std::string filename, WbWriter* writer, bool writeNormals=false, std::vector< std::string >* datanames=NULL, std::vector< std::vector < double > >* nodedata=NULL );
-   void writeMeshPly( const std::string& filename);
-
-   /*======================================================================*/
-   using GbObject3D::isPointInGbObject3D; //Grund: dadurch muss man hier  isPointInGbObject3D(GbPoint3D*) nicht ausprogrammieren, welche sonst hier "ueberdeckt" waere
-
-   bool intersectLine(const double& p1_x1, const double& p1_x2, const double& p1_x3, const double& p2_x1, const double& p2_x2, const double& p2_x3);
-
+    GbTriFaceMesh3D();
+    GbTriFaceMesh3D(std::string name, std::vector<Vertex> *nodes, std::vector<TriFace> *triangles,
+                    KDTREE_SPLITAGORITHM splitAlg = KDTREE_SAHPLIT, bool removeRedundantNodes = true);
+    ~GbTriFaceMesh3D() override;
+
+    GbTriFaceMesh3D *clone() override; // { throw UbException(UB_EXARGS,"not implemented"); }
+    void finalize() override {}
+
+    // void setRegardPointInPolyhedronTest(bool value) { this->regardPiO=value; }
+
+    std::string toString() override;
+
+    // std::string getName();
+    std::vector<Vertex> *getNodes();
+    std::vector<TriFace> *getTriangles();
+
+    void setTransferViaFilename(bool transferViaFilename, std::string filename, double transX1, double transX2,
+                                double transX3)
+    {
+        this->filename            = filename;
+        this->transferViaFilename = transferViaFilename;
+        this->transX1             = transX1;
+        this->transX2             = transX2;
+        this->transX3             = transX3;
+    }
+    void readMeshFromSTLFile(std::string filename, bool removeRedundantNodes);
+
+    double getX1Minimum() override
+    {
+        if (!this->consistent)
+            this->calculateValues();
+        return this->x1min;
+    }
+    double getX1Maximum() override
+    {
+        if (!this->consistent)
+            this->calculateValues();
+        return this->x1max;
+    }
+    double getX1Centroid() override
+    {
+        if (!this->consistent)
+            this->calculateValues();
+        return this->x1center;
+    }
+
+    double getX2Minimum() override
+    {
+        if (!this->consistent)
+            this->calculateValues();
+        return this->x2min;
+    }
+    double getX2Maximum() override
+    {
+        if (!this->consistent)
+            this->calculateValues();
+        return this->x2max;
+    }
+    double getX2Centroid() override
+    {
+        if (!this->consistent)
+            this->calculateValues();
+        return this->x2center;
+    }
+
+    double getX3Minimum() override
+    {
+        if (!this->consistent)
+            this->calculateValues();
+        return this->x3min;
+    }
+    double getX3Centroid() override
+    {
+        if (!this->consistent)
+            this->calculateValues();
+        return this->x3center;
+    }
+    double getX3Maximum() override
+    {
+        if (!this->consistent)
+            this->calculateValues();
+        return this->x3max;
+    }
+
+    void calculateValues();
+
+    double getVolume();
+    void deleteRedundantNodes();
+
+    UbTupleDouble6 calculateMomentOfInertia(double rhoP);
+    UbTupleDouble3 calculateCenterOfGravity();
+
+    void setCenterCoordinates(const double &x1, const double &x2, const double &x3) override;
+
+    void scale(const double &sx1, const double &sx2, const double &sx3) override;
+    void rotate(const double &alpha, const double &beta, const double &gamma) override;
+    void rotateAroundPoint(const double &px1, const double &px2, const double &px3, const double &alpha,
+                           const double &beta, const double &gamma);
+    void translate(const double &x1, const double &x2, const double &x3) override;
+    void reflectAcrossXYLine(const double &alpha);
+
+    bool isPointInGbObject3D(const double &x1, const double &x2, const double &x3) override;
+    bool isPointInGbObject3D(const double &x1, const double &x2, const double &x3, int counter);
+    bool isPointInGbObject3D(const double &x1, const double &x2, const double &x3, bool &pointIsOnBoundary) override;
+
+    GbLine3D *createClippedLine3D(GbPoint3D &point1, GbPoint3D &point2) override;
+
+    std::vector<GbTriangle3D *> getSurfaceTriangleSet() override;
+    void addSurfaceTriangleSet(std::vector<UbTupleFloat3> &nodes, std::vector<UbTupleInt3> &triangles) override;
+
+    std::vector<GbTriFaceMesh3D::TriFace *> getTrianglesForVertex(Vertex *vertex);
+
+    void setKdTreeSplitAlgorithm(KDTREE_SPLITAGORITHM mode);
+    KDTREE_SPLITAGORITHM getKdTreeSplitAlgorithm() { return this->kdtreeSplitAlg; }
+    Kd::Tree<double> *getKdTree() { return this->kdTree; }
+
+    virtual UbTuple<std::string, std::string> writeMesh(std::string filename, WbWriter *writer,
+                                                        bool writeNormals                          = false,
+                                                        std::vector<std::string> *datanames        = NULL,
+                                                        std::vector<std::vector<double>> *nodedata = NULL);
+    void writeMeshPly(const std::string &filename);
+
+    /*======================================================================*/
+    using GbObject3D::isPointInGbObject3D; // Grund: dadurch muss man hier  isPointInGbObject3D(GbPoint3D*) nicht
+                                           // ausprogrammieren, welche sonst hier "ueberdeckt" waere
+
+    bool intersectLine(const double &p1_x1, const double &p1_x2, const double &p1_x3, const double &p2_x1,
+                       const double &p2_x2, const double &p2_x3);
 
 protected:
-   KDTREE_SPLITAGORITHM kdtreeSplitAlg;
-   void init();
-
-   std::vector<Vertex>*  nodes;
-   std::vector<TriFace>* triangles;
-   //for transfer
-   std::string filename;
-   bool transferViaFilename{false};
-   double transX1{0.0};
-   double transX2{0.0};
-   double transX3{0.0};
-
-   double x1min;
-   double x1max;
-   double x2min;
-   double x2max;
-   double x3min;
-   double x3max;
-   double x1center;
-   double x2center;
-   double x3center;
-
-   bool consistent {false};
-
-   bool buildVertTriRelationMap{false};
-   std::multimap<Vertex*,TriFace*> relationVertTris;
-
-   Kd::Tree< double >* kdTree = nullptr;
+    KDTREE_SPLITAGORITHM kdtreeSplitAlg;
+    void init();
+
+    std::vector<Vertex> *nodes;
+    std::vector<TriFace> *triangles;
+    // for transfer
+    std::string filename;
+    bool transferViaFilename{ false };
+    double transX1{ 0.0 };
+    double transX2{ 0.0 };
+    double transX3{ 0.0 };
+
+    double x1min;
+    double x1max;
+    double x2min;
+    double x2max;
+    double x3min;
+    double x3max;
+    double x1center;
+    double x2center;
+    double x3center;
+
+    bool consistent{ false };
+
+    bool buildVertTriRelationMap{ false };
+    std::multimap<Vertex *, TriFace *> relationVertTris;
+
+    Kd::Tree<double> *kdTree = nullptr;
 };
 
-
-#endif //GBTRIFACEMESH3D_H
+#endif // GBTRIFACEMESH3D_H
diff --git a/src/basics/geometry3d/GbTriangle3D.cpp b/src/basics/geometry3d/GbTriangle3D.cpp
index 51edfa5eafcd6160790480abea450de372bfc5b9..3b5a96af747d9ee6157b9a246de7b4482f3b4b8b 100644
--- a/src/basics/geometry3d/GbTriangle3D.cpp
+++ b/src/basics/geometry3d/GbTriangle3D.cpp
@@ -1,28 +1,28 @@
 //=======================================================================================
-// ____          ____    __    ______     __________   __      __       __        __         
-// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |        
-//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |        
-//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |        
-//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____    
-//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|   
-//      \    \  |    |   ________________________________________________________________    
-//       \    \ |    |  |  ______________________________________________________________|   
-//        \    \|    |  |  |         __          __     __     __     ______      _______    
-//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)   
-//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______    
+// ____          ____    __    ______     __________   __      __       __        __
+// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |
+//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |
+//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |
+//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____
+//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|
+//      \    \  |    |   ________________________________________________________________
+//       \    \ |    |  |  ______________________________________________________________|
+//        \    \|    |  |  |         __          __     __     __     ______      _______
+//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)
+//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______
 //           \       |  |  |        |  |_____   |   \_/   |   |  |   |  |_/  /    _____  |
-//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/   
+//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/
 //
-//  This file is part of VirtualFluids. VirtualFluids is free software: you can 
+//  This file is part of VirtualFluids. VirtualFluids is free software: you can
 //  redistribute it and/or modify it under the terms of the GNU General Public
-//  License as published by the Free Software Foundation, either version 3 of 
+//  License as published by the Free Software Foundation, either version 3 of
 //  the License, or (at your option) any later version.
-//  
-//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT 
-//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
-//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License 
+//
+//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT
+//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 //  for more details.
-//  
+//
 //  You should have received a copy of the GNU General Public License along
 //  with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>.
 //
@@ -30,489 +30,531 @@
 //! \ingroup geometry3d
 //! \author Soeren Freudiger, Sebastian Geller
 //=======================================================================================
-#include <GbTriangle3D.h>
-#include <GbSystem3D.h>
-#include <GbLine3D.h>
 #include <GbCuboid3D.h>
+#include <GbLine3D.h>
+#include <GbSystem3D.h>
+#include <GbTriangle3D.h>
 
 #include <basics/utilities/UbMath.h>
 
-using namespace std;                                                               
+using namespace std;
 
 GbTriangle3D::GbTriangle3D()
 {
-   this->init();
-   this->consistent = false;
+    this->init();
+    this->consistent = false;
 }
 /*======================================================================*/
 /*
-* Creates an empty 2D triangle with the specified points.
-* @param point1 the 1st point
-* @param point2 the 2nd point
-* @param point3 the 3nd point
-*/
-GbTriangle3D::GbTriangle3D(GbPoint3D* point1, GbPoint3D* point2, GbPoint3D* point3)
+ * Creates an empty 2D triangle with the specified points.
+ * @param point1 the 1st point
+ * @param point2 the 2nd point
+ * @param point3 the 3nd point
+ */
+GbTriangle3D::GbTriangle3D(GbPoint3D *point1, GbPoint3D *point2, GbPoint3D *point3)
 {
-   this->init();
-   this->points[0] = point1;
-   this->points[1] = point2;
-   this->points[2] = point3;
-
-   this->calculateNormal();
-   this->consistent = false;
-
-   this->points[0]->addObserver(this);
-   this->points[1]->addObserver(this);
-   this->points[2]->addObserver(this);
-   
-   //this.po        = new PointObserver(this);
-   //this.points[0].addObserver(this.po);
-   //this.points[1].addObserver(this.po);
-   //this.points[2].addObserver(this.po);
+    this->init();
+    this->points[0] = point1;
+    this->points[1] = point2;
+    this->points[2] = point3;
+
+    this->calculateNormal();
+    this->consistent = false;
+
+    this->points[0]->addObserver(this);
+    this->points[1]->addObserver(this);
+    this->points[2]->addObserver(this);
+
+    // this.po        = new PointObserver(this);
+    // this.points[0].addObserver(this.po);
+    // this.points[1].addObserver(this.po);
+    // this.points[2].addObserver(this.po);
 }
 /*======================================================================*/
 /*
-* Creates a 3D triangle as clone of the specified 2D triangle.
-* @param triangle the 3D triangle to be cloned
-*/
-GbTriangle3D::GbTriangle3D(GbTriangle3D* triangle)
+ * Creates a 3D triangle as clone of the specified 2D triangle.
+ * @param triangle the 3D triangle to be cloned
+ */
+GbTriangle3D::GbTriangle3D(GbTriangle3D *triangle)
 {
-   this->init();
-   this->points[0] = triangle->points[0]->clone();
-   this->points[1] = triangle->points[1]->clone();
-   this->points[2] = triangle->points[2]->clone();
-
-   this->consistent = false;
-   this->calculateNormal();
-   this->calculateValues();
+    this->init();
+    this->points[0] = triangle->points[0]->clone();
+    this->points[1] = triangle->points[1]->clone();
+    this->points[2] = triangle->points[2]->clone();
+
+    this->consistent = false;
+    this->calculateNormal();
+    this->calculateValues();
 }
 /*======================================================================*/
 GbTriangle3D::~GbTriangle3D()
 {
-   if(this->points[0]) this->points[0]->removeObserver(this);
-   if(this->points[1]) this->points[1]->removeObserver(this);
-   if(this->points[2]) this->points[2]->removeObserver(this);
+    if (this->points[0])
+        this->points[0]->removeObserver(this);
+    if (this->points[1])
+        this->points[1]->removeObserver(this);
+    if (this->points[2])
+        this->points[2]->removeObserver(this);
 }
 /*======================================================================*/
 void GbTriangle3D::deletePoints()
-{ 
-   if(points[0]) { delete points[0]; points[0]=NULL;}
-   if(points[1]) { delete points[1]; points[1]=NULL;}
-   if(points[2]) { delete points[2]; points[2]=NULL;}
+{
+    if (points[0]) {
+        delete points[0];
+        points[0] = NULL;
+    }
+    if (points[1]) {
+        delete points[1];
+        points[1] = NULL;
+    }
+    if (points[2]) {
+        delete points[2];
+        points[2] = NULL;
+    }
 }
 
 /*======================================================================*/
 /*  Methoden                                                            */
 /*                                                                      */
 /*
-* Creates a 3D triangle as clone of this 3D triangle.
-*/
-GbTriangle3D* GbTriangle3D::clone()
-{
-   return(new GbTriangle3D(this));
-}
+ * Creates a 3D triangle as clone of this 3D triangle.
+ */
+GbTriangle3D *GbTriangle3D::clone() { return (new GbTriangle3D(this)); }
 /*======================================================================*/
 /*
-* Returns the number of times this 2D triangle contains the specified point.
-* @param point the point
-* @return the number of times this 2D triangle contains the specified point
-*/
-int GbTriangle3D::contains(GbPoint3D* point)
+ * Returns the number of times this 2D triangle contains the specified point.
+ * @param point the point
+ * @return the number of times this 2D triangle contains the specified point
+ */
+int GbTriangle3D::contains(GbPoint3D *point)
 {
-   int n = 0;
-   for(int i=0; i<3; i++) if(this->points[i]->equals(point)) n++;
-   return(n);
+    int n = 0;
+    for (int i = 0; i < 3; i++)
+        if (this->points[i]->equals(point))
+            n++;
+    return (n);
 }
 /*======================================================================*/
 /*
-* Returns the number of times this 2D triangle contains a point equal to the specified point.
-* @param point the point
-* @return the number of times this 2D triangle contains a point equal to the specified point
-*/
-int GbTriangle3D::containsEqual(GbPoint3D* point)
+ * Returns the number of times this 2D triangle contains a point equal to the specified point.
+ * @param point the point
+ * @return the number of times this 2D triangle contains a point equal to the specified point
+ */
+int GbTriangle3D::containsEqual(GbPoint3D *point)
 {
-   int n = 0;
-   for(int i=0; i<3; i++) if(this->points[i]->equals(point)) n++;
-   return(n);
+    int n = 0;
+    for (int i = 0; i < 3; i++)
+        if (this->points[i]->equals(point))
+            n++;
+    return (n);
 }
 /*======================================================================*/
 /*
-* Returns the specified point.
-* @param index the index (must be 0, 1, or 2)
-* @return the specified point
-* @exception ArrayIndexOutOfBoundsException if the specified index is not valid
-*/
-GbPoint3D* GbTriangle3D::getPoint(const int& index) 
+ * Returns the specified point.
+ * @param index the index (must be 0, 1, or 2)
+ * @return the specified point
+ * @exception ArrayIndexOutOfBoundsException if the specified index is not valid
+ */
+GbPoint3D *GbTriangle3D::getPoint(const int &index)
 {
-   if(index < 0 || index > 2) throw UbException(UB_EXARGS,"invalid index specified: ");
-   return((this->points[index]));
+    if (index < 0 || index > 2)
+        throw UbException(UB_EXARGS, "invalid index specified: ");
+    return ((this->points[index]));
 }
 /*======================================================================*/
-vector<GbPoint3D> GbTriangle3D::getPoints() 
+vector<GbPoint3D> GbTriangle3D::getPoints()
 {
-   vector<GbPoint3D> p(3);
-   p[0] = *(points[0]);
-   p[1] = *(points[1]);
-   p[2] = *(points[2]);
-   return p;
-   //
-   //vector<GbPoint3D> p(3);// = new vector<GbPoint3D*>;
-   //p.resize(3);//, NULL);
-   //p[0] = this->points[0];
-   //p[1] = this->points[1];
-   //p[2] = this->points[2];
-   //return(p);
+    vector<GbPoint3D> p(3);
+    p[0] = *(points[0]);
+    p[1] = *(points[1]);
+    p[2] = *(points[2]);
+    return p;
+    //
+    // vector<GbPoint3D> p(3);// = new vector<GbPoint3D*>;
+    // p.resize(3);//, NULL);
+    // p[0] = this->points[0];
+    // p[1] = this->points[1];
+    // p[2] = this->points[2];
+    // return(p);
 }
 /*======================================================================*/
 /*
-* Returns the area of this triangle.
-* The area is positive for positive ordered points, otherwise negative.
-* @return the area of this triangle
-*/
+ * Returns the area of this triangle.
+ * The area is positive for positive ordered points, otherwise negative.
+ * @return the area of this triangle
+ */
 double GbTriangle3D::getArea()
 {
-   if(!this->consistent) this->calculateValues();
-   // throw UbException(UB_EXARGS,"not correct calculated ...");
-   return(this->area);
+    if (!this->consistent)
+        this->calculateValues();
+    // throw UbException(UB_EXARGS,"not correct calculated ...");
+    return (this->area);
 }
 /*
-* Returns the centroid x1 coordinate of this triangle.
-* @return the centroid x1 coordinate of this triangle
-*/
+ * Returns the centroid x1 coordinate of this triangle.
+ * @return the centroid x1 coordinate of this triangle
+ */
 double GbTriangle3D::getX1Centroid()
 {
-   if(!this->consistent) this->calculateValues();
-   return(this->x1s);
+    if (!this->consistent)
+        this->calculateValues();
+    return (this->x1s);
 }
 /*
-* Returns the minimum x1 coordinate of this triangle.
-* @return the minimum x1 coordinate of this triangle
-*/
+ * Returns the minimum x1 coordinate of this triangle.
+ * @return the minimum x1 coordinate of this triangle
+ */
 double GbTriangle3D::getX1Minimum()
 {
-   if(!this->consistent) this->calculateValues();
-   return(this->x1min);
+    if (!this->consistent)
+        this->calculateValues();
+    return (this->x1min);
 }
 /*
-* Returns the maximum x1 coordinate of this triangle.
-* @return the maximum x1 coordinate of this triangle
-*/
+ * Returns the maximum x1 coordinate of this triangle.
+ * @return the maximum x1 coordinate of this triangle
+ */
 double GbTriangle3D::getX1Maximum()
 {
-   if(!this->consistent) this->calculateValues();
-   return(this->x1max);
+    if (!this->consistent)
+        this->calculateValues();
+    return (this->x1max);
 }
 /*
-* Returns the centroid x2 coordinate of this triangle.
-* @return the centroid x2 coordinate of this triangle
-*/
+ * Returns the centroid x2 coordinate of this triangle.
+ * @return the centroid x2 coordinate of this triangle
+ */
 double GbTriangle3D::getX2Centroid()
 {
-   if(!this->consistent) this->calculateValues();
-   return(this->x2s);
+    if (!this->consistent)
+        this->calculateValues();
+    return (this->x2s);
 }
-/*                                                         
-* Returns the minimum x2 coordinate of this triangle.
-* @return the minimum x2 coordinate of this triangle
-*/
+/*
+ * Returns the minimum x2 coordinate of this triangle.
+ * @return the minimum x2 coordinate of this triangle
+ */
 double GbTriangle3D::getX2Minimum()
 {
-   if(!this->consistent) this->calculateValues();
-   return(this->x2min);
+    if (!this->consistent)
+        this->calculateValues();
+    return (this->x2min);
 }
 /*
-* Returns the maximum x2 coordinate of this triangle.
-* @return the maximum x2 coordinate of this triangle
-*/
+ * Returns the maximum x2 coordinate of this triangle.
+ * @return the maximum x2 coordinate of this triangle
+ */
 double GbTriangle3D::getX2Maximum()
 {
-   if(!this->consistent) this->calculateValues();
-   return(this->x2max);
+    if (!this->consistent)
+        this->calculateValues();
+    return (this->x2max);
 }
 double GbTriangle3D::getX3Centroid()
 {
-   if(!this->consistent) this->calculateValues();
-   return(this->x3s);
+    if (!this->consistent)
+        this->calculateValues();
+    return (this->x3s);
 }
 double GbTriangle3D::getX3Minimum()
 {
-   if(!this->consistent) this->calculateValues();
-   return(this->x3min);
+    if (!this->consistent)
+        this->calculateValues();
+    return (this->x3min);
 }
 double GbTriangle3D::getX3Maximum()
 {
-   if(!this->consistent) this->calculateValues();
-   return(this->x3max);
+    if (!this->consistent)
+        this->calculateValues();
+    return (this->x3max);
 }
 
 /*
-* Sets the specified point.
-* @param point the point
-* @param index the index (must be 0, 1, or 2)
-* @exception ArrayIndexOutOfBoundsException if the specified index is not valid
-*/
-void GbTriangle3D::setPoint(GbPoint3D* point, int index) 
+ * Sets the specified point.
+ * @param point the point
+ * @param index the index (must be 0, 1, or 2)
+ * @exception ArrayIndexOutOfBoundsException if the specified index is not valid
+ */
+void GbTriangle3D::setPoint(GbPoint3D *point, int index)
 {
-   if(index < 0 || index > 2) throw UbException(UB_EXARGS,"invalid index specified: ");
-   this->points[index] = point;
-   this->consistent    = false;
-   this->calculateNormal();
+    if (index < 0 || index > 2)
+        throw UbException(UB_EXARGS, "invalid index specified: ");
+    this->points[index] = point;
+    this->consistent    = false;
+    this->calculateNormal();
 }
 
 /*
-* Returns the surface triangle set with new nodes !!!
-* @returns the surface triangle set with new nodes !!!
-*/
-vector<GbTriangle3D*> GbTriangle3D::getSurfaceTriangleSet()
+ * Returns the surface triangle set with new nodes !!!
+ * @returns the surface triangle set with new nodes !!!
+ */
+vector<GbTriangle3D *> GbTriangle3D::getSurfaceTriangleSet()
 {
-   vector<GbTriangle3D*> triangles;
-   
-   triangles.push_back(new GbTriangle3D(new GbPoint3D(getPoint1()),new GbPoint3D(getPoint2()),new GbPoint3D(getPoint3())));
+    vector<GbTriangle3D *> triangles;
 
-   return triangles;
-}
+    triangles.push_back(
+        new GbTriangle3D(new GbPoint3D(getPoint1()), new GbPoint3D(getPoint2()), new GbPoint3D(getPoint3())));
 
+    return triangles;
+}
 
 /*
-* Returns the string representation of the triangle
-* @returns the string representation of the triangle
-*/
+ * Returns the string representation of the triangle
+ * @returns the string representation of the triangle
+ */
 
 string GbTriangle3D::toString()
 {
-   stringstream ss;
-   ss<<"GbTriangle3D[area=";
-   ss<<this->getArea();
-
-   ss<<", x1s="<<this->x1s;
-   ss<<", x2s="<<this->x2s;
-   ss<<", x3s="<<this->x3s;
-   ss<<", x1min="<<this->x1min;
-   ss<<", x1max="<<this->x1max;
-   ss<<", x2min="<<this->x2min;
-   ss<<", x2max="<<this->x2max;
-   ss<<", x3min="<<this->x3min;
-   ss<<", x3max="<<this->x3max;
-   ss<<", points1="<<this->points[0]->toString();
-   ss<<", points2="<<this->points[1]->toString();
-   ss<<", points3="<<this->points[2]->toString();
-   ss<<"]";
-   return((ss.str()).c_str());
+    stringstream ss;
+    ss << "GbTriangle3D[area=";
+    ss << this->getArea();
+
+    ss << ", x1s=" << this->x1s;
+    ss << ", x2s=" << this->x2s;
+    ss << ", x3s=" << this->x3s;
+    ss << ", x1min=" << this->x1min;
+    ss << ", x1max=" << this->x1max;
+    ss << ", x2min=" << this->x2min;
+    ss << ", x2max=" << this->x2max;
+    ss << ", x3min=" << this->x3min;
+    ss << ", x3max=" << this->x3max;
+    ss << ", points1=" << this->points[0]->toString();
+    ss << ", points2=" << this->points[1]->toString();
+    ss << ", points3=" << this->points[2]->toString();
+    ss << "]";
+    return ((ss.str()).c_str());
 }
 /*======================================================================*/
-double GbTriangle3D::getIntersectionRaytraceFactor(const double& x1, const double& x2, const double& x3, const double& rx1, const double& rx2, const double& rx3)
+double GbTriangle3D::getIntersectionRaytraceFactor(const double &x1, const double &x2, const double &x3,
+                                                   const double &rx1, const double &rx2, const double &rx3)
 {
-   //e1 = v1 - v0
-   double e1x1 = this->points[1]->x1-this->points[0]->x1;
-   double e1x2 = this->points[1]->x2-this->points[0]->x2;
-   double e1x3 = this->points[1]->x3-this->points[0]->x3;  
-
-   //e2 = v2 - v0
-   double e2x1 = this->points[2]->x1-this->points[0]->x1;
-   double e2x2 = this->points[2]->x2-this->points[0]->x2;
-   double e2x3 = this->points[2]->x3-this->points[0]->x3;  
-
-   //p = d x e2
-   double px1 = rx2*e2x3 - rx3*e2x2;
-   double px2 = rx3*e2x1 - rx1*e2x3;
-   double px3 = rx1*e2x2 - rx2*e2x1;
-
-   //a = e1 dot p
-   double a = e1x1*px1 + e1x2*px2 + e1x3*px3;
-   if(fabs(a)<1.E-10) return -1.0;
-   double f = 1.0/a;
-
-   //s = o - v0
-   double sx1 = x1 - this->points[0]->x1;
-   double sx2 = x2 - this->points[0]->x2;
-   double sx3 = x3 - this->points[0]->x3;
-
-   //u = f * ( s dot p)
-   double u = f * ( sx1*px1 + sx2*px2 + sx3*px3 );
-   if(u<-1.E-10 || u>1.0+1.E-10) return -1.0;
-
-   //q = s x e1
-   double qx1 = sx2*e1x3 - sx3*e1x2;
-   double qx2 = sx3*e1x1 - sx1*e1x3;
-   double qx3 = sx1*e1x2 - sx2*e1x1;
-
-   //v = f*(e2 dot q)
-   double v = f * (rx1*qx1 + rx2*qx2 + rx3*qx3);
-   if(v<-1.E-10 || (u+v)>1.0+1.E-10) return -1.0;
-
-   //t = f * (e2 dot q)
-   return f * (e2x1*qx1 + e2x2*qx2 + e2x3*qx3);
+    // e1 = v1 - v0
+    double e1x1 = this->points[1]->x1 - this->points[0]->x1;
+    double e1x2 = this->points[1]->x2 - this->points[0]->x2;
+    double e1x3 = this->points[1]->x3 - this->points[0]->x3;
+
+    // e2 = v2 - v0
+    double e2x1 = this->points[2]->x1 - this->points[0]->x1;
+    double e2x2 = this->points[2]->x2 - this->points[0]->x2;
+    double e2x3 = this->points[2]->x3 - this->points[0]->x3;
+
+    // p = d x e2
+    double px1 = rx2 * e2x3 - rx3 * e2x2;
+    double px2 = rx3 * e2x1 - rx1 * e2x3;
+    double px3 = rx1 * e2x2 - rx2 * e2x1;
+
+    // a = e1 dot p
+    double a = e1x1 * px1 + e1x2 * px2 + e1x3 * px3;
+    if (fabs(a) < 1.E-10)
+        return -1.0;
+    double f = 1.0 / a;
+
+    // s = o - v0
+    double sx1 = x1 - this->points[0]->x1;
+    double sx2 = x2 - this->points[0]->x2;
+    double sx3 = x3 - this->points[0]->x3;
+
+    // u = f * ( s dot p)
+    double u = f * (sx1 * px1 + sx2 * px2 + sx3 * px3);
+    if (u < -1.E-10 || u > 1.0 + 1.E-10)
+        return -1.0;
+
+    // q = s x e1
+    double qx1 = sx2 * e1x3 - sx3 * e1x2;
+    double qx2 = sx3 * e1x1 - sx1 * e1x3;
+    double qx3 = sx1 * e1x2 - sx2 * e1x1;
+
+    // v = f*(e2 dot q)
+    double v = f * (rx1 * qx1 + rx2 * qx2 + rx3 * qx3);
+    if (v < -1.E-10 || (u + v) > 1.0 + 1.E-10)
+        return -1.0;
+
+    // t = f * (e2 dot q)
+    return f * (e2x1 * qx1 + e2x2 * qx2 + e2x3 * qx3);
 }
 
 /*===========================================================*/
 
-GbLine3D* GbTriangle3D::createClippedLine3D(GbPoint3D& point1, GbPoint3D& point2)
+GbLine3D *GbTriangle3D::createClippedLine3D(GbPoint3D &point1, GbPoint3D &point2)
 {
-   GbPoint3D *result = this->calculateIntersectionPoints3D(&point1, &point2);
-   if(!result) return NULL;
+    GbPoint3D *result = this->calculateIntersectionPoints3D(&point1, &point2);
+    if (!result)
+        return NULL;
 
-   return new GbLine3D(result, new GbPoint3D(point2));
+    return new GbLine3D(result, new GbPoint3D(point2));
 
-   //return GbSystem::createClipLine3D(point1, point2,
-      //p1->getX1Coordinate(),p1->getX2Coordinate(),p1->getX3Coordinate(),
-      //p2->getX1Coordinate(),p2->getX2Coordinate(),p2->getX3Coordinate() );
+    // return GbSystem::createClipLine3D(point1, point2,
+    // p1->getX1Coordinate(),p1->getX2Coordinate(),p1->getX3Coordinate(),
+    // p2->getX1Coordinate(),p2->getX2Coordinate(),p2->getX3Coordinate() );
 }
 
-//von Navodit ...
+// von Navodit ...
 /*===========================================================*/
-GbPoint3D* GbTriangle3D::calculateIntersectionPoints3D(GbLine3D* line)
+GbPoint3D *GbTriangle3D::calculateIntersectionPoints3D(GbLine3D *line)
 {
-   return this->calculateIntersectionPoints3D(line->getPoint1(), line->getPoint2());
+    return this->calculateIntersectionPoints3D(line->getPoint1(), line->getPoint2());
 }
 /*===========================================================*/
-GbPoint3D* GbTriangle3D::calculateIntersectionPoints3D(GbPoint3D* linePoint1, GbPoint3D* linePoint2)
+GbPoint3D *GbTriangle3D::calculateIntersectionPoints3D(GbPoint3D *linePoint1, GbPoint3D *linePoint2)
 {
-   GbVector3D Point1(linePoint1->x1, linePoint1->x2, linePoint1->x3);
-   GbVector3D Point2(linePoint2->x1, linePoint2->x2, linePoint2->x3);
-   GbVector3D direction = Point2-Point1;
-   GbVector3D GbPoint3D1(this->getPoint1()->x1,this->getPoint1()->x2,this->getPoint1()->x3);
-   GbVector3D GbPoint3D2(this->getPoint2()->x1,this->getPoint2()->x2,this->getPoint2()->x3);
-   GbVector3D GbPoint3D3(this->getPoint3()->x1,this->getPoint3()->x2,this->getPoint3()->x3);
-   GbVector3D V2V1 = GbPoint3D2-GbPoint3D1;
-   GbVector3D V3V1 = GbPoint3D3-GbPoint3D1;
-   GbVector3D V2V1V3V1 = V2V1.Cross(V3V1);
-   V2V1V3V1.Normalize();
-   GbVector3D Normal = V2V1V3V1;
-
-   double d = -Normal.Dot(GbPoint3D1);            
-   double denom = Normal.Dot(direction);       
-
-   if (UbMath::zero(denom)) return NULL;   //line does not intersect the plane of the triangle !
-   else
-   {
-      double mu = -1.*(d + Point1.Dot(Normal))/denom;            //mu = -(d+ Normal.Point1)/denom
-
-      //   GbVector3D p1 = Point2-Point1;
-      //   GbVector3D p2 = p1*mu;
-      //   GbVector3D p3 = Point1+p2;
-      GbVector3D point = Point1 + mu*(Point2 -Point1);
-
-      if (mu<0.0 || mu>1.0)    return NULL;     // Point of intersection of line and plane does not lie on the triangle   
-      else
-      {
-         //Test whether Point lies inside the triangle or not
-         bool test=true;
-         GbVector3D a = GbPoint3D1-point;
-         GbVector3D b = GbPoint3D2-point;
-         GbVector3D c = GbPoint3D3-point;
-         GbVector3D ab = a.Cross(b);
-         GbVector3D bc = b.Cross(c);
-         GbVector3D ca = c.Cross(a);
-         GbVector3D Q1 = ab*0.5;
-         GbVector3D Q2 = bc*0.5;
-         GbVector3D Q3 = ca*0.5;
-         GbVector3D Q1Q2 = Q1+Q2;
-         GbVector3D Q = Q1Q2+Q3;
-
-         if (UbMath::less(Q.Dot(Q1), 0.0)) test = false; 
-         if (UbMath::less(Q.Dot(Q2), 0.0)) test = false; 
-         if (UbMath::less(Q.Dot(Q3), 0.0)) test = false; 
-
-         if (test == true) return (new GbPoint3D(point.X1(), point.X2(), point.X3()));
-         else          return NULL;
-      }
-   }
+    GbVector3D Point1(linePoint1->x1, linePoint1->x2, linePoint1->x3);
+    GbVector3D Point2(linePoint2->x1, linePoint2->x2, linePoint2->x3);
+    GbVector3D direction = Point2 - Point1;
+    GbVector3D GbPoint3D1(this->getPoint1()->x1, this->getPoint1()->x2, this->getPoint1()->x3);
+    GbVector3D GbPoint3D2(this->getPoint2()->x1, this->getPoint2()->x2, this->getPoint2()->x3);
+    GbVector3D GbPoint3D3(this->getPoint3()->x1, this->getPoint3()->x2, this->getPoint3()->x3);
+    GbVector3D V2V1     = GbPoint3D2 - GbPoint3D1;
+    GbVector3D V3V1     = GbPoint3D3 - GbPoint3D1;
+    GbVector3D V2V1V3V1 = V2V1.Cross(V3V1);
+    V2V1V3V1.Normalize();
+    GbVector3D Normal = V2V1V3V1;
+
+    double d     = -Normal.Dot(GbPoint3D1);
+    double denom = Normal.Dot(direction);
+
+    if (UbMath::zero(denom))
+        return NULL; // line does not intersect the plane of the triangle !
+    else {
+        double mu = -1. * (d + Point1.Dot(Normal)) / denom; // mu = -(d+ Normal.Point1)/denom
+
+        //   GbVector3D p1 = Point2-Point1;
+        //   GbVector3D p2 = p1*mu;
+        //   GbVector3D p3 = Point1+p2;
+        GbVector3D point = Point1 + mu * (Point2 - Point1);
+
+        if (mu < 0.0 || mu > 1.0)
+            return NULL; // Point of intersection of line and plane does not lie on the triangle
+        else {
+            // Test whether Point lies inside the triangle or not
+            bool test       = true;
+            GbVector3D a    = GbPoint3D1 - point;
+            GbVector3D b    = GbPoint3D2 - point;
+            GbVector3D c    = GbPoint3D3 - point;
+            GbVector3D ab   = a.Cross(b);
+            GbVector3D bc   = b.Cross(c);
+            GbVector3D ca   = c.Cross(a);
+            GbVector3D Q1   = ab * 0.5;
+            GbVector3D Q2   = bc * 0.5;
+            GbVector3D Q3   = ca * 0.5;
+            GbVector3D Q1Q2 = Q1 + Q2;
+            GbVector3D Q    = Q1Q2 + Q3;
+
+            if (UbMath::less(Q.Dot(Q1), 0.0))
+                test = false;
+            if (UbMath::less(Q.Dot(Q2), 0.0))
+                test = false;
+            if (UbMath::less(Q.Dot(Q3), 0.0))
+                test = false;
+
+            if (test == true)
+                return (new GbPoint3D(point.X1(), point.X2(), point.X3()));
+            else
+                return NULL;
+        }
+    }
 }
 
 /**
-* Returns the distance between the 3D triangle and the specified 3D Point                                                                      
-* @param point the 3D point from whom the distance is to be calculated
-* @return the distance of the specified point from the triangle
-*/
-double GbTriangle3D::calculateDistanceToPoint3D(GbPoint3D *point) 
+ * Returns the distance between the 3D triangle and the specified 3D Point
+ * @param point the 3D point from whom the distance is to be calculated
+ * @return the distance of the specified point from the triangle
+ */
+double GbTriangle3D::calculateDistanceToPoint3D(GbPoint3D *point)
 {
-   return this->calculateDistanceToPoint3D(point->x1, point->x2, point->x3);
+    return this->calculateDistanceToPoint3D(point->x1, point->x2, point->x3);
 }
 /*=======================================================================*/
-double GbTriangle3D::calculateDistanceToPoint3D(const double& x1, const double& x2, const double& x3) 
+double GbTriangle3D::calculateDistanceToPoint3D(const double &x1, const double &x2, const double &x3)
 {
-   //
-   //throw UbException(UB_EXARGS,"Ich glaub GbTriangle3D::calculateDistanceToPoint3D(...) kann man so nicht nehmen,jedenfalls nicht fuer die q's");
-   cout<<"??? ch glaub GbTriangle3D::calculateDistanceToPoint3D(...) kann man so nicht nehmen,jedenfalls nicht fuer die q's"<<endl;
-   GbVector3D P0(x1, x2, x3);
-   GbVector3D P1(this->points[0]->x1, this->points[0]->x2, this->points[0]->x3);
-   GbVector3D P2(this->points[1]->x1, this->points[1]->x2, this->points[1]->x3);
-   GbVector3D P3(this->points[2]->x1, this->points[2]->x2, this->points[2]->x3);
-
-   //Determine normal to triangle
-   GbVector3D Normal = (P1-P2).Cross(P1-P3);
-   double alpha = UbMath::ACos((P1-P0).Dot(Normal)/((P1-P0).Length()*Normal.Length()));
-
-   double P0P0dash = (P0-P1).Length()*cos(alpha);
-   Normal.Normalize();
-   GbVector3D Projection = Normal*(-P0P0dash);
-
-   GbVector3D P0dash = P0+Projection;
-
-   //Check if point P0dash lies within the triangle P1P2P3.
-   bool test = false;
-   if ( ((P1-P0).Cross(P2-P0)).Dot(Normal) > 0 ) test = true;
-   if ( ((P2-P0).Cross(P3-P0)).Dot(Normal) > 0 ) test = true;
-   if ( ((P3-P0).Cross(P1-P0)).Dot(Normal) > 0 ) test = true;
-
-   if (test == true) return (P0-P0dash).Length();
-   else
-   // Determine the distance of point P0 from all edges and vertices and return the minimum distance
-   {
-      double dP0P1 = (P0-P1).Length(); //Distance of Point P0 from Point P1
-      double dP0P2 = (P0-P2).Length(); //Distance of Point P0 from Point P2
-      double dP0P3 = (P0-P3).Length(); //Distance of Point P0 from Point P3
-
-      GbVector3D MP1P2 = P2-P1;        //Direction vector for line P1P2
-      GbVector3D MP2P3 = P3-P2;        //Direction vector for line P2P3
-      GbVector3D MP3P1 = P1-P3;        //Direction vector for line P3P1
-
-      double tP1P2 = MP1P2.Dot(P0-P1) / MP1P2.Dot(MP1P2);
-      double tP2P3 = MP2P3.Dot(P0-P2) / MP2P3.Dot(MP2P3);
-      double tP3P1 = MP3P1.Dot(P0-P3) / MP3P1.Dot(MP3P1);
-
-      double dP1P2 = (P0-(P1+(MP1P2*tP1P2))).Length(); //Distance of Point P0 from line P1P2
-      double dP2P3 = (P0-(P2+(MP2P3*tP2P3))).Length(); //Distance of Point P0 from line P2P3
-      double dP3P1 = (P0-(P3+(MP3P1*tP3P1))).Length(); //Distance of Point P0 from line P3P1
-
-      double distanceP0[6]; //Array to store all the distances from Point P0
-      distanceP0[0] = dP0P1; 
-      distanceP0[1] = dP0P2; 
-      distanceP0[2] = dP0P3; 
-      distanceP0[3] = dP1P2; 
-      distanceP0[4] = dP2P3; 
-      distanceP0[5] = dP3P1; 
-
-      double d = 0.0;
-      //Find the minimum distance from Point P0
-      for (int i=0; i<6; i++)
-      {
-         if(distanceP0[i]<d) d = distanceP0[i];
-      }
-      return d;
-   }
+    //
+    // throw UbException(UB_EXARGS,"Ich glaub GbTriangle3D::calculateDistanceToPoint3D(...) kann man so nicht
+    // nehmen,jedenfalls nicht fuer die q's");
+    cout << "??? ch glaub GbTriangle3D::calculateDistanceToPoint3D(...) kann man so nicht nehmen,jedenfalls nicht fuer "
+            "die q's"
+         << endl;
+    GbVector3D P0(x1, x2, x3);
+    GbVector3D P1(this->points[0]->x1, this->points[0]->x2, this->points[0]->x3);
+    GbVector3D P2(this->points[1]->x1, this->points[1]->x2, this->points[1]->x3);
+    GbVector3D P3(this->points[2]->x1, this->points[2]->x2, this->points[2]->x3);
+
+    // Determine normal to triangle
+    GbVector3D Normal = (P1 - P2).Cross(P1 - P3);
+    double alpha      = UbMath::ACos((P1 - P0).Dot(Normal) / ((P1 - P0).Length() * Normal.Length()));
+
+    double P0P0dash = (P0 - P1).Length() * cos(alpha);
+    Normal.Normalize();
+    GbVector3D Projection = Normal * (-P0P0dash);
+
+    GbVector3D P0dash = P0 + Projection;
+
+    // Check if point P0dash lies within the triangle P1P2P3.
+    bool test = false;
+    if (((P1 - P0).Cross(P2 - P0)).Dot(Normal) > 0)
+        test = true;
+    if (((P2 - P0).Cross(P3 - P0)).Dot(Normal) > 0)
+        test = true;
+    if (((P3 - P0).Cross(P1 - P0)).Dot(Normal) > 0)
+        test = true;
+
+    if (test == true)
+        return (P0 - P0dash).Length();
+    else
+    // Determine the distance of point P0 from all edges and vertices and return the minimum distance
+    {
+        double dP0P1 = (P0 - P1).Length(); // Distance of Point P0 from Point P1
+        double dP0P2 = (P0 - P2).Length(); // Distance of Point P0 from Point P2
+        double dP0P3 = (P0 - P3).Length(); // Distance of Point P0 from Point P3
+
+        GbVector3D MP1P2 = P2 - P1; // Direction vector for line P1P2
+        GbVector3D MP2P3 = P3 - P2; // Direction vector for line P2P3
+        GbVector3D MP3P1 = P1 - P3; // Direction vector for line P3P1
+
+        double tP1P2 = MP1P2.Dot(P0 - P1) / MP1P2.Dot(MP1P2);
+        double tP2P3 = MP2P3.Dot(P0 - P2) / MP2P3.Dot(MP2P3);
+        double tP3P1 = MP3P1.Dot(P0 - P3) / MP3P1.Dot(MP3P1);
+
+        double dP1P2 = (P0 - (P1 + (MP1P2 * tP1P2))).Length(); // Distance of Point P0 from line P1P2
+        double dP2P3 = (P0 - (P2 + (MP2P3 * tP2P3))).Length(); // Distance of Point P0 from line P2P3
+        double dP3P1 = (P0 - (P3 + (MP3P1 * tP3P1))).Length(); // Distance of Point P0 from line P3P1
+
+        double distanceP0[6]; // Array to store all the distances from Point P0
+        distanceP0[0] = dP0P1;
+        distanceP0[1] = dP0P2;
+        distanceP0[2] = dP0P3;
+        distanceP0[3] = dP1P2;
+        distanceP0[4] = dP2P3;
+        distanceP0[5] = dP3P1;
+
+        double d = 0.0;
+        // Find the minimum distance from Point P0
+        for (int i = 0; i < 6; i++) {
+            if (distanceP0[i] < d)
+                d = distanceP0[i];
+        }
+        return d;
+    }
 }
 /**
-* Returns the normalized distance between the 3D triangle and the specified 3D Point
-* copied from Benjamin A.
-* @param point the 3D point from whom the distance is to be calculated
-* @return the distance of the specified point from the triangle
-*/
-double GbTriangle3D::calculateNormalizedDistanceToPoint3D(const double& x1, const double& y1, const double& z1, 
-                                                          const double& x2, const double& y2, const double& z2)
+ * Returns the normalized distance between the 3D triangle and the specified 3D Point
+ * copied from Benjamin A.
+ * @param point the 3D point from whom the distance is to be calculated
+ * @return the distance of the specified point from the triangle
+ */
+double GbTriangle3D::calculateNormalizedDistanceToPoint3D(const double &x1, const double &y1, const double &z1,
+                                                          const double &x2, const double &y2, const double &z2)
 {
-    //face* pf
+    // face* pf
     double xa, xb, xc, ya, yb, yc, za, zb, zc;
-    //double xp, yp, zp;
-    double tt=0, xi=0, eta=0;
+    // double xp, yp, zp;
+    double tt = 0, xi = 0, eta = 0;
     double zaehler, nenner;
     double wurzel3 = sqrt(3.);
 
-    //Weltkoordinaten der Dreiecke
+    // Weltkoordinaten der Dreiecke
     xa = this->points[0]->x1;
     xb = this->points[1]->x1;
     xc = this->points[2]->x1;
-         
+
     ya = this->points[0]->x2;
     yb = this->points[1]->x2;
     yc = this->points[2]->x2;
@@ -521,164 +563,185 @@ double GbTriangle3D::calculateNormalizedDistanceToPoint3D(const double& x1, cons
     zb = this->points[1]->x3;
     zc = this->points[2]->x3;
 
-    //Shape-Funktionen zum Berechnen der Schnittpunkte
-    zaehler =
-       static_cast<double>(((-1.0*zc+zb)*ya+(yc-1.0*yb)*za+zc*yb-1.0*zb*yc)*x1
-       +((-1.0*zb+zc)*xa+(xb-1.0*xc)*za-1.0*xb*zc+xc*zb)*y1+((-1.0*yc+yb)*xa
-       +(-1.0*xb+xc)*ya-1.0*xc*yb+xb*yc)*z1+((-1.0*zc+zb)*ya+(yc-1.0*yb)*za
-       +zc*yb-1.0*zb*yc)*x2+((-1.0*zb+zc)*xa+(xb-1.0*xc)*za-1.0*xb*zc+xc*zb)*y2
-       +((-1.0*yc+yb)*xa+(-1.0*xb+xc)*ya-1.0*xc*yb+xb*yc)*z2+(2.0*zb*yc-2.0*zc*yb)*xa
-       +(2.0*xb*zc-2.0*xc*zb)*ya+(-2.0*xb*yc+2.0*xc*yb)*za);
-    nenner  =
-       static_cast<double>((((-1.0*zc+zb)*ya+(yc-1.0*yb)*za+zc*yb-1.0*zb*yc)*x1
-       +((-1.0*zb+zc)*xa+(xb-1.0*xc)*za-1.0*xb*zc+xc*zb)*y1+((-1.0*yc+yb)*xa
-       +(-1.0*xb+xc)*ya-1.0*xc*yb+xb*yc)*z1+((-1.0*zb+zc)*ya+(-1.0*yc+yb)*za-1.0*zc*yb+zb*yc)
-       *x2+((-1.0*zc+zb)*xa+(-1.0*xb+xc)*za+xb*zc-1.0*xc*zb)*y2+((yc-1.0*yb)*xa+(xb
-       -1.0*xc)*ya+xc*yb-1.0*xb*yc)*z2));
-    if( UbMath::greater(nenner, 0.0) ) tt = zaehler/nenner;
-    else tt=-999.;
-
-    zaehler =
-       static_cast<double>(((-2.0*zc+za+zb)*y2+(-1.0*yb-1.0*ya+2.0*yc)*z2+zc*ya
-       -1.0*zb*yc+zc*yb-1.0*za*yc)*x1+((-1.0*za+2.0*zc-1.0*zb)*x2+(xa-2.0*xc+xb)*z2
-       -1.0*xa*zc-1.0*xb*zc+xc*za+xc*zb)*y1+((-2.0*yc+ya+yb)*x2+(-1.0*xa-1.0*xb+2.0*xc)
-       *y2-1.0*xc*yb+xa*yc+xb*yc-1.0*xc*ya)*z1+(zb*yc-1.0*zc*ya-1.0*zc*yb+za*yc)
-       *x2+(-1.0*xc*za+xb*zc+xa*zc-1.0*xc*zb)*y2+(xc*yb-1.0*xa*yc-1.0*xb*yc+xc*ya)*z2);
-    nenner  =
-       static_cast<double>((((zc-1.0*zb)*ya+(yb-1.0*yc)*za+zb*yc-1.0*zc*yb)*x1
-       +((zb-1.0*zc)*xa+(xc-1.0*xb)*za-1.0*xc*zb+xb*zc)*y1+((-1.0*yb+yc)*xa+(xb-1.0*xc)
-       *ya-1.0*xb*yc+xc*yb)*z1+((zb-1.0*zc)*ya+(-1.0*yb+yc)*za+zc*yb-1.0*zb*yc)*x2
-       +((zc-1.0*zb)*xa+(xb-1.0*xc)*za-1.0*xb*zc+xc*zb)*y2+((yb-1.0*yc)*xa
-       +(xc-1.0*xb)*ya+xb*yc-1.0*xc*yb)*z2));
-    if( UbMath::greater(nenner, 0.0) ) xi = zaehler/nenner;
-    else xi=-999.;
-
-    zaehler =
-       static_cast<double>(((za-1.0*zb)*y2+(-1.0*ya+yb)*z2-1.0*za*yb+zb*ya)*x1+
-       ((-1.0*za+zb)*x2+(xa-1.0*xb)*z2-1.0*xa*zb+xb*za)*y1+((ya-1.0*yb)*x2+(xb-1.0*xa)
-       *y2+xa*yb-1.0*xb*ya)*z1+(-1.0*zb*ya+za*yb)*x2+(-1.0*xb*za+xa*zb)*y2
-       +(-1.0*xa*yb+xb*ya)*z2);
-    nenner  =
-       static_cast<double>((((zc-1.0*zb)*ya+(yb-1.0*yc)*za+zb*yc-1.0*zc*yb)*x1
-       +((zb-1.0*zc)*xa+(xc-1.0*xb)*za-1.0*xc*zb+xb*zc)*y1+((-1.0*yb+yc)*xa+(xb-1.0*xc)
-       *ya-1.0*xb*yc+xc*yb)*z1+((zb-1.0*zc)*ya+(-1.0*yb+yc)*za+zc*yb-1.0*zb*yc)*x2
-       +((zc-1.0*zb)*xa+(xb-1.0*xc)*za-1.0*xb*zc+xc*zb)*y2+((yb-1.0*yc)*xa+(xc-1.0*xb)
-       *ya+xb*yc-1.0*xc*yb)*z2));
-    if ( UbMath::greater(nenner, 0.0) ) eta = static_cast<double>((zaehler/nenner)*wurzel3*-1.);
-    else eta=-999.;
-
-    if (tt >= -1.0-UbMath::Epsilon<double>::val() && tt <= 1.0){
-       if(xi >= -1.0+eta/wurzel3-UbMath::Epsilon<double>::val() && xi <=
-          1.0-eta/wurzel3+UbMath::Epsilon<double>::val()){
-             if (eta >= 0-UbMath::Epsilon<double>::val() && eta <= wurzel3+UbMath::Epsilon<double>::val()){
+    // Shape-Funktionen zum Berechnen der Schnittpunkte
+    zaehler = static_cast<double>(((-1.0 * zc + zb) * ya + (yc - 1.0 * yb) * za + zc * yb - 1.0 * zb * yc) * x1 +
+                                  ((-1.0 * zb + zc) * xa + (xb - 1.0 * xc) * za - 1.0 * xb * zc + xc * zb) * y1 +
+                                  ((-1.0 * yc + yb) * xa + (-1.0 * xb + xc) * ya - 1.0 * xc * yb + xb * yc) * z1 +
+                                  ((-1.0 * zc + zb) * ya + (yc - 1.0 * yb) * za + zc * yb - 1.0 * zb * yc) * x2 +
+                                  ((-1.0 * zb + zc) * xa + (xb - 1.0 * xc) * za - 1.0 * xb * zc + xc * zb) * y2 +
+                                  ((-1.0 * yc + yb) * xa + (-1.0 * xb + xc) * ya - 1.0 * xc * yb + xb * yc) * z2 +
+                                  (2.0 * zb * yc - 2.0 * zc * yb) * xa + (2.0 * xb * zc - 2.0 * xc * zb) * ya +
+                                  (-2.0 * xb * yc + 2.0 * xc * yb) * za);
+    nenner  = static_cast<double>((((-1.0 * zc + zb) * ya + (yc - 1.0 * yb) * za + zc * yb - 1.0 * zb * yc) * x1 +
+                                  ((-1.0 * zb + zc) * xa + (xb - 1.0 * xc) * za - 1.0 * xb * zc + xc * zb) * y1 +
+                                  ((-1.0 * yc + yb) * xa + (-1.0 * xb + xc) * ya - 1.0 * xc * yb + xb * yc) * z1 +
+                                  ((-1.0 * zb + zc) * ya + (-1.0 * yc + yb) * za - 1.0 * zc * yb + zb * yc) * x2 +
+                                  ((-1.0 * zc + zb) * xa + (-1.0 * xb + xc) * za + xb * zc - 1.0 * xc * zb) * y2 +
+                                  ((yc - 1.0 * yb) * xa + (xb - 1.0 * xc) * ya + xc * yb - 1.0 * xb * yc) * z2));
+    if (UbMath::greater(nenner, 0.0))
+        tt = zaehler / nenner;
+    else
+        tt = -999.;
+
+    zaehler = static_cast<double>(((-2.0 * zc + za + zb) * y2 + (-1.0 * yb - 1.0 * ya + 2.0 * yc) * z2 + zc * ya -
+                                   1.0 * zb * yc + zc * yb - 1.0 * za * yc) *
+                                      x1 +
+                                  ((-1.0 * za + 2.0 * zc - 1.0 * zb) * x2 + (xa - 2.0 * xc + xb) * z2 - 1.0 * xa * zc -
+                                   1.0 * xb * zc + xc * za + xc * zb) *
+                                      y1 +
+                                  ((-2.0 * yc + ya + yb) * x2 + (-1.0 * xa - 1.0 * xb + 2.0 * xc) * y2 - 1.0 * xc * yb +
+                                   xa * yc + xb * yc - 1.0 * xc * ya) *
+                                      z1 +
+                                  (zb * yc - 1.0 * zc * ya - 1.0 * zc * yb + za * yc) * x2 +
+                                  (-1.0 * xc * za + xb * zc + xa * zc - 1.0 * xc * zb) * y2 +
+                                  (xc * yb - 1.0 * xa * yc - 1.0 * xb * yc + xc * ya) * z2);
+    nenner  = static_cast<double>((((zc - 1.0 * zb) * ya + (yb - 1.0 * yc) * za + zb * yc - 1.0 * zc * yb) * x1 +
+                                  ((zb - 1.0 * zc) * xa + (xc - 1.0 * xb) * za - 1.0 * xc * zb + xb * zc) * y1 +
+                                  ((-1.0 * yb + yc) * xa + (xb - 1.0 * xc) * ya - 1.0 * xb * yc + xc * yb) * z1 +
+                                  ((zb - 1.0 * zc) * ya + (-1.0 * yb + yc) * za + zc * yb - 1.0 * zb * yc) * x2 +
+                                  ((zc - 1.0 * zb) * xa + (xb - 1.0 * xc) * za - 1.0 * xb * zc + xc * zb) * y2 +
+                                  ((yb - 1.0 * yc) * xa + (xc - 1.0 * xb) * ya + xb * yc - 1.0 * xc * yb) * z2));
+    if (UbMath::greater(nenner, 0.0))
+        xi = zaehler / nenner;
+    else
+        xi = -999.;
+
+    zaehler = static_cast<double>(((za - 1.0 * zb) * y2 + (-1.0 * ya + yb) * z2 - 1.0 * za * yb + zb * ya) * x1 +
+                                  ((-1.0 * za + zb) * x2 + (xa - 1.0 * xb) * z2 - 1.0 * xa * zb + xb * za) * y1 +
+                                  ((ya - 1.0 * yb) * x2 + (xb - 1.0 * xa) * y2 + xa * yb - 1.0 * xb * ya) * z1 +
+                                  (-1.0 * zb * ya + za * yb) * x2 + (-1.0 * xb * za + xa * zb) * y2 +
+                                  (-1.0 * xa * yb + xb * ya) * z2);
+    nenner  = static_cast<double>((((zc - 1.0 * zb) * ya + (yb - 1.0 * yc) * za + zb * yc - 1.0 * zc * yb) * x1 +
+                                  ((zb - 1.0 * zc) * xa + (xc - 1.0 * xb) * za - 1.0 * xc * zb + xb * zc) * y1 +
+                                  ((-1.0 * yb + yc) * xa + (xb - 1.0 * xc) * ya - 1.0 * xb * yc + xc * yb) * z1 +
+                                  ((zb - 1.0 * zc) * ya + (-1.0 * yb + yc) * za + zc * yb - 1.0 * zb * yc) * x2 +
+                                  ((zc - 1.0 * zb) * xa + (xb - 1.0 * xc) * za - 1.0 * xb * zc + xc * zb) * y2 +
+                                  ((yb - 1.0 * yc) * xa + (xc - 1.0 * xb) * ya + xb * yc - 1.0 * xc * yb) * z2));
+    if (UbMath::greater(nenner, 0.0))
+        eta = static_cast<double>((zaehler / nenner) * wurzel3 * -1.);
+    else
+        eta = -999.;
+
+    if (tt >= -1.0 - UbMath::Epsilon<double>::val() && tt <= 1.0) {
+        if (xi >= -1.0 + eta / wurzel3 - UbMath::Epsilon<double>::val() &&
+            xi <= 1.0 - eta / wurzel3 + UbMath::Epsilon<double>::val()) {
+            if (eta >= 0 - UbMath::Epsilon<double>::val() && eta <= wurzel3 + UbMath::Epsilon<double>::val()) {
                 /*xp = x1*(0.5-tt/2)+x2*(0.5+tt/2);
                 yp = y1*(0.5-tt/2)+y2*(0.5+tt/2);
                 zp = z1*(0.5-tt/2)+z2*(0.5+tt/2);*/
-                return
-                   static_cast<double>((sqrt(pow((x1*(0.5-tt/2)+x2*(0.5+tt/2))-x1,2)
-                   +pow((y1*(0.5-tt/2)+y2*(0.5+tt/2))-y1,2)+pow((z1*(0.5-tt/2)+z2*(0.5+tt/2))-z1,2))));
-             }
-          }
+                return static_cast<double>((sqrt(pow((x1 * (0.5 - tt / 2) + x2 * (0.5 + tt / 2)) - x1, 2) +
+                                                 pow((y1 * (0.5 - tt / 2) + y2 * (0.5 + tt / 2)) - y1, 2) +
+                                                 pow((z1 * (0.5 - tt / 2) + z2 * (0.5 + tt / 2)) - z1, 2))));
+            }
+        }
     }
     return (-999.);
 }
 /*
-* Returns true if the specified 2D point lies within (or on the border of) this 2D triangle.
-* @param point the 2D point to check
-* @return true if the specified 2D point lies within (or on the border of) this 2D triangle
-*/
- bool GbTriangle3D::enclosesPoint2D(double x1, double x2)
- {
-	 int i=0;
-	 //Punkt(x1,x2) liegt auf einem der Eckpunkte
-    if(x1==this->getPoint(0)->getX1Coordinate() && x2 == this->getPoint(0)->getX2Coordinate())	return true;
-	 if(x1==this->getPoint(1)->getX1Coordinate() && x2 == this->getPoint(1)->getX2Coordinate())	return true;
-	 if(x1==this->getPoint(2)->getX1Coordinate() && x2 == this->getPoint(2)->getX2Coordinate())  return true;
-
-	 //Erste Grade aus dem zu pruefenden Punkt(x,y) und einem zweiten Punkt(x+0.333,y+2.333)
-	 GbPoint3D p1;		p1.setX1(x1);			p1.setX2(x2);			p1.setX3(0.0);
-	 GbPoint3D p2;		p2.setX1(x1+0.333);	p2.setX2(x2+3.333);	p2.setX3(0.0);
-	 //Punkte des Dreiecks auf 2D reduziert
-	 GbPoint3D dp1;	dp1.setX1(this->getPoint(0)->getX1Coordinate());	dp1.setX2(this->getPoint(0)->getX2Coordinate());	dp1.setX3(0.0);
-	 GbPoint3D dp2;	dp2.setX1(this->getPoint(1)->getX1Coordinate());	dp2.setX2(this->getPoint(1)->getX2Coordinate());	dp2.setX3(0.0);
-	 GbPoint3D dp3;	dp3.setX1(this->getPoint(2)->getX1Coordinate());	dp3.setX2(this->getPoint(2)->getX2Coordinate());	dp3.setX3(0.0);
-	 //ueberpruefen, ob der Punkt(x,y) innerhalt der Boundingbox des Dreiecks liegt
-	 if(	 x1<this->getX1Maximum() && x1>getX1Minimum()
-		 && x2<this->getX2Maximum() && x2>getX2Minimum())
-	 {
-		 GbPoint3D* dummy = NULL;
-		 //ueberpruefen, ob der Punkt innerhalb des Dreiecks liegt
-		 dummy = GbSystem3D::calculateIntersectionPoint3D(p1,p2,dp1,dp2);
-		 if(dummy!=NULL)
-       {
-          if(dummy->getX1Coordinate()==p1.getX1Coordinate() && dummy->getX2Coordinate()==p1.getX2Coordinate())	
-          {
-             delete dummy;
-             return true;
-          }
-			 else if(dummy->getX1Coordinate()>p1.getX1Coordinate())
-          {
-             i++;
-          }
-			 else
-          {
-             i--;
-          }
-       }
-       if(dummy)  delete dummy;
-
-       dummy = GbSystem3D::calculateIntersectionPoint3D(p1,p2,dp2,dp3);
-		 if(dummy!=NULL)
-       {
-          if(dummy->getX1Coordinate()==p1.getX1Coordinate() && dummy->getX2Coordinate()==p1.getX2Coordinate())
-          {
-             if(dummy)  delete dummy;
-             return true;
-          }
-			 else if(dummy->getX1Coordinate()>p1.getX1Coordinate())
-          {
-             i++;
-          }
-			 else
-          {
-             i--;
-          }
-       }
-       if(dummy)  delete dummy;
-
-		 dummy = GbSystem3D::calculateIntersectionPoint3D(p1,p2,dp3,dp1);
-		 if(dummy!=NULL)
-       {
-          if(dummy->getX1Coordinate()==p1.getX1Coordinate() && dummy->getX2Coordinate()==p1.getX2Coordinate())
-          {
-             if(dummy)  delete dummy;
-             return true;
-          }
-			 else if(dummy->getX1Coordinate()>p1.getX1Coordinate())
-          {
-             i++;
-          }
-          else
-          {
-             i--;
-          }
-       }
-       if(dummy)  delete dummy;
-	 }
-	 if(i==-1) return true;
-	 if(i==1 ) return true;
-	
+ * Returns true if the specified 2D point lies within (or on the border of) this 2D triangle.
+ * @param point the 2D point to check
+ * @return true if the specified 2D point lies within (or on the border of) this 2D triangle
+ */
+bool GbTriangle3D::enclosesPoint2D(double x1, double x2)
+{
+    int i = 0;
+    // Punkt(x1,x2) liegt auf einem der Eckpunkte
+    if (x1 == this->getPoint(0)->getX1Coordinate() && x2 == this->getPoint(0)->getX2Coordinate())
+        return true;
+    if (x1 == this->getPoint(1)->getX1Coordinate() && x2 == this->getPoint(1)->getX2Coordinate())
+        return true;
+    if (x1 == this->getPoint(2)->getX1Coordinate() && x2 == this->getPoint(2)->getX2Coordinate())
+        return true;
+
+    // Erste Grade aus dem zu pruefenden Punkt(x,y) und einem zweiten Punkt(x+0.333,y+2.333)
+    GbPoint3D p1;
+    p1.setX1(x1);
+    p1.setX2(x2);
+    p1.setX3(0.0);
+    GbPoint3D p2;
+    p2.setX1(x1 + 0.333);
+    p2.setX2(x2 + 3.333);
+    p2.setX3(0.0);
+    // Punkte des Dreiecks auf 2D reduziert
+    GbPoint3D dp1;
+    dp1.setX1(this->getPoint(0)->getX1Coordinate());
+    dp1.setX2(this->getPoint(0)->getX2Coordinate());
+    dp1.setX3(0.0);
+    GbPoint3D dp2;
+    dp2.setX1(this->getPoint(1)->getX1Coordinate());
+    dp2.setX2(this->getPoint(1)->getX2Coordinate());
+    dp2.setX3(0.0);
+    GbPoint3D dp3;
+    dp3.setX1(this->getPoint(2)->getX1Coordinate());
+    dp3.setX2(this->getPoint(2)->getX2Coordinate());
+    dp3.setX3(0.0);
+    // ueberpruefen, ob der Punkt(x,y) innerhalt der Boundingbox des Dreiecks liegt
+    if (x1 < this->getX1Maximum() && x1 > getX1Minimum() && x2 < this->getX2Maximum() && x2 > getX2Minimum()) {
+        GbPoint3D *dummy = NULL;
+        // ueberpruefen, ob der Punkt innerhalb des Dreiecks liegt
+        dummy = GbSystem3D::calculateIntersectionPoint3D(p1, p2, dp1, dp2);
+        if (dummy != NULL) {
+            if (dummy->getX1Coordinate() == p1.getX1Coordinate() && dummy->getX2Coordinate() == p1.getX2Coordinate()) {
+                delete dummy;
+                return true;
+            } else if (dummy->getX1Coordinate() > p1.getX1Coordinate()) {
+                i++;
+            } else {
+                i--;
+            }
+        }
+        if (dummy)
+            delete dummy;
+
+        dummy = GbSystem3D::calculateIntersectionPoint3D(p1, p2, dp2, dp3);
+        if (dummy != NULL) {
+            if (dummy->getX1Coordinate() == p1.getX1Coordinate() && dummy->getX2Coordinate() == p1.getX2Coordinate()) {
+                if (dummy)
+                    delete dummy;
+                return true;
+            } else if (dummy->getX1Coordinate() > p1.getX1Coordinate()) {
+                i++;
+            } else {
+                i--;
+            }
+        }
+        if (dummy)
+            delete dummy;
+
+        dummy = GbSystem3D::calculateIntersectionPoint3D(p1, p2, dp3, dp1);
+        if (dummy != NULL) {
+            if (dummy->getX1Coordinate() == p1.getX1Coordinate() && dummy->getX2Coordinate() == p1.getX2Coordinate()) {
+                if (dummy)
+                    delete dummy;
+                return true;
+            } else if (dummy->getX1Coordinate() > p1.getX1Coordinate()) {
+                i++;
+            } else {
+                i--;
+            }
+        }
+        if (dummy)
+            delete dummy;
+    }
+    if (i == -1)
+        return true;
+    if (i == 1)
+        return true;
+
     return false;
- }
+}
 
 ///*
 //* Returns a new 2D polygon clipped by the specified 2D rectangle (result may be null!).
 //* @param rectangle the 2D rectangle
 //* @return a new 2D polygon clipped by the specified 2D rectangle
 //*/
-GbPolygon3D* GbTriangle3D::createClippedPolygon3D(GbCuboid3D* cube)
+GbPolygon3D *GbTriangle3D::createClippedPolygon3D(GbCuboid3D *cube)
 {
-   return(GbSystem3D::clipPolygon3D(this->getPoints(), cube->getPoint1()->getX1Coordinate(), cube->getPoint1()->getX2Coordinate(), cube->getPoint1()->getX3Coordinate(), cube->getPoint2()->getX1Coordinate(), cube->getPoint2()->getX2Coordinate(), cube->getPoint2()->getX3Coordinate()));
+    return (GbSystem3D::clipPolygon3D(this->getPoints(), cube->getPoint1()->getX1Coordinate(),
+                                      cube->getPoint1()->getX2Coordinate(), cube->getPoint1()->getX3Coordinate(),
+                                      cube->getPoint2()->getX1Coordinate(), cube->getPoint2()->getX2Coordinate(),
+                                      cube->getPoint2()->getX3Coordinate()));
 }
 ///*
 //* Returns a new 2D polygon clipped by the specified 2D rectangle (result may be null!).
@@ -686,445 +749,400 @@ GbPolygon3D* GbTriangle3D::createClippedPolygon3D(GbCuboid3D* cube)
 //* @param p2 the 2nd point of the rectangle
 //* @return a new 2D polygon clipped by the specified 2D rectangle
 //*/
-//public GbPolygon2D createClippedPolygon2D(GbPoint2D p1, GbPoint2D p2)
+// public GbPolygon2D createClippedPolygon2D(GbPoint2D p1, GbPoint2D p2)
 //{
 //   return(GbSystem.clipPolygon2D(this.points, p1.x1, p1.x2, p2.x1, p2.x2));
 //}
 /*
-* Returns a new 2D polygon clipped by the specified 2D rectangle (result may be null!).
-* @param p1x1 the 1st x1 coordinate of the rectangle
-* @param p1x2 the 1st x2 coordinate of the rectangle
-* @param p2x1 the 2nd x1 coordinate of the rectangle
-* @param p2x2 the 2nd x2 coordinate of the rectangle
-* @return a new 2D polygon clipped by the specified 2D rectangle
-*/
-GbPolygon3D* GbTriangle3D::createClippedPolygon3D(const double& p1x1, const double& p1x2, const double& p1x3, const double& p2x1, const double& p2x2, const double& p2x3)
+ * Returns a new 2D polygon clipped by the specified 2D rectangle (result may be null!).
+ * @param p1x1 the 1st x1 coordinate of the rectangle
+ * @param p1x2 the 1st x2 coordinate of the rectangle
+ * @param p2x1 the 2nd x1 coordinate of the rectangle
+ * @param p2x2 the 2nd x2 coordinate of the rectangle
+ * @return a new 2D polygon clipped by the specified 2D rectangle
+ */
+GbPolygon3D *GbTriangle3D::createClippedPolygon3D(const double &p1x1, const double &p1x2, const double &p1x3,
+                                                  const double &p2x1, const double &p2x2, const double &p2x3)
 {
-   return(GbSystem3D::clipPolygon3D(this->getPoints(), p1x1, p1x2, p1x3, p2x1, p2x2, p2x3));
+    return (GbSystem3D::clipPolygon3D(this->getPoints(), p1x1, p1x2, p1x3, p2x1, p2x2, p2x3));
 }
 
 /*
-* Returns true if the specified 2D rectangle lies completely within this 2D triangle.
-* @param rectangle the 2D rectangle to check
-* @return true if the specified 2D rectangle lies completely within this 2D triangle
-*/
-//bool enclosesRectangle2D(GbRectangle2D *rectangle)
+ * Returns true if the specified 2D rectangle lies completely within this 2D triangle.
+ * @param rectangle the 2D rectangle to check
+ * @return true if the specified 2D rectangle lies completely within this 2D triangle
+ */
+// bool enclosesRectangle2D(GbRectangle2D *rectangle)
 //{
-//   GbPolygon2D p = GbSystem.clipPolygon2D(this.points, rectangle.p1.x1, rectangle.p1.x2, rectangle.p2.x1, rectangle.p2.x2);
-//   return(p!=null && GbSystem.equal(Math.abs(p.getArea()), rectangle.getArea()));
+//   GbPolygon2D p = GbSystem.clipPolygon2D(this.points, rectangle.p1.x1, rectangle.p1.x2, rectangle.p2.x1,
+//   rectangle.p2.x2); return(p!=null && GbSystem.equal(Math.abs(p.getArea()), rectangle.getArea()));
 //}
 /*
-* Returns true if the specified 2D rectangle lies completely within this 2D triangle.
-* @param p1 the 1st point of the rectangle to check
-* @param p2 the 2nd point of the rectangle to check                         triangle
-* @return true if the specified 2D rectangle lies completely within this 2D
-*/
-//public boolean enclosesRectangle2D(GbPoint2D p1, GbPoint2D p2)
+ * Returns true if the specified 2D rectangle lies completely within this 2D triangle.
+ * @param p1 the 1st point of the rectangle to check
+ * @param p2 the 2nd point of the rectangle to check                         triangle
+ * @return true if the specified 2D rectangle lies completely within this 2D
+ */
+// public boolean enclosesRectangle2D(GbPoint2D p1, GbPoint2D p2)
 //{
 //   GbPolygon2D p = GbSystem.clipPolygon2D(this.points, p1.x1, p1.x2, p2.x1, p2.x2);
 //   return(p!=null && GbSystem.equal(Math.abs(p.getArea()), Math.abs((p1.x1-p2.x1)*(p1.x2-p2.x2))));
 //}
 /*
-* Returns true if the specified 2D rectangle lies completely within this 2D triangle.
-* @param p1x1 the 1st x1 coordinate of the rectangle to check
-* @param p1x2 the 1st x2 coordinate of the rectangle to check
-* @param p2x1 the 2nd x1 coordinate of the rectangle to check
-* @param p2x2 the 2nd x2 coordinate of the rectangle to check
-* @return true if the specified 2D rectangle lies completely within this 2D triangle
-*/
-//public boolean enclosesRectangle2D(double p1x1, double p1x2, double p2x1, double p2x2)
+ * Returns true if the specified 2D rectangle lies completely within this 2D triangle.
+ * @param p1x1 the 1st x1 coordinate of the rectangle to check
+ * @param p1x2 the 1st x2 coordinate of the rectangle to check
+ * @param p2x1 the 2nd x1 coordinate of the rectangle to check
+ * @param p2x2 the 2nd x2 coordinate of the rectangle to check
+ * @return true if the specified 2D rectangle lies completely within this 2D triangle
+ */
+// public boolean enclosesRectangle2D(double p1x1, double p1x2, double p2x1, double p2x2)
 //{
 //   GbPolygon2D p = GbSystem.clipPolygon2D(this.points, p1x1, p1x2, p2x1, p2x2);
 //   return(p!=null && GbSystem.equal(Math.abs(p.getArea()), Math.abs((p1x1-p2x1)*(p1x2-p2x2))));
 //}
 
 /*
-* Returns true if the specified 2D rectangle is crossed by this 2D triangle.
-* @param rectangle the 2D rectangle to check
-* @return true if the specified 2D rectangle is crossed by this 2D triangle
-*/
-//public boolean crossesRectangle2D(GbRectangle2D rectangle)
+ * Returns true if the specified 2D rectangle is crossed by this 2D triangle.
+ * @param rectangle the 2D rectangle to check
+ * @return true if the specified 2D rectangle is crossed by this 2D triangle
+ */
+// public boolean crossesRectangle2D(GbRectangle2D rectangle)
 //{
-//   GbPolygon2D p = GbSystem.clipPolygon2D(this.points, rectangle.p1.x1, rectangle.p1.x2, rectangle.p2.x1, rectangle.p2.x2);
-//   return(p!=null && GbSystem.inOpenInterval(Math.abs(p.getArea()), 0.0, rectangle.getArea()));
+//   GbPolygon2D p = GbSystem.clipPolygon2D(this.points, rectangle.p1.x1, rectangle.p1.x2, rectangle.p2.x1,
+//   rectangle.p2.x2); return(p!=null && GbSystem.inOpenInterval(Math.abs(p.getArea()), 0.0, rectangle.getArea()));
 //}
 /*
-* Returns true if the specified 2D rectangle is crossed by this 2D triangle.
-* @param p1 the 1st point of the rectangle to check
-* @param p2 the 2nd point of the rectangle to check
-* @return true if the specified 2D rectangle is crossed by this 2D triangle
-*/
-//public boolean crossesRectangle2D(GbPoint2D p1, GbPoint2D p2)
+ * Returns true if the specified 2D rectangle is crossed by this 2D triangle.
+ * @param p1 the 1st point of the rectangle to check
+ * @param p2 the 2nd point of the rectangle to check
+ * @return true if the specified 2D rectangle is crossed by this 2D triangle
+ */
+// public boolean crossesRectangle2D(GbPoint2D p1, GbPoint2D p2)
 //{
 //   GbPolygon2D p = GbSystem.clipPolygon2D(this.points, p1.x1, p1.x2, p2.x1, p2.x2);
 //   return(p!=null && GbSystem.inOpenInterval(Math.abs(p.getArea()), 0.0, Math.abs((p1.x1-p2.x1)*(p1.x2-p2.x2))));
 //}
 /*
-* Returns true if the specified 2D rectangle is crossed by this 2D triangle.
-* @param p1x1 the 1st x1 coordinate of the rectangle to check
-* @param p1x2 the 1st x2 coordinate of the rectangle to check
-* @param p2x1 the 2nd x1 coordinate of the rectangle to check
-* @param p2x2 the 2nd x2 coordinate of the rectangle to check
-* @return true if the specified 2D rectangle is crossed by this 2D triangle
-*/
-//public boolean crossesRectangle2D(double p1x1, double p1x2, double p2x1, double p2x2)
+ * Returns true if the specified 2D rectangle is crossed by this 2D triangle.
+ * @param p1x1 the 1st x1 coordinate of the rectangle to check
+ * @param p1x2 the 1st x2 coordinate of the rectangle to check
+ * @param p2x1 the 2nd x1 coordinate of the rectangle to check
+ * @param p2x2 the 2nd x2 coordinate of the rectangle to check
+ * @return true if the specified 2D rectangle is crossed by this 2D triangle
+ */
+// public boolean crossesRectangle2D(double p1x1, double p1x2, double p2x1, double p2x2)
 //{
 //   GbPolygon2D p = GbSystem.clipPolygon2D(this.points, p1x1, p1x2, p2x1, p2x2);
 //   return(p!=null && GbSystem.inOpenInterval(Math.abs(p.getArea()), 0.0, Math.abs((p1x1-p2x1)*(p1x2-p2x2))));
 //}
 
 /*
-* Returns true if the specified 2D rectangle lies (at least partly) within this 2D triangle.
-* @param rectangle the 2D rectangle to check
-* @return true if the specified 2D rectangle lies (at least partly) within this 2D triangle
-*/
-//public boolean enclosesOrCrossesRectangle2D(GbRectangle2D rectangle)
+ * Returns true if the specified 2D rectangle lies (at least partly) within this 2D triangle.
+ * @param rectangle the 2D rectangle to check
+ * @return true if the specified 2D rectangle lies (at least partly) within this 2D triangle
+ */
+// public boolean enclosesOrCrossesRectangle2D(GbRectangle2D rectangle)
 //{
-//   GbPolygon2D p = GbSystem.clipPolygon2D(this.points, rectangle.p1.x1, rectangle.p1.x2, rectangle.p2.x1, rectangle.p2.x2);
-//   return(p!=null && GbSystem.greater(Math.abs(p.getArea()), 0.0));
+//   GbPolygon2D p = GbSystem.clipPolygon2D(this.points, rectangle.p1.x1, rectangle.p1.x2, rectangle.p2.x1,
+//   rectangle.p2.x2); return(p!=null && GbSystem.greater(Math.abs(p.getArea()), 0.0));
 //}
 /*
-* Returns true if the specified 2D rectangle lies (at least partly) within this 2D triangle.
-* @param p1 the 1st point of the rectangle to check
-* @param p2 the 2nd point of the rectangle to check
-* @return true if the specified 2D rectangle lies (at least partly) within this 2D triangle
-*/
-//public boolean enclosesOrCrossesRectangle2D(GbPoint2D p1, GbPoint2D p2)
+ * Returns true if the specified 2D rectangle lies (at least partly) within this 2D triangle.
+ * @param p1 the 1st point of the rectangle to check
+ * @param p2 the 2nd point of the rectangle to check
+ * @return true if the specified 2D rectangle lies (at least partly) within this 2D triangle
+ */
+// public boolean enclosesOrCrossesRectangle2D(GbPoint2D p1, GbPoint2D p2)
 //{
 //   GbPolygon2D p = GbSystem.clipPolygon2D(this.points, p1.x1, p1.x2, p2.x1, p2.x2);
 //   return(p!=null && GbSystem.greater(Math.abs(p.getArea()), 0.0));
 //}
 /*
-* Returns true if the specified 2D rectangle lies (at least partly) within this 2D triangle.
-* @param p1x1 the 1st x1 coordinate of the rectangle to check
-* @param p1x2 the 1st x2 coordinate of the rectangle to check
-* @param p2x1 the 2nd x1 coordinate of the rectangle to check
-* @param p2x2 the 2nd x2 coordinate of the rectangle to check
-* @return true if the specified 2D rectangle lies (at least partly) within this 2D triangle
-*/
-//public boolean enclosesOrCrossesRectangle2D(double p1x1, double p1x2, double p2x1, double p2x2)
+ * Returns true if the specified 2D rectangle lies (at least partly) within this 2D triangle.
+ * @param p1x1 the 1st x1 coordinate of the rectangle to check
+ * @param p1x2 the 1st x2 coordinate of the rectangle to check
+ * @param p2x1 the 2nd x1 coordinate of the rectangle to check
+ * @param p2x2 the 2nd x2 coordinate of the rectangle to check
+ * @return true if the specified 2D rectangle lies (at least partly) within this 2D triangle
+ */
+// public boolean enclosesOrCrossesRectangle2D(double p1x1, double p1x2, double p2x1, double p2x2)
 //{
 //   GbPolygon2D p = GbSystem.clipPolygon2D(this.points, p1x1, p1x2, p2x1, p2x2);
 //   return(p!=null && GbSystem.greater(Math.abs(p.getArea()), 0.0));
 //}
 /*======================================================================*/
 
-
 /*======================================================================*/
 /*  Private Methoden                                                    */
 /*                                                                      */
 void GbTriangle3D::calculateValues()
 {
-   this->x1min = this->points[0]->x1;
-   this->x1max = this->points[0]->x1;
-   this->x2min = this->points[0]->x2;
-   this->x2max = this->points[0]->x2;
-   this->x3min = this->points[0]->x3;
-   this->x3max = this->points[0]->x3;
-
-   if(this->points[1]->x1 < this->x1min) this->x1min = this->points[1]->x1;
-   if(this->points[1]->x1 > this->x1max) this->x1max = this->points[1]->x1;
-   if(this->points[1]->x2 < this->x2min) this->x2min = this->points[1]->x2;
-   if(this->points[1]->x2 > this->x2max) this->x2max = this->points[1]->x2;
-   if(this->points[1]->x3 < this->x3min) this->x3min = this->points[1]->x3;
-   if(this->points[1]->x3 > this->x3max) this->x3max = this->points[1]->x3;
-
-   if(this->points[2]->x1 < this->x1min) this->x1min = this->points[2]->x1;
-   if(this->points[2]->x1 > this->x1max) this->x1max = this->points[2]->x1;
-   if(this->points[2]->x2 < this->x2min) this->x2min = this->points[2]->x2;
-   if(this->points[2]->x2 > this->x2max) this->x2max = this->points[2]->x2;
-   if(this->points[2]->x3 < this->x3min) this->x3min = this->points[2]->x3;
-   if(this->points[2]->x3 > this->x3max) this->x3max = this->points[2]->x3;
-
-   this->x1s   = (this->points[0]->x1+this->points[1]->x1+this->points[2]->x1)/3.0;
-   this->x2s   = (this->points[0]->x2+this->points[1]->x2+this->points[2]->x2)/3.0;
-   this->x3s   = (this->points[0]->x3+this->points[1]->x3+this->points[2]->x3)/3.0;
-
-   GbVector3D A(points[0]->x1,points[0]->x2,points[0]->x3);
-   GbVector3D B(points[1]->x1,points[1]->x2,points[1]->x3);
-   GbVector3D C(points[2]->x1,points[2]->x2,points[2]->x3);
-   GbVector3D AB = B-A;
-   GbVector3D AC = C-A;
-   GbVector3D N = AB.Cross(AC);
-   this->area = 0.5*N.Length();
-   this->consistent = true;
+    this->x1min = this->points[0]->x1;
+    this->x1max = this->points[0]->x1;
+    this->x2min = this->points[0]->x2;
+    this->x2max = this->points[0]->x2;
+    this->x3min = this->points[0]->x3;
+    this->x3max = this->points[0]->x3;
+
+    if (this->points[1]->x1 < this->x1min)
+        this->x1min = this->points[1]->x1;
+    if (this->points[1]->x1 > this->x1max)
+        this->x1max = this->points[1]->x1;
+    if (this->points[1]->x2 < this->x2min)
+        this->x2min = this->points[1]->x2;
+    if (this->points[1]->x2 > this->x2max)
+        this->x2max = this->points[1]->x2;
+    if (this->points[1]->x3 < this->x3min)
+        this->x3min = this->points[1]->x3;
+    if (this->points[1]->x3 > this->x3max)
+        this->x3max = this->points[1]->x3;
+
+    if (this->points[2]->x1 < this->x1min)
+        this->x1min = this->points[2]->x1;
+    if (this->points[2]->x1 > this->x1max)
+        this->x1max = this->points[2]->x1;
+    if (this->points[2]->x2 < this->x2min)
+        this->x2min = this->points[2]->x2;
+    if (this->points[2]->x2 > this->x2max)
+        this->x2max = this->points[2]->x2;
+    if (this->points[2]->x3 < this->x3min)
+        this->x3min = this->points[2]->x3;
+    if (this->points[2]->x3 > this->x3max)
+        this->x3max = this->points[2]->x3;
+
+    this->x1s = (this->points[0]->x1 + this->points[1]->x1 + this->points[2]->x1) / 3.0;
+    this->x2s = (this->points[0]->x2 + this->points[1]->x2 + this->points[2]->x2) / 3.0;
+    this->x3s = (this->points[0]->x3 + this->points[1]->x3 + this->points[2]->x3) / 3.0;
+
+    GbVector3D A(points[0]->x1, points[0]->x2, points[0]->x3);
+    GbVector3D B(points[1]->x1, points[1]->x2, points[1]->x3);
+    GbVector3D C(points[2]->x1, points[2]->x2, points[2]->x3);
+    GbVector3D AB    = B - A;
+    GbVector3D AC    = C - A;
+    GbVector3D N     = AB.Cross(AC);
+    this->area       = 0.5 * N.Length();
+    this->consistent = true;
 }
 /*======================================================================*/
 
-
 /*======================================================================*/
 GbVector3D GbTriangle3D::getNormal()
 {
-   this->calculateNormal();
-   return normal; 
+    this->calculateNormal();
+    return normal;
 }
 /*======================================================================*/
 void GbTriangle3D::init()
 {
-   x1s        = 0.0;
-   x2s        = 0.0;
-   x3s        = 0.0;
-   x1min      = 0.0;
-   x1max      = 0.0;
-   x2min      = 0.0;
-   x2max      = 0.0;
-   area       = 0.0;
-   consistent = false;
-   points.resize(3,NULL);
+    x1s        = 0.0;
+    x2s        = 0.0;
+    x3s        = 0.0;
+    x1min      = 0.0;
+    x1max      = 0.0;
+    x2min      = 0.0;
+    x2max      = 0.0;
+    area       = 0.0;
+    consistent = false;
+    points.resize(3, NULL);
 }
 /*=======================================================*/
 void GbTriangle3D::calculateNormal()
 {
-   GbPoint3D*& a = points[0]; 
-   GbPoint3D*& b = points[1];
-   GbPoint3D*& c = points[2];
-   normal[0] = ( c->getX3Coordinate() - a->getX3Coordinate()) * ( b->getX2Coordinate() - a->getX2Coordinate() ) -
-               ( b->getX3Coordinate() - a->getX3Coordinate()) * ( c->getX2Coordinate() - a->getX2Coordinate() );
-   normal[1] = ( b->getX3Coordinate() - a->getX3Coordinate()) * ( c->getX1Coordinate() - a->getX1Coordinate() ) -
-               ( b->getX1Coordinate() - a->getX1Coordinate()) * ( c->getX3Coordinate() - a->getX3Coordinate() );
-   normal[2] = ( b->getX1Coordinate() - a->getX1Coordinate()) * ( c->getX2Coordinate() - a->getX2Coordinate() ) -
-               ( b->getX2Coordinate() - a->getX2Coordinate()) * ( c->getX1Coordinate() - a->getX1Coordinate() );
-   normal.Normalize();
+    GbPoint3D *&a = points[0];
+    GbPoint3D *&b = points[1];
+    GbPoint3D *&c = points[2];
+    normal[0]     = (c->getX3Coordinate() - a->getX3Coordinate()) * (b->getX2Coordinate() - a->getX2Coordinate()) -
+                (b->getX3Coordinate() - a->getX3Coordinate()) * (c->getX2Coordinate() - a->getX2Coordinate());
+    normal[1] = (b->getX3Coordinate() - a->getX3Coordinate()) * (c->getX1Coordinate() - a->getX1Coordinate()) -
+                (b->getX1Coordinate() - a->getX1Coordinate()) * (c->getX3Coordinate() - a->getX3Coordinate());
+    normal[2] = (b->getX1Coordinate() - a->getX1Coordinate()) * (c->getX2Coordinate() - a->getX2Coordinate()) -
+                (b->getX2Coordinate() - a->getX2Coordinate()) * (c->getX1Coordinate() - a->getX1Coordinate());
+    normal.Normalize();
 }
 /*=======================================================*/
-//toDo: 
+// toDo:
 double GbTriangle3D::getDistanceFromPoint(GbVector3D punct)
 {
-	GbVector3D Point1(this->getPoint1()->getX1Coordinate(), this->getPoint1()->getX2Coordinate(), this->getPoint1()->getX3Coordinate());
-	GbVector3D Point2(this->getPoint2()->getX1Coordinate(), this->getPoint2()->getX2Coordinate(), this->getPoint2()->getX3Coordinate());
-	GbVector3D Point3(this->getPoint3()->getX1Coordinate(), this->getPoint3()->getX2Coordinate(), this->getPoint3()->getX3Coordinate());
-
-	GbVector3D kDiff = Point1 - punct;
-	GbVector3D kEdge0 = Point2 - Point1;
-	GbVector3D kEdge1 = Point3 - Point1;
-	double fA00 = kEdge0.SquaredLength();
-	double fA01 = kEdge0.Dot(kEdge1);
-	double fA11 = kEdge1.SquaredLength();
-	double fB0 = kDiff.Dot(kEdge0);
-	double fB1 = kDiff.Dot(kEdge1);
-	double fC = kDiff.SquaredLength();
-	double fDet = fabs(fA00*fA11-fA01*fA01);
-	double fS = fA01*fB1-fA11*fB0;
-	double fT = fA01*fB0-fA00*fB1;
-	double fSqrDistance;
-
-	if (fS + fT <= fDet)
-	{
-		if (fS < (double)0.0)
-		{
-			if (fT < (double)0.0)  // region 4
-			{
-				if (fB0 < (double)0.0)
-				{
-					fT = (double)0.0;
-					if (-fB0 >= fA00)
-					{
-						fS = (double)1.0;
-						fSqrDistance = fA00+((double)2.0)*fB0+fC;
-					}
-					else
-					{
-						fS = -fB0/fA00;
-						fSqrDistance = fB0*fS+fC;
-					}
-				}
-				else
-				{
-					fS = (double)0.0;
-					if (fB1 >= (double)0.0)
-					{
-						fT = (double)0.0;
-						fSqrDistance = fC;
-					}
-					else if (-fB1 >= fA11)
-					{
-						fT = (double)1.0;
-						fSqrDistance = fA11+((double)2.0)*fB1+fC;
-					}
-					else
-					{
-						fT = -fB1/fA11;
-						fSqrDistance = fB1*fT+fC;
-					}
-				}
-			}
-			else  // region 3
-			{
-				fS = (double)0.0;
-				if (fB1 >= (double)0.0)
-				{
-					fT = (double)0.0;
-					fSqrDistance = fC;
-				}
-				else if (-fB1 >= fA11)
-				{
-					fT = (double)1.0;
-					fSqrDistance = fA11+((double)2.0)*fB1+fC;
-				}
-				else
-				{
-					fT = -fB1/fA11;
-					fSqrDistance = fB1*fT+fC;
-				}
-			}
-		}
-		else if (fT < (double)0.0)  // region 5
-		{
-			fT = (double)0.0;
-			if (fB0 >= (double)0.0)
-			{
-				fS = (double)0.0;
-				fSqrDistance = fC;
-			}
-			else if (-fB0 >= fA00)
-			{
-				fS = (double)1.0;
-				fSqrDistance = fA00+((double)2.0)*fB0+fC;
-			}
-			else
-			{
-				fS = -fB0/fA00;
-				fSqrDistance = fB0*fS+fC;
-			}
-		}
-		else  // region 0
-		{
-			// minimum at interior point
-			double fInvDet = ((double)1.0)/fDet;
-			fS *= fInvDet;
-			fT *= fInvDet;
-			fSqrDistance = fS*(fA00*fS+fA01*fT+((double)2.0)*fB0) +
-				fT*(fA01*fS+fA11*fT+((double)2.0)*fB1)+fC;
-		}
-	}
-	else
-	{
-		double fTmp0, fTmp1, fNumer, fDenom;
-
-		if (fS < (double)0.0)  // region 2
-		{
-			fTmp0 = fA01 + fB0;
-			fTmp1 = fA11 + fB1;
-			if (fTmp1 > fTmp0)
-			{
-				fNumer = fTmp1 - fTmp0;
-				fDenom = fA00-2.0f*fA01+fA11;
-				if (fNumer >= fDenom)
-				{
-					fS = (double)1.0;
-					fT = (double)0.0;
-					fSqrDistance = fA00+((double)2.0)*fB0+fC;
-				}
-				else
-				{
-					fS = fNumer/fDenom;
-					fT = (double)1.0 - fS;
-					fSqrDistance = fS*(fA00*fS+fA01*fT+2.0f*fB0) +
-						fT*(fA01*fS+fA11*fT+((double)2.0)*fB1)+fC;
-				}
-			}
-			else
-			{
-				fS = (double)0.0;
-				if (fTmp1 <= (double)0.0)
-				{
-					fT = (double)1.0;
-					fSqrDistance = fA11+((double)2.0)*fB1+fC;
-				}
-				else if (fB1 >= (double)0.0)
-				{
-					fT = (double)0.0;
-					fSqrDistance = fC;
-				}
-				else
-				{
-					fT = -fB1/fA11;
-					fSqrDistance = fB1*fT+fC;
-				}
-			}
-		}
-		else if (fT < (double)0.0)  // region 6
-		{
-			fTmp0 = fA01 + fB1;
-			fTmp1 = fA00 + fB0;
-			if (fTmp1 > fTmp0)
-			{
-				fNumer = fTmp1 - fTmp0;
-				fDenom = fA00-((double)2.0)*fA01+fA11;
-				if (fNumer >= fDenom)
-				{
-					fT = (double)1.0;
-					fS = (double)0.0;
-					fSqrDistance = fA11+((double)2.0)*fB1+fC;
-				}
-				else
-				{
-					fT = fNumer/fDenom;
-					fS = (double)1.0 - fT;
-					fSqrDistance = fS*(fA00*fS+fA01*fT+((double)2.0)*fB0) +
-						fT*(fA01*fS+fA11*fT+((double)2.0)*fB1)+fC;
-				}
-			}
-			else
-			{
-				fT = (double)0.0;
-				if (fTmp1 <= (double)0.0)
-				{
-					fS = (double)1.0;
-					fSqrDistance = fA00+((double)2.0)*fB0+fC;
-				}
-				else if (fB0 >= (double)0.0)
-				{
-					fS = (double)0.0;
-					fSqrDistance = fC;
-				}
-				else
-				{
-					fS = -fB0/fA00;
-					fSqrDistance = fB0*fS+fC;
-				}
-			}
-		}
-		else  // region 1
-		{
-			fNumer = fA11 + fB1 - fA01 - fB0;
-			if (fNumer <= (double)0.0)
-			{
-				fS = (double)0.0;
-				fT = (double)1.0;
-				fSqrDistance = fA11+((double)2.0)*fB1+fC;
-			}
-			else
-			{
-				fDenom = fA00-2.0f*fA01+fA11;
-				if (fNumer >= fDenom)
-				{
-					fS = (double)1.0;
-					fT = (double)0.0;
-					fSqrDistance = fA00+((double)2.0)*fB0+fC;
-				}
-				else
-				{
-					fS = fNumer/fDenom;
-					fT = (double)1.0 - fS;
-					fSqrDistance = fS*(fA00*fS+fA01*fT+((double)2.0)*fB0) +
-						fT*(fA01*fS+fA11*fT+((double)2.0)*fB1)+fC;
-				}
-			}
-		}
-	}
-
-	// account for numerical round-off error
-	if (fSqrDistance < (double)0.0)
-	{
-		fSqrDistance = (double)0.0;
-	}
-/*
-	m_kClosestPoint0 = punct;
-	m_kClosestPoint1 = m_rkTriangle.V[0] + fS*kEdge0 + fT*kEdge1;
-	m_afTriangleBary[1] = fS;
-	m_afTriangleBary[2] = fT;
-	m_afTriangleBary[0] = (double)1.0 - fS - fT;
-*/
-	return sqrt(fSqrDistance);
+    GbVector3D Point1(this->getPoint1()->getX1Coordinate(), this->getPoint1()->getX2Coordinate(),
+                      this->getPoint1()->getX3Coordinate());
+    GbVector3D Point2(this->getPoint2()->getX1Coordinate(), this->getPoint2()->getX2Coordinate(),
+                      this->getPoint2()->getX3Coordinate());
+    GbVector3D Point3(this->getPoint3()->getX1Coordinate(), this->getPoint3()->getX2Coordinate(),
+                      this->getPoint3()->getX3Coordinate());
+
+    GbVector3D kDiff  = Point1 - punct;
+    GbVector3D kEdge0 = Point2 - Point1;
+    GbVector3D kEdge1 = Point3 - Point1;
+    double fA00       = kEdge0.SquaredLength();
+    double fA01       = kEdge0.Dot(kEdge1);
+    double fA11       = kEdge1.SquaredLength();
+    double fB0        = kDiff.Dot(kEdge0);
+    double fB1        = kDiff.Dot(kEdge1);
+    double fC         = kDiff.SquaredLength();
+    double fDet       = fabs(fA00 * fA11 - fA01 * fA01);
+    double fS         = fA01 * fB1 - fA11 * fB0;
+    double fT         = fA01 * fB0 - fA00 * fB1;
+    double fSqrDistance;
+
+    if (fS + fT <= fDet) {
+        if (fS < (double)0.0) {
+            if (fT < (double)0.0) // region 4
+            {
+                if (fB0 < (double)0.0) {
+                    fT = (double)0.0;
+                    if (-fB0 >= fA00) {
+                        fS           = (double)1.0;
+                        fSqrDistance = fA00 + ((double)2.0) * fB0 + fC;
+                    } else {
+                        fS           = -fB0 / fA00;
+                        fSqrDistance = fB0 * fS + fC;
+                    }
+                } else {
+                    fS = (double)0.0;
+                    if (fB1 >= (double)0.0) {
+                        fT           = (double)0.0;
+                        fSqrDistance = fC;
+                    } else if (-fB1 >= fA11) {
+                        fT           = (double)1.0;
+                        fSqrDistance = fA11 + ((double)2.0) * fB1 + fC;
+                    } else {
+                        fT           = -fB1 / fA11;
+                        fSqrDistance = fB1 * fT + fC;
+                    }
+                }
+            } else // region 3
+            {
+                fS = (double)0.0;
+                if (fB1 >= (double)0.0) {
+                    fT           = (double)0.0;
+                    fSqrDistance = fC;
+                } else if (-fB1 >= fA11) {
+                    fT           = (double)1.0;
+                    fSqrDistance = fA11 + ((double)2.0) * fB1 + fC;
+                } else {
+                    fT           = -fB1 / fA11;
+                    fSqrDistance = fB1 * fT + fC;
+                }
+            }
+        } else if (fT < (double)0.0) // region 5
+        {
+            fT = (double)0.0;
+            if (fB0 >= (double)0.0) {
+                fS           = (double)0.0;
+                fSqrDistance = fC;
+            } else if (-fB0 >= fA00) {
+                fS           = (double)1.0;
+                fSqrDistance = fA00 + ((double)2.0) * fB0 + fC;
+            } else {
+                fS           = -fB0 / fA00;
+                fSqrDistance = fB0 * fS + fC;
+            }
+        } else // region 0
+        {
+            // minimum at interior point
+            double fInvDet = ((double)1.0) / fDet;
+            fS *= fInvDet;
+            fT *= fInvDet;
+            fSqrDistance = fS * (fA00 * fS + fA01 * fT + ((double)2.0) * fB0) +
+                           fT * (fA01 * fS + fA11 * fT + ((double)2.0) * fB1) + fC;
+        }
+    } else {
+        double fTmp0, fTmp1, fNumer, fDenom;
+
+        if (fS < (double)0.0) // region 2
+        {
+            fTmp0 = fA01 + fB0;
+            fTmp1 = fA11 + fB1;
+            if (fTmp1 > fTmp0) {
+                fNumer = fTmp1 - fTmp0;
+                fDenom = fA00 - 2.0f * fA01 + fA11;
+                if (fNumer >= fDenom) {
+                    fS           = (double)1.0;
+                    fT           = (double)0.0;
+                    fSqrDistance = fA00 + ((double)2.0) * fB0 + fC;
+                } else {
+                    fS           = fNumer / fDenom;
+                    fT           = (double)1.0 - fS;
+                    fSqrDistance = fS * (fA00 * fS + fA01 * fT + 2.0f * fB0) +
+                                   fT * (fA01 * fS + fA11 * fT + ((double)2.0) * fB1) + fC;
+                }
+            } else {
+                fS = (double)0.0;
+                if (fTmp1 <= (double)0.0) {
+                    fT           = (double)1.0;
+                    fSqrDistance = fA11 + ((double)2.0) * fB1 + fC;
+                } else if (fB1 >= (double)0.0) {
+                    fT           = (double)0.0;
+                    fSqrDistance = fC;
+                } else {
+                    fT           = -fB1 / fA11;
+                    fSqrDistance = fB1 * fT + fC;
+                }
+            }
+        } else if (fT < (double)0.0) // region 6
+        {
+            fTmp0 = fA01 + fB1;
+            fTmp1 = fA00 + fB0;
+            if (fTmp1 > fTmp0) {
+                fNumer = fTmp1 - fTmp0;
+                fDenom = fA00 - ((double)2.0) * fA01 + fA11;
+                if (fNumer >= fDenom) {
+                    fT           = (double)1.0;
+                    fS           = (double)0.0;
+                    fSqrDistance = fA11 + ((double)2.0) * fB1 + fC;
+                } else {
+                    fT           = fNumer / fDenom;
+                    fS           = (double)1.0 - fT;
+                    fSqrDistance = fS * (fA00 * fS + fA01 * fT + ((double)2.0) * fB0) +
+                                   fT * (fA01 * fS + fA11 * fT + ((double)2.0) * fB1) + fC;
+                }
+            } else {
+                fT = (double)0.0;
+                if (fTmp1 <= (double)0.0) {
+                    fS           = (double)1.0;
+                    fSqrDistance = fA00 + ((double)2.0) * fB0 + fC;
+                } else if (fB0 >= (double)0.0) {
+                    fS           = (double)0.0;
+                    fSqrDistance = fC;
+                } else {
+                    fS           = -fB0 / fA00;
+                    fSqrDistance = fB0 * fS + fC;
+                }
+            }
+        } else // region 1
+        {
+            fNumer = fA11 + fB1 - fA01 - fB0;
+            if (fNumer <= (double)0.0) {
+                fS           = (double)0.0;
+                fT           = (double)1.0;
+                fSqrDistance = fA11 + ((double)2.0) * fB1 + fC;
+            } else {
+                fDenom = fA00 - 2.0f * fA01 + fA11;
+                if (fNumer >= fDenom) {
+                    fS           = (double)1.0;
+                    fT           = (double)0.0;
+                    fSqrDistance = fA00 + ((double)2.0) * fB0 + fC;
+                } else {
+                    fS           = fNumer / fDenom;
+                    fT           = (double)1.0 - fS;
+                    fSqrDistance = fS * (fA00 * fS + fA01 * fT + ((double)2.0) * fB0) +
+                                   fT * (fA01 * fS + fA11 * fT + ((double)2.0) * fB1) + fC;
+                }
+            }
+        }
+    }
+
+    // account for numerical round-off error
+    if (fSqrDistance < (double)0.0) {
+        fSqrDistance = (double)0.0;
+    }
+    /*
+        m_kClosestPoint0 = punct;
+        m_kClosestPoint1 = m_rkTriangle.V[0] + fS*kEdge0 + fT*kEdge1;
+        m_afTriangleBary[1] = fS;
+        m_afTriangleBary[2] = fT;
+        m_afTriangleBary[0] = (double)1.0 - fS - fT;
+    */
+    return sqrt(fSqrDistance);
 }
diff --git a/src/basics/geometry3d/GbTriangle3D.h b/src/basics/geometry3d/GbTriangle3D.h
index ae20245f03bb09dcd5982efcb37d4874003533df..a48b0828d0f53f96068abec528747f5b7a4365fe 100644
--- a/src/basics/geometry3d/GbTriangle3D.h
+++ b/src/basics/geometry3d/GbTriangle3D.h
@@ -1,28 +1,28 @@
 //=======================================================================================
-// ____          ____    __    ______     __________   __      __       __        __         
-// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |        
-//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |        
-//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |        
-//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____    
-//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|   
-//      \    \  |    |   ________________________________________________________________    
-//       \    \ |    |  |  ______________________________________________________________|   
-//        \    \|    |  |  |         __          __     __     __     ______      _______    
-//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)   
-//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______    
+// ____          ____    __    ______     __________   __      __       __        __
+// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |
+//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |
+//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |
+//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____
+//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|
+//      \    \  |    |   ________________________________________________________________
+//       \    \ |    |  |  ______________________________________________________________|
+//        \    \|    |  |  |         __          __     __     __     ______      _______
+//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)
+//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______
 //           \       |  |  |        |  |_____   |   \_/   |   |  |   |  |_/  /    _____  |
-//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/   
+//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/
 //
-//  This file is part of VirtualFluids. VirtualFluids is free software: you can 
+//  This file is part of VirtualFluids. VirtualFluids is free software: you can
 //  redistribute it and/or modify it under the terms of the GNU General Public
-//  License as published by the Free Software Foundation, either version 3 of 
+//  License as published by the Free Software Foundation, either version 3 of
 //  the License, or (at your option) any later version.
-//  
-//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT 
-//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
-//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License 
+//
+//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT
+//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 //  for more details.
-//  
+//
 //  You should have received a copy of the GNU General Public License along
 //  with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>.
 //
@@ -36,8 +36,8 @@
 #include <sstream>
 
 #include <GbObject3D.h>
-#include <GbVector3D.h>
 #include <GbPoint3D.h>
+#include <GbVector3D.h>
 
 #include <PointerDefinitions.h>
 
@@ -46,170 +46,177 @@ class GbPolygon3D;
 class GbObject3DCreator;
 
 //////////////////////////////////////////////////////////////////////////
-//! 
+//!
 //! \class GbTriangle3D
-//! 
+//!
 //! \brief This Class provides basic 3D triangle objects.
 //! \details The describing points are observed by 2D triangle objects.
-//! 
-//////////////////////////////////////////////////////////////////////////  
+//!
+//////////////////////////////////////////////////////////////////////////
 
-class GbTriangle3D : public GbObject3D , public UbObserver
+class GbTriangle3D : public GbObject3D, public UbObserver
 {
 public:
-   /*======================================================================*/
-   /*  Konstruktoren                                                       */
-   /*                                                                      */
-   GbTriangle3D();
-   GbTriangle3D(GbPoint3D* point1, GbPoint3D* point2, GbPoint3D* point3);
-   GbTriangle3D(GbTriangle3D* triangle);
-   ~GbTriangle3D() override;
-   /*======================================================================*/
-   /*  Methoden                                                            */
-   /*                                                                      */
-   GbTriangle3D* clone() override;
-   void finalize() override
-   {
-      this->deletePoints();
-   }
-
-   GbPoint3D* getPoint1()   { return this->points[0]; }
-   GbPoint3D* getPoint2()   { return this->points[1]; }
-   GbPoint3D* getPoint3()   { return this->points[2]; }
-
-   GbVector3D getNormal();
-   void       calculateNormal();
-
-   void deletePoints();
-
-   int contains(GbPoint3D* point);
-   int containsEqual(GbPoint3D* point);
-   GbPoint3D* getPoint(const int& index);
-   std::vector<GbPoint3D> getPoints();
-   double getArea();
-   double getX1Centroid() override;
-   double getX1Minimum() override;
-   double getX1Maximum() override;           
-   double getX2Centroid() override;
-   double getX2Minimum() override;
-   double getX2Maximum() override;
-   double getX3Centroid() override;
-   double getX3Minimum() override;
-   double getX3Maximum() override;
-
-   void setInconsistent() { this->consistent = false;}
-
-   void setPoint(GbPoint3D *point, int index);
-
-   //bool equals(GbObject3D *object)
-   std::vector<GbTriangle3D*> getSurfaceTriangleSet() override;
-   bool isPointInGbObject3D(const double&  /*x1*/, const double&  /*x2*/, const double&  /*x3*/) override   
-   {
-      //der einfachheit halber ... 
-      return false;
-      //throw UbException(__FILE__, __LINE__, "GbTriangle3D::isPointInObject3D- not implemented");
-   }
-   bool isPointInGbObject3D(const double&  /*x1*/, const double&  /*x2*/, const double&  /*x3*/, bool& pointIsOnBoundary) override   
-   {
-      //der einfachheit halber ... 
-      pointIsOnBoundary = false;
-      return false;
-      //throw UbException(__FILE__, __LINE__, "GbTriangle3D::isPointInObject3D- not implemented");
-   }
-   bool isCellInsideGbObject3D(const double&  /*x11*/,const double&  /*x21*/,const double&  /*x31*/,const double&  /*x12*/,const double&  /*x22*/,const double&  /*x23*/) override { return false; }
-
-
-   // get distance from a point to the triangle
-   //todo CHANGE...
-   double getDistanceFromPoint(GbVector3D punct);
-
-   std::string toString() override;
-
-   /*======================================================================*/
-   /*  Calculation                                                         */
-   /*                                                                      */
-//   std::vector<GbPoint3D> calculateIntersectionPoints3D(GbLine3D *line);
-   bool hasRaytracing() override { return true; }
-   /*|r| must be 1! einheitsvector!!*/
-   double getIntersectionRaytraceFactor(const double& x1, const double& x2, const double& x3, const double& rx1, const double& rx2, const double& rx3) override;
-//   bool isPointOnEdge(GbVector3D& q);
-   
-   GbPoint3D* calculateIntersectionPoints3D(GbLine3D* line);
-   GbPoint3D* calculateIntersectionPoints3D(GbPoint3D* linePoint1, GbPoint3D* linePoint2);
-   double calculateDistanceToPoint3D(GbPoint3D *point);
-   double calculateDistanceToPoint3D(const double& x1, const double& x2, const double& x3);      
-   double calculateNormalizedDistanceToPoint3D(const double& x1, const double& y1, const double& z1, const double& x2, const double& y2, const double& z2);
-
-   bool enclosesPoint2D(double x1, double x2);
-   GbPolygon3D* createClippedPolygon3D(GbCuboid3D* cube);   
-   GbLine3D* createClippedLine3D (GbPoint3D& point1, GbPoint3D& point2) override;
-   //public GbPolygon2D createClippedPolygon2D(GbPoint2D p1, GbPoint2D p2);
-   GbPolygon3D* createClippedPolygon3D(const double& p1x1, const double& p1x2, const double& p1x3, const double& p2x1, const double& p2x2, const double& p2x3);
-   //bool enclosesRectangle2D(GbRectangle2D *rectangle);
-   //public boolean enclosesRectangle2D(GbPoint2D p1, GbPoint2D p2);
-   //public boolean enclosesRectangle2D(double p1x1, double p1x2, double p2x1, double p2x2);
-   //public boolean crossesRectangle2D(GbRectangle2D rectangle);
-   //public boolean crossesRectangle2D(GbPoint2D p1, GbPoint2D p2);
-   //public boolean crossesRectangle2D(double p1x1, double p1x2, double p2x1, double p2x2);
-   //public boolean enclosesOrCrossesRectangle2D(GbRectangle2D rectangle);
-   //public boolean enclosesOrCrossesRectangle2D(GbPoint2D p1, GbPoint2D p2);
-   //public boolean enclosesOrCrossesRectangle2D(double p1x1, double p1x2, double p2x1, double p2x2);
-   /*======================================================================*/
-   /*======================================================================*/
-   /*  Private Methoden                                                    */
-   /*                                                                      */
-   virtual void calculateValues();
-
-
-   //virtuelle Methoden von UbObserver
-   //!! quick and dirty von sirann !!
-   void objectChanged(UbObservable* changedObject) override
-   {
-      GbPoint3D* point = dynamic_cast<GbPoint3D*>(changedObject);
-      if(!point || (  this->points[0]!=point && this->points[1]!=point && this->points[2]!=point) ) 
-         return;
-      
-      this->consistent = false;
-   }
-   void objectWillBeDeleted(UbObservable* objectForDeletion) override
-   {
-      if(this->points[0])
-      {
-         UbObservable* observedObj = dynamic_cast<UbObservable*>(this->points[0]);
-         if(objectForDeletion == observedObj) { this->points[0] = NULL; }
-      }
-      if(this->points[1])
-      {
-         UbObservable* observedObj = dynamic_cast<UbObservable*>(this->points[1]);
-         if(objectForDeletion == observedObj) { this->points[1] = NULL; }
-      }
-      if(this->points[2])
-      {
-         UbObservable* observedObj = dynamic_cast<UbObservable*>(this->points[2]);
-         if(objectForDeletion == observedObj) { this->points[2] = NULL; }
-      }
-      //ACHTUNG: eigentlich muessten in allen methoden von GbLine if abfragen fuer NULL pointer hin... toDo
-   }
-   using GbObject3D::isPointInGbObject3D; //Grund: dadurch muss man hier  isPointInGbObject3D(GbPoint3D*) nicht ausprogrammieren, welche sonst hier "ueberdeckt" waere
+    /*======================================================================*/
+    /*  Konstruktoren                                                       */
+    /*                                                                      */
+    GbTriangle3D();
+    GbTriangle3D(GbPoint3D *point1, GbPoint3D *point2, GbPoint3D *point3);
+    GbTriangle3D(GbTriangle3D *triangle);
+    ~GbTriangle3D() override;
+    /*======================================================================*/
+    /*  Methoden                                                            */
+    /*                                                                      */
+    GbTriangle3D *clone() override;
+    void finalize() override { this->deletePoints(); }
+
+    GbPoint3D *getPoint1() { return this->points[0]; }
+    GbPoint3D *getPoint2() { return this->points[1]; }
+    GbPoint3D *getPoint3() { return this->points[2]; }
+
+    GbVector3D getNormal();
+    void calculateNormal();
+
+    void deletePoints();
+
+    int contains(GbPoint3D *point);
+    int containsEqual(GbPoint3D *point);
+    GbPoint3D *getPoint(const int &index);
+    std::vector<GbPoint3D> getPoints();
+    double getArea();
+    double getX1Centroid() override;
+    double getX1Minimum() override;
+    double getX1Maximum() override;
+    double getX2Centroid() override;
+    double getX2Minimum() override;
+    double getX2Maximum() override;
+    double getX3Centroid() override;
+    double getX3Minimum() override;
+    double getX3Maximum() override;
+
+    void setInconsistent() { this->consistent = false; }
+
+    void setPoint(GbPoint3D *point, int index);
+
+    // bool equals(GbObject3D *object)
+    std::vector<GbTriangle3D *> getSurfaceTriangleSet() override;
+    bool isPointInGbObject3D(const double & /*x1*/, const double & /*x2*/, const double & /*x3*/) override
+    {
+        // der einfachheit halber ...
+        return false;
+        // throw UbException(__FILE__, __LINE__, "GbTriangle3D::isPointInObject3D- not implemented");
+    }
+    bool isPointInGbObject3D(const double & /*x1*/, const double & /*x2*/, const double & /*x3*/,
+                             bool &pointIsOnBoundary) override
+    {
+        // der einfachheit halber ...
+        pointIsOnBoundary = false;
+        return false;
+        // throw UbException(__FILE__, __LINE__, "GbTriangle3D::isPointInObject3D- not implemented");
+    }
+    bool isCellInsideGbObject3D(const double & /*x11*/, const double & /*x21*/, const double & /*x31*/,
+                                const double & /*x12*/, const double & /*x22*/, const double & /*x23*/) override
+    {
+        return false;
+    }
+
+    // get distance from a point to the triangle
+    // todo CHANGE...
+    double getDistanceFromPoint(GbVector3D punct);
+
+    std::string toString() override;
+
+    /*======================================================================*/
+    /*  Calculation                                                         */
+    /*                                                                      */
+    //   std::vector<GbPoint3D> calculateIntersectionPoints3D(GbLine3D *line);
+    bool hasRaytracing() override { return true; }
+    /*|r| must be 1! einheitsvector!!*/
+    double getIntersectionRaytraceFactor(const double &x1, const double &x2, const double &x3, const double &rx1,
+                                         const double &rx2, const double &rx3) override;
+    //   bool isPointOnEdge(GbVector3D& q);
+
+    GbPoint3D *calculateIntersectionPoints3D(GbLine3D *line);
+    GbPoint3D *calculateIntersectionPoints3D(GbPoint3D *linePoint1, GbPoint3D *linePoint2);
+    double calculateDistanceToPoint3D(GbPoint3D *point);
+    double calculateDistanceToPoint3D(const double &x1, const double &x2, const double &x3);
+    double calculateNormalizedDistanceToPoint3D(const double &x1, const double &y1, const double &z1, const double &x2,
+                                                const double &y2, const double &z2);
+
+    bool enclosesPoint2D(double x1, double x2);
+    GbPolygon3D *createClippedPolygon3D(GbCuboid3D *cube);
+    GbLine3D *createClippedLine3D(GbPoint3D &point1, GbPoint3D &point2) override;
+    // public GbPolygon2D createClippedPolygon2D(GbPoint2D p1, GbPoint2D p2);
+    GbPolygon3D *createClippedPolygon3D(const double &p1x1, const double &p1x2, const double &p1x3, const double &p2x1,
+                                        const double &p2x2, const double &p2x3);
+    // bool enclosesRectangle2D(GbRectangle2D *rectangle);
+    // public boolean enclosesRectangle2D(GbPoint2D p1, GbPoint2D p2);
+    // public boolean enclosesRectangle2D(double p1x1, double p1x2, double p2x1, double p2x2);
+    // public boolean crossesRectangle2D(GbRectangle2D rectangle);
+    // public boolean crossesRectangle2D(GbPoint2D p1, GbPoint2D p2);
+    // public boolean crossesRectangle2D(double p1x1, double p1x2, double p2x1, double p2x2);
+    // public boolean enclosesOrCrossesRectangle2D(GbRectangle2D rectangle);
+    // public boolean enclosesOrCrossesRectangle2D(GbPoint2D p1, GbPoint2D p2);
+    // public boolean enclosesOrCrossesRectangle2D(double p1x1, double p1x2, double p2x1, double p2x2);
+    /*======================================================================*/
+    /*======================================================================*/
+    /*  Private Methoden                                                    */
+    /*                                                                      */
+    virtual void calculateValues();
+
+    // virtuelle Methoden von UbObserver
+    //!! quick and dirty von sirann !!
+    void objectChanged(UbObservable *changedObject) override
+    {
+        GbPoint3D *point = dynamic_cast<GbPoint3D *>(changedObject);
+        if (!point || (this->points[0] != point && this->points[1] != point && this->points[2] != point))
+            return;
+
+        this->consistent = false;
+    }
+    void objectWillBeDeleted(UbObservable *objectForDeletion) override
+    {
+        if (this->points[0]) {
+            UbObservable *observedObj = dynamic_cast<UbObservable *>(this->points[0]);
+            if (objectForDeletion == observedObj) {
+                this->points[0] = NULL;
+            }
+        }
+        if (this->points[1]) {
+            UbObservable *observedObj = dynamic_cast<UbObservable *>(this->points[1]);
+            if (objectForDeletion == observedObj) {
+                this->points[1] = NULL;
+            }
+        }
+        if (this->points[2]) {
+            UbObservable *observedObj = dynamic_cast<UbObservable *>(this->points[2]);
+            if (objectForDeletion == observedObj) {
+                this->points[2] = NULL;
+            }
+        }
+        // ACHTUNG: eigentlich muessten in allen methoden von GbLine if abfragen fuer NULL pointer hin... toDo
+    }
+    using GbObject3D::isPointInGbObject3D; // Grund: dadurch muss man hier  isPointInGbObject3D(GbPoint3D*) nicht
+                                           // ausprogrammieren, welche sonst hier "ueberdeckt" waere
 
 protected:
-   bool   consistent;
-   double x1s;
-   double x2s;
-   double x3s;
-   double x1min;
-   double x1max;
-   double x2min;
-   double x2max;
-   double x3min;
-   double x3max;
-   double area;
-   
-   GbVector3D normal;
-   std::vector<GbPoint3D*> points;
-   
+    bool consistent;
+    double x1s;
+    double x2s;
+    double x3s;
+    double x1min;
+    double x1max;
+    double x2min;
+    double x2max;
+    double x3min;
+    double x3max;
+    double area;
+
+    GbVector3D normal;
+    std::vector<GbPoint3D *> points;
+
 private:
-   void init();
+    void init();
 };
 /*=========================================================================*/
 
diff --git a/src/basics/geometry3d/GbTriangularMesh3D.cpp b/src/basics/geometry3d/GbTriangularMesh3D.cpp
index de781b33886f41a8244aaec495ad0a2b76dc676b..94138be759437d57271e172f71be923e493c2c23 100644
--- a/src/basics/geometry3d/GbTriangularMesh3D.cpp
+++ b/src/basics/geometry3d/GbTriangularMesh3D.cpp
@@ -4,292 +4,306 @@
 
 #include <basics/utilities/UbMath.h>
 
-#include <geometry3d/GbHalfSpace3D.h>
-#include <geometry3d/GbCuboid3D.h>
 #include <geometry3d/CoordinateTransformation3D.h>
-                         
+#include <geometry3d/GbCuboid3D.h>
+#include <geometry3d/GbHalfSpace3D.h>
+
 using namespace std;
 
 GbTriangularMesh3D::GbTriangularMesh3D() : GbObject3D()
 {
-   this->setName("new GbMesh");
-   this->nodes     = new vector<GbPoint3D*>;           
-   this->triangles = new vector<GbTriangle3D*>;
-   this->edges     = new vector<GbLine3D*>;
-   
-   this->pointinobjecttest = RAYCROSSING;
-
-   this->consistent = false;                                 
-   x1min = x1max = x2min = x2max = x3min = x3max = 0.0;
+    this->setName("new GbMesh");
+    this->nodes     = new vector<GbPoint3D *>;
+    this->triangles = new vector<GbTriangle3D *>;
+    this->edges     = new vector<GbLine3D *>;
+
+    this->pointinobjecttest = RAYCROSSING;
+
+    this->consistent = false;
+    x1min = x1max = x2min = x2max = x3min = x3max = 0.0;
 }
 /*=============================================================================================*/
-GbTriangularMesh3D::GbTriangularMesh3D(string name, vector<GbPoint3D*> *nodes, vector<GbTriangle3D*> *triangles) : GbObject3D()
+GbTriangularMesh3D::GbTriangularMesh3D(string name, vector<GbPoint3D *> *nodes, vector<GbTriangle3D *> *triangles)
+    : GbObject3D()
 {
-   if(name.size()==0 ) throw UbException(UB_EXARGS,"no name specified");
-   if(!nodes         ) throw UbException(UB_EXARGS,"no nodes specified");
-   if(!triangles     ) throw UbException(UB_EXARGS,"no triangles specified");
-                                                         
-   this->setName(name);
-   this->nodes      = nodes;           
-   this->triangles  = triangles;     
-   this->edges      = new vector<GbLine3D*>;
-   this->pointinobjecttest = RAYCROSSING;
-
-   this->consistent = false;                                 
-   x1min = x1max = x2min = x2max = x3min = x3max = 0.0;
+    if (name.size() == 0)
+        throw UbException(UB_EXARGS, "no name specified");
+    if (!nodes)
+        throw UbException(UB_EXARGS, "no nodes specified");
+    if (!triangles)
+        throw UbException(UB_EXARGS, "no triangles specified");
+
+    this->setName(name);
+    this->nodes             = nodes;
+    this->triangles         = triangles;
+    this->edges             = new vector<GbLine3D *>;
+    this->pointinobjecttest = RAYCROSSING;
+
+    this->consistent = false;
+    x1min = x1max = x2min = x2max = x3min = x3max = 0.0;
 }
 /*=============================================================================================*/
-GbTriangularMesh3D::GbTriangularMesh3D(string name, vector<GbTriangle3D*> *tris) : GbObject3D()
+GbTriangularMesh3D::GbTriangularMesh3D(string name, vector<GbTriangle3D *> *tris) : GbObject3D()
 {
-   cout<<"Das Teil erzeugt seinen KnotenVector aus den Dreiecken ...\n Es sollte deleteRedundantNodes() aufgerufen werden \n";
-   if(name.size()==0 ) throw UbException(UB_EXARGS,"no name specified");
-   if(!tris          ) throw UbException(UB_EXARGS,"no triangles specified");
-
-   vector<GbPoint3D*> *points = new vector<GbPoint3D*>;
-   this->triangles = new vector<GbTriangle3D*>;
-   GbPoint3D* p1 = NULL;
-   GbPoint3D* p2 = NULL;
-   GbPoint3D* p3 = NULL;
-   for(int u=0;u<(int)tris->size();u++)
-   {
-      if(UbMath::zero((*tris)[u]->getArea()))
-      {
-         (*tris)[u]->finalize();
-         delete (*tris)[u];
-         (*tris)[u] = NULL;
-         continue;
-      }
-      this->triangles->push_back((*tris)[u]);
-      p1 = (*tris)[u]->getPoint1();
-      p2 = (*tris)[u]->getPoint2();
-      p3 = (*tris)[u]->getPoint3();
-      points->push_back(p1);
-      points->push_back(p2);
-      points->push_back(p3);
-   }
-
-   this->setName(name);
-   this->nodes            = points; 
-   //this->triangles        = triangles;     
-   this->edges = new vector<GbLine3D*>;
-   this->edges->resize(0, NULL);
-   this->pointinobjecttest = RAYCROSSING;
-   
-   this->consistent       = false;                                 
-   x1min = x1max = x2min = x2max = x3min = x3max = 0.0;
+    cout << "Das Teil erzeugt seinen KnotenVector aus den Dreiecken ...\n Es sollte deleteRedundantNodes() aufgerufen "
+            "werden \n";
+    if (name.size() == 0)
+        throw UbException(UB_EXARGS, "no name specified");
+    if (!tris)
+        throw UbException(UB_EXARGS, "no triangles specified");
+
+    vector<GbPoint3D *> *points = new vector<GbPoint3D *>;
+    this->triangles             = new vector<GbTriangle3D *>;
+    GbPoint3D *p1               = NULL;
+    GbPoint3D *p2               = NULL;
+    GbPoint3D *p3               = NULL;
+    for (int u = 0; u < (int)tris->size(); u++) {
+        if (UbMath::zero((*tris)[u]->getArea())) {
+            (*tris)[u]->finalize();
+            delete (*tris)[u];
+            (*tris)[u] = NULL;
+            continue;
+        }
+        this->triangles->push_back((*tris)[u]);
+        p1 = (*tris)[u]->getPoint1();
+        p2 = (*tris)[u]->getPoint2();
+        p3 = (*tris)[u]->getPoint3();
+        points->push_back(p1);
+        points->push_back(p2);
+        points->push_back(p3);
+    }
+
+    this->setName(name);
+    this->nodes = points;
+    // this->triangles        = triangles;
+    this->edges = new vector<GbLine3D *>;
+    this->edges->resize(0, NULL);
+    this->pointinobjecttest = RAYCROSSING;
+
+    this->consistent = false;
+    x1min = x1max = x2min = x2max = x3min = x3max = 0.0;
 }
 /*=============================================================================================*/
-GbTriangularMesh3D::GbTriangularMesh3D(string name, vector<GbPoint3D*> *nodes, vector<GbLine3D*> *edges, vector<GbTriangle3D*> *triangles) : GbObject3D()
+GbTriangularMesh3D::GbTriangularMesh3D(string name, vector<GbPoint3D *> *nodes, vector<GbLine3D *> *edges,
+                                       vector<GbTriangle3D *> *triangles)
+    : GbObject3D()
 {
-   if(name.size()==0) throw UbException(UB_EXARGS,"no name specified");
-   if(!nodes        ) throw UbException(UB_EXARGS,"no nodes specified");
-   if(!triangles    ) throw UbException(UB_EXARGS,"no triangles specified");
-   if(!edges        ) throw UbException(UB_EXARGS,"no edges specified");
-
-   this->setName(name);
-   this->nodes            = nodes;
-   this->edges            = edges;
-   this->triangles        = triangles;                   
-   this->pointinobjecttest = RAYCROSSING;
-
-   this->consistent = false;                                 
-   x1min = x1max = x2min = x2max = x3min = x3max = 0.0;
+    if (name.size() == 0)
+        throw UbException(UB_EXARGS, "no name specified");
+    if (!nodes)
+        throw UbException(UB_EXARGS, "no nodes specified");
+    if (!triangles)
+        throw UbException(UB_EXARGS, "no triangles specified");
+    if (!edges)
+        throw UbException(UB_EXARGS, "no edges specified");
+
+    this->setName(name);
+    this->nodes             = nodes;
+    this->edges             = edges;
+    this->triangles         = triangles;
+    this->pointinobjecttest = RAYCROSSING;
+
+    this->consistent = false;
+    x1min = x1max = x2min = x2max = x3min = x3max = 0.0;
 }
 /*=============================================================================================*/
 GbTriangularMesh3D::~GbTriangularMesh3D()
 {
-	if( this->nodes )
-	{
-		for(unsigned u=0; u<nodes->size(); u++) delete (*nodes)[u];
-      delete nodes;
-	}
-	if(triangles)
-	{
-		for(unsigned u=0; u<triangles->size(); u++)	delete (*triangles)[u];
-      delete triangles;
-	}
+    if (this->nodes) {
+        for (unsigned u = 0; u < nodes->size(); u++)
+            delete (*nodes)[u];
+        delete nodes;
+    }
+    if (triangles) {
+        for (unsigned u = 0; u < triangles->size(); u++)
+            delete (*triangles)[u];
+        delete triangles;
+    }
 }
 /*======================================================================*/
 void GbTriangularMesh3D::deleteRedundantNodes()
 {
-   std::map<GbPoint3D*,GbTriangle3D*> pointTriMap;
-   GbPoint3D* p1 = NULL;
-   GbPoint3D* p2 = NULL;
-   GbPoint3D* p3 = NULL;
-   GbTriangle3D* tri = NULL;
-
-   for(int u=0;u<(int)this->triangles->size();u++)
-   {
-      tri = (*this->triangles)[u];
-      p1 = tri->getPoint1();
-      p2 = tri->getPoint2();
-      p3 = tri->getPoint3();
-      pointTriMap.insert(pair<GbPoint3D*,GbTriangle3D*>(p1,tri));
-      pointTriMap.insert(pair<GbPoint3D*,GbTriangle3D*>(p2,tri));
-      pointTriMap.insert(pair<GbPoint3D*,GbTriangle3D*>(p3,tri));
-   }
-
-   cout<<"Nodes before deleting redundant:"<<this->nodes->size()<<endl;
-   GbPoint3D* pA = NULL;
-   GbPoint3D* pB = NULL;
-   std::map<GbPoint3D*,GbTriangle3D*>::iterator mapIterator; 
-   for(int u=0;u<(int)this->nodes->size();u++)
-   {
-      //cout<<u<<" von "<<this->nodes->size()<<endl;
-      pA = (*this->nodes)[u];
-      if(pA==NULL) continue;
-      for(int w=u+1;w<(int)this->nodes->size();w++)
-      {
-      //   cout<<w<<" Wvon "<<this->nodes->size()<<endl;
-         pB = (*this->nodes)[w];
-         if(pB==NULL) continue;
-         if(pA->equals(pB))
-         {
-            //doppelter Knoten ...
-            mapIterator = pointTriMap.find(pB);
-            tri = dynamic_cast<GbTriangle3D*>(mapIterator->second);
-            if(!tri) throw UbException(UB_EXARGS,"triangle not found");
-            p1 = tri->getPoint1();
-            p2 = tri->getPoint2();
-            p3 = tri->getPoint3();
-            if(pB==p1) tri->setPoint(pA, 0);
-            else if(pB==p2) tri->setPoint(pA, 1);
-            else if(pB==p3) tri->setPoint(pA, 2);
-            else throw UbException(UB_EXARGS,"node should be there");
-            delete pB;
-            (*this->nodes)[w] = NULL;
-         }
-      }
-   }
-   vector<GbPoint3D*> *points = new vector<GbPoint3D*>;
-   for(int u=0;u<(int)this->nodes->size();u++)
-   {
-      pA = (*this->nodes)[u];
-      if(pA!=NULL) points->push_back(pA);
-   }
-   delete this->nodes;
-   this->nodes = points;
-   cout<<"Nodes after deleting redundant:"<<this->nodes->size()<<endl;   
-
-
-//nochmal kontrolle ...
-   pointTriMap.clear();
-   for(int u=0;u<(int)this->triangles->size();u++)
-   {
-      tri = (*this->triangles)[u];
-      p1 = tri->getPoint1();
-      p2 = tri->getPoint2();
-      p3 = tri->getPoint3();
-      pointTriMap.insert(pair<GbPoint3D*,GbTriangle3D*>(p1,tri));
-      pointTriMap.insert(pair<GbPoint3D*,GbTriangle3D*>(p2,tri));
-      pointTriMap.insert(pair<GbPoint3D*,GbTriangle3D*>(p3,tri));
-   }
-   for(int u=0;u<(int)this->nodes->size();u++)
-   {
-      pA = (*this->nodes)[u];
-      if(pA==NULL) throw UbException(UB_EXARGS,"sollte kein NULL pointer sein ...");
-      mapIterator = pointTriMap.find(pA);
-      tri = dynamic_cast<GbTriangle3D*>(mapIterator->second);
-      if(!tri) throw UbException(UB_EXARGS,"triangle not found");
-   }
+    std::map<GbPoint3D *, GbTriangle3D *> pointTriMap;
+    GbPoint3D *p1     = NULL;
+    GbPoint3D *p2     = NULL;
+    GbPoint3D *p3     = NULL;
+    GbTriangle3D *tri = NULL;
+
+    for (int u = 0; u < (int)this->triangles->size(); u++) {
+        tri = (*this->triangles)[u];
+        p1  = tri->getPoint1();
+        p2  = tri->getPoint2();
+        p3  = tri->getPoint3();
+        pointTriMap.insert(pair<GbPoint3D *, GbTriangle3D *>(p1, tri));
+        pointTriMap.insert(pair<GbPoint3D *, GbTriangle3D *>(p2, tri));
+        pointTriMap.insert(pair<GbPoint3D *, GbTriangle3D *>(p3, tri));
+    }
+
+    cout << "Nodes before deleting redundant:" << this->nodes->size() << endl;
+    GbPoint3D *pA = NULL;
+    GbPoint3D *pB = NULL;
+    std::map<GbPoint3D *, GbTriangle3D *>::iterator mapIterator;
+    for (int u = 0; u < (int)this->nodes->size(); u++) {
+        // cout<<u<<" von "<<this->nodes->size()<<endl;
+        pA = (*this->nodes)[u];
+        if (pA == NULL)
+            continue;
+        for (int w = u + 1; w < (int)this->nodes->size(); w++) {
+            //   cout<<w<<" Wvon "<<this->nodes->size()<<endl;
+            pB = (*this->nodes)[w];
+            if (pB == NULL)
+                continue;
+            if (pA->equals(pB)) {
+                // doppelter Knoten ...
+                mapIterator = pointTriMap.find(pB);
+                tri         = dynamic_cast<GbTriangle3D *>(mapIterator->second);
+                if (!tri)
+                    throw UbException(UB_EXARGS, "triangle not found");
+                p1 = tri->getPoint1();
+                p2 = tri->getPoint2();
+                p3 = tri->getPoint3();
+                if (pB == p1)
+                    tri->setPoint(pA, 0);
+                else if (pB == p2)
+                    tri->setPoint(pA, 1);
+                else if (pB == p3)
+                    tri->setPoint(pA, 2);
+                else
+                    throw UbException(UB_EXARGS, "node should be there");
+                delete pB;
+                (*this->nodes)[w] = NULL;
+            }
+        }
+    }
+    vector<GbPoint3D *> *points = new vector<GbPoint3D *>;
+    for (int u = 0; u < (int)this->nodes->size(); u++) {
+        pA = (*this->nodes)[u];
+        if (pA != NULL)
+            points->push_back(pA);
+    }
+    delete this->nodes;
+    this->nodes = points;
+    cout << "Nodes after deleting redundant:" << this->nodes->size() << endl;
+
+    // nochmal kontrolle ...
+    pointTriMap.clear();
+    for (int u = 0; u < (int)this->triangles->size(); u++) {
+        tri = (*this->triangles)[u];
+        p1  = tri->getPoint1();
+        p2  = tri->getPoint2();
+        p3  = tri->getPoint3();
+        pointTriMap.insert(pair<GbPoint3D *, GbTriangle3D *>(p1, tri));
+        pointTriMap.insert(pair<GbPoint3D *, GbTriangle3D *>(p2, tri));
+        pointTriMap.insert(pair<GbPoint3D *, GbTriangle3D *>(p3, tri));
+    }
+    for (int u = 0; u < (int)this->nodes->size(); u++) {
+        pA = (*this->nodes)[u];
+        if (pA == NULL)
+            throw UbException(UB_EXARGS, "sollte kein NULL pointer sein ...");
+        mapIterator = pointTriMap.find(pA);
+        tri         = dynamic_cast<GbTriangle3D *>(mapIterator->second);
+        if (!tri)
+            throw UbException(UB_EXARGS, "triangle not found");
+    }
 }
 /*======================================================================*/
-void GbTriangularMesh3D::translate(const double& x1, const double& x2, const double& x3) 
+void GbTriangularMesh3D::translate(const double &x1, const double &x2, const double &x3)
 {
-   GbPoint3D* pt;
-   for(int u=0;u<(int)this->nodes->size();u++)
-   {
-      pt = (*nodes)[u];
-      pt->setX1(pt->getX1Coordinate()+x1);
-      pt->setX2(pt->getX2Coordinate()+x2);
-      pt->setX3(pt->getX3Coordinate()+x3);
-   }
-   this->consistent = false;
+    GbPoint3D *pt;
+    for (int u = 0; u < (int)this->nodes->size(); u++) {
+        pt = (*nodes)[u];
+        pt->setX1(pt->getX1Coordinate() + x1);
+        pt->setX2(pt->getX2Coordinate() + x2);
+        pt->setX3(pt->getX3Coordinate() + x3);
+    }
+    this->consistent = false;
 }
 /*======================================================================*/
-void GbTriangularMesh3D::rotate(const double& alpha, const double& beta, const double& gamma)
+void GbTriangularMesh3D::rotate(const double &alpha, const double &beta, const double &gamma)
 {
-   if(!this->consistent) this->calculateValues();
-   double a1 = this->getX1Centroid();
-   double a2 = this->getX2Centroid();
-   double a3 = this->getX3Centroid();
-   CoordinateTransformation3D trafoFor(a1, a2, a3, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0);
-   CoordinateTransformation3D trafoBack(a1, a2, a3, 1.0, 1.0, 1.0, alpha, beta, gamma);
-
-   vector<GbPoint3D*> points;
-   GbPoint3D* p1 = NULL;
-   GbPoint3D* p2 = NULL;
-   GbPoint3D* p3 = NULL;
-   for(int u=0;u<(int)this->triangles->size();u++)
-   {
-      p1 = (*triangles)[u]->getPoint1();
-      p2 = (*triangles)[u]->getPoint2();
-      p3 = (*triangles)[u]->getPoint3();
-      double p1x1 = trafoFor.transformForwardToX1Coordinate(p1->x1, p1->x2, p1->x3);
-      double p1x2 = trafoFor.transformForwardToX2Coordinate(p1->x1, p1->x2, p1->x3);
-      double p1x3 = trafoFor.transformForwardToX3Coordinate(p1->x1, p1->x2, p1->x3);
-      double p2x1 = trafoFor.transformForwardToX1Coordinate(p2->x1, p2->x2, p2->x3);
-      double p2x2 = trafoFor.transformForwardToX2Coordinate(p2->x1, p2->x2, p2->x3);
-      double p2x3 = trafoFor.transformForwardToX3Coordinate(p2->x1, p2->x2, p2->x3);
-      double p3x1 = trafoFor.transformForwardToX1Coordinate(p3->x1, p3->x2, p3->x3);
-      double p3x2 = trafoFor.transformForwardToX2Coordinate(p3->x1, p3->x2, p3->x3);
-      double p3x3 = trafoFor.transformForwardToX3Coordinate(p3->x1, p3->x2, p3->x3);
-      p1->x1 = trafoBack.transformBackwardToX1Coordinate(p1x1, p1x2, p1x3);
-      p1->x2 = trafoBack.transformBackwardToX2Coordinate(p1x1, p1x2, p1x3);
-      p1->x3 = trafoBack.transformBackwardToX3Coordinate(p1x1, p1x2, p1x3);
-      p2->x1 = trafoBack.transformBackwardToX1Coordinate(p2x1, p2x2, p2x3);
-      p2->x2 = trafoBack.transformBackwardToX2Coordinate(p2x1, p2x2, p2x3);
-      p2->x3 = trafoBack.transformBackwardToX3Coordinate(p2x1, p2x2, p2x3);
-      p3->x1 = trafoBack.transformBackwardToX1Coordinate(p3x1, p3x2, p3x3);
-      p3->x2 = trafoBack.transformBackwardToX2Coordinate(p3x1, p3x2, p3x3);
-      p3->x3 = trafoBack.transformBackwardToX3Coordinate(p3x1, p3x2, p3x3);
-   }
-   this->calculateValues();
+    if (!this->consistent)
+        this->calculateValues();
+    double a1 = this->getX1Centroid();
+    double a2 = this->getX2Centroid();
+    double a3 = this->getX3Centroid();
+    CoordinateTransformation3D trafoFor(a1, a2, a3, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0);
+    CoordinateTransformation3D trafoBack(a1, a2, a3, 1.0, 1.0, 1.0, alpha, beta, gamma);
+
+    vector<GbPoint3D *> points;
+    GbPoint3D *p1 = NULL;
+    GbPoint3D *p2 = NULL;
+    GbPoint3D *p3 = NULL;
+    for (int u = 0; u < (int)this->triangles->size(); u++) {
+        p1          = (*triangles)[u]->getPoint1();
+        p2          = (*triangles)[u]->getPoint2();
+        p3          = (*triangles)[u]->getPoint3();
+        double p1x1 = trafoFor.transformForwardToX1Coordinate(p1->x1, p1->x2, p1->x3);
+        double p1x2 = trafoFor.transformForwardToX2Coordinate(p1->x1, p1->x2, p1->x3);
+        double p1x3 = trafoFor.transformForwardToX3Coordinate(p1->x1, p1->x2, p1->x3);
+        double p2x1 = trafoFor.transformForwardToX1Coordinate(p2->x1, p2->x2, p2->x3);
+        double p2x2 = trafoFor.transformForwardToX2Coordinate(p2->x1, p2->x2, p2->x3);
+        double p2x3 = trafoFor.transformForwardToX3Coordinate(p2->x1, p2->x2, p2->x3);
+        double p3x1 = trafoFor.transformForwardToX1Coordinate(p3->x1, p3->x2, p3->x3);
+        double p3x2 = trafoFor.transformForwardToX2Coordinate(p3->x1, p3->x2, p3->x3);
+        double p3x3 = trafoFor.transformForwardToX3Coordinate(p3->x1, p3->x2, p3->x3);
+        p1->x1      = trafoBack.transformBackwardToX1Coordinate(p1x1, p1x2, p1x3);
+        p1->x2      = trafoBack.transformBackwardToX2Coordinate(p1x1, p1x2, p1x3);
+        p1->x3      = trafoBack.transformBackwardToX3Coordinate(p1x1, p1x2, p1x3);
+        p2->x1      = trafoBack.transformBackwardToX1Coordinate(p2x1, p2x2, p2x3);
+        p2->x2      = trafoBack.transformBackwardToX2Coordinate(p2x1, p2x2, p2x3);
+        p2->x3      = trafoBack.transformBackwardToX3Coordinate(p2x1, p2x2, p2x3);
+        p3->x1      = trafoBack.transformBackwardToX1Coordinate(p3x1, p3x2, p3x3);
+        p3->x2      = trafoBack.transformBackwardToX2Coordinate(p3x1, p3x2, p3x3);
+        p3->x3      = trafoBack.transformBackwardToX3Coordinate(p3x1, p3x2, p3x3);
+    }
+    this->calculateValues();
 }
 /*======================================================================*/
-   /**
-    * Returns a string representation of this triangular mesh.
-    * @return a string representation of this triangular mesh
-    */
+/**
+ * Returns a string representation of this triangular mesh.
+ * @return a string representation of this triangular mesh
+ */
 string GbTriangularMesh3D::toString()
 {
-	stringstream ss;
-	ss<<"GbTriangularMesh3D[";
-	ss<<(int)this->triangles->size()<<"-Triangles, "<<(int)this->nodes->size()<<"-Nodes, "<<(int)this->edges->size()<<"-Edges"<<endl;
-	//ss<<"\""<<this->name<<", Area=sollt mal berechnet werden ;-)"<<"\"";
-   //ss<<", x1min="<<this->x1min;
-   //ss<<", x1max="<<this->x1max;
-   //ss<<", x2min="<<this->x2min;
-   //ss<<", x2max="<<this->x2max;
-   //ss<<", x3min="<<this->x3min;
-   //ss<<", x3max="<<this->x3max;
-   ss<<"]";
-   return(ss.str());
+    stringstream ss;
+    ss << "GbTriangularMesh3D[";
+    ss << (int)this->triangles->size() << "-Triangles, " << (int)this->nodes->size() << "-Nodes, "
+       << (int)this->edges->size() << "-Edges" << endl;
+    // ss<<"\""<<this->name<<", Area=sollt mal berechnet werden ;-)"<<"\"";
+    // ss<<", x1min="<<this->x1min;
+    // ss<<", x1max="<<this->x1max;
+    // ss<<", x2min="<<this->x2min;
+    // ss<<", x2max="<<this->x2max;
+    // ss<<", x3min="<<this->x3min;
+    // ss<<", x3max="<<this->x3max;
+    ss << "]";
+    return (ss.str());
 }
 /**
  * Returns the name of this triangular mesh.
  * @return the name of this triangular mesh
  */
-//string GbTriangularMesh3D::getName(){ return(this->name); }
+// string GbTriangularMesh3D::getName(){ return(this->name); }
 
 /**
  * Returns the nodes of this triangular mesh.
  * @return the nodes of this triangular mesh
  */
-vector<GbPoint3D*>* GbTriangularMesh3D::getNodes()   {  return(this->nodes);   }
+vector<GbPoint3D *> *GbTriangularMesh3D::getNodes() { return (this->nodes); }
 /**
  * Returns the triangles of this triangular mesh.
  * @return the triangles of this triangular mesh
  */
-vector<GbTriangle3D*>* GbTriangularMesh3D::getTriangles()  { return(this->triangles);  }
+vector<GbTriangle3D *> *GbTriangularMesh3D::getTriangles() { return (this->triangles); }
 /**
  * Returns the center x1 coordinate of this triangular mesh.
  * @return the center x1 coordinate of this triangular mesh
  */
 double GbTriangularMesh3D::getX1Centroid()
 {
-   if(!this->consistent) this->calculateValues();
-   return(0.5*(this->x1min+this->x1max));
+    if (!this->consistent)
+        this->calculateValues();
+    return (0.5 * (this->x1min + this->x1max));
 }
 /**
  * Returns the center x2 coordinate of this triangular mesh.
@@ -297,17 +311,19 @@ double GbTriangularMesh3D::getX1Centroid()
  */
 double GbTriangularMesh3D::getX2Centroid()
 {
-   if(!this->consistent) this->calculateValues();
-   return(0.5*(this->x2min+this->x2max));
+    if (!this->consistent)
+        this->calculateValues();
+    return (0.5 * (this->x2min + this->x2max));
 }
 /**
-* Returns the center x3 coordinate of this triangular mesh.
-	* @return the center x3 coordinate of this triangular mesh
-	*/
+ * Returns the center x3 coordinate of this triangular mesh.
+ * @return the center x3 coordinate of this triangular mesh
+ */
 double GbTriangularMesh3D::getX3Centroid()
 {
-	if(!this->consistent) this->calculateValues();
-	return(0.5*(this->x3min+this->x3max));
+    if (!this->consistent)
+        this->calculateValues();
+    return (0.5 * (this->x3min + this->x3max));
 }
 
 /**
@@ -316,8 +332,9 @@ double GbTriangularMesh3D::getX3Centroid()
  */
 double GbTriangularMesh3D::getX1Minimum()
 {
-   if(!this->consistent) this->calculateValues();
-   return(this->x1min);
+    if (!this->consistent)
+        this->calculateValues();
+    return (this->x1min);
 }
 /**
  * Returns the maximum x1 coordinate of this triangular mesh.
@@ -325,8 +342,9 @@ double GbTriangularMesh3D::getX1Minimum()
  */
 double GbTriangularMesh3D::getX1Maximum()
 {
-   if(!this->consistent) this->calculateValues();
-   return(this->x1max);
+    if (!this->consistent)
+        this->calculateValues();
+    return (this->x1max);
 }
 /**
  * Returns the minimum x2 coordinate of this triangular mesh.
@@ -334,8 +352,9 @@ double GbTriangularMesh3D::getX1Maximum()
  */
 double GbTriangularMesh3D::getX2Minimum()
 {
-   if(!this->consistent) this->calculateValues();
-   return(this->x2min);
+    if (!this->consistent)
+        this->calculateValues();
+    return (this->x2min);
 }
 /**
  * Returns the maximum x2 coordinate of this triangular mesh.
@@ -343,8 +362,9 @@ double GbTriangularMesh3D::getX2Minimum()
  */
 double GbTriangularMesh3D::getX2Maximum()
 {
-   if(!this->consistent) this->calculateValues();
-   return(this->x2max);
+    if (!this->consistent)
+        this->calculateValues();
+    return (this->x2max);
 }
 /**
  * Returns the minimum x3 coordinate of this triangular mesh.
@@ -352,8 +372,9 @@ double GbTriangularMesh3D::getX2Maximum()
  */
 double GbTriangularMesh3D::getX3Minimum()
 {
-   if(!this->consistent) this->calculateValues();
-   return(this->x3min);
+    if (!this->consistent)
+        this->calculateValues();
+    return (this->x3min);
 }
 /**
  * Returns the maximum x3 coordinate of this triangular mesh.
@@ -361,34 +382,40 @@ double GbTriangularMesh3D::getX3Minimum()
  */
 double GbTriangularMesh3D::getX3Maximum()
 {
-   if(!this->consistent) this->calculateValues();
-   return(this->x3max);
+    if (!this->consistent)
+        this->calculateValues();
+    return (this->x3max);
 }
 
 void GbTriangularMesh3D::calculateValues()
 {
-   double x1, x2, x3;
-
-	this->x1min = (*this->nodes)[0]->getX1Coordinate();
-   this->x1max = (*this->nodes)[0]->getX1Coordinate();
-   this->x2min = (*this->nodes)[0]->getX2Coordinate();
-   this->x2max = (*this->nodes)[0]->getX2Coordinate();
-   this->x3min = (*this->nodes)[0]->getX3Coordinate();
-   this->x3max = (*this->nodes)[0]->getX3Coordinate();
-
-   for(int i=1; i<(int)this->nodes->size(); i++)
-   {
-		x1 = (*this->nodes)[i]->getX1Coordinate();
-		x2 = (*this->nodes)[i]->getX2Coordinate();
-		x3 = (*this->nodes)[i]->getX3Coordinate();
-		if(x1 < this->x1min) this->x1min = x1;
-		if(x1 > this->x1max) this->x1max = x1;
-		if(x2 < this->x2min) this->x2min = x2;
-		if(x2 > this->x2max) this->x2max = x2;
-		if(x3 < this->x3min) this->x3min = x3;
-		if(x3 > this->x3max) this->x3max = x3;
-   }
-   this->consistent = true;
+    double x1, x2, x3;
+
+    this->x1min = (*this->nodes)[0]->getX1Coordinate();
+    this->x1max = (*this->nodes)[0]->getX1Coordinate();
+    this->x2min = (*this->nodes)[0]->getX2Coordinate();
+    this->x2max = (*this->nodes)[0]->getX2Coordinate();
+    this->x3min = (*this->nodes)[0]->getX3Coordinate();
+    this->x3max = (*this->nodes)[0]->getX3Coordinate();
+
+    for (int i = 1; i < (int)this->nodes->size(); i++) {
+        x1 = (*this->nodes)[i]->getX1Coordinate();
+        x2 = (*this->nodes)[i]->getX2Coordinate();
+        x3 = (*this->nodes)[i]->getX3Coordinate();
+        if (x1 < this->x1min)
+            this->x1min = x1;
+        if (x1 > this->x1max)
+            this->x1max = x1;
+        if (x2 < this->x2min)
+            this->x2min = x2;
+        if (x2 > this->x2max)
+            this->x2max = x2;
+        if (x3 < this->x3min)
+            this->x3min = x3;
+        if (x3 > this->x3max)
+            this->x3max = x3;
+    }
+    this->consistent = true;
 }
 
 /**
@@ -397,219 +424,243 @@ void GbTriangularMesh3D::calculateValues()
  */
 double GbTriangularMesh3D::getArea()
 {
-   double area = 0.0;
-   for(int i=0; i<(int)this->triangles->size(); i++) area += (*this->triangles)[i]->getArea();
-   return(area);
+    double area = 0.0;
+    for (int i = 0; i < (int)this->triangles->size(); i++)
+        area += (*this->triangles)[i]->getArea();
+    return (area);
 }
 /**
  * Returns the total volume of this triangular mesh.
  * @return the total volume of this triangular mesh
-  */
+ */
 double GbTriangularMesh3D::getVolume()
 {
-   GbTriangle3D* triangle;
-   GbPoint3D* p1;
-   GbPoint3D* p2;
-   GbPoint3D* p3;
-
-   double x1,x2,x3,y1,y2,y3,z1,z2,z3;
-   double G3i;
-   double volume = 0.0;
-   int size = (int)this->triangles->size();
-   for(int u=0; u<size;u++)
-   {
-      triangle = (*this->triangles)[u];
-      p1 = triangle->getPoint1();
-      p2 = triangle->getPoint2();
-      p3 = triangle->getPoint3();
-      x1 = p1->getX1Coordinate(); y1 = p1->getX2Coordinate(); z1 = p1->getX3Coordinate();
-      x2 = p2->getX1Coordinate(); y2 = p2->getX2Coordinate(); z2 = p2->getX3Coordinate();
-      x3 = p3->getX1Coordinate(); y3 = p3->getX2Coordinate(); z3 = p3->getX3Coordinate();
-      G3i = x1*(y2*z3-z2*y3)+y1*(z2*x3-x2*z3)+z1*(x2*y3-y2*x3);
-      volume = volume+G3i/6.0;
-   }
-   return volume;
+    GbTriangle3D *triangle;
+    GbPoint3D *p1;
+    GbPoint3D *p2;
+    GbPoint3D *p3;
+
+    double x1, x2, x3, y1, y2, y3, z1, z2, z3;
+    double G3i;
+    double volume = 0.0;
+    int size      = (int)this->triangles->size();
+    for (int u = 0; u < size; u++) {
+        triangle = (*this->triangles)[u];
+        p1       = triangle->getPoint1();
+        p2       = triangle->getPoint2();
+        p3       = triangle->getPoint3();
+        x1       = p1->getX1Coordinate();
+        y1       = p1->getX2Coordinate();
+        z1       = p1->getX3Coordinate();
+        x2       = p2->getX1Coordinate();
+        y2       = p2->getX2Coordinate();
+        z2       = p2->getX3Coordinate();
+        x3       = p3->getX1Coordinate();
+        y3       = p3->getX2Coordinate();
+        z3       = p3->getX3Coordinate();
+        G3i      = x1 * (y2 * z3 - z2 * y3) + y1 * (z2 * x3 - x2 * z3) + z1 * (x2 * y3 - y2 * x3);
+        volume   = volume + G3i / 6.0;
+    }
+    return volume;
 }
 /*===============================================*/
 UbTupleDouble3 GbTriangularMesh3D::calculateCenterOfGravity()
 {
-   GbTriangle3D* triangle;
-   GbPoint3D* p1;
-   GbPoint3D* p2;
-   GbPoint3D* p3;
-
-   double x1,x2,x3,y1,y2,y3,z1,z2,z3;
-   double G3i;
-   double rSP1 = 0.0;double rSP2 = 0.0;double rSP3 = 0.0;
-   double volume = 0.0;
-   int size = (int)this->triangles->size();
-   for(int u=0; u<size;u++)
-   {
-      triangle = (*this->triangles)[u];
-      p1 = triangle->getPoint1();
-      p2 = triangle->getPoint2();
-      p3 = triangle->getPoint3();
-      x1 = p1->getX1Coordinate(); y1 = p1->getX2Coordinate(); z1 = p1->getX3Coordinate();
-      x2 = p2->getX1Coordinate(); y2 = p2->getX2Coordinate(); z2 = p2->getX3Coordinate();
-      x3 = p3->getX1Coordinate(); y3 = p3->getX2Coordinate(); z3 = p3->getX3Coordinate();
-      G3i = x1*(y2*z3-z2*y3)+y1*(z2*x3-x2*z3)+z1*(x2*y3-y2*x3);
-      volume = volume+G3i/6.0;
-      rSP1 = rSP1+G3i*(x1+x2+x3);
-      rSP2 = rSP2+G3i*(y1+y2+y3);
-      rSP3 = rSP3+G3i*(z1+z2+z3);
-   }
-   rSP1 = rSP1/(24.0*volume);
-   rSP2 = rSP2/(24.0*volume);
-   rSP3 = rSP3/(24.0*volume);
-
-   return {rSP1, rSP2, rSP3};
+    GbTriangle3D *triangle;
+    GbPoint3D *p1;
+    GbPoint3D *p2;
+    GbPoint3D *p3;
+
+    double x1, x2, x3, y1, y2, y3, z1, z2, z3;
+    double G3i;
+    double rSP1   = 0.0;
+    double rSP2   = 0.0;
+    double rSP3   = 0.0;
+    double volume = 0.0;
+    int size      = (int)this->triangles->size();
+    for (int u = 0; u < size; u++) {
+        triangle = (*this->triangles)[u];
+        p1       = triangle->getPoint1();
+        p2       = triangle->getPoint2();
+        p3       = triangle->getPoint3();
+        x1       = p1->getX1Coordinate();
+        y1       = p1->getX2Coordinate();
+        z1       = p1->getX3Coordinate();
+        x2       = p2->getX1Coordinate();
+        y2       = p2->getX2Coordinate();
+        z2       = p2->getX3Coordinate();
+        x3       = p3->getX1Coordinate();
+        y3       = p3->getX2Coordinate();
+        z3       = p3->getX3Coordinate();
+        G3i      = x1 * (y2 * z3 - z2 * y3) + y1 * (z2 * x3 - x2 * z3) + z1 * (x2 * y3 - y2 * x3);
+        volume   = volume + G3i / 6.0;
+        rSP1     = rSP1 + G3i * (x1 + x2 + x3);
+        rSP2     = rSP2 + G3i * (y1 + y2 + y3);
+        rSP3     = rSP3 + G3i * (z1 + z2 + z3);
+    }
+    rSP1 = rSP1 / (24.0 * volume);
+    rSP2 = rSP2 / (24.0 * volume);
+    rSP3 = rSP3 / (24.0 * volume);
+
+    return { rSP1, rSP2, rSP3 };
 }
 /*===============================================*/
 UbTupleDouble6 GbTriangularMesh3D::calculateMomentOfInertia(double rhoP)
 {
-   GbTriangle3D* triangle;
-   GbPoint3D* p1;
-   GbPoint3D* p2;
-   GbPoint3D* p3;
-   
-   double x1,x2,x3,y1,y2,y3,z1,z2,z3;
-   double G3i;
-   double xx,yy,zz,xy,yz,zx;
-   double rSP1 = 0.0;double rSP2 = 0.0;double rSP3 = 0.0;
-   double volume = 0.0;
-   double top11 = 0.0;double top22 = 0.0;double top33 = 0.0;
-   double top12 = 0.0;double top23 = 0.0;double top13 = 0.0;
-   int size = (int)this->triangles->size();
-   for(int u=0; u<size;u++)
-   {
-      triangle = (*this->triangles)[u];
-      p1 = triangle->getPoint1();
-      p2 = triangle->getPoint2();
-      p3 = triangle->getPoint3();
-      x1 = p1->getX1Coordinate(); y1 = p1->getX2Coordinate(); z1 = p1->getX3Coordinate();
-      x2 = p2->getX1Coordinate(); y2 = p2->getX2Coordinate(); z2 = p2->getX3Coordinate();
-      x3 = p3->getX1Coordinate(); y3 = p3->getX2Coordinate(); z3 = p3->getX3Coordinate();
-      G3i = x1*(y2*z3-z2*y3)+y1*(z2*x3-x2*z3)+z1*(x2*y3-y2*x3);
-      volume = volume+G3i/6.0;
-      rSP1 = rSP1+G3i*(x1+x2+x3);
-      rSP2 = rSP2+G3i*(y1+y2+y3);
-      rSP3 = rSP3+G3i*(z1+z2+z3);
-   }
-   rSP1 = rSP1/(24.0*volume);
-   rSP2 = rSP2/(24.0*volume);
-   rSP3 = rSP3/(24.0*volume);
-
-   double x1s = 0.0;//rSP1;//0.0;//
-   double x2s = 0.0;//rSP2;//0.0;//
-   double x3s = 0.0;//rSP3;//0.0;//
-
-   for(int u=0; u<size;u++)
-   {
-      triangle = (*this->triangles)[u];
-      p1 = triangle->getPoint1();
-      p2 = triangle->getPoint2();
-      p3 = triangle->getPoint3();
-      x1 = p1->getX1Coordinate()-x1s; 
-      y1 = p1->getX2Coordinate()-x2s; 
-      z1 = p1->getX3Coordinate()-x3s;
-      x2 = p2->getX1Coordinate()-x1s; 
-      y2 = p2->getX2Coordinate()-x2s; 
-      z2 = p2->getX3Coordinate()-x3s;
-      x3 = p3->getX1Coordinate()-x1s; 
-      y3 = p3->getX2Coordinate()-x2s; 
-      z3 = p3->getX3Coordinate()-x3s;
-      G3i = x1*(y2*z3-z2*y3)+y1*(z2*x3-x2*z3)+z1*(x2*y3-y2*x3);
-      //rSP1 = rSP1+G3i*(x1+x2+x3)/(24.0*volume);
-      //rSP2 = rSP2+G3i*(y1+y2+y3)/(24.0*volume);
-      //rSP3 = rSP3+G3i*(z1+z2+z3)/(24.0*volume);
-      xx = x1*x1+x2*x2+x3*x3+x1*x2+x2*x3+x3*x1;
-      yy = y1*y1+y2*y2+y3*y3+y1*y2+y2*y3+y3*y1;
-      zz = z1*z1+z2*z2+z3*z3+z1*z2+z2*z3+z3*z1;
-      top11 = top11+(yy+zz)*rhoP*G3i/60.;
-      top22 = top22+(xx+zz)*rhoP*G3i/60.;
-      top33 = top33+(yy+xx)*rhoP*G3i/60.;
-      xy = 2.0*(x1*y1+x2*y2+x3*y3)+x2*y3+x3*y1+x1*y2+x3*y2+x1*y3+x2*y1;
-      yz = 2.0*(y1*z1+y2*z2+y3*z3)+y2*z3+y3*z1+y1*z2+y3*z2+y1*z3+y2*z1;
-      zx = 2.0*(z1*x1+z2*x2+z3*x3)+z2*x3+z3*x1+z1*x2+z3*x2+z1*x3+z2*x1;
-      top12 = top12-xy*rhoP*G3i/120.;
-      top23 = top23-yz*rhoP*G3i/120.;
-      top13 = top13-zx*rhoP*G3i/120.;
-   }
-   //Satz von Steiner ...
-   top11 = top11-rhoP*volume*(rSP2*rSP2+rSP3+rSP3);
-   top22 = top22-rhoP*volume*(rSP3*rSP3+rSP1*rSP1);
-   top33 = top33-rhoP*volume*(rSP1*rSP1+rSP2*rSP2);
-   top12 = top12+rhoP*volume*rSP1*rSP2;
-   top23 = top23+rhoP*volume*rSP2*rSP3;
-   top13 = top13+rhoP*volume*rSP3*rSP1;
-   
-   cout<<"Volume:"<<volume<<"\n Traegheitsmomente:\n";
-   cout<<" top11:"<<top11<<" top22:"<<top22<<" top33:"<<top33<<endl;
-   cout<<" top12:"<<top12<<" top23:"<<top23<<" top13:"<<top13<<endl;
-
-   return {top11,top22,top33,top12,top23,top13};
+    GbTriangle3D *triangle;
+    GbPoint3D *p1;
+    GbPoint3D *p2;
+    GbPoint3D *p3;
+
+    double x1, x2, x3, y1, y2, y3, z1, z2, z3;
+    double G3i;
+    double xx, yy, zz, xy, yz, zx;
+    double rSP1   = 0.0;
+    double rSP2   = 0.0;
+    double rSP3   = 0.0;
+    double volume = 0.0;
+    double top11  = 0.0;
+    double top22  = 0.0;
+    double top33  = 0.0;
+    double top12  = 0.0;
+    double top23  = 0.0;
+    double top13  = 0.0;
+    int size      = (int)this->triangles->size();
+    for (int u = 0; u < size; u++) {
+        triangle = (*this->triangles)[u];
+        p1       = triangle->getPoint1();
+        p2       = triangle->getPoint2();
+        p3       = triangle->getPoint3();
+        x1       = p1->getX1Coordinate();
+        y1       = p1->getX2Coordinate();
+        z1       = p1->getX3Coordinate();
+        x2       = p2->getX1Coordinate();
+        y2       = p2->getX2Coordinate();
+        z2       = p2->getX3Coordinate();
+        x3       = p3->getX1Coordinate();
+        y3       = p3->getX2Coordinate();
+        z3       = p3->getX3Coordinate();
+        G3i      = x1 * (y2 * z3 - z2 * y3) + y1 * (z2 * x3 - x2 * z3) + z1 * (x2 * y3 - y2 * x3);
+        volume   = volume + G3i / 6.0;
+        rSP1     = rSP1 + G3i * (x1 + x2 + x3);
+        rSP2     = rSP2 + G3i * (y1 + y2 + y3);
+        rSP3     = rSP3 + G3i * (z1 + z2 + z3);
+    }
+    rSP1 = rSP1 / (24.0 * volume);
+    rSP2 = rSP2 / (24.0 * volume);
+    rSP3 = rSP3 / (24.0 * volume);
+
+    double x1s = 0.0; // rSP1;//0.0;//
+    double x2s = 0.0; // rSP2;//0.0;//
+    double x3s = 0.0; // rSP3;//0.0;//
+
+    for (int u = 0; u < size; u++) {
+        triangle = (*this->triangles)[u];
+        p1       = triangle->getPoint1();
+        p2       = triangle->getPoint2();
+        p3       = triangle->getPoint3();
+        x1       = p1->getX1Coordinate() - x1s;
+        y1       = p1->getX2Coordinate() - x2s;
+        z1       = p1->getX3Coordinate() - x3s;
+        x2       = p2->getX1Coordinate() - x1s;
+        y2       = p2->getX2Coordinate() - x2s;
+        z2       = p2->getX3Coordinate() - x3s;
+        x3       = p3->getX1Coordinate() - x1s;
+        y3       = p3->getX2Coordinate() - x2s;
+        z3       = p3->getX3Coordinate() - x3s;
+        G3i      = x1 * (y2 * z3 - z2 * y3) + y1 * (z2 * x3 - x2 * z3) + z1 * (x2 * y3 - y2 * x3);
+        // rSP1 = rSP1+G3i*(x1+x2+x3)/(24.0*volume);
+        // rSP2 = rSP2+G3i*(y1+y2+y3)/(24.0*volume);
+        // rSP3 = rSP3+G3i*(z1+z2+z3)/(24.0*volume);
+        xx    = x1 * x1 + x2 * x2 + x3 * x3 + x1 * x2 + x2 * x3 + x3 * x1;
+        yy    = y1 * y1 + y2 * y2 + y3 * y3 + y1 * y2 + y2 * y3 + y3 * y1;
+        zz    = z1 * z1 + z2 * z2 + z3 * z3 + z1 * z2 + z2 * z3 + z3 * z1;
+        top11 = top11 + (yy + zz) * rhoP * G3i / 60.;
+        top22 = top22 + (xx + zz) * rhoP * G3i / 60.;
+        top33 = top33 + (yy + xx) * rhoP * G3i / 60.;
+        xy    = 2.0 * (x1 * y1 + x2 * y2 + x3 * y3) + x2 * y3 + x3 * y1 + x1 * y2 + x3 * y2 + x1 * y3 + x2 * y1;
+        yz    = 2.0 * (y1 * z1 + y2 * z2 + y3 * z3) + y2 * z3 + y3 * z1 + y1 * z2 + y3 * z2 + y1 * z3 + y2 * z1;
+        zx    = 2.0 * (z1 * x1 + z2 * x2 + z3 * x3) + z2 * x3 + z3 * x1 + z1 * x2 + z3 * x2 + z1 * x3 + z2 * x1;
+        top12 = top12 - xy * rhoP * G3i / 120.;
+        top23 = top23 - yz * rhoP * G3i / 120.;
+        top13 = top13 - zx * rhoP * G3i / 120.;
+    }
+    // Satz von Steiner ...
+    top11 = top11 - rhoP * volume * (rSP2 * rSP2 + rSP3 + rSP3);
+    top22 = top22 - rhoP * volume * (rSP3 * rSP3 + rSP1 * rSP1);
+    top33 = top33 - rhoP * volume * (rSP1 * rSP1 + rSP2 * rSP2);
+    top12 = top12 + rhoP * volume * rSP1 * rSP2;
+    top23 = top23 + rhoP * volume * rSP2 * rSP3;
+    top13 = top13 + rhoP * volume * rSP3 * rSP1;
+
+    cout << "Volume:" << volume << "\n Traegheitsmomente:\n";
+    cout << " top11:" << top11 << " top22:" << top22 << " top33:" << top33 << endl;
+    cout << " top12:" << top12 << " top23:" << top23 << " top13:" << top13 << endl;
+
+    return { top11, top22, top33, top12, top23, top13 };
 }
 
- /**
-  * Returns the volume of this triangular mesh within the specified rectangle.
-  * @param p1x1 the 1st x1 coordinate of the rectangle
-  * @param p1x2 the 1st x2 coordinate of the rectangle
-  * @param p2x1 the 2nd x1 coordinate of the rectangle
-  * @param p2x2 the 2nd x2 coordinate of the rectangle
-  * @return the volume of this triangular mesh within the specified rectangle
-  * @exception NullPointerException if no triangles are found within the specified rectangle
-  */
-double GbTriangularMesh3D::getVolumeForRectangle(const double&  /*p1x1*/, const double&  /*p1x2*/, const double&  /*p2x1*/, const double&  /*p2x2*/) 
+/**
+ * Returns the volume of this triangular mesh within the specified rectangle.
+ * @param p1x1 the 1st x1 coordinate of the rectangle
+ * @param p1x2 the 1st x2 coordinate of the rectangle
+ * @param p2x1 the 2nd x1 coordinate of the rectangle
+ * @param p2x2 the 2nd x2 coordinate of the rectangle
+ * @return the volume of this triangular mesh within the specified rectangle
+ * @exception NullPointerException if no triangles are found within the specified rectangle
+ */
+double GbTriangularMesh3D::getVolumeForRectangle(const double & /*p1x1*/, const double & /*p1x2*/,
+                                                 const double & /*p2x1*/, const double & /*p2x2*/)
 {
-	throw UbException(UB_EXARGS,"not yet implemented");
-  //    GbPolygon2D polygon;
-  //    double      volume = 0.0;
-  //    double      area1 = Math.abs((p1x1-p2x1)*(p1x2-p2x2));
-  //    double      area2 = 0.0;
-  //    double      t1min, t1max, t2min, t2max;
-  //    double      x1, x2;
-  //    boolean     f = false;
-
-  //    for(int i=0; i<this.triangles.length; i++)
-  //    {
-		//	t1min = this.triangles[i].getX1Minimum();
-		//	t1max = this.triangles[i].getX1Maximum();
-		//	if(GbSystem.less2(t1min, t1max, p1x1, p2x1))    continue;
-		//	if(GbSystem.greater2(t1min, t1max, p1x1, p2x1)) continue;
-
-		//	t2min = this.triangles[i].getX2Minimum();
-		//	t2max = this.triangles[i].getX2Maximum();
-		//	if(GbSystem.less2(t2min, t2max, p1x2, p2x2))    continue;
-		//	if(GbSystem.greater2(t2min, t2max, p1x2, p2x2)) continue;
-
-		//	if(GbSystem.inOpenInterval(t1min, p1x1, p2x1) && GbSystem.inOpenInterval(t1max, p1x1, p2x1) &&
-		//		GbSystem.inOpenInterval(t2min, p1x2, p2x2) && GbSystem.inOpenInterval(t2max, p1x2, p2x2))
-		//	{
-		//		volume += this.triangles[i].getVolume();
-		//		area2  += this.triangles[i].getArea();
-		//		f       = true;
-		//	}
-		//	else
-		//	{
-		//		polygon = this.triangles[i].createClippedPolygon3D(p1x1, p1x2, p2x1, p2x2);
-
-		//		if(polygon != null && polygon.size() > 2)
-		//		{
-		//			try
-		//			{
-		//				x1      = polygon.getX1Centroid();
-		//				x2      = polygon.getX2Centroid();
-		//				volume += this.triangles[i].getX3Coordinate(x1, x2) * Math.abs(polygon.getArea());
-		//				area2  += Math.abs(polygon.getArea());
-		//				f       = true;
-		//			}
-		//			catch(Exception e){}
-		//		}
-		//	}
-		//	if(GbSystem.greaterEqual(area2, area1)) break;
-		//}
-  //    if(f) return(volume);
-  //    else  throw new NullPointerException();
+    throw UbException(UB_EXARGS, "not yet implemented");
+    //    GbPolygon2D polygon;
+    //    double      volume = 0.0;
+    //    double      area1 = Math.abs((p1x1-p2x1)*(p1x2-p2x2));
+    //    double      area2 = 0.0;
+    //    double      t1min, t1max, t2min, t2max;
+    //    double      x1, x2;
+    //    boolean     f = false;
+
+    //    for(int i=0; i<this.triangles.length; i++)
+    //    {
+    //	t1min = this.triangles[i].getX1Minimum();
+    //	t1max = this.triangles[i].getX1Maximum();
+    //	if(GbSystem.less2(t1min, t1max, p1x1, p2x1))    continue;
+    //	if(GbSystem.greater2(t1min, t1max, p1x1, p2x1)) continue;
+
+    //	t2min = this.triangles[i].getX2Minimum();
+    //	t2max = this.triangles[i].getX2Maximum();
+    //	if(GbSystem.less2(t2min, t2max, p1x2, p2x2))    continue;
+    //	if(GbSystem.greater2(t2min, t2max, p1x2, p2x2)) continue;
+
+    //	if(GbSystem.inOpenInterval(t1min, p1x1, p2x1) && GbSystem.inOpenInterval(t1max, p1x1, p2x1) &&
+    //		GbSystem.inOpenInterval(t2min, p1x2, p2x2) && GbSystem.inOpenInterval(t2max, p1x2, p2x2))
+    //	{
+    //		volume += this.triangles[i].getVolume();
+    //		area2  += this.triangles[i].getArea();
+    //		f       = true;
+    //	}
+    //	else
+    //	{
+    //		polygon = this.triangles[i].createClippedPolygon3D(p1x1, p1x2, p2x1, p2x2);
+
+    //		if(polygon != null && polygon.size() > 2)
+    //		{
+    //			try
+    //			{
+    //				x1      = polygon.getX1Centroid();
+    //				x2      = polygon.getX2Centroid();
+    //				volume += this.triangles[i].getX3Coordinate(x1, x2) * Math.abs(polygon.getArea());
+    //				area2  += Math.abs(polygon.getArea());
+    //				f       = true;
+    //			}
+    //			catch(Exception e){}
+    //		}
+    //	}
+    //	if(GbSystem.greaterEqual(area2, area1)) break;
+    //}
+    //    if(f) return(volume);
+    //    else  throw new NullPointerException();
 }
 
 /**
@@ -620,45 +671,46 @@ double GbTriangularMesh3D::getVolumeForRectangle(const double&  /*p1x1*/, const
  * @param p2x2 the 2nd x2 coordinate of the rectangle
  * @return the triangles of this triangular mesh located within the specified rectangle
  */
-vector<GbTriangle3D*>* GbTriangularMesh3D::getTrianglesForRectangle(const double&  /*p1x1*/, const double&  /*p1x2*/, const double&  /*p2x1*/, const double&  /*p2x2*/)
+vector<GbTriangle3D *> *GbTriangularMesh3D::getTrianglesForRectangle(const double & /*p1x1*/, const double & /*p1x2*/,
+                                                                     const double & /*p2x1*/, const double & /*p2x2*/)
 {
-	throw UbException(UB_EXARGS,"not yet implemented");
-  //    QbList      triangleList = new QbList(GbTriangle3D.class);
-  //    GbPolygon2D polygon;
-  //    double      t1min, t1max, t2min, t2max;
-  //    double      area1 = Math.abs((p1x1-p2x1)*(p1x2-p2x2));
-  //    double      area2 = 0.0;
-
-  //    for(int i=0; i<this.triangles.length; i++)
-  //    {
-		//	t1min = this.triangles[i].getX1Minimum();
-		//	t1max = this.triangles[i].getX1Maximum();
-		//	if(GbSystem.less2(t1min, t1max, p1x1, p2x1))    continue;
-		//	if(GbSystem.greater2(t1min, t1max, p1x1, p2x1)) continue;
-
-		//	t2min = this.triangles[i].getX2Minimum();
-		//	t2max = this.triangles[i].getX2Maximum();
-		//	if(GbSystem.less2(t2min, t2max, p1x2, p2x2))    continue;
-		//	if(GbSystem.greater2(t2min, t2max, p1x2, p2x2)) continue;
-
-		//	if(GbSystem.inOpenInterval(t1min, p1x1, p2x1) && GbSystem.inOpenInterval(t1max, p1x1, p2x1) &&
-		//		GbSystem.inOpenInterval(t2min, p1x2, p2x2) && GbSystem.inOpenInterval(t2max, p1x2, p2x2))
-		//	{
-		//		try { triangleList.append(this.triangles[i]); } catch(Exception e){}
-		//		area2 += this.triangles[i].getArea();
-		//	}
-		//	else
-		//	{
-		//		polygon = this.triangles[i].createClippedPolygon3D(p1x1, p1x2, p2x1, p2x2);
-		//		if(polygon != null && polygon.size() > 2)
-		//		{
-		//			try { triangleList.append(this.triangles[i]); } catch(Exception e){}
-		//			area2 += Math.abs(polygon.getArea());
-		//		}
-		//	}
-		//	if(GbSystem.greaterEqual(area2, area1)) break;
-		//}
-  //    return((GbTriangle3D[])triangleList.getObjectArray());
+    throw UbException(UB_EXARGS, "not yet implemented");
+    //    QbList      triangleList = new QbList(GbTriangle3D.class);
+    //    GbPolygon2D polygon;
+    //    double      t1min, t1max, t2min, t2max;
+    //    double      area1 = Math.abs((p1x1-p2x1)*(p1x2-p2x2));
+    //    double      area2 = 0.0;
+
+    //    for(int i=0; i<this.triangles.length; i++)
+    //    {
+    //	t1min = this.triangles[i].getX1Minimum();
+    //	t1max = this.triangles[i].getX1Maximum();
+    //	if(GbSystem.less2(t1min, t1max, p1x1, p2x1))    continue;
+    //	if(GbSystem.greater2(t1min, t1max, p1x1, p2x1)) continue;
+
+    //	t2min = this.triangles[i].getX2Minimum();
+    //	t2max = this.triangles[i].getX2Maximum();
+    //	if(GbSystem.less2(t2min, t2max, p1x2, p2x2))    continue;
+    //	if(GbSystem.greater2(t2min, t2max, p1x2, p2x2)) continue;
+
+    //	if(GbSystem.inOpenInterval(t1min, p1x1, p2x1) && GbSystem.inOpenInterval(t1max, p1x1, p2x1) &&
+    //		GbSystem.inOpenInterval(t2min, p1x2, p2x2) && GbSystem.inOpenInterval(t2max, p1x2, p2x2))
+    //	{
+    //		try { triangleList.append(this.triangles[i]); } catch(Exception e){}
+    //		area2 += this.triangles[i].getArea();
+    //	}
+    //	else
+    //	{
+    //		polygon = this.triangles[i].createClippedPolygon3D(p1x1, p1x2, p2x1, p2x2);
+    //		if(polygon != null && polygon.size() > 2)
+    //		{
+    //			try { triangleList.append(this.triangles[i]); } catch(Exception e){}
+    //			area2 += Math.abs(polygon.getArea());
+    //		}
+    //	}
+    //	if(GbSystem.greaterEqual(area2, area1)) break;
+    //}
+    //    return((GbTriangle3D[])triangleList.getObjectArray());
 }
 /**
  * Returns the nodes of this triangular mesh located within the specified rectangle (may be an empty array).
@@ -668,19 +720,21 @@ vector<GbTriangle3D*>* GbTriangularMesh3D::getTrianglesForRectangle(const double
  * @param p2x2 the 2nd x2 coordinate of the rectangle
  * @return the nodes of this triangular mesh located within the specified rectangle
  */
-vector<GbPoint3D*>* GbTriangularMesh3D::getNodesForRectangle(const double&  /*p1x1*/, const double&  /*p1x2*/, const double&  /*p2x1*/, const double&  /*p2x2*/)
+vector<GbPoint3D *> *GbTriangularMesh3D::getNodesForRectangle(const double & /*p1x1*/, const double & /*p1x2*/,
+                                                              const double & /*p2x1*/, const double & /*p2x2*/)
 {
-	throw UbException(UB_EXARGS,"not implemented");
-//   QbList nodeList = new QbList(GbPoint3D.class);
-
-   //   for(int i=0; i<this.edges.length; i++)
-   //   {
-			//if(GbSystem.inClosedInterval(this.nodes[i].getX1Coordinate(), p1x1, p2x1) && GbSystem.inClosedInterval(this.nodes[i].getX2Coordinate(), p1x2, p2x2))
-			//{
-			//	try { nodeList.append(this.nodes[i]); } catch(Exception e){}
-			//}
-   //   }
-   //   return((GbPoint3D[])nodeList.getObjectArray());
+    throw UbException(UB_EXARGS, "not implemented");
+    //   QbList nodeList = new QbList(GbPoint3D.class);
+
+    //   for(int i=0; i<this.edges.length; i++)
+    //   {
+    // if(GbSystem.inClosedInterval(this.nodes[i].getX1Coordinate(), p1x1, p2x1) &&
+    // GbSystem.inClosedInterval(this.nodes[i].getX2Coordinate(), p1x2, p2x2))
+    //{
+    //	try { nodeList.append(this.nodes[i]); } catch(Exception e){}
+    //}
+    //   }
+    //   return((GbPoint3D[])nodeList.getObjectArray());
 }
 
 /**
@@ -693,69 +747,70 @@ vector<GbPoint3D*>* GbTriangularMesh3D::getNodesForRectangle(const double&  /*p1
  * @return the difference of maximum and minimum x3 coordinates of this triangular mesh within the specified rectangle
  * @exception NullPointerException if no triangles are found within the specified rectangle
  */
-double GbTriangularMesh3D::getX3RangeForRectangle(const double&  /*p1x1*/, const double&  /*p1x2*/, const double&  /*p2x1*/, const double&  /*p2x2*/) 
+double GbTriangularMesh3D::getX3RangeForRectangle(const double & /*p1x1*/, const double & /*p1x2*/,
+                                                  const double & /*p2x1*/, const double & /*p2x2*/)
 {
-	throw UbException(UB_EXARGS,"not implemented");
- //     GbPolygon3D polygon;
- //     boolean     f     = false;
- //     double      x3min = 0.0;
- //     double      x3max = 0.0;
- //     double      t1min, t1max, t2min, t2max;
- //     double      area1 = Math.abs((p1x1-p2x1)*(p1x2-p2x2));
- //     double      area2 = 0.0;
-
- //     for(int i=0; i<this.triangles.length; i++)
- //     {
-	// t1min = this.triangles[i].getX1Minimum();
-	// t1max = this.triangles[i].getX1Maximum();
-	// if(GbSystem.less2(t1min, t1max, p1x1, p2x1))    continue;
-	// if(GbSystem.greater2(t1min, t1max, p1x1, p2x1)) continue;
-
-	// t2min = this.triangles[i].getX2Minimum();
-	// t2max = this.triangles[i].getX2Maximum();
-	// if(GbSystem.less2(t2min, t2max, p1x2, p2x2))    continue;
-	// if(GbSystem.greater2(t2min, t2max, p1x2, p2x2)) continue;
-
-	// if(GbSystem.inOpenInterval(t1min, p1x1, p2x1) && GbSystem.inOpenInterval(t1max, p1x1, p2x1) &&
-	//    GbSystem.inOpenInterval(t2min, p1x2, p2x2) && GbSystem.inOpenInterval(t2max, p1x2, p2x2))
-	// {
-	//    if(f)
-	//    {
-	//       if(this.triangles[i].getX3Minimum() < x3min) x3min = this.triangles[i].getX3Minimum();
-	//       if(this.triangles[i].getX3Maximum() > x3max) x3max = this.triangles[i].getX3Maximum();
-	//    }
-	//    else
-	//    {
-	//       x3min = this.triangles[i].getX3Minimum();
-	//       x3max = this.triangles[i].getX3Maximum();
-	//       f     = true;
-	//    }
-	//    area2 += this.triangles[i].getArea();
-	//}
-	// else
-	// {
-	//    polygon = this.triangles[i].createClippedPolygon3D(p1x1, p1x2, p2x1, p2x2);
-
-	//    if(polygon != null && polygon.size() > 2)
-	//    {
-	//       if(f)
-	//       {
-	//          if(polygon.getX3Minimum() < x3min) x3min = polygon.getX3Minimum();
-	//          if(polygon.getX3Maximum() > x3max) x3max = polygon.getX3Maximum();
-	//       }
-	//       else
-	//       {
-	//          x3min = polygon.getX3Minimum();
-	//          x3max = polygon.getX3Maximum();
-	//          f     = true;
-	//       }
-	//       area2 += Math.abs(polygon.getArea());
-	//    }
-	// }
-	// if(GbSystem.greaterEqual(area2, area1)) break;
- //     }
- //     if(f) return(x3max-x3min);
- //     else  throw new NullPointerException();
+    throw UbException(UB_EXARGS, "not implemented");
+    //     GbPolygon3D polygon;
+    //     boolean     f     = false;
+    //     double      x3min = 0.0;
+    //     double      x3max = 0.0;
+    //     double      t1min, t1max, t2min, t2max;
+    //     double      area1 = Math.abs((p1x1-p2x1)*(p1x2-p2x2));
+    //     double      area2 = 0.0;
+
+    //     for(int i=0; i<this.triangles.length; i++)
+    //     {
+    // t1min = this.triangles[i].getX1Minimum();
+    // t1max = this.triangles[i].getX1Maximum();
+    // if(GbSystem.less2(t1min, t1max, p1x1, p2x1))    continue;
+    // if(GbSystem.greater2(t1min, t1max, p1x1, p2x1)) continue;
+
+    // t2min = this.triangles[i].getX2Minimum();
+    // t2max = this.triangles[i].getX2Maximum();
+    // if(GbSystem.less2(t2min, t2max, p1x2, p2x2))    continue;
+    // if(GbSystem.greater2(t2min, t2max, p1x2, p2x2)) continue;
+
+    // if(GbSystem.inOpenInterval(t1min, p1x1, p2x1) && GbSystem.inOpenInterval(t1max, p1x1, p2x1) &&
+    //    GbSystem.inOpenInterval(t2min, p1x2, p2x2) && GbSystem.inOpenInterval(t2max, p1x2, p2x2))
+    // {
+    //    if(f)
+    //    {
+    //       if(this.triangles[i].getX3Minimum() < x3min) x3min = this.triangles[i].getX3Minimum();
+    //       if(this.triangles[i].getX3Maximum() > x3max) x3max = this.triangles[i].getX3Maximum();
+    //    }
+    //    else
+    //    {
+    //       x3min = this.triangles[i].getX3Minimum();
+    //       x3max = this.triangles[i].getX3Maximum();
+    //       f     = true;
+    //    }
+    //    area2 += this.triangles[i].getArea();
+    //}
+    // else
+    // {
+    //    polygon = this.triangles[i].createClippedPolygon3D(p1x1, p1x2, p2x1, p2x2);
+
+    //    if(polygon != null && polygon.size() > 2)
+    //    {
+    //       if(f)
+    //       {
+    //          if(polygon.getX3Minimum() < x3min) x3min = polygon.getX3Minimum();
+    //          if(polygon.getX3Maximum() > x3max) x3max = polygon.getX3Maximum();
+    //       }
+    //       else
+    //       {
+    //          x3min = polygon.getX3Minimum();
+    //          x3max = polygon.getX3Maximum();
+    //          f     = true;
+    //       }
+    //       area2 += Math.abs(polygon.getArea());
+    //    }
+    // }
+    // if(GbSystem.greaterEqual(area2, area1)) break;
+    //     }
+    //     if(f) return(x3max-x3min);
+    //     else  throw new NullPointerException();
 }
 /**
  * Returns the minimum x3 coordinates of this triangular mesh within the specified rectangle.
@@ -766,64 +821,65 @@ double GbTriangularMesh3D::getX3RangeForRectangle(const double&  /*p1x1*/, const
  * @return the minimum x3 coordinates of this triangular mesh within the specified rectangle
  * @exception NullPointerException if no triangles are found within the specified rectangle
  */
-double GbTriangularMesh3D::getX3MinimumForRectangle(const double&  /*p1x1*/, const double&  /*p1x2*/, const double&  /*p2x1*/, const double&  /*p2x2*/) 
+double GbTriangularMesh3D::getX3MinimumForRectangle(const double & /*p1x1*/, const double & /*p1x2*/,
+                                                    const double & /*p2x1*/, const double & /*p2x2*/)
 {
-	throw UbException(UB_EXARGS,"not implemented");
-  //    GbPolygon3D polygon;
-  //    boolean     f     = false;
-  //    double      x3min = 0.0;
-  //    double      t1min, t1max, t2min, t2max;
-  //    double      area1 = Math.abs((p1x1-p2x1)*(p1x2-p2x2));
-  //    double      area2 = 0.0;
-
-  //    for(int i=0; i<this.triangles.length; i++)
-  //    {
-	 //t1min = this.triangles[i].getX1Minimum();
-	 //t1max = this.triangles[i].getX1Maximum();
-	 //if(GbSystem.less2(t1min, t1max, p1x1, p2x1))    continue;
-	 //if(GbSystem.greater2(t1min, t1max, p1x1, p2x1)) continue;
-
-	 //t2min = this.triangles[i].getX2Minimum();
-	 //t2max = this.triangles[i].getX2Maximum();
-	 //if(GbSystem.less2(t2min, t2max, p1x2, p2x2))    continue;
-	 //if(GbSystem.greater2(t2min, t2max, p1x2, p2x2)) continue;
-
-	 //if(GbSystem.inOpenInterval(t1min, p1x1, p2x1) && GbSystem.inOpenInterval(t1max, p1x1, p2x1) &&
-	 //   GbSystem.inOpenInterval(t2min, p1x2, p2x2) && GbSystem.inOpenInterval(t2max, p1x2, p2x2))
-	 //{
-	 //   if(f)
-	 //   {
-	 //      if(this.triangles[i].getX3Minimum() < x3min) x3min = this.triangles[i].getX3Minimum();
-	 //   }
-	 //   else
-	 //   {
-	 //      x3min = this.triangles[i].getX3Minimum();
-	 //      f     = true;
-	 //   }
-	 //   area2 += this.triangles[i].getArea();
-	 //}
-	 //else
-	 //{
-	 //   polygon = this.triangles[i].createClippedPolygon3D(p1x1, p1x2, p2x1, p2x2);
-
-	 //   if(polygon != null && polygon.size() > 2)
-	 //   {
-	 //      if(f)
-	 //      {
-	 //         if(polygon.getX3Minimum() < x3min) x3min = polygon.getX3Minimum();
-	 //      }
-	 //      else
-	 //      {
-	 //         x3min = polygon.getX3Minimum();
-	 //         f     = true;
-	 //      }
-	 //      area2 += Math.abs(polygon.getArea());
-	 //   }
-	 //}
-	 //if(GbSystem.greaterEqual(area2, area1)) break;
-  //    }
-  //    if(f) return(x3min);
-  //    else  throw new NullPointerException();
+    throw UbException(UB_EXARGS, "not implemented");
+    //    GbPolygon3D polygon;
+    //    boolean     f     = false;
+    //    double      x3min = 0.0;
+    //    double      t1min, t1max, t2min, t2max;
+    //    double      area1 = Math.abs((p1x1-p2x1)*(p1x2-p2x2));
+    //    double      area2 = 0.0;
+
+    //    for(int i=0; i<this.triangles.length; i++)
+    //    {
+    // t1min = this.triangles[i].getX1Minimum();
+    // t1max = this.triangles[i].getX1Maximum();
+    // if(GbSystem.less2(t1min, t1max, p1x1, p2x1))    continue;
+    // if(GbSystem.greater2(t1min, t1max, p1x1, p2x1)) continue;
+
+    // t2min = this.triangles[i].getX2Minimum();
+    // t2max = this.triangles[i].getX2Maximum();
+    // if(GbSystem.less2(t2min, t2max, p1x2, p2x2))    continue;
+    // if(GbSystem.greater2(t2min, t2max, p1x2, p2x2)) continue;
+
+    // if(GbSystem.inOpenInterval(t1min, p1x1, p2x1) && GbSystem.inOpenInterval(t1max, p1x1, p2x1) &&
+    //   GbSystem.inOpenInterval(t2min, p1x2, p2x2) && GbSystem.inOpenInterval(t2max, p1x2, p2x2))
+    //{
+    //   if(f)
+    //   {
+    //      if(this.triangles[i].getX3Minimum() < x3min) x3min = this.triangles[i].getX3Minimum();
+    //   }
+    //   else
+    //   {
+    //      x3min = this.triangles[i].getX3Minimum();
+    //      f     = true;
+    //   }
+    //   area2 += this.triangles[i].getArea();
+    //}
+    // else
+    //{
+    //   polygon = this.triangles[i].createClippedPolygon3D(p1x1, p1x2, p2x1, p2x2);
+
+    //   if(polygon != null && polygon.size() > 2)
+    //   {
+    //      if(f)
+    //      {
+    //         if(polygon.getX3Minimum() < x3min) x3min = polygon.getX3Minimum();
+    //      }
+    //      else
+    //      {
+    //         x3min = polygon.getX3Minimum();
+    //         f     = true;
+    //      }
+    //      area2 += Math.abs(polygon.getArea());
+    //   }
+    //}
+    // if(GbSystem.greaterEqual(area2, area1)) break;
+    //    }
+    //    if(f) return(x3min);
+    //    else  throw new NullPointerException();
 }
 /**
  * Returns the maximum x3 coordinates of this triangular mesh within the specified rectangle.
@@ -834,199 +890,206 @@ double GbTriangularMesh3D::getX3MinimumForRectangle(const double&  /*p1x1*/, con
  * @return the maximum x3 coordinates of this triangular mesh within the specified rectangle
  * @exception NullPointerException if no triangles are found within the specified rectangle
  */
-double GbTriangularMesh3D::getX3MaximumForRectangle(const double&  /*p1x1*/, const double&  /*p1x2*/, const double&  /*p2x1*/, const double&  /*p2x2*/) 
+double GbTriangularMesh3D::getX3MaximumForRectangle(const double & /*p1x1*/, const double & /*p1x2*/,
+                                                    const double & /*p2x1*/, const double & /*p2x2*/)
 {
-   throw UbException(UB_EXARGS,"not implemented");
-  //    GbPolygon3D polygon;
-  //    boolean     f     = false;
-  //    double      x3max = 0.0;
-  //    double      t1min, t1max, t2min, t2max;
-  //    double      area1 = Math.abs((p1x1-p2x1)*(p1x2-p2x2));
-  //    double      area2 = 0.0;
-
-  //    for(int i=0; i<this.triangles.length; i++)
-  //    {
-	 //t1min = this.triangles[i].getX1Minimum();
-	 //t1max = this.triangles[i].getX1Maximum();
-	 //if(GbSystem.less2(t1min, t1max, p1x1, p2x1))    continue;
-	 //if(GbSystem.greater2(t1min, t1max, p1x1, p2x1)) continue;
-
-	 //t2min = this.triangles[i].getX2Minimum();
-	 //t2max = this.triangles[i].getX2Maximum();
-	 //if(GbSystem.less2(t2min, t2max, p1x2, p2x2))    continue;
-	 //if(GbSystem.greater2(t2min, t2max, p1x2, p2x2)) continue;
-
-	 //if(GbSystem.inOpenInterval(t1min, p1x1, p2x1) && GbSystem.inOpenInterval(t1max, p1x1, p2x1) &&
-	 //   GbSystem.inOpenInterval(t2min, p1x2, p2x2) && GbSystem.inOpenInterval(t2max, p1x2, p2x2))
-	 //{
-	 //   if(f)
-	 //   {
-	 //      if(this.triangles[i].getX3Maximum() < x3max) x3max = this.triangles[i].getX3Maximum();
-	 //   }
-	 //   else
-	 //   {
-	 //      x3max = this.triangles[i].getX3Maximum();
-	 //      f     = true;
-	 //   }
-	 //   area2 += this.triangles[i].getArea();
-	 //}
-	 //else
-	 //{
-	 //   polygon = this.triangles[i].createClippedPolygon3D(p1x1, p1x2, p2x1, p2x2);
-
-	 //   if(polygon != null && polygon.size() > 2)
-	 //   {
-	 //      if(f)
-	 //      {
-	 //         if(polygon.getX3Maximum() < x3max) x3max = polygon.getX3Maximum();
-	 //      }
-	 //      else
-	 //      {
-	 //         x3max = polygon.getX3Maximum();
-	 //         f     = true;
-	 //      }
-	 //      area2 += Math.abs(polygon.getArea());
-	 //   }
-	 //}
-	 //if(GbSystem.greaterEqual(area2, area1)) break;
-  //    }
-  //    if(f) return(x3max);
-  //    else  throw new NullPointerException();
+    throw UbException(UB_EXARGS, "not implemented");
+    //    GbPolygon3D polygon;
+    //    boolean     f     = false;
+    //    double      x3max = 0.0;
+    //    double      t1min, t1max, t2min, t2max;
+    //    double      area1 = Math.abs((p1x1-p2x1)*(p1x2-p2x2));
+    //    double      area2 = 0.0;
+
+    //    for(int i=0; i<this.triangles.length; i++)
+    //    {
+    // t1min = this.triangles[i].getX1Minimum();
+    // t1max = this.triangles[i].getX1Maximum();
+    // if(GbSystem.less2(t1min, t1max, p1x1, p2x1))    continue;
+    // if(GbSystem.greater2(t1min, t1max, p1x1, p2x1)) continue;
+
+    // t2min = this.triangles[i].getX2Minimum();
+    // t2max = this.triangles[i].getX2Maximum();
+    // if(GbSystem.less2(t2min, t2max, p1x2, p2x2))    continue;
+    // if(GbSystem.greater2(t2min, t2max, p1x2, p2x2)) continue;
+
+    // if(GbSystem.inOpenInterval(t1min, p1x1, p2x1) && GbSystem.inOpenInterval(t1max, p1x1, p2x1) &&
+    //   GbSystem.inOpenInterval(t2min, p1x2, p2x2) && GbSystem.inOpenInterval(t2max, p1x2, p2x2))
+    //{
+    //   if(f)
+    //   {
+    //      if(this.triangles[i].getX3Maximum() < x3max) x3max = this.triangles[i].getX3Maximum();
+    //   }
+    //   else
+    //   {
+    //      x3max = this.triangles[i].getX3Maximum();
+    //      f     = true;
+    //   }
+    //   area2 += this.triangles[i].getArea();
+    //}
+    // else
+    //{
+    //   polygon = this.triangles[i].createClippedPolygon3D(p1x1, p1x2, p2x1, p2x2);
+
+    //   if(polygon != null && polygon.size() > 2)
+    //   {
+    //      if(f)
+    //      {
+    //         if(polygon.getX3Maximum() < x3max) x3max = polygon.getX3Maximum();
+    //      }
+    //      else
+    //      {
+    //         x3max = polygon.getX3Maximum();
+    //         f     = true;
+    //      }
+    //      area2 += Math.abs(polygon.getArea());
+    //   }
+    //}
+    // if(GbSystem.greaterEqual(area2, area1)) break;
+    //    }
+    //    if(f) return(x3max);
+    //    else  throw new NullPointerException();
 }
 /*======================================================================*/
-vector<GbTriangle3D*> GbTriangularMesh3D::getSurfaceTriangleSet()
+vector<GbTriangle3D *> GbTriangularMesh3D::getSurfaceTriangleSet()
 {
-   vector<GbTriangle3D*> tris;
-   GbTriangle3D* triangle;
-   GbPoint3D* p1;
-   GbPoint3D* p2;
-   GbPoint3D* p3;
-   int size = (int)this->triangles->size();
-   for(int u=0; u<size;u++)
-   {
-      triangle = (*this->triangles)[u];
-      p1 = new GbPoint3D(triangle->getPoint1());
-      p2 = new GbPoint3D(triangle->getPoint2());
-      p3 = new GbPoint3D(triangle->getPoint3());
-      tris.push_back(new GbTriangle3D(p1, p2, p3));
-   }
-   return tris;
+    vector<GbTriangle3D *> tris;
+    GbTriangle3D *triangle;
+    GbPoint3D *p1;
+    GbPoint3D *p2;
+    GbPoint3D *p3;
+    int size = (int)this->triangles->size();
+    for (int u = 0; u < size; u++) {
+        triangle = (*this->triangles)[u];
+        p1       = new GbPoint3D(triangle->getPoint1());
+        p2       = new GbPoint3D(triangle->getPoint2());
+        p3       = new GbPoint3D(triangle->getPoint3());
+        tris.push_back(new GbTriangle3D(p1, p2, p3));
+    }
+    return tris;
 }
 /*======================================================================*/
 /*
-* Function to determine if the point is inside the polyhedron defined as a 3D object
-* using the Halfspace algorithm
-* @param xp the x-coordinate of the point
-* @param yp the y-coordinate of the point
-* @param zp the z-coordinate of the point
-* @return true if point is inside else return false
-*/
-bool GbTriangularMesh3D::isPointInObject3DHalfSpace(const double& xp, const double& yp, const double& zp)
-{ 
-   vector<GbTriangle3D*> *Triangles = this->triangles;
-   int Trianglesize = (int)Triangles->size();
-   //GbPoint3D Point(xp,yp,zp);
-   for (int i=0; i<Trianglesize; i++)
-   {
-      //GbPoint3D* point1 = (*Triangles)[i]->getPoint1();
-      //GbPoint3D* point2 = (*Triangles)[i]->getPoint2();
-      //GbPoint3D* point3 = (*Triangles)[i]->getPoint3();
-
-      //GbHalfSpace3D halfspace(point1, point2, point3);
-      GbHalfSpace3D halfspace((*Triangles)[i]);
-      if (halfspace.ptInside(xp,yp,zp)) return false;
-   }
-   return true;
+ * Function to determine if the point is inside the polyhedron defined as a 3D object
+ * using the Halfspace algorithm
+ * @param xp the x-coordinate of the point
+ * @param yp the y-coordinate of the point
+ * @param zp the z-coordinate of the point
+ * @return true if point is inside else return false
+ */
+bool GbTriangularMesh3D::isPointInObject3DHalfSpace(const double &xp, const double &yp, const double &zp)
+{
+    vector<GbTriangle3D *> *Triangles = this->triangles;
+    int Trianglesize                  = (int)Triangles->size();
+    // GbPoint3D Point(xp,yp,zp);
+    for (int i = 0; i < Trianglesize; i++) {
+        // GbPoint3D* point1 = (*Triangles)[i]->getPoint1();
+        // GbPoint3D* point2 = (*Triangles)[i]->getPoint2();
+        // GbPoint3D* point3 = (*Triangles)[i]->getPoint3();
+
+        // GbHalfSpace3D halfspace(point1, point2, point3);
+        GbHalfSpace3D halfspace((*Triangles)[i]);
+        if (halfspace.ptInside(xp, yp, zp))
+            return false;
+    }
+    return true;
 }
 /*======================================================================*/
-bool GbTriangularMesh3D::isPointInObject3DRayCrossing(const double& xp, const double& yp, const double& zp, int radius, int  /*numVertices*/, int numTriangles)
+bool GbTriangularMesh3D::isPointInObject3DRayCrossing(const double &xp, const double &yp, const double &zp, int radius,
+                                                      int /*numVertices*/, int numTriangles)
 {
-   GbVector3D point(xp,yp,zp);
+    GbVector3D point(xp, yp, zp);
 
-   if ( this->InPolyhedron(numTriangles, point, radius) ) return true;
-   else                                                   return false;
-   
+    if (this->InPolyhedron(numTriangles, point, radius))
+        return true;
+    else
+        return false;
 }
 /*======================================================================*/
-bool GbTriangularMesh3D::isPointInGbObject3D(const double& x1, const double& x2, const double& x3)
+bool GbTriangularMesh3D::isPointInGbObject3D(const double &x1, const double &x2, const double &x3)
 {
-   double xmin=this->getX1Minimum();	double xmax=this->getX1Maximum();
-   double ymin=this->getX2Minimum();	double ymax=this->getX2Maximum();
-   double zmin=this->getX3Minimum();	double zmax=this->getX3Maximum();
-   double dX = (xmax-xmin)/100.;
-   double dY = (ymax-ymin)/100.;
-   double dZ = (zmax-zmin)/100.;
-   GbCuboid3D boundingCube(xmin-dX, ymin-dY, zmin-dZ, xmax+dX, ymax+dY, zmax+dZ);
-   if(!boundingCube.isPointInGbObject3D(x1, x2, x3)) { boundingCube.finalize(); return false; }
-
-   // Halfspace algorithm, Area of spherical polygons algorithm or Ray crossing algorithm
-   GbVector3D bMin(boundingCube.getPoint1());
-   GbVector3D bMax(boundingCube.getPoint2());
-
-   boundingCube.finalize();
-
-   bMin = bMax.Subtract(bMin);
-   int radius = (int)(bMin.Length()+1)+1;
-
-   if(this->pointinobjecttest == HALFSPACE)        return this->isPointInObject3DHalfSpace(x1,x2,x3);
-   else if(this->pointinobjecttest == RAYCROSSING) return this->isPointInObject3DRayCrossing(x1,x2,x3,radius,(int)this->nodes->size(),(int)this->triangles->size());
-   else throw UbException(UB_EXARGS,"no ptInObjTest");
+    double xmin = this->getX1Minimum();
+    double xmax = this->getX1Maximum();
+    double ymin = this->getX2Minimum();
+    double ymax = this->getX2Maximum();
+    double zmin = this->getX3Minimum();
+    double zmax = this->getX3Maximum();
+    double dX   = (xmax - xmin) / 100.;
+    double dY   = (ymax - ymin) / 100.;
+    double dZ   = (zmax - zmin) / 100.;
+    GbCuboid3D boundingCube(xmin - dX, ymin - dY, zmin - dZ, xmax + dX, ymax + dY, zmax + dZ);
+    if (!boundingCube.isPointInGbObject3D(x1, x2, x3)) {
+        boundingCube.finalize();
+        return false;
+    }
+
+    // Halfspace algorithm, Area of spherical polygons algorithm or Ray crossing algorithm
+    GbVector3D bMin(boundingCube.getPoint1());
+    GbVector3D bMax(boundingCube.getPoint2());
+
+    boundingCube.finalize();
+
+    bMin       = bMax.Subtract(bMin);
+    int radius = (int)(bMin.Length() + 1) + 1;
+
+    if (this->pointinobjecttest == HALFSPACE)
+        return this->isPointInObject3DHalfSpace(x1, x2, x3);
+    else if (this->pointinobjecttest == RAYCROSSING)
+        return this->isPointInObject3DRayCrossing(x1, x2, x3, radius, (int)this->nodes->size(),
+                                                  (int)this->triangles->size());
+    else
+        throw UbException(UB_EXARGS, "no ptInObjTest");
 }
 /*======================================================================*/
-bool GbTriangularMesh3D::isPointInGbObject3D(const double&  /*x1*/, const double&  /*x2*/, const double&  /*x3*/, bool&  /*pointIsOnBoundary*/)
+bool GbTriangularMesh3D::isPointInGbObject3D(const double & /*x1*/, const double & /*x2*/, const double & /*x3*/,
+                                             bool & /*pointIsOnBoundary*/)
 {
-    throw UbException(UB_EXARGS,"not implemented");
+    throw UbException(UB_EXARGS, "not implemented");
 }
 /*======================================================================*/
-GbLine3D* GbTriangularMesh3D::createClippedLine3D(GbPoint3D&  /*point1*/, GbPoint3D&  /*point2*/)
+GbLine3D *GbTriangularMesh3D::createClippedLine3D(GbPoint3D & /*point1*/, GbPoint3D & /*point2*/)
 {
-   throw UbException(UB_EXARGS,"not implemented");
+    throw UbException(UB_EXARGS, "not implemented");
 }
 /*======================================================================*/
-void GbTriangularMesh3D::writeMesh(string filename, WbWriter* writer, bool writeNormals) 
+void GbTriangularMesh3D::writeMesh(string filename, WbWriter *writer, bool writeNormals)
 {
-   vector<UbTupleFloat3 > nodes(triangles->size()*3);
-   vector<UbTupleInt3 >   tris(triangles->size());
-
-   for(size_t i=0; i<triangles->size(); i++)
-   {
-      GbTriangle3D&  tri = *((*triangles)[i]);
-      GbPoint3D&   node1 = *tri.getPoint(0);
-      GbPoint3D&   node2 = *tri.getPoint(1);
-      GbPoint3D&   node3 = *tri.getPoint(2);
-      
-      nodes[i*3  ] = makeUbTuple( (float)node1.getX1Coordinate()
-                                 ,(float)node1.getX2Coordinate()  
-                                 ,(float)node1.getX3Coordinate());
-      nodes[i*3+1] = makeUbTuple( (float)node2.getX1Coordinate()
-                                 ,(float)node2.getX2Coordinate()  
-                                 ,(float)node2.getX3Coordinate());
-      nodes[i*3+2] = makeUbTuple( (float)node3.getX1Coordinate()
-                                 ,(float)node3.getX2Coordinate()  
-                                 ,(float)node3.getX3Coordinate());
-
-      tris[i] = makeUbTuple((int)i*3,(int)i*3+1,(int)i*3+2);
-   }
-   writer->writeTriangles(filename,nodes,tris);
-   
-   if(writeNormals)
-   {
-      vector<UbTupleFloat3 > lineNodes(triangles->size()*2);
-      vector<UbTupleInt2 >   lines(triangles->size());
-      for(size_t i=0; i<triangles->size(); i++)
-      {
-         GbVector3D vec = (*triangles)[i]->getNormal();
-         lineNodes[i*2  ] = makeUbTuple( (float)(*triangles)[i]->getX1Centroid()
-                                        ,(float)(*triangles)[i]->getX2Centroid()  
-                                        ,(float)(*triangles)[i]->getX3Centroid());
-         lineNodes[i*2+1] = makeUbTuple( (float)((*triangles)[i]->getX1Centroid()+vec.X1())
-                                        ,(float)((*triangles)[i]->getX2Centroid()+vec.X2())  
-                                        ,(float)((*triangles)[i]->getX3Centroid()+vec.X3()));
-
-         lines[i] = makeUbTuple((int)i*2,(int)i*2+1);
-      }
-      writer->writeLines(filename+"_normals",lineNodes,lines);
-   }
+    vector<UbTupleFloat3> nodes(triangles->size() * 3);
+    vector<UbTupleInt3> tris(triangles->size());
+
+    for (size_t i = 0; i < triangles->size(); i++) {
+        GbTriangle3D &tri = *((*triangles)[i]);
+        GbPoint3D &node1  = *tri.getPoint(0);
+        GbPoint3D &node2  = *tri.getPoint(1);
+        GbPoint3D &node3  = *tri.getPoint(2);
+
+        nodes[i * 3] =
+            makeUbTuple((float)node1.getX1Coordinate(), (float)node1.getX2Coordinate(), (float)node1.getX3Coordinate());
+        nodes[i * 3 + 1] =
+            makeUbTuple((float)node2.getX1Coordinate(), (float)node2.getX2Coordinate(), (float)node2.getX3Coordinate());
+        nodes[i * 3 + 2] =
+            makeUbTuple((float)node3.getX1Coordinate(), (float)node3.getX2Coordinate(), (float)node3.getX3Coordinate());
+
+        tris[i] = makeUbTuple((int)i * 3, (int)i * 3 + 1, (int)i * 3 + 2);
+    }
+    writer->writeTriangles(filename, nodes, tris);
+
+    if (writeNormals) {
+        vector<UbTupleFloat3> lineNodes(triangles->size() * 2);
+        vector<UbTupleInt2> lines(triangles->size());
+        for (size_t i = 0; i < triangles->size(); i++) {
+            GbVector3D vec = (*triangles)[i]->getNormal();
+            lineNodes[i * 2] =
+                makeUbTuple((float)(*triangles)[i]->getX1Centroid(), (float)(*triangles)[i]->getX2Centroid(),
+                            (float)(*triangles)[i]->getX3Centroid());
+            lineNodes[i * 2 + 1] = makeUbTuple((float)((*triangles)[i]->getX1Centroid() + vec.X1()),
+                                               (float)((*triangles)[i]->getX2Centroid() + vec.X2()),
+                                               (float)((*triangles)[i]->getX3Centroid() + vec.X3()));
+
+            lines[i] = makeUbTuple((int)i * 2, (int)i * 2 + 1);
+        }
+        writer->writeLines(filename + "_normals", lineNodes, lines);
+    }
 }
 
 /*======================================================================*/
@@ -1038,68 +1101,76 @@ This function returns a char:
 'i': the query point a is strictly interior to polyhedron P.
 'o': the query point a is strictly exterior to( or outside of) polyhedron P.
 */
-bool GbTriangularMesh3D::InPolyhedron( int F, GbVector3D& q, int radius )
+bool GbTriangularMesh3D::InPolyhedron(int F, GbVector3D &q, int radius)
 {
-   GbVector3D r;  /* Ray endpoint. */
-   GbVector3D p;  /* Intersection point; not used. */
-   int f, k = 0, crossings = 0;
-   char code = '?';
-
-   while( k++ < F ) 
-   {
-      crossings = 0;
-
-      RandomRay( r, radius ); 
-      r = q.Add(r);
-      // printf("Ray endpoint: (%d,%d,%d)\n", r[0],r[1],r[2] );
-
-      for ( f = 0; f < F; f++ )  /* Begin check each face */
-      {
-          if( BoxTest( (*this->triangles)[f], q, r ) == false ) code = '0'; // printf("BoxTest = 0!\n");
-         else                                                  code = SegTriInt( (*this->triangles)[f], q, r, p );// printf( "Face = %d: BoxTest/SegTriInt returns %c\n\n", f, code );
-
-         /* If ray is degenerate, then goto outer while to generate another. */
-         if( code=='p' || code=='v' || code=='e' ) break; //goto LOOP; //printf("Degenerate ray\n");
-         /* If ray hits face at interior point, increment crossings. */
-         else if ( code=='f' ) crossings++; // printf( "crossings = %d\n", crossings );
-         /* If query endpoint q sits on a V/E/F, return that code. */
-         else if ( code=='V' || code=='E' || code=='F' ) return true;
-         /* If ray misses triangle, do nothing. */
-         else if ( code=='0' ) { /*nothing to do*/ }
-         else throw UbException(UB_EXARGS,"Error" );
-      } /* End check each face */
-
-      /* No degeneracies encountered: ray is generic, so finished. */
-      if(f>=F) break;
-   } /* End while loop */
-
-   //   printf( "Crossings = %d\n", crossings );
-   /* q strictly interior to polyhedron iff an odd number of crossings. */
-   if( (crossings%2) == 1 ) return true;
-   
-   return false;
+    GbVector3D r; /* Ray endpoint. */
+    GbVector3D p; /* Intersection point; not used. */
+    int f, k = 0, crossings = 0;
+    char code = '?';
+
+    while (k++ < F) {
+        crossings = 0;
+
+        RandomRay(r, radius);
+        r = q.Add(r);
+        // printf("Ray endpoint: (%d,%d,%d)\n", r[0],r[1],r[2] );
+
+        for (f = 0; f < F; f++) /* Begin check each face */
+        {
+            if (BoxTest((*this->triangles)[f], q, r) == false)
+                code = '0'; // printf("BoxTest = 0!\n");
+            else
+                code = SegTriInt((*this->triangles)[f], q, r,
+                                 p); // printf( "Face = %d: BoxTest/SegTriInt returns %c\n\n", f, code );
+
+            /* If ray is degenerate, then goto outer while to generate another. */
+            if (code == 'p' || code == 'v' || code == 'e')
+                break; // goto LOOP; //printf("Degenerate ray\n");
+            /* If ray hits face at interior point, increment crossings. */
+            else if (code == 'f')
+                crossings++; // printf( "crossings = %d\n", crossings );
+            /* If query endpoint q sits on a V/E/F, return that code. */
+            else if (code == 'V' || code == 'E' || code == 'F')
+                return true;
+            /* If ray misses triangle, do nothing. */
+            else if (code == '0') { /*nothing to do*/
+            } else
+                throw UbException(UB_EXARGS, "Error");
+        } /* End check each face */
+
+        /* No degeneracies encountered: ray is generic, so finished. */
+        if (f >= F)
+            break;
+    } /* End while loop */
+
+    //   printf( "Crossings = %d\n", crossings );
+    /* q strictly interior to polyhedron iff an odd number of crossings. */
+    if ((crossings % 2) == 1)
+        return true;
+
+    return false;
 }
 
 /* Return a random ray endpoint */
-void GbTriangularMesh3D::RandomRay( GbVector3D& ray, int radius )
+void GbTriangularMesh3D::RandomRay(GbVector3D &ray, int radius)
 {
-   double x, y, z, w, t;
-
-   double MAX_INT = 2147483647;
-   /* Generate a random point on a sphere of radius 1. */
-   /* the sphere is sliced at z, and a random point at angle t
-   generated on the circle of intersection. */
-   z = 2.0 * (double) rand() / MAX_INT - 1.0;
-   t = 2.0 * UbMath::PI * (double) rand() / MAX_INT;
-   w = sqrt( 1 - z*z );
-   x = w * cos( t );
-   y = w * sin( t );
-
-   ray[0] = radius * x;
-   ray[1] = radius * y;
-   ray[2] = radius * z;
-
-   /*printf( "RandomRay returns %6d %6d %6d\n", ray[X], ray[Y], ray[Z] );*/
+    double x, y, z, w, t;
+
+    double MAX_INT = 2147483647;
+    /* Generate a random point on a sphere of radius 1. */
+    /* the sphere is sliced at z, and a random point at angle t
+    generated on the circle of intersection. */
+    z = 2.0 * (double)rand() / MAX_INT - 1.0;
+    t = 2.0 * UbMath::PI * (double)rand() / MAX_INT;
+    w = sqrt(1 - z * z);
+    x = w * cos(t);
+    y = w * sin(t);
+
+    ray[0] = radius * x;
+    ray[1] = radius * y;
+    ray[2] = radius * z;
+
+    /*printf( "RandomRay returns %6d %6d %6d\n", ray[X], ray[Y], ray[Z] );*/
 }
 
 /*---------------------------------------------------------------------
@@ -1109,80 +1180,78 @@ void GbTriangularMesh3D::RandomRay( GbVector3D& ray, int radius )
 '0': The segment lies strictly to one side or the other of the plane.
 '1': The segement intersects the plane, and 'p' does not hold.
 ---------------------------------------------------------------------*/
-char	GbTriangularMesh3D::SegPlaneInt( GbTriangle3D* T, GbVector3D& q, GbVector3D& r, GbVector3D& p, int *m)
+char GbTriangularMesh3D::SegPlaneInt(GbTriangle3D *T, GbVector3D &q, GbVector3D &r, GbVector3D &p, int *m)
 {
-  // cout<<"SegPlaneInt..\n";
-   GbVector3D N; double D;
-   GbVector3D rq;
-   double num, denom, t;
-   int i;
-
-   *m = PlaneCoeff( T, N, &D );
-   /*printf("m=%d; plane=(%lf,%lf,%lf,%lf)\n", m, N[X],N[Y],N[Z],D);*/
-   num = D - q.Dot( N );
-   rq = r.Subtract( q );
-   denom = rq.Dot( N );
-   /*printf("SegPlaneInt: num=%lf, denom=%lf\n", num, denom );*/
-
-   if ( denom == 0.0 ) {  /* Segment is parallel to plane. */
-      if ( num == 0.0 )   /* q is on plane. */
-   //if (UbMath::zero(denom)) {  /* Segment is parallel to plane. */
-   //   if ( UbMath::zero(num))   /* q is on plane. */
-         return 'p';
-      else
-         return '0';
-   }
-   else
-      t = num / denom;
-   /*printf("SegPlaneInt: t=%lf \n", t );*/
-
-   for( i = 0; i < 3; i++ )
-      p[i] = q[i] + t * ( r[i] - q[i] );
-
-   if ( (0.0 < t) && (t < 1.0) )
-      return '1';
-   else if ( num == 0.0 )   /* t == 0 */
-      return 'q';
-   else if ( num == denom ) /* t == 1 */
-      return 'r';
-   else return '0';
-
-   //if ( (0.0 < t) && (t < 1.0) )
-   //   return '1';
-   //else if ( UbMath::zero(num))   /* t == 0 */
-   //   return 'q';
-   //else if ( UbMath::equal(num , denom) ) /* t == 1 */
-   //   return 'r';
-   //else return '0';
-
+    // cout<<"SegPlaneInt..\n";
+    GbVector3D N;
+    double D;
+    GbVector3D rq;
+    double num, denom, t;
+    int i;
+
+    *m = PlaneCoeff(T, N, &D);
+    /*printf("m=%d; plane=(%lf,%lf,%lf,%lf)\n", m, N[X],N[Y],N[Z],D);*/
+    num   = D - q.Dot(N);
+    rq    = r.Subtract(q);
+    denom = rq.Dot(N);
+    /*printf("SegPlaneInt: num=%lf, denom=%lf\n", num, denom );*/
+
+    if (denom == 0.0) { /* Segment is parallel to plane. */
+        if (num == 0.0) /* q is on plane. */
+                        // if (UbMath::zero(denom)) {  /* Segment is parallel to plane. */
+            //   if ( UbMath::zero(num))   /* q is on plane. */
+            return 'p';
+        else
+            return '0';
+    } else
+        t = num / denom;
+    /*printf("SegPlaneInt: t=%lf \n", t );*/
+
+    for (i = 0; i < 3; i++)
+        p[i] = q[i] + t * (r[i] - q[i]);
+
+    if ((0.0 < t) && (t < 1.0))
+        return '1';
+    else if (num == 0.0) /* t == 0 */
+        return 'q';
+    else if (num == denom) /* t == 1 */
+        return 'r';
+    else
+        return '0';
+
+    // if ( (0.0 < t) && (t < 1.0) )
+    //   return '1';
+    // else if ( UbMath::zero(num))   /* t == 0 */
+    //   return 'q';
+    // else if ( UbMath::equal(num , denom) ) /* t == 1 */
+    //   return 'r';
+    // else return '0';
 }
 /*---------------------------------------------------------------------
 Computes N & D and returns index m of largest component.
 ---------------------------------------------------------------------*/
-int	GbTriangularMesh3D::PlaneCoeff( GbTriangle3D* T, GbVector3D& N, double *D )
+int GbTriangularMesh3D::PlaneCoeff(GbTriangle3D *T, GbVector3D &N, double *D)
 {
-   int i;
-   double t;              /* Temp storage */
-   double biggest = 0.0;  /* Largest component of normal vector. */
-   int m = 0;             /* Index of largest component. */
-
-   N = T->getNormal();
-   /*printf("PlaneCoeff: N=(%lf,%lf,%lf)\n", N[X],N[Y],N[Z]);*/
-   GbVector3D a(T->getPoint1());
-
-   *D = a.Dot( N );
-
-   /* Find the largest component of N. */
-   for ( i = 0; i < 3; i++ )
-   {
-      t = std::fabs( N[i] );
-      if ( t > biggest ) 
-      {
-         biggest = t;
-         m = i;
-      }
-   }
-   return m;
+    int i;
+    double t;             /* Temp storage */
+    double biggest = 0.0; /* Largest component of normal vector. */
+    int m          = 0;   /* Index of largest component. */
+
+    N = T->getNormal();
+    /*printf("PlaneCoeff: N=(%lf,%lf,%lf)\n", N[X],N[Y],N[Z]);*/
+    GbVector3D a(T->getPoint1());
+
+    *D = a.Dot(N);
+
+    /* Find the largest component of N. */
+    for (i = 0; i < 3; i++) {
+        t = std::fabs(N[i]);
+        if (t > biggest) {
+            biggest = t;
+            m       = i;
+        }
+    }
+    return m;
 }
 
 /* Assumption: p lies in the plane containing T.
@@ -1193,128 +1262,126 @@ Returns a char:
 '0': the query point p does not intersect (misses) triangle T.
 */
 
-char 	GbTriangularMesh3D::InTri3D( GbTriangle3D* T, int m, GbVector3D&  /*p*/ )
+char GbTriangularMesh3D::InTri3D(GbTriangle3D *T, int m, GbVector3D & /*p*/)
 {
-//   int i;           /* Index for X,Y,Z           */
-   int j;           /* Index for X,Y             */
-//   int k;           /* Index for triangle vertex */
-   GbVector3D pp;      /* projected p */
-   GbVector3D Tp[3];   /* projected T: three new vertices */
-
-   /* Project out coordinate m in both p and the triangular face */
-   //j = 0;
-   //for ( i = 0; i < 3; i++ ) {
-   //   if ( i != m ) {    /* skip largest coordinate */
-   //      pp[j] = p[i];
-   //      //for ( k = 0; k < 3; k++ )
-   //         std::cout<<"aachtung###############################################";
-   //      //            Tp[k][j] = Vertices[T[k]][i];
-   //      j++;
-   //   }
-   //}
-   j=0;
-   if(m!=0)
-   {
-      Tp[0][j] = T->getPoint1()->getX1Coordinate();
-      Tp[1][j] = T->getPoint2()->getX1Coordinate();
-      Tp[2][j] = T->getPoint3()->getX1Coordinate();
-      j++;
-   }
-   if(m!=1)
-   {
-      Tp[0][j] = T->getPoint1()->getX2Coordinate();
-      Tp[1][j] = T->getPoint2()->getX2Coordinate();
-      Tp[2][j] = T->getPoint3()->getX2Coordinate();
-      j++;
-   }
-   if(m!=2)
-   {
-      Tp[0][j] = T->getPoint1()->getX3Coordinate();
-      Tp[1][j] = T->getPoint2()->getX3Coordinate();
-      Tp[2][j] = T->getPoint3()->getX3Coordinate();
-      j++;
-   }
-
-   return( InTri2D( Tp, pp ) );
+    //   int i;           /* Index for X,Y,Z           */
+    int j;            /* Index for X,Y             */
+                      //   int k;           /* Index for triangle vertex */
+    GbVector3D pp;    /* projected p */
+    GbVector3D Tp[3]; /* projected T: three new vertices */
+
+    /* Project out coordinate m in both p and the triangular face */
+    // j = 0;
+    // for ( i = 0; i < 3; i++ ) {
+    //   if ( i != m ) {    /* skip largest coordinate */
+    //      pp[j] = p[i];
+    //      //for ( k = 0; k < 3; k++ )
+    //         std::cout<<"aachtung###############################################";
+    //      //            Tp[k][j] = Vertices[T[k]][i];
+    //      j++;
+    //   }
+    //}
+    j = 0;
+    if (m != 0) {
+        Tp[0][j] = T->getPoint1()->getX1Coordinate();
+        Tp[1][j] = T->getPoint2()->getX1Coordinate();
+        Tp[2][j] = T->getPoint3()->getX1Coordinate();
+        j++;
+    }
+    if (m != 1) {
+        Tp[0][j] = T->getPoint1()->getX2Coordinate();
+        Tp[1][j] = T->getPoint2()->getX2Coordinate();
+        Tp[2][j] = T->getPoint3()->getX2Coordinate();
+        j++;
+    }
+    if (m != 2) {
+        Tp[0][j] = T->getPoint1()->getX3Coordinate();
+        Tp[1][j] = T->getPoint2()->getX3Coordinate();
+        Tp[2][j] = T->getPoint3()->getX3Coordinate();
+        j++;
+    }
+
+    return (InTri2D(Tp, pp));
 }
 
-char 	GbTriangularMesh3D::InTri2D( GbVector3D Tp[3], GbVector3D& pp )
+char GbTriangularMesh3D::InTri2D(GbVector3D Tp[3], GbVector3D &pp)
 {
-   double area0, area1, area2;
-
-   /* compute three AreaSign() values for pp w.r.t. each edge of the face in 2D */
-   area0 = AreaSign( pp, Tp[0], Tp[1] );
-   area1 = AreaSign( pp, Tp[1], Tp[2] );
-   area2 = AreaSign( pp, Tp[2], Tp[0] );
- //  printf("area0=%f  area1=%f  area2=%f\n",area0,area1,area2);
-
-   if ( (( area0 == 0. ) && ( area1 > 0. ) && ( area2 > 0. )) ||
-           (( area1 == 0. ) && ( area0 > 0. ) && ( area2 > 0. )) ||
-                   (( area2 == 0. ) && ( area0 > 0. ) && ( area1 > 0. )) )
-      return 'E';
- 
-   if ( (( area0 == 0. ) && ( area1 < 0. ) && ( area2 < 0. )) ||
-      (( area1 == 0. ) && ( area0 < 0. ) && ( area2 < 0. )) ||
-      (( area2 == 0. ) && ( area0 < 0. ) && ( area1 < 0. )) )
-      return 'E';                 
-
-   if ( (( area0 >  0. ) && ( area1 > 0. ) && ( area2 > 0. )) ||
-           (( area0 <  0. ) && ( area1 < 0. ) && ( area2 < 0. )) )
-      return 'F';
-
-   if ( ( area0 == 0.0 ) && ( area1 == 0.0 ) && ( area2 == 0.0 ) )
-      fprintf( stderr, "Error in InTriD\n" ), exit(EXIT_FAILURE);
-
-   if ( (( area0 == 0. ) && ( area1 == 0. )) ||
-      (( area0 == 0. ) && ( area2 == 0. )) ||
-      (( area1 == 0. ) && ( area2 == 0. )) )
-      return 'V';
-
-   else  
-      return '0';  
+    double area0, area1, area2;
+
+    /* compute three AreaSign() values for pp w.r.t. each edge of the face in 2D */
+    area0 = AreaSign(pp, Tp[0], Tp[1]);
+    area1 = AreaSign(pp, Tp[1], Tp[2]);
+    area2 = AreaSign(pp, Tp[2], Tp[0]);
+    //  printf("area0=%f  area1=%f  area2=%f\n",area0,area1,area2);
+
+    if (((area0 == 0.) && (area1 > 0.) && (area2 > 0.)) || ((area1 == 0.) && (area0 > 0.) && (area2 > 0.)) ||
+        ((area2 == 0.) && (area0 > 0.) && (area1 > 0.)))
+        return 'E';
+
+    if (((area0 == 0.) && (area1 < 0.) && (area2 < 0.)) || ((area1 == 0.) && (area0 < 0.) && (area2 < 0.)) ||
+        ((area2 == 0.) && (area0 < 0.) && (area1 < 0.)))
+        return 'E';
+
+    if (((area0 > 0.) && (area1 > 0.) && (area2 > 0.)) || ((area0 < 0.) && (area1 < 0.) && (area2 < 0.)))
+        return 'F';
+
+    if ((area0 == 0.0) && (area1 == 0.0) && (area2 == 0.0))
+        fprintf(stderr, "Error in InTriD\n"), exit(EXIT_FAILURE);
+
+    if (((area0 == 0.) && (area1 == 0.)) || ((area0 == 0.) && (area2 == 0.)) || ((area1 == 0.) && (area2 == 0.)))
+        return 'V';
+
+    else
+        return '0';
 }
 
-double GbTriangularMesh3D::AreaSign( GbVector3D& a, GbVector3D& b, GbVector3D& c )  
+double GbTriangularMesh3D::AreaSign(GbVector3D &a, GbVector3D &b, GbVector3D &c)
 {
-   double area2;
+    double area2;
 
-   area2 = ( b[0] - a[0] ) * ( c[1] - a[1] ) -
-           ( c[0] - a[0] ) * ( b[1] - a[1] );
+    area2 = (b[0] - a[0]) * (c[1] - a[1]) - (c[0] - a[0]) * (b[1] - a[1]);
 
-   return area2;
-   /* The area should be an integer. */
-   // FIXME: unrechable code
-   //if      ( area2 >  0.5 ) return  1;
-   //else if ( area2 < -0.5 ) return -1;
-   //else                     return  0;
-}                            
+    return area2;
+    /* The area should be an integer. */
+    // FIXME: unrechable code
+    // if      ( area2 >  0.5 ) return  1;
+    // else if ( area2 < -0.5 ) return -1;
+    // else                     return  0;
+}
 
-char    GbTriangularMesh3D::SegTriInt( GbTriangle3D* T, GbVector3D& q, GbVector3D& r, GbVector3D& p )
+char GbTriangularMesh3D::SegTriInt(GbTriangle3D *T, GbVector3D &q, GbVector3D &r, GbVector3D &p)
 {
-   int code = '?';
-   int m = -1;
-
-   code = (unsigned char)SegPlaneInt( T, q, r, p, &m );
-   //  printf("SegPlaneInt code=%c, m=%d; p=(%lf,%lf,%lf)\n", code,m,p[0],p[1],p[2]);
-
-   if      ( code == '0')  return '0';
-   else if ( code == 'q')  return InTri3D( T, m, q );
-   else if ( code == 'r')  return InTri3D( T, m, r );
-   else if ( code == 'p' ) return InPlane( T, m, q, r, p );
-   else if ( code == '1' ) return SegTriCross( T, q, r );
-   else /* Error */        return code;
+    int code = '?';
+    int m    = -1;
+
+    code = (unsigned char)SegPlaneInt(T, q, r, p, &m);
+    //  printf("SegPlaneInt code=%c, m=%d; p=(%lf,%lf,%lf)\n", code,m,p[0],p[1],p[2]);
+
+    if (code == '0')
+        return '0';
+    else if (code == 'q')
+        return InTri3D(T, m, q);
+    else if (code == 'r')
+        return InTri3D(T, m, r);
+    else if (code == 'p')
+        return InPlane(T, m, q, r, p);
+    else if (code == '1')
+        return SegTriCross(T, q, r);
+    else /* Error */
+        return code;
 }
 
-char	GbTriangularMesh3D::InPlane( GbTriangle3D*  /*T*/, int  /*m*/, GbVector3D&  /*q*/, GbVector3D&  /*r*/, GbVector3D&  /*p*/)
+char GbTriangularMesh3D::InPlane(GbTriangle3D * /*T*/, int /*m*/, GbVector3D & /*q*/, GbVector3D & /*r*/,
+                                 GbVector3D & /*p*/)
 {
-  // cout<<"inplane\n";
-   /* NOT IMPLEMENTED */
-   return 'p';
+    // cout<<"inplane\n";
+    /* NOT IMPLEMENTED */
+    return 'p';
 }
 
 /*---------------------------------------------------------------------
 The signed volumes of three tetrahedra are computed, determined
-by the segment qr, and each edge of the triangle.  
+by the segment qr, and each edge of the triangle.
 Returns a char:
 'v': the open segment includes a vertex of T.
 'e': the open segment includes a point in the relative interior of an edge
@@ -1324,108 +1391,109 @@ of T.
 '0': the open segment does not intersect triangle T.
 ---------------------------------------------------------------------*/
 
-char GbTriangularMesh3D::SegTriCross( GbTriangle3D* T, GbVector3D& q, GbVector3D& r )
+char GbTriangularMesh3D::SegTriCross(GbTriangle3D *T, GbVector3D &q, GbVector3D &r)
 {
-  // cout<<"SegTriCross\n";
-   double vol0, vol1, vol2;
-   GbVector3D vert0(T->getPoint1());
-   GbVector3D vert1(T->getPoint2());
-   GbVector3D vert2(T->getPoint3());
-
-   vol0 = VolumeSign( q, vert0, vert1, r ); 
-   vol1 = VolumeSign( q, vert1, vert2, r ); 
-   vol2 = VolumeSign( q, vert2, vert0, r );
-
-   //  printf( "SegTriCross:  vol0 = %d; vol1 = %d; vol2 = %d\n", vol0, vol1, vol2 ); 
-
-   /* Same sign: segment intersects interior of triangle. */
-   if ( ( ( vol0 > 0. ) && ( vol1 > 0. ) && ( vol2 > 0. ) ) || 
-      ( ( vol0 < 0. ) && ( vol1 < 0. ) && ( vol2 < 0. ) ) )
-   //if ( ( UbMath::greater(vol0, 0. ) && UbMath::greater(vol1 , 0. ) && UbMath::greater(vol2 , 0. ) ) || 
-   //     ( UbMath::less(vol0, 0. ) && UbMath::less(vol1, 0. ) && UbMath::less(vol2, 0. ) ) )
-   {
-      return 'f';
-   }
-
-   /* Opposite sign: no intersection between segment and triangle */
-   if ( ( ( vol0 > 0. ) || ( vol1 > 0. ) || ( vol2 > 0. ) ) &&
-      ( ( vol0 < 0. ) || ( vol1 < 0. ) || ( vol2 < 0. ) ) )
-   {
-      return '0';
-   }
-   else if ( ( vol0 == 0.0 ) && ( vol1 == 0.0 ) && ( vol2 == 0.0 ) )
-   {
-      std::cout<<vol0<<" "<<vol1<<" "<<vol2<<std::endl;
-      fprintf( stderr, "Error 1 in SegTriCross\n" ), exit(EXIT_FAILURE);
-   }
-
-   /* Two zeros: segment intersects vertex. */
-   else if ( ( ( vol0 == 0. ) && ( vol1 == 0. ) ) || 
-      ( ( vol0 == 0. ) && ( vol2 == 0. ) ) || 
-      ( ( vol1 == 0. ) && ( vol2 == 0. ) ) )
-   {
-      return 'v';
-   }
-
-   /* One zero: segment intersects edge. */
-   else if ( ( vol0 == 0. ) || ( vol1 == 0. ) || ( vol2 == 0. ) )
-   {
-      return 'e';
-   }
-   
-   throw UbException(UB_EXARGS,"fprintf( stderr, Error 2 in SegTriCross\n ), exit(EXIT_FAILURE);");
+    // cout<<"SegTriCross\n";
+    double vol0, vol1, vol2;
+    GbVector3D vert0(T->getPoint1());
+    GbVector3D vert1(T->getPoint2());
+    GbVector3D vert2(T->getPoint3());
+
+    vol0 = VolumeSign(q, vert0, vert1, r);
+    vol1 = VolumeSign(q, vert1, vert2, r);
+    vol2 = VolumeSign(q, vert2, vert0, r);
+
+    //  printf( "SegTriCross:  vol0 = %d; vol1 = %d; vol2 = %d\n", vol0, vol1, vol2 );
+
+    /* Same sign: segment intersects interior of triangle. */
+    if (((vol0 > 0.) && (vol1 > 0.) && (vol2 > 0.)) || ((vol0 < 0.) && (vol1 < 0.) && (vol2 < 0.)))
+    // if ( ( UbMath::greater(vol0, 0. ) && UbMath::greater(vol1 , 0. ) && UbMath::greater(vol2 , 0. ) ) ||
+    //     ( UbMath::less(vol0, 0. ) && UbMath::less(vol1, 0. ) && UbMath::less(vol2, 0. ) ) )
+    {
+        return 'f';
+    }
+
+    /* Opposite sign: no intersection between segment and triangle */
+    if (((vol0 > 0.) || (vol1 > 0.) || (vol2 > 0.)) && ((vol0 < 0.) || (vol1 < 0.) || (vol2 < 0.))) {
+        return '0';
+    } else if ((vol0 == 0.0) && (vol1 == 0.0) && (vol2 == 0.0)) {
+        std::cout << vol0 << " " << vol1 << " " << vol2 << std::endl;
+        fprintf(stderr, "Error 1 in SegTriCross\n"), exit(EXIT_FAILURE);
+    }
+
+    /* Two zeros: segment intersects vertex. */
+    else if (((vol0 == 0.) && (vol1 == 0.)) || ((vol0 == 0.) && (vol2 == 0.)) || ((vol1 == 0.) && (vol2 == 0.))) {
+        return 'v';
+    }
+
+    /* One zero: segment intersects edge. */
+    else if ((vol0 == 0.) || (vol1 == 0.) || (vol2 == 0.)) {
+        return 'e';
+    }
+
+    throw UbException(UB_EXARGS, "fprintf( stderr, Error 2 in SegTriCross\n ), exit(EXIT_FAILURE);");
 }
 
-
-double GbTriangularMesh3D::VolumeSign( GbVector3D& a, GbVector3D& b, GbVector3D& c, GbVector3D& d )
-{ 
-   double vol;
-   double ax, ay, az, bx, by, bz, cx, cy, cz, dx, dy, dz;
-   double bxdx, bydy, bzdz, cxdx, cydy, czdz;
-
-   ax = a[0];   ay = a[1];   az = a[2];
-   bx = b[0];   by = b[1];   bz = b[2];
-   cx = c[0];   cy = c[1];   cz = c[2];
-   dx = d[0];   dy = d[1];   dz = d[2];
-
-   bxdx=bx-dx;
-   bydy=by-dy;
-   bzdz=bz-dz;
-   cxdx=cx-dx;
-   cydy=cy-dy;
-   czdz=cz-dz;
-   vol = (az-dz) * (bxdx*cydy - bydy*cxdx)
-      + (ay-dy) * (bzdz*cxdx - bxdx*czdz)
-      + (ax-dx) * (bydy*czdz - bzdz*cydy);
-
-   //std::cout<< vol<<std::endl;
-   return vol;
-
-
-   /* The volume should be an integer. */
-   // FIXME: unreachable code
-   //if      ( vol > 0.5 )   return  1;
-   //else if ( vol < -0.5 )  return -1;
-   //else                    return  0;
+double GbTriangularMesh3D::VolumeSign(GbVector3D &a, GbVector3D &b, GbVector3D &c, GbVector3D &d)
+{
+    double vol;
+    double ax, ay, az, bx, by, bz, cx, cy, cz, dx, dy, dz;
+    double bxdx, bydy, bzdz, cxdx, cydy, czdz;
+
+    ax = a[0];
+    ay = a[1];
+    az = a[2];
+    bx = b[0];
+    by = b[1];
+    bz = b[2];
+    cx = c[0];
+    cy = c[1];
+    cz = c[2];
+    dx = d[0];
+    dy = d[1];
+    dz = d[2];
+
+    bxdx = bx - dx;
+    bydy = by - dy;
+    bzdz = bz - dz;
+    cxdx = cx - dx;
+    cydy = cy - dy;
+    czdz = cz - dz;
+    vol  = (az - dz) * (bxdx * cydy - bydy * cxdx) + (ay - dy) * (bzdz * cxdx - bxdx * czdz) +
+          (ax - dx) * (bydy * czdz - bzdz * cydy);
+
+    // std::cout<< vol<<std::endl;
+    return vol;
+
+    /* The volume should be an integer. */
+    // FIXME: unreachable code
+    // if      ( vol > 0.5 )   return  1;
+    // else if ( vol < -0.5 )  return -1;
+    // else                    return  0;
 }
 
-bool GbTriangularMesh3D::BoxTest(GbTriangle3D* triangle, GbVector3D& PointQ, GbVector3D& PointR)
+bool GbTriangularMesh3D::BoxTest(GbTriangle3D *triangle, GbVector3D &PointQ, GbVector3D &PointR)
 {
-   double minX1 = triangle->getX1Minimum();
-   double minX2 = triangle->getX2Minimum();
-   double minX3 = triangle->getX3Minimum();
-
-   double maxX1 = triangle->getX1Maximum();
-   double maxX2 = triangle->getX2Maximum();
-   double maxX3 = triangle->getX3Maximum();
-
-   if((PointQ.X1() < minX1) && (PointR.X1() < minX1)) return false;
-   if((PointQ.X2() < minX2) && (PointR.X2() < minX2)) return false;
-   if((PointQ.X3() < minX3) && (PointR.X3() < minX3)) return false;
-   if((PointQ.X1() > maxX1) && (PointR.X1() > maxX1)) return false;
-   if((PointQ.X2() > maxX2) && (PointR.X2() > maxX2)) return false;
-   if((PointQ.X3() > maxX3) && (PointR.X3() > maxX3)) return false;
-
-   return true;
+    double minX1 = triangle->getX1Minimum();
+    double minX2 = triangle->getX2Minimum();
+    double minX3 = triangle->getX3Minimum();
+
+    double maxX1 = triangle->getX1Maximum();
+    double maxX2 = triangle->getX2Maximum();
+    double maxX3 = triangle->getX3Maximum();
+
+    if ((PointQ.X1() < minX1) && (PointR.X1() < minX1))
+        return false;
+    if ((PointQ.X2() < minX2) && (PointR.X2() < minX2))
+        return false;
+    if ((PointQ.X3() < minX3) && (PointR.X3() < minX3))
+        return false;
+    if ((PointQ.X1() > maxX1) && (PointR.X1() > maxX1))
+        return false;
+    if ((PointQ.X2() > maxX2) && (PointR.X2() > maxX2))
+        return false;
+    if ((PointQ.X3() > maxX3) && (PointR.X3() > maxX3))
+        return false;
+
+    return true;
 }
-
diff --git a/src/basics/geometry3d/GbTriangularMesh3D.h b/src/basics/geometry3d/GbTriangularMesh3D.h
index 2691a95c1b3a404ca9c27e005964a5fe1273d1d3..46be833a2ccd4b6f89b4aa20b7a87a7ca028e118 100644
--- a/src/basics/geometry3d/GbTriangularMesh3D.h
+++ b/src/basics/geometry3d/GbTriangularMesh3D.h
@@ -7,9 +7,8 @@
 #ifndef GBTRIANGULARMESH_H
 #define GBTRIANGULARMESH_H
 
-#include <sstream>
 #include <iostream>
-
+#include <sstream>
 
 #include <geometry3d/GbLine3D.h>
 #include <geometry3d/GbPoint3D.h>
@@ -19,8 +18,8 @@
 #include <basics/writer/WbWriter.h>
 
 #ifdef CAB_RCF
-   #include <3rdParty/rcf/RcfSerializationIncludes.h>
-#endif //CAB_RCF
+#include <3rdParty/rcf/RcfSerializationIncludes.h>
+#endif // CAB_RCF
 
 #include <PointerDefinitions.h>
 
@@ -31,143 +30,144 @@
  * This Class provides the triangular meshes.
  * Note, that up to now no methods for checking consistency are included.
  * in this context this class describes facettes from an 3D-object !!!
-*/
-class GbTriangularMesh3D : public GbObject3D 
-{                             
+ */
+class GbTriangularMesh3D : public GbObject3D
+{
 public:
-   enum POINTINOBJECTTEST { RAYCROSSING, HALFSPACE};
-
-   GbTriangularMesh3D();
-	GbTriangularMesh3D(std::string name, std::vector<GbPoint3D*> *nodes, std::vector<GbTriangle3D*> *triangles);
-   GbTriangularMesh3D(std::string name, std::vector<GbTriangle3D*> *triangles);
-   GbTriangularMesh3D(std::string name, std::vector<GbPoint3D*> *nodes, std::vector<GbLine3D*> *edges, std::vector<GbTriangle3D*> *triangles);
-	~GbTriangularMesh3D() override;   
-   GbTriangularMesh3D* clone() override { throw UbException(UB_EXARGS,"not implemented"); }
-   void finalize() override
-   {
-      throw UbException("GbTriangularMesh3D::finalize() - toDo");
-   }
-   void setPointInObjectTest(POINTINOBJECTTEST mode) { this->pointinobjecttest = mode; }
-
-   std::string getClassName() {return "GbTriangularMesh3D"; }
-
-   std::string toString() override;
-   //std::string getName();
-   std::vector<GbPoint3D*>*    getNodes();
-   std::vector<GbTriangle3D*>* getTriangles();
-   double getX1Centroid() override;
-   double getX2Centroid() override;
-	double getX3Centroid() override;
-   double getX1Minimum() override;
-   double getX1Maximum() override;
-   double getX2Minimum() override;
-   double getX2Maximum() override;
-   double getX3Minimum() override;
-   double getX3Maximum() override;
-
-   void rotate(const double& alpha, const double& beta, const double& gamma) override;
-   void translate(const double& x1, const double& x2, const double& x3) override;
-
-   void calculateValues();
-   void deleteRedundantNodes();
-   
-   UbTupleDouble6 calculateMomentOfInertia(double rhoP);
-   UbTupleDouble3 calculateCenterOfGravity();
-   
-   double getArea();
-   double getVolume();
-   double getVolumeForRectangle(const double& p1x1, const double& p1x2, const double& p2x1, const double& p2x2);
-   std::vector<GbTriangle3D*>* getTrianglesForRectangle(const double& p1x1, const double& p1x2, const double& p2x1, const double& p2x2);
-   std::vector<GbPoint3D*>* getNodesForRectangle(const double& p1x1, const double& p1x2, const double& p2x1, const double& p2x2);
-   double getX3RangeForRectangle(const double& p1x1, const double& p1x2, const double& p2x1, const double& p2x2);
-   double getX3MinimumForRectangle(const double& p1x1, const double& p1x2, const double& p2x1, const double& p2x2);
-   double getX3MaximumForRectangle(const double& p1x1, const double& p1x2, const double& p2x1, const double& p2x2); 
-
-   bool isPointInGbObject3D(const double& x1, const double& x2, const double& x3) override;
-
-   bool isPointInGbObject3D(const double& x1, const double& x2, const double& x3, bool& pointIsOnBoundary) override;
-
-   bool isPointInObject3DHalfSpace(const double& xp, const double& yp, const double& zp);    //based on Halfspace algorithm
-   bool isPointInObject3DSpherical(const double& xp, const double& yp, const double& zp, int numTriangles);    //based on Spherical polygon area method        
-
-   //should be checked !!!                       
-   bool isPointInObject3DRayCrossing(const double& xp, const double& yp, const double& zp, int radius, int numVertices, int numTriangles);  //based on Ray tracing algorithm
-
-   bool   InPolyhedron( int F, GbVector3D& q, int radius );
-   void   RandomRay( GbVector3D& ray, int radius );
-   char	 SegPlaneInt( GbTriangle3D* Tri, GbVector3D& q, GbVector3D& r, GbVector3D& p, int *m);
-   int	 PlaneCoeff( GbTriangle3D* Tri, GbVector3D& Normal, double *D );
-   char 	 InTri3D( GbTriangle3D* T, int m, GbVector3D& p );
-   char 	 InTri2D( GbVector3D Tp[3], GbVector3D& pp );
-   double AreaSign( GbVector3D& a, GbVector3D& b, GbVector3D& c );
-   char   SegTriInt(GbTriangle3D* Tri, GbVector3D& q, GbVector3D& r, GbVector3D& p );
-   char	 InPlane( GbTriangle3D* T, int m, GbVector3D& q, GbVector3D& r, GbVector3D& p);
-   char   SegTriCross( GbTriangle3D* T, GbVector3D& q, GbVector3D& r );
-   double VolumeSign( GbVector3D& a, GbVector3D& b, GbVector3D& c, GbVector3D& d );
-   bool   BoxTest ( GbTriangle3D* triangle, GbVector3D& PointQ, GbVector3D& PointR);
-   //till here !!!
-
-
-   GbLine3D* createClippedLine3D (GbPoint3D &point1,GbPoint3D &point2) override;
-   std::vector<GbTriangle3D*> getSurfaceTriangleSet() override;     
-
-   void writeMesh(std::string filename, WbWriter* writer, bool writeNormals=false);
-   /*======================================================================*/
-   using GbObject3D::isPointInGbObject3D; //Grund: dadurch muss man hier  isPointInGbObject3D(GbPoint3D*) nicht ausprogrammieren, welche sonst hier "ueberdeckt" waere
+    enum POINTINOBJECTTEST { RAYCROSSING, HALFSPACE };
+
+    GbTriangularMesh3D();
+    GbTriangularMesh3D(std::string name, std::vector<GbPoint3D *> *nodes, std::vector<GbTriangle3D *> *triangles);
+    GbTriangularMesh3D(std::string name, std::vector<GbTriangle3D *> *triangles);
+    GbTriangularMesh3D(std::string name, std::vector<GbPoint3D *> *nodes, std::vector<GbLine3D *> *edges,
+                       std::vector<GbTriangle3D *> *triangles);
+    ~GbTriangularMesh3D() override;
+    GbTriangularMesh3D *clone() override { throw UbException(UB_EXARGS, "not implemented"); }
+    void finalize() override { throw UbException("GbTriangularMesh3D::finalize() - toDo"); }
+    void setPointInObjectTest(POINTINOBJECTTEST mode) { this->pointinobjecttest = mode; }
+
+    std::string getClassName() { return "GbTriangularMesh3D"; }
+
+    std::string toString() override;
+    // std::string getName();
+    std::vector<GbPoint3D *> *getNodes();
+    std::vector<GbTriangle3D *> *getTriangles();
+    double getX1Centroid() override;
+    double getX2Centroid() override;
+    double getX3Centroid() override;
+    double getX1Minimum() override;
+    double getX1Maximum() override;
+    double getX2Minimum() override;
+    double getX2Maximum() override;
+    double getX3Minimum() override;
+    double getX3Maximum() override;
+
+    void rotate(const double &alpha, const double &beta, const double &gamma) override;
+    void translate(const double &x1, const double &x2, const double &x3) override;
+
+    void calculateValues();
+    void deleteRedundantNodes();
+
+    UbTupleDouble6 calculateMomentOfInertia(double rhoP);
+    UbTupleDouble3 calculateCenterOfGravity();
+
+    double getArea();
+    double getVolume();
+    double getVolumeForRectangle(const double &p1x1, const double &p1x2, const double &p2x1, const double &p2x2);
+    std::vector<GbTriangle3D *> *getTrianglesForRectangle(const double &p1x1, const double &p1x2, const double &p2x1,
+                                                          const double &p2x2);
+    std::vector<GbPoint3D *> *getNodesForRectangle(const double &p1x1, const double &p1x2, const double &p2x1,
+                                                   const double &p2x2);
+    double getX3RangeForRectangle(const double &p1x1, const double &p1x2, const double &p2x1, const double &p2x2);
+    double getX3MinimumForRectangle(const double &p1x1, const double &p1x2, const double &p2x1, const double &p2x2);
+    double getX3MaximumForRectangle(const double &p1x1, const double &p1x2, const double &p2x1, const double &p2x2);
+
+    bool isPointInGbObject3D(const double &x1, const double &x2, const double &x3) override;
+
+    bool isPointInGbObject3D(const double &x1, const double &x2, const double &x3, bool &pointIsOnBoundary) override;
+
+    bool isPointInObject3DHalfSpace(const double &xp, const double &yp,
+                                    const double &zp); // based on Halfspace algorithm
+    bool isPointInObject3DSpherical(const double &xp, const double &yp, const double &zp,
+                                    int numTriangles); // based on Spherical polygon area method
+
+    // should be checked !!!
+    bool isPointInObject3DRayCrossing(const double &xp, const double &yp, const double &zp, int radius, int numVertices,
+                                      int numTriangles); // based on Ray tracing algorithm
+
+    bool InPolyhedron(int F, GbVector3D &q, int radius);
+    void RandomRay(GbVector3D &ray, int radius);
+    char SegPlaneInt(GbTriangle3D *Tri, GbVector3D &q, GbVector3D &r, GbVector3D &p, int *m);
+    int PlaneCoeff(GbTriangle3D *Tri, GbVector3D &Normal, double *D);
+    char InTri3D(GbTriangle3D *T, int m, GbVector3D &p);
+    char InTri2D(GbVector3D Tp[3], GbVector3D &pp);
+    double AreaSign(GbVector3D &a, GbVector3D &b, GbVector3D &c);
+    char SegTriInt(GbTriangle3D *Tri, GbVector3D &q, GbVector3D &r, GbVector3D &p);
+    char InPlane(GbTriangle3D *T, int m, GbVector3D &q, GbVector3D &r, GbVector3D &p);
+    char SegTriCross(GbTriangle3D *T, GbVector3D &q, GbVector3D &r);
+    double VolumeSign(GbVector3D &a, GbVector3D &b, GbVector3D &c, GbVector3D &d);
+    bool BoxTest(GbTriangle3D *triangle, GbVector3D &PointQ, GbVector3D &PointR);
+    // till here !!!
+
+    GbLine3D *createClippedLine3D(GbPoint3D &point1, GbPoint3D &point2) override;
+    std::vector<GbTriangle3D *> getSurfaceTriangleSet() override;
+
+    void writeMesh(std::string filename, WbWriter *writer, bool writeNormals = false);
+    /*======================================================================*/
+    using GbObject3D::isPointInGbObject3D; // Grund: dadurch muss man hier  isPointInGbObject3D(GbPoint3D*) nicht
+                                           // ausprogrammieren, welche sonst hier "ueberdeckt" waere
 
 #ifdef CAB_RCF
-   template<class Archive>
-   void SF_SERIALIZE(Archive & ar)
-   {
-      SF_SERIALIZE_PARENT<GbObject3D>(ar, *this);
-      ar & triangles;
-      if(ArchiveTools::isWriting(ar))
-      {
-         for(std::size_t t=0; t<triangles->size(); t++)
-         {
-            nodes->push_back((*triangles)[t]->getPoint(0));
-            nodes->push_back((*triangles)[t]->getPoint(1));
-            nodes->push_back((*triangles)[t]->getPoint(2));
-         }
-      }
-      //ar & nodes; //<- problem redundanz
-      //ar & edges;
-      ar & pointinobjecttest;
-      ar & x1min;
-      ar & x1max;
-      ar & x2min;
-      ar & x2max;
-      ar & x3min;
-      ar & x3max;
-      ar & consistent;
-   }
-#endif //CAB_RCF
+    template <class Archive>
+    void SF_SERIALIZE(Archive &ar)
+    {
+        SF_SERIALIZE_PARENT<GbObject3D>(ar, *this);
+        ar &triangles;
+        if (ArchiveTools::isWriting(ar)) {
+            for (std::size_t t = 0; t < triangles->size(); t++) {
+                nodes->push_back((*triangles)[t]->getPoint(0));
+                nodes->push_back((*triangles)[t]->getPoint(1));
+                nodes->push_back((*triangles)[t]->getPoint(2));
+            }
+        }
+        // ar & nodes; //<- problem redundanz
+        // ar & edges;
+        ar &pointinobjecttest;
+        ar &x1min;
+        ar &x1max;
+        ar &x2min;
+        ar &x2max;
+        ar &x3min;
+        ar &x3max;
+        ar &consistent;
+    }
+#endif // CAB_RCF
 
 protected:
-   std::vector<GbPoint3D*>*    nodes;
-   std::vector<GbLine3D*>*     edges;
-   std::vector<GbTriangle3D*>* triangles;
+    std::vector<GbPoint3D *> *nodes;
+    std::vector<GbLine3D *> *edges;
+    std::vector<GbTriangle3D *> *triangles;
 
 private:
-   POINTINOBJECTTEST pointinobjecttest;
-   void init();
-   /*======================================================================*/
-   double      x1min;
-   double      x1max;
-   double      x2min;
-   double      x2max;
-   double      x3min;
-   double      x3max;
-   bool        consistent;
+    POINTINOBJECTTEST pointinobjecttest;
+    void init();
+    /*======================================================================*/
+    double x1min;
+    double x1max;
+    double x2min;
+    double x2max;
+    double x3min;
+    double x3max;
+    bool consistent;
 };
 /*=========================================================================*/
 
 #if defined(RCF_USE_SF_SERIALIZATION) && !defined(SWIG)
-   #if CAB_RCF <= 903 
-      SF_SERIALIZE_ENUM(GbTriangularMesh3D::POINTINOBJECTTEST) //bei klassen ausserhalb der klasse;-)
-   #endif
-   UB_AUTO_RUN_NAMED(   SF::registerType<GbTriangularMesh3D >("GbTriangularMesh3D ")    , SF_GbTriangularMesh3D     );
-   UB_AUTO_RUN_NAMED( ( SF::registerBaseAndDerived< GbObject3D, GbTriangularMesh3D >() ), SF_GbTriangularMesh3D_BD1 );
-#endif //RCF_USE_SF_SERIALIZATION
+#if CAB_RCF <= 903
+SF_SERIALIZE_ENUM(GbTriangularMesh3D::POINTINOBJECTTEST) // bei klassen ausserhalb der klasse;-)
+#endif
+UB_AUTO_RUN_NAMED(SF::registerType<GbTriangularMesh3D>("GbTriangularMesh3D "), SF_GbTriangularMesh3D);
+UB_AUTO_RUN_NAMED((SF::registerBaseAndDerived<GbObject3D, GbTriangularMesh3D>()), SF_GbTriangularMesh3D_BD1);
+#endif // RCF_USE_SF_SERIALIZATION
 
 #endif
diff --git a/src/basics/geometry3d/GbVector3D.cpp b/src/basics/geometry3d/GbVector3D.cpp
index e763e425a6677ceeed5b9e23355b311e2a71e8a3..0c666a87586e64be83408eb5769c8f3a46a3ce98 100644
--- a/src/basics/geometry3d/GbVector3D.cpp
+++ b/src/basics/geometry3d/GbVector3D.cpp
@@ -1,28 +1,28 @@
 //=======================================================================================
-// ____          ____    __    ______     __________   __      __       __        __         
-// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |        
-//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |        
-//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |        
-//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____    
-//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|   
-//      \    \  |    |   ________________________________________________________________    
-//       \    \ |    |  |  ______________________________________________________________|   
-//        \    \|    |  |  |         __          __     __     __     ______      _______    
-//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)   
-//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______    
+// ____          ____    __    ______     __________   __      __       __        __
+// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |
+//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |
+//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |
+//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____
+//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|
+//      \    \  |    |   ________________________________________________________________
+//       \    \ |    |  |  ______________________________________________________________|
+//        \    \|    |  |  |         __          __     __     __     ______      _______
+//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)
+//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______
 //           \       |  |  |        |  |_____   |   \_/   |   |  |   |  |_/  /    _____  |
-//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/   
+//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/
 //
-//  This file is part of VirtualFluids. VirtualFluids is free software: you can 
+//  This file is part of VirtualFluids. VirtualFluids is free software: you can
 //  redistribute it and/or modify it under the terms of the GNU General Public
-//  License as published by the Free Software Foundation, either version 3 of 
+//  License as published by the Free Software Foundation, either version 3 of
 //  the License, or (at your option) any later version.
-//  
-//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT 
-//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
-//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License 
+//
+//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT
+//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 //  for more details.
-//  
+//
 //  You should have received a copy of the GNU General Public License along
 //  with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>.
 //
@@ -30,649 +30,513 @@
 //! \ingroup geometry3d
 //! \author Soeren Freudiger, Sebastian Geller
 //=======================================================================================
-#include <GbVector3D.h>
 #include <GbPoint3D.h>
+#include <GbVector3D.h>
 
-#include <basics/utilities/UbMath.h>
 #include <basics/utilities/UbInfinity.h>
+#include <basics/utilities/UbMath.h>
 
 using namespace std;
 
-
-const GbVector3D GbVector3D::ZERO(0.0,0.0,0.0);
-const GbVector3D GbVector3D::UNIT_X1(1.0,0.0,0.0);
-const GbVector3D GbVector3D::UNIT_X2(0.0,1.0,0.0);
-const GbVector3D GbVector3D::UNIT_X3(0.0,0.0,1.0);
+const GbVector3D GbVector3D::ZERO(0.0, 0.0, 0.0);
+const GbVector3D GbVector3D::UNIT_X1(1.0, 0.0, 0.0);
+const GbVector3D GbVector3D::UNIT_X2(0.0, 1.0, 0.0);
+const GbVector3D GbVector3D::UNIT_X3(0.0, 0.0, 1.0);
 
 //----------------------------------------------------------------------------
-GbVector3D::GbVector3D () 
-{                                      
-   m_afTuple[0] = 0.0;
-   m_afTuple[1] = 0.0;
-   m_afTuple[2] = 0.0;
+GbVector3D::GbVector3D()
+{
+    m_afTuple[0] = 0.0;
+    m_afTuple[1] = 0.0;
+    m_afTuple[2] = 0.0;
 }
 //----------------------------------------------------------------------------
-GbVector3D::GbVector3D (const double& fX, const double& fY, const double& fZ) 
+GbVector3D::GbVector3D(const double &fX, const double &fY, const double &fZ)
 {
-   m_afTuple[0] = fX;
-   m_afTuple[1] = fY;
-   m_afTuple[2] = fZ;
+    m_afTuple[0] = fX;
+    m_afTuple[1] = fY;
+    m_afTuple[2] = fZ;
 }
 //----------------------------------------------------------------------------
-GbVector3D::GbVector3D (const GbVector3D& rkV) 
+GbVector3D::GbVector3D(const GbVector3D &rkV)
 {
-   m_afTuple[0] = rkV.m_afTuple[0];
-   m_afTuple[1] = rkV.m_afTuple[1];
-   m_afTuple[2] = rkV.m_afTuple[2];
+    m_afTuple[0] = rkV.m_afTuple[0];
+    m_afTuple[1] = rkV.m_afTuple[1];
+    m_afTuple[2] = rkV.m_afTuple[2];
 }
 //----------------------------------------------------------------------------
 
-GbVector3D::GbVector3D (const GbPoint3D& point) 
+GbVector3D::GbVector3D(const GbPoint3D &point)
 {
-   m_afTuple[0] = point.x1;
-   m_afTuple[1] = point.x2;
-   m_afTuple[2] = point.x3;
+    m_afTuple[0] = point.x1;
+    m_afTuple[1] = point.x2;
+    m_afTuple[2] = point.x3;
 }
 
 //----------------------------------------------------------------------------
 string GbVector3D::toString()
 {
-   std::stringstream ss;
-   ss<< "GbVector3D["<<m_afTuple[0]<<","<<m_afTuple[1]<<","<<m_afTuple[2]<<"]";
-   ss<<endl;
-   return((ss.str()).c_str());
+    std::stringstream ss;
+    ss << "GbVector3D[" << m_afTuple[0] << "," << m_afTuple[1] << "," << m_afTuple[2] << "]";
+    ss << endl;
+    return ((ss.str()).c_str());
 }
 //----------------------------------------------------------------------------
-GbVector3D::operator const double* () const
-{
-   return m_afTuple;
-}
+GbVector3D::operator const double *() const { return m_afTuple; }
 //----------------------------------------------------------------------------
-GbVector3D::operator double* ()
-{
-   return m_afTuple;
-}
+GbVector3D::operator double *() { return m_afTuple; }
 //----------------------------------------------------------------------------
-double GbVector3D::operator[] (int i) const
+double GbVector3D::operator[](int i) const
 {
-   assert( 0 <= i && i <= 2 );
-   if ( i < 0 )
-      i = 0;
-   else if ( i > 2 )
-      i = 2;
+    assert(0 <= i && i <= 2);
+    if (i < 0)
+        i = 0;
+    else if (i > 2)
+        i = 2;
 
-   return m_afTuple[i];
+    return m_afTuple[i];
 }
 //----------------------------------------------------------------------------
-double& GbVector3D::operator[] (int i)
+double &GbVector3D::operator[](int i)
 {
-   assert( 0 <= i && i <= 2 );
-   if ( i < 0 )
-      i = 0;
-   else if ( i > 2 )
-      i = 2;
+    assert(0 <= i && i <= 2);
+    if (i < 0)
+        i = 0;
+    else if (i > 2)
+        i = 2;
 
-   return m_afTuple[i];
+    return m_afTuple[i];
 }
 //----------------------------------------------------------------------------
-double GbVector3D::X1 () const
-{
-   return m_afTuple[0];
-}
+double GbVector3D::X1() const { return m_afTuple[0]; }
 //----------------------------------------------------------------------------
-double& GbVector3D::X1 ()
-{
-   return m_afTuple[0];
-}
+double &GbVector3D::X1() { return m_afTuple[0]; }
 //----------------------------------------------------------------------------
-double GbVector3D::X2 () const
-{
-   return m_afTuple[1];
-}
+double GbVector3D::X2() const { return m_afTuple[1]; }
 //----------------------------------------------------------------------------
-double& GbVector3D::X2 ()
-{
-   return m_afTuple[1];
-}
+double &GbVector3D::X2() { return m_afTuple[1]; }
 //----------------------------------------------------------------------------
-double GbVector3D::X3 () const
-{
-   return m_afTuple[2];
-}
+double GbVector3D::X3() const { return m_afTuple[2]; }
 //----------------------------------------------------------------------------
-double& GbVector3D::X3 ()
-{
-   return m_afTuple[2];
-}
+double &GbVector3D::X3() { return m_afTuple[2]; }
 //----------------------------------------------------------------------------
-GbVector3D& GbVector3D::operator= (const GbVector3D& rkV)
+GbVector3D &GbVector3D::operator=(const GbVector3D &rkV)
 {
-    if(this == &rkV)
+    if (this == &rkV)
         return *this;
 
     m_afTuple[0] = rkV.m_afTuple[0];
-   m_afTuple[1] = rkV.m_afTuple[1];
-   m_afTuple[2] = rkV.m_afTuple[2];
-   return *this;
+    m_afTuple[1] = rkV.m_afTuple[1];
+    m_afTuple[2] = rkV.m_afTuple[2];
+    return *this;
 }
 //----------------------------------------------------------------------------
-int GbVector3D::CompareArrays (const GbVector3D& rkV) const
+int GbVector3D::CompareArrays(const GbVector3D &rkV) const
 {
-   return memcmp(m_afTuple,rkV.m_afTuple,3*sizeof(double));
+    return memcmp(m_afTuple, rkV.m_afTuple, 3 * sizeof(double));
 }
 //----------------------------------------------------------------------------
-bool GbVector3D::operator== (const GbVector3D& rkV) const
-{
-   return CompareArrays(rkV) == 0;
-}
+bool GbVector3D::operator==(const GbVector3D &rkV) const { return CompareArrays(rkV) == 0; }
 //----------------------------------------------------------------------------
-bool GbVector3D::operator!= (const GbVector3D& rkV) const
-{
-   return CompareArrays(rkV) != 0;
-}
+bool GbVector3D::operator!=(const GbVector3D &rkV) const { return CompareArrays(rkV) != 0; }
 //----------------------------------------------------------------------------
-bool GbVector3D::operator< (const GbVector3D& rkV) const
-{
-   return CompareArrays(rkV) < 0;
-}
+bool GbVector3D::operator<(const GbVector3D &rkV) const { return CompareArrays(rkV) < 0; }
 //----------------------------------------------------------------------------
-bool GbVector3D::operator<= (const GbVector3D& rkV) const
-{
-   return CompareArrays(rkV) <= 0;
-}
+bool GbVector3D::operator<=(const GbVector3D &rkV) const { return CompareArrays(rkV) <= 0; }
 //----------------------------------------------------------------------------
-bool GbVector3D::operator> (const GbVector3D& rkV) const
-{
-   return CompareArrays(rkV) > 0;
-}
+bool GbVector3D::operator>(const GbVector3D &rkV) const { return CompareArrays(rkV) > 0; }
 //----------------------------------------------------------------------------
-bool GbVector3D::operator>= (const GbVector3D& rkV) const
-{
-   return CompareArrays(rkV) >= 0;
-}
+bool GbVector3D::operator>=(const GbVector3D &rkV) const { return CompareArrays(rkV) >= 0; }
 //----------------------------------------------------------------------------
-GbVector3D GbVector3D::operator+ (const GbVector3D& rkV) const
+GbVector3D GbVector3D::operator+(const GbVector3D &rkV) const
 {
-   return GbVector3D(
-      m_afTuple[0]+rkV.m_afTuple[0],
-      m_afTuple[1]+rkV.m_afTuple[1],
-      m_afTuple[2]+rkV.m_afTuple[2]);
+    return GbVector3D(m_afTuple[0] + rkV.m_afTuple[0], m_afTuple[1] + rkV.m_afTuple[1],
+                      m_afTuple[2] + rkV.m_afTuple[2]);
 }
 //----------------------------------------------------------------------------
-GbVector3D GbVector3D::Add(GbVector3D& vector)
+GbVector3D GbVector3D::Add(GbVector3D &vector)
 {
-   return GbVector3D(
-      m_afTuple[0]+vector.m_afTuple[0],
-      m_afTuple[1]+vector.m_afTuple[1],
-      m_afTuple[2]+vector.m_afTuple[2]);
+    return GbVector3D(m_afTuple[0] + vector.m_afTuple[0], m_afTuple[1] + vector.m_afTuple[1],
+                      m_afTuple[2] + vector.m_afTuple[2]);
 }
 
 //----------------------------------------------------------------------------
-GbVector3D GbVector3D::operator- (const GbVector3D& rkV) const
+GbVector3D GbVector3D::operator-(const GbVector3D &rkV) const
 {
-   return GbVector3D(
-      m_afTuple[0]-rkV.m_afTuple[0],
-      m_afTuple[1]-rkV.m_afTuple[1],
-      m_afTuple[2]-rkV.m_afTuple[2]);
+    return GbVector3D(m_afTuple[0] - rkV.m_afTuple[0], m_afTuple[1] - rkV.m_afTuple[1],
+                      m_afTuple[2] - rkV.m_afTuple[2]);
 }
 //----------------------------------------------------------------------------
-GbVector3D GbVector3D::Subtract(GbVector3D& vector)
+GbVector3D GbVector3D::Subtract(GbVector3D &vector)
 {
-   return GbVector3D(
-      m_afTuple[0]-vector.m_afTuple[0],
-      m_afTuple[1]-vector.m_afTuple[1],
-      m_afTuple[2]-vector.m_afTuple[2]);
+    return GbVector3D(m_afTuple[0] - vector.m_afTuple[0], m_afTuple[1] - vector.m_afTuple[1],
+                      m_afTuple[2] - vector.m_afTuple[2]);
 }
 //----------------------------------------------------------------------------
-GbVector3D GbVector3D::operator* (const double& fScalar) const
+GbVector3D GbVector3D::operator*(const double &fScalar) const
 {
-   return GbVector3D( fScalar*m_afTuple[0],
-                      fScalar*m_afTuple[1],
-                      fScalar*m_afTuple[2]);
+    return GbVector3D(fScalar * m_afTuple[0], fScalar * m_afTuple[1], fScalar * m_afTuple[2]);
 }
 //----------------------------------------------------------------------------
-GbVector3D GbVector3D::operator/ (const double& fScalar) const
+GbVector3D GbVector3D::operator/(const double &fScalar) const
 {
-   GbVector3D kQuot;
+    GbVector3D kQuot;
 
-   if ( fScalar != 0.0 )
-   {
-      double fInvScalar = 1.0/fScalar;
-      kQuot.m_afTuple[0] = fInvScalar*m_afTuple[0];
-      kQuot.m_afTuple[1] = fInvScalar*m_afTuple[1];
-      kQuot.m_afTuple[2] = fInvScalar*m_afTuple[2];
-   }
-   else
-   {
-      kQuot.m_afTuple[0] = Ub::inf;
-      kQuot.m_afTuple[1] = Ub::inf;
-      kQuot.m_afTuple[2] = Ub::inf;
-   }
+    if (fScalar != 0.0) {
+        double fInvScalar  = 1.0 / fScalar;
+        kQuot.m_afTuple[0] = fInvScalar * m_afTuple[0];
+        kQuot.m_afTuple[1] = fInvScalar * m_afTuple[1];
+        kQuot.m_afTuple[2] = fInvScalar * m_afTuple[2];
+    } else {
+        kQuot.m_afTuple[0] = Ub::inf;
+        kQuot.m_afTuple[1] = Ub::inf;
+        kQuot.m_afTuple[2] = Ub::inf;
+    }
 
-   return kQuot;
+    return kQuot;
 }
 //----------------------------------------------------------------------------
-GbVector3D GbVector3D::operator- () const
-{
-   return GbVector3D(
-      -m_afTuple[0],
-      -m_afTuple[1],
-      -m_afTuple[2]);
-}
+GbVector3D GbVector3D::operator-() const { return GbVector3D(-m_afTuple[0], -m_afTuple[1], -m_afTuple[2]); }
 //----------------------------------------------------------------------------
-GbVector3D operator* (const double& fScalar, const GbVector3D& rkV)
+GbVector3D operator*(const double &fScalar, const GbVector3D &rkV)
 {
-   return GbVector3D(
-      fScalar*rkV[0],
-      fScalar*rkV[1],
-      fScalar*rkV[2]);
+    return GbVector3D(fScalar * rkV[0], fScalar * rkV[1], fScalar * rkV[2]);
 }
 //----------------------------------------------------------------------------
-GbVector3D& GbVector3D::operator+= (const GbVector3D& rkV)
+GbVector3D &GbVector3D::operator+=(const GbVector3D &rkV)
 {
-   m_afTuple[0] += rkV.m_afTuple[0];
-   m_afTuple[1] += rkV.m_afTuple[1];
-   m_afTuple[2] += rkV.m_afTuple[2];
-   return *this;
+    m_afTuple[0] += rkV.m_afTuple[0];
+    m_afTuple[1] += rkV.m_afTuple[1];
+    m_afTuple[2] += rkV.m_afTuple[2];
+    return *this;
 }
 //----------------------------------------------------------------------------
-GbVector3D& GbVector3D::operator-= (const GbVector3D& rkV)
+GbVector3D &GbVector3D::operator-=(const GbVector3D &rkV)
 {
-   m_afTuple[0] -= rkV.m_afTuple[0];
-   m_afTuple[1] -= rkV.m_afTuple[1];
-   m_afTuple[2] -= rkV.m_afTuple[2];
-   return *this;
+    m_afTuple[0] -= rkV.m_afTuple[0];
+    m_afTuple[1] -= rkV.m_afTuple[1];
+    m_afTuple[2] -= rkV.m_afTuple[2];
+    return *this;
 }
 //----------------------------------------------------------------------------
-GbVector3D& GbVector3D::operator*= (const double& fScalar)
+GbVector3D &GbVector3D::operator*=(const double &fScalar)
 {
-   m_afTuple[0] *= fScalar;
-   m_afTuple[1] *= fScalar;
-   m_afTuple[2] *= fScalar;
-   return *this;
+    m_afTuple[0] *= fScalar;
+    m_afTuple[1] *= fScalar;
+    m_afTuple[2] *= fScalar;
+    return *this;
 }
 //----------------------------------------------------------------------------
-GbVector3D& GbVector3D::operator/= (const double& fScalar)
+GbVector3D &GbVector3D::operator/=(const double &fScalar)
 {
-   if ( fScalar != (double)0.0 )
-   {
-      double fInvScalar = ((double)1.0)/fScalar;
-      m_afTuple[0] *= fInvScalar;
-      m_afTuple[1] *= fInvScalar;
-      m_afTuple[2] *= fInvScalar;
-   }
-   else
-   {
-      m_afTuple[0] = Ub::inf;
-      m_afTuple[1] = Ub::inf;
-      m_afTuple[2] = Ub::inf;
-   }
+    if (fScalar != (double)0.0) {
+        double fInvScalar = ((double)1.0) / fScalar;
+        m_afTuple[0] *= fInvScalar;
+        m_afTuple[1] *= fInvScalar;
+        m_afTuple[2] *= fInvScalar;
+    } else {
+        m_afTuple[0] = Ub::inf;
+        m_afTuple[1] = Ub::inf;
+        m_afTuple[2] = Ub::inf;
+    }
 
-   return *this;
+    return *this;
 }
 //----------------------------------------------------------------------------
-GbVector3D GbVector3D::Scale(const double& x)
+GbVector3D GbVector3D::Scale(const double &x)
 {
-   GbVector3D PointA(0.0,0.0,0.0);
-   PointA.m_afTuple[0] = x * m_afTuple[0];
-   PointA.m_afTuple[1] = x * m_afTuple[1];
-   PointA.m_afTuple[2] = x * m_afTuple[2];
-   return PointA;	
+    GbVector3D PointA(0.0, 0.0, 0.0);
+    PointA.m_afTuple[0] = x * m_afTuple[0];
+    PointA.m_afTuple[1] = x * m_afTuple[1];
+    PointA.m_afTuple[2] = x * m_afTuple[2];
+    return PointA;
 }
 
 //----------------------------------------------------------------------------
-double GbVector3D::Length () const
+double GbVector3D::Length() const
 {
-   return std::sqrt(
-      m_afTuple[0]*m_afTuple[0] +
-      m_afTuple[1]*m_afTuple[1] +
-      m_afTuple[2]*m_afTuple[2]);
+    return std::sqrt(m_afTuple[0] * m_afTuple[0] + m_afTuple[1] * m_afTuple[1] + m_afTuple[2] * m_afTuple[2]);
 }
 //----------------------------------------------------------------------------
-double GbVector3D::SquaredLength () const
+double GbVector3D::SquaredLength() const
 {
-   return
-      m_afTuple[0]*m_afTuple[0] +
-      m_afTuple[1]*m_afTuple[1] +
-      m_afTuple[2]*m_afTuple[2];
+    return m_afTuple[0] * m_afTuple[0] + m_afTuple[1] * m_afTuple[1] + m_afTuple[2] * m_afTuple[2];
 }
 //----------------------------------------------------------------------------
-double GbVector3D::Dot (const GbVector3D& rkV) const
+double GbVector3D::Dot(const GbVector3D &rkV) const
 {
-   return
-      m_afTuple[0]*rkV.m_afTuple[0] +
-      m_afTuple[1]*rkV.m_afTuple[1] +
-      m_afTuple[2]*rkV.m_afTuple[2];
+    return m_afTuple[0] * rkV.m_afTuple[0] + m_afTuple[1] * rkV.m_afTuple[1] + m_afTuple[2] * rkV.m_afTuple[2];
 }
 //----------------------------------------------------------------------------
-double GbVector3D::Normalize ()
+double GbVector3D::Normalize()
 {
-   double fLength = Length();
+    double fLength = Length();
 
-   if ( fLength > UbMath::Epsilon<double>::val() )
-   {
-      double fInvLength = ((double)1.0)/fLength;
-      m_afTuple[0] *= fInvLength;
-      m_afTuple[1] *= fInvLength;
-      m_afTuple[2] *= fInvLength;
-   }
-   else
-   {
-      fLength = 0.0;
-      m_afTuple[0] = 0.0;
-      m_afTuple[1] = 0.0;
-      m_afTuple[2] = 0.0;
-   }
+    if (fLength > UbMath::Epsilon<double>::val()) {
+        double fInvLength = ((double)1.0) / fLength;
+        m_afTuple[0] *= fInvLength;
+        m_afTuple[1] *= fInvLength;
+        m_afTuple[2] *= fInvLength;
+    } else {
+        fLength      = 0.0;
+        m_afTuple[0] = 0.0;
+        m_afTuple[1] = 0.0;
+        m_afTuple[2] = 0.0;
+    }
 
-   return fLength;
+    return fLength;
 }
 //----------------------------------------------------------------------------
-GbVector3D GbVector3D::Cross (const GbVector3D& rkV) const
+GbVector3D GbVector3D::Cross(const GbVector3D &rkV) const
 {
-   return GbVector3D(
-      m_afTuple[1]*rkV.m_afTuple[2] - m_afTuple[2]*rkV.m_afTuple[1],
-      m_afTuple[2]*rkV.m_afTuple[0] - m_afTuple[0]*rkV.m_afTuple[2],
-      m_afTuple[0]*rkV.m_afTuple[1] - m_afTuple[1]*rkV.m_afTuple[0]);
+    return GbVector3D(m_afTuple[1] * rkV.m_afTuple[2] - m_afTuple[2] * rkV.m_afTuple[1],
+                      m_afTuple[2] * rkV.m_afTuple[0] - m_afTuple[0] * rkV.m_afTuple[2],
+                      m_afTuple[0] * rkV.m_afTuple[1] - m_afTuple[1] * rkV.m_afTuple[0]);
 }
 
 //----------------------------------------------------------------------------
 
-GbVector3D GbVector3D::UnitCross (const GbVector3D& rkV) const
+GbVector3D GbVector3D::UnitCross(const GbVector3D &rkV) const
 {
-   GbVector3D kCross(
-      m_afTuple[1]*rkV.m_afTuple[2] - m_afTuple[2]*rkV.m_afTuple[1],
-      m_afTuple[2]*rkV.m_afTuple[0] - m_afTuple[0]*rkV.m_afTuple[2],
-      m_afTuple[0]*rkV.m_afTuple[1] - m_afTuple[1]*rkV.m_afTuple[0]);
-   kCross.Normalize();
-   return kCross;
+    GbVector3D kCross(m_afTuple[1] * rkV.m_afTuple[2] - m_afTuple[2] * rkV.m_afTuple[1],
+                      m_afTuple[2] * rkV.m_afTuple[0] - m_afTuple[0] * rkV.m_afTuple[2],
+                      m_afTuple[0] * rkV.m_afTuple[1] - m_afTuple[1] * rkV.m_afTuple[0]);
+    kCross.Normalize();
+    return kCross;
 }
 //----------------------------------------------------------------------------
-void GbVector3D::GetBarycentrics (const GbVector3D& rkV0,
-                                  const GbVector3D& rkV1, const GbVector3D& rkV2,
-                                  const GbVector3D& rkV3, double afBary[4]) const
+void GbVector3D::GetBarycentrics(const GbVector3D &rkV0, const GbVector3D &rkV1, const GbVector3D &rkV2,
+                                 const GbVector3D &rkV3, double afBary[4]) const
 {
-   // compute the vectors relative to V3 of the tetrahedron
-   GbVector3D akDiff[4] =
-   {
-      rkV0 - rkV3,
-         rkV1 - rkV3,
-         rkV2 - rkV3,
-         *this - rkV3
-   };
-
-   // If the vertices have large magnitude, the linear system of
-   // equations for computing barycentric coordinates can be
-   // ill-conditioned.  To avoid this, uniformly scale the tetrahedron
-   // edges to be of order 1.  The scaling of all differences does not
-   // change the barycentric coordinates.
-   double fMax = (double)0.0;
-   int i;
-   for (i = 0; i < 3; i++)
-   {
-      for (int j = 0; j < 3; j++)
-      {
-         double fValue = std::fabs(akDiff[i][j]);
-         if ( fValue > fMax )
-            fMax = fValue;
-      }
-   }
+    // compute the vectors relative to V3 of the tetrahedron
+    GbVector3D akDiff[4] = { rkV0 - rkV3, rkV1 - rkV3, rkV2 - rkV3, *this - rkV3 };
 
-   // scale down only large data
-   if ( fMax > (double)1.0 )
-   {
-      double fInvMax = ((double)1.0)/fMax;
-      for (i = 0; i < 4; i++)
-         akDiff[i] *= fInvMax;
-   }
+    // If the vertices have large magnitude, the linear system of
+    // equations for computing barycentric coordinates can be
+    // ill-conditioned.  To avoid this, uniformly scale the tetrahedron
+    // edges to be of order 1.  The scaling of all differences does not
+    // change the barycentric coordinates.
+    double fMax = (double)0.0;
+    int i;
+    for (i = 0; i < 3; i++) {
+        for (int j = 0; j < 3; j++) {
+            double fValue = std::fabs(akDiff[i][j]);
+            if (fValue > fMax)
+                fMax = fValue;
+        }
+    }
 
-   double fDet = akDiff[0].Dot(akDiff[1].Cross(akDiff[2]));
-   GbVector3D kE1cE2 = akDiff[1].Cross(akDiff[2]);
-   GbVector3D kE2cE0 = akDiff[2].Cross(akDiff[0]);
-   GbVector3D kE0cE1 = akDiff[0].Cross(akDiff[1]);
-   if ( std::fabs(fDet) > UbMath::Epsilon<double>::val() )
-   {
-      double fInvDet = ((double)1.0)/fDet;
-      afBary[0] = akDiff[3].Dot(kE1cE2)*fInvDet;
-      afBary[1] = akDiff[3].Dot(kE2cE0)*fInvDet;
-      afBary[2] = akDiff[3].Dot(kE0cE1)*fInvDet;
-      afBary[3] = (double)1.0 - afBary[0] - afBary[1] - afBary[2];
-   }
-   else
-   {
-      // The tetrahedron is potentially flat.  Determine the face of
-      // maximum area and compute barycentric coordinates with respect
-      // to that face.
-      GbVector3D kE02 = rkV0 - rkV2;
-      GbVector3D kE12 = rkV1 - rkV2;
-      GbVector3D kE02cE12 = kE02.Cross(kE12);
-      double fMaxSqrArea = kE02cE12.SquaredLength();
-      int iMaxIndex = 3;
-      double fSqrArea = kE0cE1.SquaredLength();
-      if ( fSqrArea > fMaxSqrArea )
-      {
-         iMaxIndex = 0;
-         fMaxSqrArea = fSqrArea;
-      }
-      fSqrArea = kE1cE2.SquaredLength();
-      if ( fSqrArea > fMaxSqrArea )
-      {
-         iMaxIndex = 1;
-         fMaxSqrArea = fSqrArea;
-      }
-      fSqrArea = kE2cE0.SquaredLength();
-      if ( fSqrArea > fMaxSqrArea )
-      {
-         iMaxIndex = 2;
-         fMaxSqrArea = fSqrArea;
-      }
+    // scale down only large data
+    if (fMax > (double)1.0) {
+        double fInvMax = ((double)1.0) / fMax;
+        for (i = 0; i < 4; i++)
+            akDiff[i] *= fInvMax;
+    }
 
-      if ( fMaxSqrArea > UbMath::Epsilon<double>::val() )
-      {
-         double fInvSqrArea = ((double)1.0)/fMaxSqrArea;
-         GbVector3D kTmp;
-         if ( iMaxIndex == 0 )
-         {
-            kTmp = akDiff[3].Cross(akDiff[1]);
-            afBary[0] = kE0cE1.Dot(kTmp)*fInvSqrArea;
-            kTmp = akDiff[0].Cross(akDiff[3]);
-            afBary[1] = kE0cE1.Dot(kTmp)*fInvSqrArea;
-            afBary[2] = (double)0.0;
-            afBary[3] = (double)1.0 - afBary[0] - afBary[1];
-         }
-         else if ( iMaxIndex == 1 )
-         {
-            afBary[0] = (double)0.0;
-            kTmp = akDiff[3].Cross(akDiff[2]);
-            afBary[1] = kE1cE2.Dot(kTmp)*fInvSqrArea;
-            kTmp = akDiff[1].Cross(akDiff[3]);
-            afBary[2] = kE1cE2.Dot(kTmp)*fInvSqrArea;
-            afBary[3] = (double)1.0 - afBary[1] - afBary[2];
-         }
-         else if ( iMaxIndex == 2 )
-         {
-            kTmp = akDiff[2].Cross(akDiff[3]);
-            afBary[0] = kE2cE0.Dot(kTmp)*fInvSqrArea;
-            afBary[1] = (double)0.0;
-            kTmp = akDiff[3].Cross(akDiff[0]);
-            afBary[2] = kE2cE0.Dot(kTmp)*fInvSqrArea;
-            afBary[3] = (double)1.0 - afBary[0] - afBary[2];
-         }
-         else
-         {
-            akDiff[3] = *this - rkV2;
-            kTmp = akDiff[3].Cross(kE12);
-            afBary[0] = kE02cE12.Dot(kTmp)*fInvSqrArea;
-            kTmp = kE02.Cross(akDiff[3]);
-            afBary[1] = kE02cE12.Dot(kTmp)*fInvSqrArea;
-            afBary[2] = (double)1.0 - afBary[0] - afBary[1];
-            afBary[3] = (double)0.0;
-         }
-      }
-      else
-      {
-         // The tetrahedron is potentially a sliver.  Determine the edge of
-         // maximum length and compute barycentric coordinates with respect
-         // to that edge.
-         double fMaxSqrLength = akDiff[0].SquaredLength();
-         iMaxIndex = 0;  // <V0,V3>
-         double fSqrLength = akDiff[1].SquaredLength();
-         if ( fSqrLength > fMaxSqrLength )
-         {
-            iMaxIndex = 1;  // <V1,V3>
-            fMaxSqrLength = fSqrLength;
-         }
-         fSqrLength = akDiff[2].SquaredLength();
-         if ( fSqrLength > fMaxSqrLength )
-         {
-            iMaxIndex = 2;  // <V2,V3>
-            fMaxSqrLength = fSqrLength;
-         }
-         fSqrLength = kE02.SquaredLength();
-         if ( fSqrLength > fMaxSqrLength )
-         {
-            iMaxIndex = 3;  // <V0,V2>
-            fMaxSqrLength = fSqrLength;
-         }
-         fSqrLength = kE12.SquaredLength();
-         if ( fSqrLength > fMaxSqrLength )
-         {
-            iMaxIndex = 4;  // <V1,V2>
-            fMaxSqrLength = fSqrLength;
-         }
-         GbVector3D kE01 = rkV0 - rkV1;
-         fSqrLength = kE01.SquaredLength();
-         if ( fSqrLength > fMaxSqrLength )
-         {
-            iMaxIndex = 5;  // <V0,V1>
-            fMaxSqrLength = fSqrLength;
-         }
+    double fDet       = akDiff[0].Dot(akDiff[1].Cross(akDiff[2]));
+    GbVector3D kE1cE2 = akDiff[1].Cross(akDiff[2]);
+    GbVector3D kE2cE0 = akDiff[2].Cross(akDiff[0]);
+    GbVector3D kE0cE1 = akDiff[0].Cross(akDiff[1]);
+    if (std::fabs(fDet) > UbMath::Epsilon<double>::val()) {
+        double fInvDet = ((double)1.0) / fDet;
+        afBary[0]      = akDiff[3].Dot(kE1cE2) * fInvDet;
+        afBary[1]      = akDiff[3].Dot(kE2cE0) * fInvDet;
+        afBary[2]      = akDiff[3].Dot(kE0cE1) * fInvDet;
+        afBary[3]      = (double)1.0 - afBary[0] - afBary[1] - afBary[2];
+    } else {
+        // The tetrahedron is potentially flat.  Determine the face of
+        // maximum area and compute barycentric coordinates with respect
+        // to that face.
+        GbVector3D kE02     = rkV0 - rkV2;
+        GbVector3D kE12     = rkV1 - rkV2;
+        GbVector3D kE02cE12 = kE02.Cross(kE12);
+        double fMaxSqrArea  = kE02cE12.SquaredLength();
+        int iMaxIndex       = 3;
+        double fSqrArea     = kE0cE1.SquaredLength();
+        if (fSqrArea > fMaxSqrArea) {
+            iMaxIndex   = 0;
+            fMaxSqrArea = fSqrArea;
+        }
+        fSqrArea = kE1cE2.SquaredLength();
+        if (fSqrArea > fMaxSqrArea) {
+            iMaxIndex   = 1;
+            fMaxSqrArea = fSqrArea;
+        }
+        fSqrArea = kE2cE0.SquaredLength();
+        if (fSqrArea > fMaxSqrArea) {
+            iMaxIndex   = 2;
+            fMaxSqrArea = fSqrArea;
+        }
 
-         if ( fMaxSqrLength > UbMath::Epsilon<double>::val() )
-         {
-            double fInvSqrLength = ((double)1.0)/fMaxSqrLength;
-            if ( iMaxIndex == 0 )
-            {
-               // P-V3 = t*(V0-V3)
-               afBary[0] = akDiff[3].Dot(akDiff[0])*fInvSqrLength;
-               afBary[1] = (double)0.0;
-               afBary[2] = (double)0.0;
-               afBary[3] = (double)1.0 - afBary[0];
+        if (fMaxSqrArea > UbMath::Epsilon<double>::val()) {
+            double fInvSqrArea = ((double)1.0) / fMaxSqrArea;
+            GbVector3D kTmp;
+            if (iMaxIndex == 0) {
+                kTmp      = akDiff[3].Cross(akDiff[1]);
+                afBary[0] = kE0cE1.Dot(kTmp) * fInvSqrArea;
+                kTmp      = akDiff[0].Cross(akDiff[3]);
+                afBary[1] = kE0cE1.Dot(kTmp) * fInvSqrArea;
+                afBary[2] = (double)0.0;
+                afBary[3] = (double)1.0 - afBary[0] - afBary[1];
+            } else if (iMaxIndex == 1) {
+                afBary[0] = (double)0.0;
+                kTmp      = akDiff[3].Cross(akDiff[2]);
+                afBary[1] = kE1cE2.Dot(kTmp) * fInvSqrArea;
+                kTmp      = akDiff[1].Cross(akDiff[3]);
+                afBary[2] = kE1cE2.Dot(kTmp) * fInvSqrArea;
+                afBary[3] = (double)1.0 - afBary[1] - afBary[2];
+            } else if (iMaxIndex == 2) {
+                kTmp      = akDiff[2].Cross(akDiff[3]);
+                afBary[0] = kE2cE0.Dot(kTmp) * fInvSqrArea;
+                afBary[1] = (double)0.0;
+                kTmp      = akDiff[3].Cross(akDiff[0]);
+                afBary[2] = kE2cE0.Dot(kTmp) * fInvSqrArea;
+                afBary[3] = (double)1.0 - afBary[0] - afBary[2];
+            } else {
+                akDiff[3] = *this - rkV2;
+                kTmp      = akDiff[3].Cross(kE12);
+                afBary[0] = kE02cE12.Dot(kTmp) * fInvSqrArea;
+                kTmp      = kE02.Cross(akDiff[3]);
+                afBary[1] = kE02cE12.Dot(kTmp) * fInvSqrArea;
+                afBary[2] = (double)1.0 - afBary[0] - afBary[1];
+                afBary[3] = (double)0.0;
             }
-            else if ( iMaxIndex == 1 )
-            {
-               // P-V3 = t*(V1-V3)
-               afBary[0] = (double)0.0;
-               afBary[1] = akDiff[3].Dot(akDiff[1])*fInvSqrLength;
-               afBary[2] = (double)0.0;
-               afBary[3] = (double)1.0 - afBary[1];
+        } else {
+            // The tetrahedron is potentially a sliver.  Determine the edge of
+            // maximum length and compute barycentric coordinates with respect
+            // to that edge.
+            double fMaxSqrLength = akDiff[0].SquaredLength();
+            iMaxIndex            = 0; // <V0,V3>
+            double fSqrLength    = akDiff[1].SquaredLength();
+            if (fSqrLength > fMaxSqrLength) {
+                iMaxIndex     = 1; // <V1,V3>
+                fMaxSqrLength = fSqrLength;
             }
-            else if ( iMaxIndex == 2 )
-            {
-               // P-V3 = t*(V2-V3)
-               afBary[0] = (double)0.0;
-               afBary[1] = (double)0.0;
-               afBary[2] = akDiff[3].Dot(akDiff[2])*fInvSqrLength;
-               afBary[3] = (double)1.0 - afBary[2];
+            fSqrLength = akDiff[2].SquaredLength();
+            if (fSqrLength > fMaxSqrLength) {
+                iMaxIndex     = 2; // <V2,V3>
+                fMaxSqrLength = fSqrLength;
             }
-            else if ( iMaxIndex == 3 )
-            {
-               // P-V2 = t*(V0-V2)
-               akDiff[3] = *this - rkV2;
-               afBary[0] = akDiff[3].Dot(kE02)*fInvSqrLength;
-               afBary[1] = (double)0.0;
-               afBary[2] = (double)1.0 - afBary[0];
-               afBary[3] = (double)0.0;
+            fSqrLength = kE02.SquaredLength();
+            if (fSqrLength > fMaxSqrLength) {
+                iMaxIndex     = 3; // <V0,V2>
+                fMaxSqrLength = fSqrLength;
             }
-            else if ( iMaxIndex == 4 )
-            {
-               // P-V2 = t*(V1-V2)
-               akDiff[3] = *this - rkV2;
-               afBary[0] = (double)0.0;
-               afBary[1] = akDiff[3].Dot(kE12)*fInvSqrLength;
-               afBary[2] = (double)1.0 - afBary[1];
-               afBary[3] = (double)0.0;
+            fSqrLength = kE12.SquaredLength();
+            if (fSqrLength > fMaxSqrLength) {
+                iMaxIndex     = 4; // <V1,V2>
+                fMaxSqrLength = fSqrLength;
             }
-            else
-            {
-               // P-V1 = t*(V0-V1)
-               akDiff[3] = *this - rkV1;
-               afBary[0] = akDiff[3].Dot(kE01)*fInvSqrLength;
-               afBary[1] = (double)1.0 - afBary[0];
-               afBary[2] = (double)0.0;
-               afBary[3] = (double)0.0;
+            GbVector3D kE01 = rkV0 - rkV1;
+            fSqrLength      = kE01.SquaredLength();
+            if (fSqrLength > fMaxSqrLength) {
+                iMaxIndex     = 5; // <V0,V1>
+                fMaxSqrLength = fSqrLength;
             }
-         }
-         else
-         {
-            // tetrahedron is a nearly a point, just return equal weights
-            afBary[0] = (double)0.25;
-            afBary[1] = afBary[0];
-            afBary[2] = afBary[0];
-            afBary[3] = afBary[0];
-         }
-      }
-   }
+
+            if (fMaxSqrLength > UbMath::Epsilon<double>::val()) {
+                double fInvSqrLength = ((double)1.0) / fMaxSqrLength;
+                if (iMaxIndex == 0) {
+                    // P-V3 = t*(V0-V3)
+                    afBary[0] = akDiff[3].Dot(akDiff[0]) * fInvSqrLength;
+                    afBary[1] = (double)0.0;
+                    afBary[2] = (double)0.0;
+                    afBary[3] = (double)1.0 - afBary[0];
+                } else if (iMaxIndex == 1) {
+                    // P-V3 = t*(V1-V3)
+                    afBary[0] = (double)0.0;
+                    afBary[1] = akDiff[3].Dot(akDiff[1]) * fInvSqrLength;
+                    afBary[2] = (double)0.0;
+                    afBary[3] = (double)1.0 - afBary[1];
+                } else if (iMaxIndex == 2) {
+                    // P-V3 = t*(V2-V3)
+                    afBary[0] = (double)0.0;
+                    afBary[1] = (double)0.0;
+                    afBary[2] = akDiff[3].Dot(akDiff[2]) * fInvSqrLength;
+                    afBary[3] = (double)1.0 - afBary[2];
+                } else if (iMaxIndex == 3) {
+                    // P-V2 = t*(V0-V2)
+                    akDiff[3] = *this - rkV2;
+                    afBary[0] = akDiff[3].Dot(kE02) * fInvSqrLength;
+                    afBary[1] = (double)0.0;
+                    afBary[2] = (double)1.0 - afBary[0];
+                    afBary[3] = (double)0.0;
+                } else if (iMaxIndex == 4) {
+                    // P-V2 = t*(V1-V2)
+                    akDiff[3] = *this - rkV2;
+                    afBary[0] = (double)0.0;
+                    afBary[1] = akDiff[3].Dot(kE12) * fInvSqrLength;
+                    afBary[2] = (double)1.0 - afBary[1];
+                    afBary[3] = (double)0.0;
+                } else {
+                    // P-V1 = t*(V0-V1)
+                    akDiff[3] = *this - rkV1;
+                    afBary[0] = akDiff[3].Dot(kE01) * fInvSqrLength;
+                    afBary[1] = (double)1.0 - afBary[0];
+                    afBary[2] = (double)0.0;
+                    afBary[3] = (double)0.0;
+                }
+            } else {
+                // tetrahedron is a nearly a point, just return equal weights
+                afBary[0] = (double)0.25;
+                afBary[1] = afBary[0];
+                afBary[2] = afBary[0];
+                afBary[3] = afBary[0];
+            }
+        }
+    }
 }
 //----------------------------------------------------------------------------
-void GbVector3D::Orthonormalize (GbVector3D& rkU, GbVector3D& rkV, GbVector3D& rkW)
+void GbVector3D::Orthonormalize(GbVector3D &rkU, GbVector3D &rkV, GbVector3D &rkW)
 {
-   // If the input vectors are v0, v1, and v2, then the Gram-Schmidt
-   // orthonormalization produces vectors u0, u1, and u2 as follows,
-   //
-   //   u0 = v0/|v0|
-   //   u1 = (v1-(u0*v1)u0)/|v1-(u0*v1)u0|
-   //   u2 = (v2-(u0*v2)u0-(u1*v2)u1)/|v2-(u0*v2)u0-(u1*v2)u1|
-   //
-   // where |A| indicates length of vector A and A*B indicates dot
-   // product of vectors A and B.
+    // If the input vectors are v0, v1, and v2, then the Gram-Schmidt
+    // orthonormalization produces vectors u0, u1, and u2 as follows,
+    //
+    //   u0 = v0/|v0|
+    //   u1 = (v1-(u0*v1)u0)/|v1-(u0*v1)u0|
+    //   u2 = (v2-(u0*v2)u0-(u1*v2)u1)/|v2-(u0*v2)u0-(u1*v2)u1|
+    //
+    // where |A| indicates length of vector A and A*B indicates dot
+    // product of vectors A and B.
 
-   // compute u0
-   rkU.Normalize();
+    // compute u0
+    rkU.Normalize();
 
-   // compute u1
-   double fDot0 = rkU.Dot(rkV); 
-   rkV -= fDot0*rkU;
-   rkV.Normalize();
+    // compute u1
+    double fDot0 = rkU.Dot(rkV);
+    rkV -= fDot0 * rkU;
+    rkV.Normalize();
 
-   // compute u2
-   double fDot1 = rkV.Dot(rkW);
-   fDot0 = rkU.Dot(rkW);
-   rkW -= fDot0*rkU + fDot1*rkV;
-   rkW.Normalize();
+    // compute u2
+    double fDot1 = rkV.Dot(rkW);
+    fDot0        = rkU.Dot(rkW);
+    rkW -= fDot0 * rkU + fDot1 * rkV;
+    rkW.Normalize();
 }
 //----------------------------------------------------------------------------
-void GbVector3D::Orthonormalize (GbVector3D* akV)
-{
-   Orthonormalize(akV[0],akV[1],akV[2]);
-}
+void GbVector3D::Orthonormalize(GbVector3D *akV) { Orthonormalize(akV[0], akV[1], akV[2]); }
 //----------------------------------------------------------------------------
-void GbVector3D::GenerateOrthonormalBasis (GbVector3D& rkU, GbVector3D& rkV,
-                                           GbVector3D& rkW, bool bUnitLengthW)
+void GbVector3D::GenerateOrthonormalBasis(GbVector3D &rkU, GbVector3D &rkV, GbVector3D &rkW, bool bUnitLengthW)
 {
-   if ( !bUnitLengthW )
-      rkW.Normalize();
+    if (!bUnitLengthW)
+        rkW.Normalize();
 
-   double fInvLength;
+    double fInvLength;
 
-   if ( std::fabs(rkW.m_afTuple[0]) >=
-      std::fabs(rkW.m_afTuple[1]) )
-   {
-      // W.x or W.z is the largest magnitude component, swap them
-      fInvLength = UbMath::invSqrt(rkW.m_afTuple[0]*rkW.m_afTuple[0] + rkW.m_afTuple[2]*rkW.m_afTuple[2]);
-      rkU.m_afTuple[0] = -rkW.m_afTuple[2]*fInvLength;
-      rkU.m_afTuple[1] = (double)0.0;
-      rkU.m_afTuple[2] = +rkW.m_afTuple[0]*fInvLength;
-   }
-   else
-   {
-      // W.y or W.z is the largest magnitude component, swap them
-      fInvLength = UbMath::invSqrt(rkW.m_afTuple[1]*rkW.m_afTuple[1] + rkW.m_afTuple[2]*rkW.m_afTuple[2]);
-      rkU.m_afTuple[0] = (double)0.0;
-      rkU.m_afTuple[1] = +rkW.m_afTuple[2]*fInvLength;
-      rkU.m_afTuple[2] = -rkW.m_afTuple[1]*fInvLength;
-   }
+    if (std::fabs(rkW.m_afTuple[0]) >= std::fabs(rkW.m_afTuple[1])) {
+        // W.x or W.z is the largest magnitude component, swap them
+        fInvLength       = UbMath::invSqrt(rkW.m_afTuple[0] * rkW.m_afTuple[0] + rkW.m_afTuple[2] * rkW.m_afTuple[2]);
+        rkU.m_afTuple[0] = -rkW.m_afTuple[2] * fInvLength;
+        rkU.m_afTuple[1] = (double)0.0;
+        rkU.m_afTuple[2] = +rkW.m_afTuple[0] * fInvLength;
+    } else {
+        // W.y or W.z is the largest magnitude component, swap them
+        fInvLength       = UbMath::invSqrt(rkW.m_afTuple[1] * rkW.m_afTuple[1] + rkW.m_afTuple[2] * rkW.m_afTuple[2]);
+        rkU.m_afTuple[0] = (double)0.0;
+        rkU.m_afTuple[1] = +rkW.m_afTuple[2] * fInvLength;
+        rkU.m_afTuple[2] = -rkW.m_afTuple[1] * fInvLength;
+    }
 
-   rkV = rkW.Cross(rkU);
+    rkV = rkW.Cross(rkU);
 }
 //----------------------------------------------------------------------------
-
diff --git a/src/basics/geometry3d/GbVector3D.h b/src/basics/geometry3d/GbVector3D.h
index 9bf699fa2141043245bfa29396351f823ccc3c11..f92ae5ae21effc4adaafbf343426e231cd4d7452 100644
--- a/src/basics/geometry3d/GbVector3D.h
+++ b/src/basics/geometry3d/GbVector3D.h
@@ -1,28 +1,28 @@
 //=======================================================================================
-// ____          ____    __    ______     __________   __      __       __        __         
-// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |        
-//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |        
-//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |        
-//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____    
-//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|   
-//      \    \  |    |   ________________________________________________________________    
-//       \    \ |    |  |  ______________________________________________________________|   
-//        \    \|    |  |  |         __          __     __     __     ______      _______    
-//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)   
-//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______    
+// ____          ____    __    ______     __________   __      __       __        __
+// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |
+//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |
+//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |
+//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____
+//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|
+//      \    \  |    |   ________________________________________________________________
+//       \    \ |    |  |  ______________________________________________________________|
+//        \    \|    |  |  |         __          __     __     __     ______      _______
+//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)
+//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______
 //           \       |  |  |        |  |_____   |   \_/   |   |  |   |  |_/  /    _____  |
-//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/   
+//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/
 //
-//  This file is part of VirtualFluids. VirtualFluids is free software: you can 
+//  This file is part of VirtualFluids. VirtualFluids is free software: you can
 //  redistribute it and/or modify it under the terms of the GNU General Public
-//  License as published by the Free Software Foundation, either version 3 of 
+//  License as published by the Free Software Foundation, either version 3 of
 //  the License, or (at your option) any later version.
-//  
-//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT 
-//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
-//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License 
+//
+//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT
+//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 //  for more details.
-//  
+//
 //  You should have received a copy of the GNU General Public License along
 //  with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>.
 //
@@ -32,9 +32,9 @@
 //=======================================================================================
 #ifndef GBVECTOR3D_H
 #define GBVECTOR3D_H
-                                                                   
-#include <cfloat>                               
-#include <cassert> 
+
+#include <cassert>
+#include <cfloat>
 #include <string>
 
 #include <PointerDefinitions.h>
@@ -42,89 +42,87 @@
 class GbPoint3D;
 
 //! \brief This Class provides basic 3D vector objects.
-class GbVector3D 
+class GbVector3D
 {
 public:
-   // construction
-    GbVector3D (); 
-    GbVector3D (const double& fX1, const double& fX2, const double& fX3);
-    GbVector3D (const GbVector3D& rkV);
-    GbVector3D (const GbPoint3D& rkV);
+    // construction
+    GbVector3D();
+    GbVector3D(const double &fX1, const double &fX2, const double &fX3);
+    GbVector3D(const GbVector3D &rkV);
+    GbVector3D(const GbPoint3D &rkV);
 
     std::string toString();
 
     // coordinate access
-    operator const double* () const;
-    operator double* ();
-    double operator[] (int i) const;
-    double& operator[] (int i);
-    double X1 () const;
-    double& X1 ();
-    double X2 () const;
-    double& X2 ();                                    
-    double X3 () const;
-    double& X3 ();
+    operator const double *() const;
+    operator double *();
+    double operator[](int i) const;
+    double &operator[](int i);
+    double X1() const;
+    double &X1();
+    double X2() const;
+    double &X2();
+    double X3() const;
+    double &X3();
 
     // assignment
-    GbVector3D& operator= (const GbVector3D& rkV);
+    GbVector3D &operator=(const GbVector3D &rkV);
 
     // comparison
-    bool operator== (const GbVector3D& rkV) const;
-    bool operator!= (const GbVector3D& rkV) const;
-    bool operator<  (const GbVector3D& rkV) const;
-    bool operator<= (const GbVector3D& rkV) const;
-    bool operator>  (const GbVector3D& rkV) const;
-    bool operator>= (const GbVector3D& rkV) const;
+    bool operator==(const GbVector3D &rkV) const;
+    bool operator!=(const GbVector3D &rkV) const;
+    bool operator<(const GbVector3D &rkV) const;
+    bool operator<=(const GbVector3D &rkV) const;
+    bool operator>(const GbVector3D &rkV) const;
+    bool operator>=(const GbVector3D &rkV) const;
 
     // arithmetic operations
-    GbVector3D operator+ (const GbVector3D& rkV) const;
-    GbVector3D operator- (const GbVector3D& rkV) const;
-    GbVector3D operator* (const double& fScalar) const;
-    GbVector3D operator/ (const double& fScalar) const;
-    GbVector3D operator- () const;
+    GbVector3D operator+(const GbVector3D &rkV) const;
+    GbVector3D operator-(const GbVector3D &rkV) const;
+    GbVector3D operator*(const double &fScalar) const;
+    GbVector3D operator/(const double &fScalar) const;
+    GbVector3D operator-() const;
 
     // arithmetic updates
-    GbVector3D& operator+= (const GbVector3D& rkV);
-    GbVector3D& operator-= (const GbVector3D& rkV);
-    GbVector3D& operator*= (const double& fScalar);
-    GbVector3D& operator/= (const double& fScalar);
+    GbVector3D &operator+=(const GbVector3D &rkV);
+    GbVector3D &operator-=(const GbVector3D &rkV);
+    GbVector3D &operator*=(const double &fScalar);
+    GbVector3D &operator/=(const double &fScalar);
 
-    GbVector3D Add(GbVector3D& vector);
-    GbVector3D Subtract(GbVector3D& vector);
-    GbVector3D Scale(const double& x);
+    GbVector3D Add(GbVector3D &vector);
+    GbVector3D Subtract(GbVector3D &vector);
+    GbVector3D Scale(const double &x);
 
     // vector operations
-    double Length () const;
-    double SquaredLength () const;
-    double Dot (const GbVector3D& rkV) const;
-    double Normalize ();
+    double Length() const;
+    double SquaredLength() const;
+    double Dot(const GbVector3D &rkV) const;
+    double Normalize();
 
     // The cross products are computed using the right-handed rule.  Be aware
     // that some graphics APIs use a left-handed rule.  If you have to compute
     // a cross product with these functions and send the result to the API
     // that expects left-handed, you will need to change sign on the vector
     // (replace each component value c by -c).
-    GbVector3D Cross (const GbVector3D& rkV) const;
-    GbVector3D UnitCross (const GbVector3D& rkV) const;
+    GbVector3D Cross(const GbVector3D &rkV) const;
+    GbVector3D UnitCross(const GbVector3D &rkV) const;
 
     // Compute the barycentric coordinates of the point with respect to the
     // tetrahedron <V0,V1,V2,V3>, P = b0*V0 + b1*V1 + b2*V2 + b3*V3, where
     // b0 + b1 + b2 + b3 = 1.
-    void GetBarycentrics (const GbVector3D& rkV0,
-                          const GbVector3D& rkV1, const GbVector3D& rkV2,
-                          const GbVector3D& rkV3, double afBary[4]) const;
+    void GetBarycentrics(const GbVector3D &rkV0, const GbVector3D &rkV1, const GbVector3D &rkV2, const GbVector3D &rkV3,
+                         double afBary[4]) const;
 
     // Gram-Schmidt orthonormalization.  Take linearly independent vectors
     // U, V, and W and compute an orthonormal set (unit length, mutually
     // perpendicular).
-    static void Orthonormalize (GbVector3D& rkU, GbVector3D& rkV, GbVector3D& rkW);
-    static void Orthonormalize (GbVector3D* akV);
+    static void Orthonormalize(GbVector3D &rkU, GbVector3D &rkV, GbVector3D &rkW);
+    static void Orthonormalize(GbVector3D *akV);
 
     // Input W must be initialized to a nonzero vector, output is {U,V,W},
     // an orthonormal basis.  A hint is provided about whether or not W
     // is already unit length.
-    static void GenerateOrthonormalBasis (GbVector3D& rkU, GbVector3D& rkV,
-                                          GbVector3D& rkW, bool bUnitLengthW);
+    static void GenerateOrthonormalBasis(GbVector3D &rkU, GbVector3D &rkV, GbVector3D &rkW, bool bUnitLengthW);
 
     // special vectors
     static const GbVector3D ZERO;
@@ -134,11 +132,11 @@ public:
 
 private:
     // support for comparisons
-    int CompareArrays (const GbVector3D& rkV) const;
+    int CompareArrays(const GbVector3D &rkV) const;
 
     double m_afTuple[3];
 };
 
-GbVector3D operator* (const double& fScalar, const GbVector3D& rkV);
+GbVector3D operator*(const double &fScalar, const GbVector3D &rkV);
 
-#endif //GBVECTOR3D_H
+#endif // GBVECTOR3D_H
diff --git a/src/basics/geometry3d/GbVoxelMatrix3D.cpp b/src/basics/geometry3d/GbVoxelMatrix3D.cpp
index 11c0f9d0d21485b8e24fd6568f90e451fc2e598d..bc2a89bc8cb7a78ba5c77b528ce48c7223d6698c 100644
--- a/src/basics/geometry3d/GbVoxelMatrix3D.cpp
+++ b/src/basics/geometry3d/GbVoxelMatrix3D.cpp
@@ -1,10 +1,10 @@
 #include <geometry3d/GbVoxelMatrix3D.h>
 
-#include <basics/utilities/UbMath.h>
 #include <basics/utilities/UbFileInputASCII.h>
-#include <geometry3d/GbTriangle3D.h>
 #include <basics/utilities/UbFileOutputASCII.h>
+#include <basics/utilities/UbMath.h>
 #include <geometry3d/CoordinateTransformation3D.h>
+#include <geometry3d/GbTriangle3D.h>
 
 #include <basics/utilities/UbSystem.h>
 
@@ -17,985 +17,950 @@ using namespace std;
 const float GbVoxelMatrix3D::SOLID = 1.0f;
 const float GbVoxelMatrix3D::FLUID = 0.0f;
 
-
 /*=======================================================*/
 // Konstruktor
 GbVoxelMatrix3D::GbVoxelMatrix3D(int nx1, int nx2, int nx3, float initVal, double lowerThreshold, double upperThreshold)
-   : GbObject3D()
-   , lowerThreshold(lowerThreshold)
-   , upperThreshold(upperThreshold)
-   , nodesX1(nx1)
-   , nodesX2(nx2)
-   , nodesX3(nx3)
-   , voxelMatrix(Matrix3D(nx1, nx2, nx3, initVal))
+    : GbObject3D(), lowerThreshold(lowerThreshold), upperThreshold(upperThreshold), nodesX1(nx1), nodesX2(nx2),
+      nodesX3(nx3), voxelMatrix(Matrix3D(nx1, nx2, nx3, initVal))
 {
-   this->setName("VoxelMatrix3D");
+    this->setName("VoxelMatrix3D");
 }
 /*=======================================================*/
-GbVoxelMatrix3D::GbVoxelMatrix3D()
-   : GbObject3D()
-    
-{
-   this->setName("VoxelMatrix3D");
-}
+GbVoxelMatrix3D::GbVoxelMatrix3D() : GbObject3D() { this->setName("VoxelMatrix3D"); }
 /*=======================================================*/
-GbVoxelMatrix3D::GbVoxelMatrix3D(const Matrix3D& voxelMatrix, double lowerThreshold, double upperThreshold)
-   : GbObject3D()
-   , nodesX1((int)voxelMatrix.getNX1())
-   , nodesX2((int)voxelMatrix.getNX2())
-   , nodesX3((int)voxelMatrix.getNX3())
-   , lowerThreshold(lowerThreshold)
-   , upperThreshold(upperThreshold)
-   , voxelMatrix(voxelMatrix)
+GbVoxelMatrix3D::GbVoxelMatrix3D(const Matrix3D &voxelMatrix, double lowerThreshold, double upperThreshold)
+    : GbObject3D(), nodesX1((int)voxelMatrix.getNX1()), nodesX2((int)voxelMatrix.getNX2()),
+      nodesX3((int)voxelMatrix.getNX3()), lowerThreshold(lowerThreshold), upperThreshold(upperThreshold),
+      voxelMatrix(voxelMatrix)
 {
-   this->setName("VoxelMatrix3D");
+    this->setName("VoxelMatrix3D");
 }
 /*=======================================================*/
-GbVoxelMatrix3D* GbVoxelMatrix3D::clone()
+GbVoxelMatrix3D *GbVoxelMatrix3D::clone()
 {
-   GbVoxelMatrix3D* vm = new GbVoxelMatrix3D(voxelMatrix, lowerThreshold, upperThreshold);
-   vm->setVoxelMatrixMininum(minX1, minX2, minX3);
-   vm->setVoxelMatrixDelta(deltaX1, deltaX2, deltaX3);
-   return vm;
+    GbVoxelMatrix3D *vm = new GbVoxelMatrix3D(voxelMatrix, lowerThreshold, upperThreshold);
+    vm->setVoxelMatrixMininum(minX1, minX2, minX3);
+    vm->setVoxelMatrixDelta(deltaX1, deltaX2, deltaX3);
+    return vm;
 }
 /*=======================================================*/
-void GbVoxelMatrix3D::setCenterCoordinates(const double& x1, const double& x2, const double& x3)
+void GbVoxelMatrix3D::setCenterCoordinates(const double &x1, const double &x2, const double &x3)
 {
-   this->translate(x1-getX1Centroid(), x2-getX2Centroid(), x3-getX3Centroid());
+    this->translate(x1 - getX1Centroid(), x2 - getX2Centroid(), x3 - getX3Centroid());
 }
 /*=======================================================*/
-void GbVoxelMatrix3D::translate(const double& tx1, const double& tx2, const double& tx3)
+void GbVoxelMatrix3D::translate(const double &tx1, const double &tx2, const double &tx3)
 {
-   this->minX1 += tx1;
-   this->minX2 += tx2;
-   this->minX3 += tx3;
-   this->notifyObserversObjectChanged();
+    this->minX1 += tx1;
+    this->minX2 += tx2;
+    this->minX3 += tx3;
+    this->notifyObserversObjectChanged();
 }
 /*=======================================================*/
 void GbVoxelMatrix3D::setClosedVoidSpaceToSolid()
 {
-   voxelMatrixTemp = Matrix3D(nodesX1, nodesX2, nodesX3, SOLID);
-   flagMatrix = CbArray3D<char>(nodesX1, nodesX2, nodesX3, 0);
-
-   for (int x3 = 0; x3<nodesX3; x3++)
-   {
-      for (int x2 = 0; x2<nodesX2; x2++)
-      {
-         for (int x1 = 0; x1<nodesX1; x1++)
-         {
-            if (voxelMatrix(x1, x2, x3)==FLUID)
-            {
-               UBLOG(logINFO, "setClosedVoidSpaceToSolid:start");
-               x1Nbr.push_back(x1);
-               x2Nbr.push_back(x2);
-               x3Nbr.push_back(x3);
-               int size = (int)x1Nbr.size();
-               while (size>0)
-               {
-                  for (int i = 0; i<size; i++)
-                  {
-                     findFluidNeighbor(x1Nbr[i], x2Nbr[i], x3Nbr[i]);
-                  }
-
-                  swap(x1Nbr, x1NbrTemp);
-                  swap(x2Nbr, x2NbrTemp);
-                  swap(x3Nbr, x3NbrTemp);
-
-                  x1NbrTemp.clear();
-                  x2NbrTemp.clear();
-                  x3NbrTemp.clear();
-                  size = (int)x1Nbr.size();
-               }
-               UBLOG(logINFO, "setClosedVoidSpaceToSolid:end");
-               voxelMatrix = voxelMatrixTemp;
-               return;
+    voxelMatrixTemp = Matrix3D(nodesX1, nodesX2, nodesX3, SOLID);
+    flagMatrix      = CbArray3D<char>(nodesX1, nodesX2, nodesX3, 0);
+
+    for (int x3 = 0; x3 < nodesX3; x3++) {
+        for (int x2 = 0; x2 < nodesX2; x2++) {
+            for (int x1 = 0; x1 < nodesX1; x1++) {
+                if (voxelMatrix(x1, x2, x3) == FLUID) {
+                    UBLOG(logINFO, "setClosedVoidSpaceToSolid:start");
+                    x1Nbr.push_back(x1);
+                    x2Nbr.push_back(x2);
+                    x3Nbr.push_back(x3);
+                    int size = (int)x1Nbr.size();
+                    while (size > 0) {
+                        for (int i = 0; i < size; i++) {
+                            findFluidNeighbor(x1Nbr[i], x2Nbr[i], x3Nbr[i]);
+                        }
+
+                        swap(x1Nbr, x1NbrTemp);
+                        swap(x2Nbr, x2NbrTemp);
+                        swap(x3Nbr, x3NbrTemp);
+
+                        x1NbrTemp.clear();
+                        x2NbrTemp.clear();
+                        x3NbrTemp.clear();
+                        size = (int)x1Nbr.size();
+                    }
+                    UBLOG(logINFO, "setClosedVoidSpaceToSolid:end");
+                    voxelMatrix = voxelMatrixTemp;
+                    return;
+                }
             }
-
-         }
-      }
-   }
+        }
+    }
 }
 /*=======================================================*/
 void GbVoxelMatrix3D::findFluidNeighbor(int x1, int x2, int x3)
 {
-   for (int k3 = -1; k3<=1; k3++)
-   {
-      for (int k2 = -1; k2<=1; k2++)
-      {
-         for (int k1 = -1; k1<=1; k1++)
-         {
-            int j1 = x1+k1;
-            int j2 = x2+k2;
-            int j3 = x3+k3;
-            if (j1>=0&&j1<nodesX1 && j2>=0&&j2<nodesX2 && j3>=0&&j3<nodesX3)
-            {
-               if (voxelMatrix(j1, j2, j3)==FLUID)
-               {
-                  if (flagMatrix(j1, j2, j3)==0)
-                  {
-                     voxelMatrixTemp(j1, j2, j3) = FLUID;
-                     flagMatrix(j1, j2, j3) = 1;
-                     x1NbrTemp.push_back(j1);
-                     x2NbrTemp.push_back(j2);
-                     x3NbrTemp.push_back(j3);
-                  }
-               }
+    for (int k3 = -1; k3 <= 1; k3++) {
+        for (int k2 = -1; k2 <= 1; k2++) {
+            for (int k1 = -1; k1 <= 1; k1++) {
+                int j1 = x1 + k1;
+                int j2 = x2 + k2;
+                int j3 = x3 + k3;
+                if (j1 >= 0 && j1 < nodesX1 && j2 >= 0 && j2 < nodesX2 && j3 >= 0 && j3 < nodesX3) {
+                    if (voxelMatrix(j1, j2, j3) == FLUID) {
+                        if (flagMatrix(j1, j2, j3) == 0) {
+                            voxelMatrixTemp(j1, j2, j3) = FLUID;
+                            flagMatrix(j1, j2, j3)      = 1;
+                            x1NbrTemp.push_back(j1);
+                            x2NbrTemp.push_back(j2);
+                            x3NbrTemp.push_back(j3);
+                        }
+                    }
+                }
             }
-         }
-      }
-   }
+        }
+    }
 }
 /*=======================================================*/
 void GbVoxelMatrix3D::calculateNumberOfSolidAndFluid()
 {
-   numberOfSolid = 0;
-
-   for (int x3 = 0; x3<nodesX3; x3++)
-      for (int x2 = 0; x2<nodesX2; x2++)
-         for (int x1 = 0; x1<nodesX1; x1++)
-         {
-            if (voxelMatrix(x1, x2, x3)==GbVoxelMatrix3D::SOLID)
-            {
-               numberOfSolid++;
+    numberOfSolid = 0;
+
+    for (int x3 = 0; x3 < nodesX3; x3++)
+        for (int x2 = 0; x2 < nodesX2; x2++)
+            for (int x1 = 0; x1 < nodesX1; x1++) {
+                if (voxelMatrix(x1, x2, x3) == GbVoxelMatrix3D::SOLID) {
+                    numberOfSolid++;
+                }
             }
-         }
 
-   numberOfFluid = (long)nodesX1*(long)nodesX2*(long)nodesX3-numberOfSolid;
+    numberOfFluid = (long)nodesX1 * (long)nodesX2 * (long)nodesX3 - numberOfSolid;
 }
 /*=======================================================*/
-long GbVoxelMatrix3D::getNumberOfSolid()
-{
-   return numberOfSolid;
-}
+long GbVoxelMatrix3D::getNumberOfSolid() { return numberOfSolid; }
 /*=======================================================*/
-long GbVoxelMatrix3D::getNumberOfFluid()
-{
-   return numberOfFluid;
-}
+long GbVoxelMatrix3D::getNumberOfFluid() { return numberOfFluid; }
 /*=======================================================*/
-double GbVoxelMatrix3D::getIntersectionRaytraceFactor(const double& x1, const double& x2, const double& x3, const double& rx1, const double& rx2, const double& rx3)
-{
-   if (!((UbMath::equal(rx1, 0.0)||UbMath::equal(fabs(rx1), 1.0)||UbMath::equal(fabs(rx1), UbMath::one_over_sqrt2)||UbMath::equal(fabs(rx1), UbMath::one_over_sqrt3))
-      &&(UbMath::equal(rx2, 0.0)||UbMath::equal(fabs(rx2), 1.0)||UbMath::equal(fabs(rx2), UbMath::one_over_sqrt2)||UbMath::equal(fabs(rx2), UbMath::one_over_sqrt3))
-      &&(UbMath::equal(rx3, 0.0)||UbMath::equal(fabs(rx3), 1.0)||UbMath::equal(fabs(rx3), UbMath::one_over_sqrt2)||UbMath::equal(fabs(rx3), UbMath::one_over_sqrt3))))
-   {
-      throw UbException(UB_EXARGS, "nur fuer diskrete Boltzmannrichungen implementiert!!!");
-   }
-
-   //nachbarindex ermitteln
-   int ndx1 = 0, ndx2 = 0, ndx3 = 0;
-   if (UbMath::greater(rx1, 0.0)) ndx1 = 1;
-   else if (UbMath::less(rx1, 0.0)) ndx1 = -1;
-   if (UbMath::greater(rx2, 0.0)) ndx2 = 1;
-   else if (UbMath::less(rx2, 0.0)) ndx2 = -1;
-   if (UbMath::greater(rx3, 0.0)) ndx3 = 1;
-   else if (UbMath::less(rx3, 0.0)) ndx3 = -1;
-
-   int nix1 = UbMath::integerRounding((x1-minX1)/deltaX1)+ndx1;
-   int nix2 = UbMath::integerRounding((x2-minX2)/deltaX2)+ndx2;
-   int nix3 = UbMath::integerRounding((x3-minX3)/deltaX3)+ndx3;
-
-   //test ob nachbar solid
-   if (nix1>=0
-      &&nix2>=0
-      &&nix3>=0
-      &&nix1<voxelMatrix.getNX1()
-      &&nix2<voxelMatrix.getNX2()
-      &&nix3<voxelMatrix.getNX3())
-   {
-      if (UbMath::equal(voxelMatrix(nix1, nix2, nix3), SOLID))
-      {
-         //return halber abstand der beiden knoten
-         return 0.5*sqrt((ndx1*deltaX1)*(ndx1*deltaX1)
-            +(ndx2*deltaX2)*(ndx2*deltaX2)
-            +(ndx3*deltaX3)*(ndx3*deltaX3));
-      }
-   }
-
-   return 0.0;
+double GbVoxelMatrix3D::getIntersectionRaytraceFactor(const double &x1, const double &x2, const double &x3,
+                                                      const double &rx1, const double &rx2, const double &rx3)
+{
+    if (!((UbMath::equal(rx1, 0.0) || UbMath::equal(fabs(rx1), 1.0) ||
+           UbMath::equal(fabs(rx1), UbMath::one_over_sqrt2) || UbMath::equal(fabs(rx1), UbMath::one_over_sqrt3)) &&
+          (UbMath::equal(rx2, 0.0) || UbMath::equal(fabs(rx2), 1.0) ||
+           UbMath::equal(fabs(rx2), UbMath::one_over_sqrt2) || UbMath::equal(fabs(rx2), UbMath::one_over_sqrt3)) &&
+          (UbMath::equal(rx3, 0.0) || UbMath::equal(fabs(rx3), 1.0) ||
+           UbMath::equal(fabs(rx3), UbMath::one_over_sqrt2) || UbMath::equal(fabs(rx3), UbMath::one_over_sqrt3)))) {
+        throw UbException(UB_EXARGS, "nur fuer diskrete Boltzmannrichungen implementiert!!!");
+    }
+
+    // nachbarindex ermitteln
+    int ndx1 = 0, ndx2 = 0, ndx3 = 0;
+    if (UbMath::greater(rx1, 0.0))
+        ndx1 = 1;
+    else if (UbMath::less(rx1, 0.0))
+        ndx1 = -1;
+    if (UbMath::greater(rx2, 0.0))
+        ndx2 = 1;
+    else if (UbMath::less(rx2, 0.0))
+        ndx2 = -1;
+    if (UbMath::greater(rx3, 0.0))
+        ndx3 = 1;
+    else if (UbMath::less(rx3, 0.0))
+        ndx3 = -1;
+
+    int nix1 = UbMath::integerRounding((x1 - minX1) / deltaX1) + ndx1;
+    int nix2 = UbMath::integerRounding((x2 - minX2) / deltaX2) + ndx2;
+    int nix3 = UbMath::integerRounding((x3 - minX3) / deltaX3) + ndx3;
+
+    // test ob nachbar solid
+    if (nix1 >= 0 && nix2 >= 0 && nix3 >= 0 && nix1 < voxelMatrix.getNX1() && nix2 < voxelMatrix.getNX2() &&
+        nix3 < voxelMatrix.getNX3()) {
+        if (UbMath::equal(voxelMatrix(nix1, nix2, nix3), SOLID)) {
+            // return halber abstand der beiden knoten
+            return 0.5 * sqrt((ndx1 * deltaX1) * (ndx1 * deltaX1) + (ndx2 * deltaX2) * (ndx2 * deltaX2) +
+                              (ndx3 * deltaX3) * (ndx3 * deltaX3));
+        }
+    }
+
+    return 0.0;
 }
 /*=======================================================*/
-bool GbVoxelMatrix3D::isPointInGbObject3D(const double& x1p, const double& x2p, const double& x3p)
+bool GbVoxelMatrix3D::isPointInGbObject3D(const double &x1p, const double &x2p, const double &x3p)
 {
-   //index ermitteln
-   int ix1 = UbMath::integerRounding((x1p-minX1)/deltaX1);
-   int ix2 = UbMath::integerRounding((x2p-minX2)/deltaX2);
-   int ix3 = UbMath::integerRounding((x3p-minX3)/deltaX3);
-
-   if (ix1>=0
-      &&ix2>=0
-      &&ix3>=0
-      &&ix1<voxelMatrix.getNX1()
-      &&ix2<voxelMatrix.getNX2()
-      &&ix3<voxelMatrix.getNX3())
-   {
-      if (UbMath::equal(voxelMatrix(ix1, ix2, ix3), SOLID)) return true;
-   }
-
-   return false;
+    // index ermitteln
+    int ix1 = UbMath::integerRounding((x1p - minX1) / deltaX1);
+    int ix2 = UbMath::integerRounding((x2p - minX2) / deltaX2);
+    int ix3 = UbMath::integerRounding((x3p - minX3) / deltaX3);
+
+    if (ix1 >= 0 && ix2 >= 0 && ix3 >= 0 && ix1 < voxelMatrix.getNX1() && ix2 < voxelMatrix.getNX2() &&
+        ix3 < voxelMatrix.getNX3()) {
+        if (UbMath::equal(voxelMatrix(ix1, ix2, ix3), SOLID))
+            return true;
+    }
+
+    return false;
 }
 /*=======================================================*/
-bool GbVoxelMatrix3D::isPointInGbObject3D(const double& x1p, const double& x2p, const double& x3p, bool& pointIsOnBoundary)
+bool GbVoxelMatrix3D::isPointInGbObject3D(const double &x1p, const double &x2p, const double &x3p,
+                                          bool &pointIsOnBoundary)
 {
-   pointIsOnBoundary = false;
+    pointIsOnBoundary = false;
 
-   return isPointInGbObject3D(x1p, x2p, x3p);
+    return isPointInGbObject3D(x1p, x2p, x3p);
 }
 /*=======================================================*/
-bool GbVoxelMatrix3D::isCellInsideGbObject3D(const double&  /*x1p1*/, const double&  /*x2p1*/, const double&  /*x3p1*/, const double&  /*x1p2*/, const double&  /*x2p2*/, const double&  /*x3p2*/)
+bool GbVoxelMatrix3D::isCellInsideGbObject3D(const double & /*x1p1*/, const double & /*x2p1*/, const double & /*x3p1*/,
+                                             const double & /*x1p2*/, const double & /*x2p2*/, const double & /*x3p2*/)
 {
-   return false;
-   //FIXME: unreachable cide
-   ////dass haengt von der Konfigration ab, aber meist ist der Block groesser wie etliche Poren ...
-
-   //   //indizes ermitteln
-   //int startix1 = (int)std::floor((x1p1-minX1)/deltaX1+1E-13);
-   //int startix2 = (int)std::floor((x2p1-minX2)/deltaX2+1E-13);
-   //int startix3 = (int)std::floor((x3p1-minX3)/deltaX3+1E-13);
-
-   //if (startix1<0) return false;
-   //if (startix2<0) return false;
-   //if (startix3<0) return false;
-
-   //int maxiX1 = (int)voxelMatrix.getNX1()-1;
-   //int maxiX2 = (int)voxelMatrix.getNX2()-1;
-   //int maxiX3 = (int)voxelMatrix.getNX3()-1;
-
-   //int endix1 = (int)std::ceil((x1p2-minX1)/deltaX1-1E-13);
-   //int endix2 = (int)std::ceil((x2p2-minX2)/deltaX2-1E-13);
-   //int endix3 = (int)std::ceil((x3p2-minX3)/deltaX3-1E-13);
-
-   //if (endix1>maxiX1) return false;
-   //if (endix2>maxiX2) return false;
-   //if (endix3>maxiX3) return false;
-
-   //for (int ix3 = startix3; ix3<=endix3; ix3++)
-   //   for (int ix2 = startix2; ix2<=endix2; ix2++)
-   //      for (int ix1 = startix1; ix1<=endix1; ix1++)
-   //         if (UbMath::equal(voxelMatrix(ix1, ix2, ix3), FLUID))
-   //            return false;
-   //return true;
+    return false;
+    // FIXME: unreachable cide
+    ////dass haengt von der Konfigration ab, aber meist ist der Block groesser wie etliche Poren ...
+
+    //   //indizes ermitteln
+    // int startix1 = (int)std::floor((x1p1-minX1)/deltaX1+1E-13);
+    // int startix2 = (int)std::floor((x2p1-minX2)/deltaX2+1E-13);
+    // int startix3 = (int)std::floor((x3p1-minX3)/deltaX3+1E-13);
+
+    // if (startix1<0) return false;
+    // if (startix2<0) return false;
+    // if (startix3<0) return false;
+
+    // int maxiX1 = (int)voxelMatrix.getNX1()-1;
+    // int maxiX2 = (int)voxelMatrix.getNX2()-1;
+    // int maxiX3 = (int)voxelMatrix.getNX3()-1;
+
+    // int endix1 = (int)std::ceil((x1p2-minX1)/deltaX1-1E-13);
+    // int endix2 = (int)std::ceil((x2p2-minX2)/deltaX2-1E-13);
+    // int endix3 = (int)std::ceil((x3p2-minX3)/deltaX3-1E-13);
+
+    // if (endix1>maxiX1) return false;
+    // if (endix2>maxiX2) return false;
+    // if (endix3>maxiX3) return false;
+
+    // for (int ix3 = startix3; ix3<=endix3; ix3++)
+    //   for (int ix2 = startix2; ix2<=endix2; ix2++)
+    //      for (int ix1 = startix1; ix1<=endix1; ix1++)
+    //         if (UbMath::equal(voxelMatrix(ix1, ix2, ix3), FLUID))
+    //            return false;
+    // return true;
 }
 /*=======================================================*/
-bool GbVoxelMatrix3D::isCellCuttingGbObject3D(const double& x1a, const double& x2a, const double& x3a, const double& x1b, const double& x2b, const double& x3b)
-//Merksatz: cell oder deren Volumen schneidet oder beinhaltet komplette oder Teile der CuboidUmrandung
-//returns true:
+bool GbVoxelMatrix3D::isCellCuttingGbObject3D(const double &x1a, const double &x2a, const double &x3a,
+                                              const double &x1b, const double &x2b, const double &x3b)
+// Merksatz: cell oder deren Volumen schneidet oder beinhaltet komplette oder Teile der CuboidUmrandung
+// returns true:
 //  - cell cuts  GbVoxelMatrix3D
 //  - cell boxes GbVoxelMatrix3D
-//returns false:
-//  - cell completely inside GbVoxelMatrix3D 
+// returns false:
+//  - cell completely inside GbVoxelMatrix3D
 //  - cell und cuboid3D haben kein gemeinsames Volumen
 {
-   //erstmal die dumm Loesung
-   if (!(this->isCellInsideGbObject3D(x1a, x2a, x3a, x1b, x2b, x3b))
-      &&this->isCellInsideOrCuttingGbObject3D(x1a, x2a, x3a, x1b, x2b, x3b))
-   {
-      return true;
-   }
-
-   return false;
+    // erstmal die dumm Loesung
+    if (!(this->isCellInsideGbObject3D(x1a, x2a, x3a, x1b, x2b, x3b)) &&
+        this->isCellInsideOrCuttingGbObject3D(x1a, x2a, x3a, x1b, x2b, x3b)) {
+        return true;
+    }
+
+    return false;
 }
 /*=======================================================*/
-bool GbVoxelMatrix3D::isCellInsideOrCuttingGbObject3D(const double& x1a, const double& x2a, const double& x3a, const double& x1b, const double& x2b, const double& x3b)
-//returns true:
+bool GbVoxelMatrix3D::isCellInsideOrCuttingGbObject3D(const double &x1a, const double &x2a, const double &x3a,
+                                                      const double &x1b, const double &x2b, const double &x3b)
+// returns true:
 //  - cell completely inside cuboid3D ( = cuboid3D boxes cell)
 //  - cell cuts  cuboid3D
 //  - cell boxes cuboid3D
-//returns false:
+// returns false:
 //  - cell und cuboid3D haben kein gemeinsames Volumen
 {
-   //simpler check, da unser GbCuboid3D ein AABB is:
-  //  anfA        midA         endA             anfB    midB    endB
-  //   |            x<-- dxA -->|                 |<-dxB->x       |
-  //                |<----------------- T --------------->|
-  //ist |T| <= dxA + dxB -> overlap!
+    // simpler check, da unser GbCuboid3D ein AABB is:
+    //  anfA        midA         endA             anfB    midB    endB
+    //   |            x<-- dxA -->|                 |<-dxB->x       |
+    //                |<----------------- T --------------->|
+    // ist |T| <= dxA + dxB -> overlap!
 
-   if (UbMath::lessEqual(std::fabs(this->getX1Centroid()-0.5*(x1b+x1a)      /*Tx1*/)
-      , 0.5*(this->getLengthX1()+std::fabs(x1b-x1a) /*dx1A+dx1B*/))
+    if (UbMath::lessEqual(std::fabs(this->getX1Centroid() - 0.5 * (x1b + x1a) /*Tx1*/),
+                          0.5 * (this->getLengthX1() + std::fabs(x1b - x1a) /*dx1A+dx1B*/))
 
-      &&UbMath::lessEqual(std::fabs(this->getX2Centroid()-0.5*(x2b+x2a)      /*Tx2*/)
-         , 0.5*(this->getLengthX2()+std::fabs(x2b-x2a) /*dx2A+dx2B*/))
+        && UbMath::lessEqual(std::fabs(this->getX2Centroid() - 0.5 * (x2b + x2a) /*Tx2*/),
+                             0.5 * (this->getLengthX2() + std::fabs(x2b - x2a) /*dx2A+dx2B*/))
 
-      &&UbMath::lessEqual(std::fabs(this->getX3Centroid()-0.5*(x3b+x3a)      /*Tx3*/)
-         , 0.5*(this->getLengthX3()+std::fabs(x3b-x3a) /*dx3A+dx3B*/)))
-   {
-      return true;
-   }
+        && UbMath::lessEqual(std::fabs(this->getX3Centroid() - 0.5 * (x3b + x3a) /*Tx3*/),
+                             0.5 * (this->getLengthX3() + std::fabs(x3b - x3a) /*dx3A+dx3B*/))) {
+        return true;
+    }
 
-   return false;
+    return false;
 }
 /*=======================================================*/
-vector<GbTriangle3D*> GbVoxelMatrix3D::getSurfaceTriangleSet()
+vector<GbTriangle3D *> GbVoxelMatrix3D::getSurfaceTriangleSet()
 {
-   vector<GbTriangle3D*> triangles;
+    vector<GbTriangle3D *> triangles;
 
 #ifdef MC_CUBES
-   //MC
-   typedef McCubes::Matrix3DWrapper< Matrix3D >                McMatrixWrapper;
-   typedef McCubes::MarchingCubes< McMatrixWrapper >           McMarchingCubesGenerator;
-   typedef McMarchingCubesGenerator::Vertex                    McVertex;
-   typedef McMarchingCubesGenerator::Triangle                  McTriangle;
-
-   McMatrixWrapper wrapper(&voxelMatrix);//,0,0,0,voxelMatrix.getNX1()-1,voxelMatrix.getNX2()-1,voxelMatrix.getNX3()-1);
-   McMarchingCubesGenerator mc(wrapper);
-
-   mc.init_all();
-   mc.run(0.5);
-
-   //const int   nofVertices  = mc.nverts();
-   const int   nofTriangles = mc.ntrigs();
-
-   McVertex*   mcvertices = mc.vertices();
-   McTriangle* mctriangles = mc.triangles();
-
-   for (int t = 0; t<nofTriangles; t++)
-   {
-      triangles.push_back(new GbTriangle3D(new GbPoint3D(minX1+deltaX1 * (mcvertices[mctriangles[t].v1].x /*-1*/)
-         , minX2+deltaX2 * (mcvertices[mctriangles[t].v1].y /*-1*/)
-         , minX3+deltaX3 * (mcvertices[mctriangles[t].v1].z /*-1*/))
-         , new GbPoint3D(minX1+deltaX1 * (mcvertices[mctriangles[t].v2].x /*-1*/)
-            , minX2+deltaX2 * (mcvertices[mctriangles[t].v2].y /*-1*/)
-            , minX3+deltaX3 * (mcvertices[mctriangles[t].v2].z /*-1*/))
-         , new GbPoint3D(minX1+deltaX1 * (mcvertices[mctriangles[t].v3].x /*-1*/)
-            , minX2+deltaX2 * (mcvertices[mctriangles[t].v3].y /*-1*/)
-            , minX3+deltaX3 * (mcvertices[mctriangles[t].v3].z /*-1*/))));
-   }
+    // MC
+    typedef McCubes::Matrix3DWrapper<Matrix3D> McMatrixWrapper;
+    typedef McCubes::MarchingCubes<McMatrixWrapper> McMarchingCubesGenerator;
+    typedef McMarchingCubesGenerator::Vertex McVertex;
+    typedef McMarchingCubesGenerator::Triangle McTriangle;
+
+    McMatrixWrapper wrapper(
+        &voxelMatrix); //,0,0,0,voxelMatrix.getNX1()-1,voxelMatrix.getNX2()-1,voxelMatrix.getNX3()-1);
+    McMarchingCubesGenerator mc(wrapper);
+
+    mc.init_all();
+    mc.run(0.5);
+
+    // const int   nofVertices  = mc.nverts();
+    const int nofTriangles = mc.ntrigs();
+
+    McVertex *mcvertices    = mc.vertices();
+    McTriangle *mctriangles = mc.triangles();
+
+    for (int t = 0; t < nofTriangles; t++) {
+        triangles.push_back(
+            new GbTriangle3D(new GbPoint3D(minX1 + deltaX1 * (mcvertices[mctriangles[t].v1].x /*-1*/),
+                                           minX2 + deltaX2 * (mcvertices[mctriangles[t].v1].y /*-1*/),
+                                           minX3 + deltaX3 * (mcvertices[mctriangles[t].v1].z /*-1*/)),
+                             new GbPoint3D(minX1 + deltaX1 * (mcvertices[mctriangles[t].v2].x /*-1*/),
+                                           minX2 + deltaX2 * (mcvertices[mctriangles[t].v2].y /*-1*/),
+                                           minX3 + deltaX3 * (mcvertices[mctriangles[t].v2].z /*-1*/)),
+                             new GbPoint3D(minX1 + deltaX1 * (mcvertices[mctriangles[t].v3].x /*-1*/),
+                                           minX2 + deltaX2 * (mcvertices[mctriangles[t].v3].y /*-1*/),
+                                           minX3 + deltaX3 * (mcvertices[mctriangles[t].v3].z /*-1*/))));
+    }
 #else
-   cerr<<"vector<GbTriangle3D*> GbVoxelMatrix3D::getSurfaceTriangleSet() - benoetigt MARCHING_CUBE paket aus 3rdParty"<<endl;
+    cerr
+        << "vector<GbTriangle3D*> GbVoxelMatrix3D::getSurfaceTriangleSet() - benoetigt MARCHING_CUBE paket aus 3rdParty"
+        << endl;
 #endif // MC_CUBES
 
-   return triangles;
+    return triangles;
 }
 /*=======================================================*/
-void GbVoxelMatrix3D::addSurfaceTriangleSet(vector<UbTupleFloat3>&  /*nodes*/, vector<UbTupleInt3>&  /*triangles*/)
+void GbVoxelMatrix3D::addSurfaceTriangleSet(vector<UbTupleFloat3> & /*nodes*/, vector<UbTupleInt3> & /*triangles*/)
 {
-   UBLOG(logINFO, " GbVoxelMatrix3D addSurfaceTriangleSet start")
-      if (!this->addSurfaceTriangleSetFlag)
-      {
-         UBLOG(logINFO, " GbVoxelMatrix3D addSurfaceTriangleSet end without TriangleSetCreation")
-            return;
-      }
+    UBLOG(logINFO, " GbVoxelMatrix3D addSurfaceTriangleSet start")
+    if (!this->addSurfaceTriangleSetFlag) {
+        UBLOG(logINFO, " GbVoxelMatrix3D addSurfaceTriangleSet end without TriangleSetCreation")
+        return;
+    }
 #ifdef MC_CUBES
-   UBLOG(logDEBUG1, " GbVoxelMatrix3D addSurfaceTriangleSet MC defined")
-
-      typedef McCubes::Matrix3DWrapper< Matrix3D >                McMatrixWrapper;
-   typedef McCubes::MarchingCubes< McMatrixWrapper >           McMarchingCubesGenerator;
-   typedef McMarchingCubesGenerator::Vertex                    McVertex;
-   typedef McMarchingCubesGenerator::Triangle                  McTriangle;
-
-   //MC
-   {  //standard( fuer voxelmatrix)
-      McMatrixWrapper wrapper(&voxelMatrix);
-      McMarchingCubesGenerator mc(wrapper);
-
-      UBLOG(logDEBUG1, " GbVoxelMatrix3D addSurfaceTriangleSet McMarchingCubesGenerator")
-
-         UBLOG(logDEBUG1, " GbVoxelMatrix3D addSurfaceTriangleSet mc.init")
-         mc.init_all();
-      UBLOG(logDEBUG1, " GbVoxelMatrix3D addSurfaceTriangleSet mc.run")
-         mc.run(0.5);
-      UBLOG(logDEBUG1, " GbVoxelMatrix3D addSurfaceTriangleSet mc.run done")
-
-         const int   nofVertices = mc.nverts();
-      const int   nofTriangles = mc.ntrigs();
-
-      McVertex*   mcvertices = mc.vertices();
-      McTriangle* mctriangles = mc.triangles();
-
-      UBLOG(logDEBUG1, " GbVoxelMatrix3D node tuple")
-         for (int n = 0; n<nofVertices; n++)
-            nodes.push_back(makeUbTuple((float)(minX1+deltaX1 * (mcvertices[n].x /*-1*/)),   //Anm: kein -1, da man durch manipulation der indices die dreiecke um eins versetzt bekommt
-            (float)(minX2+deltaX2 * (mcvertices[n].y /*-1*/)),
-               (float)(minX3+deltaX3 * (mcvertices[n].z /*-1*/))));
-      UBLOG(logDEBUG1, " GbVoxelMatrix3D triangles tuple")
-         for (int t = 0; t<nofTriangles; t++)
+    UBLOG(logDEBUG1, " GbVoxelMatrix3D addSurfaceTriangleSet MC defined")
+
+    typedef McCubes::Matrix3DWrapper<Matrix3D> McMatrixWrapper;
+    typedef McCubes::MarchingCubes<McMatrixWrapper> McMarchingCubesGenerator;
+    typedef McMarchingCubesGenerator::Vertex McVertex;
+    typedef McMarchingCubesGenerator::Triangle McTriangle;
+
+    // MC
+    { // standard( fuer voxelmatrix)
+        McMatrixWrapper wrapper(&voxelMatrix);
+        McMarchingCubesGenerator mc(wrapper);
+
+        UBLOG(logDEBUG1, " GbVoxelMatrix3D addSurfaceTriangleSet McMarchingCubesGenerator")
+
+        UBLOG(logDEBUG1, " GbVoxelMatrix3D addSurfaceTriangleSet mc.init")
+        mc.init_all();
+        UBLOG(logDEBUG1, " GbVoxelMatrix3D addSurfaceTriangleSet mc.run")
+        mc.run(0.5);
+        UBLOG(logDEBUG1, " GbVoxelMatrix3D addSurfaceTriangleSet mc.run done")
+
+        const int nofVertices  = mc.nverts();
+        const int nofTriangles = mc.ntrigs();
+
+        McVertex *mcvertices    = mc.vertices();
+        McTriangle *mctriangles = mc.triangles();
+
+        UBLOG(logDEBUG1, " GbVoxelMatrix3D node tuple")
+        for (int n = 0; n < nofVertices; n++)
+            nodes.push_back(makeUbTuple(
+                (float)(minX1 + deltaX1 * (mcvertices[n].x /*-1*/)), // Anm: kein -1, da man durch manipulation der
+                                                                     // indices die dreiecke um eins versetzt bekommt
+                (float)(minX2 + deltaX2 * (mcvertices[n].y /*-1*/)),
+                (float)(minX3 + deltaX3 * (mcvertices[n].z /*-1*/))));
+        UBLOG(logDEBUG1, " GbVoxelMatrix3D triangles tuple")
+        for (int t = 0; t < nofTriangles; t++)
             triangles.push_back(makeUbTuple(mctriangles[t].v1, mctriangles[t].v2, mctriangles[t].v3));
-      UBLOG(logDEBUG1, " GbVoxelMatrix3D triangles tuple done")
-   }
-
-   //false - das scheint probleme bei der asphaltprobe zu machen 1500x600x100
-   // da lief es bis C - evtl. memory voll
-   if (false)  //extension... um die raender koerrekt abzubilden muesste man eine dummy FLUID reihe um 
-   {         //die matrix legen( lsg1: temp matrix mit 2 reihen pro richtung mehr -> zuviel speicher, 500^3 = 500MB
-             // lsg2: fuer jede flaeche eine dummy matrix -> wie folgt:
-      int nx1 = (int)voxelMatrix.getNX1();
-      int nx2 = (int)voxelMatrix.getNX2();
-      int nx3 = (int)voxelMatrix.getNX3();
-      UBLOG(logINFO, " A ")
-         Matrix3D tmpX1Min(2, nx2+2, nx3+2, FLUID);
-      Matrix3D tmpX1Max(2, nx2+2, nx3+2, FLUID);
-      for (int x3 = 0; x3<nx3; x3++)
-         for (int x2 = 0; x2<nx2; x2++)
-         {
-            tmpX1Min(1, x2+1, x3+1) = voxelMatrix(0, x2, x3);
-            tmpX1Max(0, x2+1, x3+1) = voxelMatrix(nx1-1, x2, x3);
-         }
-      UBLOG(logINFO, " B")
-         Matrix3D tmpX2Min(nx1+2, 2, nx3+2, FLUID);
-      Matrix3D tmpX2Max(nx1+2, 2, nx3+2, FLUID);
-      for (int x3 = 0; x3<nx3; x3++)
-         for (int x1 = 0; x1<nx1; x1++)
-         {
-            tmpX2Min(x1+1, 1, x3+1) = voxelMatrix(x1, 0, x3);
-            tmpX2Max(x1+1, 0, x3+1) = voxelMatrix(x1, nx2-1, x3);
-         }
-      UBLOG(logINFO, " C ")
-         Matrix3D tmpX3Min(nx1+2, nx3+2, 2, FLUID);
-      Matrix3D tmpX3Max(nx1+2, nx3+2, 2, FLUID);
-      for (int x2 = 0; x2<nx2; x2++)
-         for (int x1 = 0; x1<nx1; x1++)
-         {
-            tmpX3Min(x1+1, x2+1, 1) = voxelMatrix(x1, x2, 0);
-            tmpX3Max(x1+1, x2+1, 0) = voxelMatrix(x1, x2, nx3-1);
-         }
-      UBLOG(logINFO, " D")
-         Matrix3D* matrices[] = { &tmpX1Min, &tmpX1Max, &tmpX2Min, &tmpX2Max, &tmpX3Min, &tmpX3Max };
-      int            dx1[] = { -1,     nx1-1,        -1,        -1,        -1,        -1 };
-      int            dx2[] = { -1,        -1,        -1,     nx2-1,        -1,        -1 };
-      int            dx3[] = { -1,        -1,        -1,        -1,        -1,     nx3-1 };
-      UBLOG(logINFO, " E")
-         for (int i = 0; i<6; i++)
-         {
+        UBLOG(logDEBUG1, " GbVoxelMatrix3D triangles tuple done")
+    }
+
+    // false - das scheint probleme bei der asphaltprobe zu machen 1500x600x100
+    // da lief es bis C - evtl. memory voll
+    if (false) // extension... um die raender koerrekt abzubilden muesste man eine dummy FLUID reihe um
+    {          // die matrix legen( lsg1: temp matrix mit 2 reihen pro richtung mehr -> zuviel speicher, 500^3 = 500MB
+      // lsg2: fuer jede flaeche eine dummy matrix -> wie folgt:
+        int nx1 = (int)voxelMatrix.getNX1();
+        int nx2 = (int)voxelMatrix.getNX2();
+        int nx3 = (int)voxelMatrix.getNX3();
+        UBLOG(logINFO, " A ")
+        Matrix3D tmpX1Min(2, nx2 + 2, nx3 + 2, FLUID);
+        Matrix3D tmpX1Max(2, nx2 + 2, nx3 + 2, FLUID);
+        for (int x3 = 0; x3 < nx3; x3++)
+            for (int x2 = 0; x2 < nx2; x2++) {
+                tmpX1Min(1, x2 + 1, x3 + 1) = voxelMatrix(0, x2, x3);
+                tmpX1Max(0, x2 + 1, x3 + 1) = voxelMatrix(nx1 - 1, x2, x3);
+            }
+        UBLOG(logINFO, " B")
+        Matrix3D tmpX2Min(nx1 + 2, 2, nx3 + 2, FLUID);
+        Matrix3D tmpX2Max(nx1 + 2, 2, nx3 + 2, FLUID);
+        for (int x3 = 0; x3 < nx3; x3++)
+            for (int x1 = 0; x1 < nx1; x1++) {
+                tmpX2Min(x1 + 1, 1, x3 + 1) = voxelMatrix(x1, 0, x3);
+                tmpX2Max(x1 + 1, 0, x3 + 1) = voxelMatrix(x1, nx2 - 1, x3);
+            }
+        UBLOG(logINFO, " C ")
+        Matrix3D tmpX3Min(nx1 + 2, nx3 + 2, 2, FLUID);
+        Matrix3D tmpX3Max(nx1 + 2, nx3 + 2, 2, FLUID);
+        for (int x2 = 0; x2 < nx2; x2++)
+            for (int x1 = 0; x1 < nx1; x1++) {
+                tmpX3Min(x1 + 1, x2 + 1, 1) = voxelMatrix(x1, x2, 0);
+                tmpX3Max(x1 + 1, x2 + 1, 0) = voxelMatrix(x1, x2, nx3 - 1);
+            }
+        UBLOG(logINFO, " D")
+        Matrix3D *matrices[] = { &tmpX1Min, &tmpX1Max, &tmpX2Min, &tmpX2Max, &tmpX3Min, &tmpX3Max };
+        int dx1[]            = { -1, nx1 - 1, -1, -1, -1, -1 };
+        int dx2[]            = { -1, -1, -1, nx2 - 1, -1, -1 };
+        int dx3[]            = { -1, -1, -1, -1, -1, nx3 - 1 };
+        UBLOG(logINFO, " E")
+        for (int i = 0; i < 6; i++) {
             McMatrixWrapper wrapper(matrices[i]);
             McMarchingCubesGenerator mc(wrapper);
 
             mc.init_all();
             mc.run(0.5);
 
-            McVertex*   mcvertices = mc.vertices();
-            McTriangle* mctriangles = mc.triangles();
+            McVertex *mcvertices    = mc.vertices();
+            McTriangle *mctriangles = mc.triangles();
 
             int deltaNodeNr = (int)nodes.size();
             UBLOG(logINFO, " GbVoxelMatrix3D node tuple")
-               for (int n = 0; n<mc.nverts(); n++)
-                  nodes.push_back(makeUbTuple((float)(minX1+deltaX1 * (mcvertices[n].x+dx1[i])),   //Anm: kein -1, da man durch manipulation der indices die dreiecke um eins versetzt bekommt
-                  (float)(minX2+deltaX2 * (mcvertices[n].y+dx2[i])),
-                     (float)(minX3+deltaX3 * (mcvertices[n].z+dx3[i]))));
-            for (int t = 0; t<mc.ntrigs(); t++)
-               triangles.push_back(makeUbTuple(deltaNodeNr+mctriangles[t].v1, deltaNodeNr+mctriangles[t].v2, deltaNodeNr+mctriangles[t].v3));
-         }
-   }
+            for (int n = 0; n < mc.nverts(); n++)
+                nodes.push_back(
+                    makeUbTuple((float)(minX1 + deltaX1 * (mcvertices[n].x +
+                                                           dx1[i])), // Anm: kein -1, da man durch manipulation der
+                                                                     // indices die dreiecke um eins versetzt bekommt
+                                (float)(minX2 + deltaX2 * (mcvertices[n].y + dx2[i])),
+                                (float)(minX3 + deltaX3 * (mcvertices[n].z + dx3[i]))));
+            for (int t = 0; t < mc.ntrigs(); t++)
+                triangles.push_back(makeUbTuple(deltaNodeNr + mctriangles[t].v1, deltaNodeNr + mctriangles[t].v2,
+                                                deltaNodeNr + mctriangles[t].v3));
+        }
+    }
 #else
-   cerr<<"void GbVoxelMatrix3D.addSurfaceTriangleSet  - benoetigt MARCHING_CUBE paket aus 3rdParty"<<endl;
+    cerr << "void GbVoxelMatrix3D.addSurfaceTriangleSet  - benoetigt MARCHING_CUBE paket aus 3rdParty" << endl;
 #endif // MC_CUBES
 
-   UBLOG(logINFO, " GbVoxelMatrix3D addSurfaceTriangleSet end")
+    UBLOG(logINFO, " GbVoxelMatrix3D addSurfaceTriangleSet end")
 }
 /*=======================================================*/
-string GbVoxelMatrix3D::toString()
-{
-   return "GbVoxelMatrix3D";
-}
+string GbVoxelMatrix3D::toString() { return "GbVoxelMatrix3D"; }
 /*=======================================================*/
 void GbVoxelMatrix3D::readMatrixFromVtiASCIIFile(std::string filename)
 
 {
-   //UBLOG(logINFO,"  - create GbVoxelMatrix3D");
-   UbFileInputASCII in(filename);
-   //ifstream in(filename.c_str(), ios::binary);
-   if (!in) throw UbException(UB_EXARGS, "could not open file "+filename);
-   in.readLine();
-   in.readLine();
-   in.readLine();
-   in.readLine();
-   in.readLine();
-
-   voxelMatrix = Matrix3D(nodesX1, nodesX2, nodesX3, GbVoxelMatrix3D::FLUID);
-
-   //UBLOG(logINFO,"  - init values");
-   int val;
-   for (int x3 = 0; x3<nodesX3; x3++)
-      for (int x2 = 0; x2<nodesX2; x2++)
-         for (int x1 = 0; x1<nodesX1; x1++)
-         {
-            val = in.readInteger();
-            //if( !UbMath::equal(val, 0.0f) ) 
-            //if( UbMath::greater(val, threshold) ) 
-            if ((double)val>=lowerThreshold&&(double)val<=upperThreshold)
-            {
-               (voxelMatrix)(x1, x2, x3) = GbVoxelMatrix3D::SOLID;
+    // UBLOG(logINFO,"  - create GbVoxelMatrix3D");
+    UbFileInputASCII in(filename);
+    // ifstream in(filename.c_str(), ios::binary);
+    if (!in)
+        throw UbException(UB_EXARGS, "could not open file " + filename);
+    in.readLine();
+    in.readLine();
+    in.readLine();
+    in.readLine();
+    in.readLine();
+
+    voxelMatrix = Matrix3D(nodesX1, nodesX2, nodesX3, GbVoxelMatrix3D::FLUID);
+
+    // UBLOG(logINFO,"  - init values");
+    int val;
+    for (int x3 = 0; x3 < nodesX3; x3++)
+        for (int x2 = 0; x2 < nodesX2; x2++)
+            for (int x1 = 0; x1 < nodesX1; x1++) {
+                val = in.readInteger();
+                // if( !UbMath::equal(val, 0.0f) )
+                // if( UbMath::greater(val, threshold) )
+                if ((double)val >= lowerThreshold && (double)val <= upperThreshold) {
+                    (voxelMatrix)(x1, x2, x3) = GbVoxelMatrix3D::SOLID;
+                }
             }
-         }
-   //UBLOG(logINFO,"  - create GbVoxelMatrix3D done");
+    // UBLOG(logINFO,"  - create GbVoxelMatrix3D done");
 }
 
 //////////////////////////////////////////////////////////////////////////
-void GbVoxelMatrix3D::rotate90aroundX(double  /*cX1*/, double cX2, double cX3)
+void GbVoxelMatrix3D::rotate90aroundX(double /*cX1*/, double cX2, double cX3)
 {
-//   double tempMinPunktX1 = minX1-cX1;
-   double tempMinPunktX2 = minX2-cX2;
-   double tempMinPunktX3 = getX3Maximum()-cX3;
-
-//   double tempMinPunktX1tf = tempMinPunktX1;
-   double tempMinPunktX2tf = -tempMinPunktX3;
-   double tempMinPunktX3tf = tempMinPunktX2;
-
-//   double minX1_temp = tempMinPunktX1tf+cX1;
-   double minX2_temp = tempMinPunktX2tf+cX2;
-   double minX3_temp = tempMinPunktX3tf+cX3;
-
-   minX2 = minX2_temp;
-   minX3 = minX3_temp;
-
-   int nx1 = (int)voxelMatrix.getNX1();
-   int nx2 = (int)voxelMatrix.getNX2();
-   int nx3 = (int)voxelMatrix.getNX3();
-
-   int nx1_new = nx1;
-   int nx2_new = nx3;
-   int nx3_new = nx2;
-
-   double delta_temp = deltaX2;
-   deltaX2 = deltaX3;
-   deltaX3 = delta_temp;
-
-   GbVoxelMatrix3D::Matrix3D voxelMatrix_temp(nx1_new, nx2_new, nx3_new);
-
-   for (int x3 = 0; x3<nx3; x3++) {
-      for (int x2 = 0; x2<nx2; x2++) {
-         for (int x1 = 0; x1<nx1; x1++)
-         {
-            voxelMatrix_temp(x1, nx3-x3-1, x2) = this->voxelMatrix(x1, x2, x3);
-         }
-      }
-   }
-   std::swap(this->voxelMatrix, voxelMatrix_temp);
+    //   double tempMinPunktX1 = minX1-cX1;
+    double tempMinPunktX2 = minX2 - cX2;
+    double tempMinPunktX3 = getX3Maximum() - cX3;
+
+    //   double tempMinPunktX1tf = tempMinPunktX1;
+    double tempMinPunktX2tf = -tempMinPunktX3;
+    double tempMinPunktX3tf = tempMinPunktX2;
+
+    //   double minX1_temp = tempMinPunktX1tf+cX1;
+    double minX2_temp = tempMinPunktX2tf + cX2;
+    double minX3_temp = tempMinPunktX3tf + cX3;
+
+    minX2 = minX2_temp;
+    minX3 = minX3_temp;
+
+    int nx1 = (int)voxelMatrix.getNX1();
+    int nx2 = (int)voxelMatrix.getNX2();
+    int nx3 = (int)voxelMatrix.getNX3();
+
+    int nx1_new = nx1;
+    int nx2_new = nx3;
+    int nx3_new = nx2;
+
+    double delta_temp = deltaX2;
+    deltaX2           = deltaX3;
+    deltaX3           = delta_temp;
+
+    GbVoxelMatrix3D::Matrix3D voxelMatrix_temp(nx1_new, nx2_new, nx3_new);
+
+    for (int x3 = 0; x3 < nx3; x3++) {
+        for (int x2 = 0; x2 < nx2; x2++) {
+            for (int x1 = 0; x1 < nx1; x1++) {
+                voxelMatrix_temp(x1, nx3 - x3 - 1, x2) = this->voxelMatrix(x1, x2, x3);
+            }
+        }
+    }
+    std::swap(this->voxelMatrix, voxelMatrix_temp);
 }
 //////////////////////////////////////////////////////////////////////////
 void GbVoxelMatrix3D::rotate90aroundX()
 {
-   double cX1 = this->getX1Centroid();
-   double cX2 = this->getX2Centroid();
-   double cX3 = this->getX3Centroid();
+    double cX1 = this->getX1Centroid();
+    double cX2 = this->getX2Centroid();
+    double cX3 = this->getX3Centroid();
 
-   rotate90aroundX(cX1, cX2, cX3);
+    rotate90aroundX(cX1, cX2, cX3);
 }
 //////////////////////////////////////////////////////////////////////////
-void GbVoxelMatrix3D::rotate90aroundY(double cX1, double  /*cX2*/, double cX3)
+void GbVoxelMatrix3D::rotate90aroundY(double cX1, double /*cX2*/, double cX3)
 {
-   double tempMinPunktX1 = getX1Maximum()-cX1;
-//   double tempMinPunktX2 = minX2-cX2;
-   double tempMinPunktX3 = minX3-cX3;
-
-   double tempMinPunktX1tf = tempMinPunktX3;
-//   double tempMinPunktX2tf = tempMinPunktX2;
-   double tempMinPunktX3tf = -tempMinPunktX1;
-
-   double minX1_temp = tempMinPunktX1tf+cX1;
-//   double minX2_temp = tempMinPunktX2tf+cX2;
-   double minX3_temp = tempMinPunktX3tf+cX3;
-
-   minX1 = minX1_temp;
-   minX3 = minX3_temp;
-
-   int nx1 = (int)voxelMatrix.getNX1();
-   int nx2 = (int)voxelMatrix.getNX2();
-   int nx3 = (int)voxelMatrix.getNX3();
-
-   int nx1_new = nx3;
-   int nx2_new = nx2;
-   int nx3_new = nx1;
-
-   double delta_temp = deltaX1;
-   deltaX1 = deltaX3;
-   deltaX3 = delta_temp;
-
-   GbVoxelMatrix3D::Matrix3D voxelMatrix_temp(nx1_new, nx2_new, nx3_new);
-
-   for (int x3 = 0; x3<nx3; x3++) {
-      for (int x2 = 0; x2<nx2; x2++) {
-         for (int x1 = 0; x1<nx1; x1++)
-         {
-            voxelMatrix_temp(x3, x2, nx1-x1-1) = this->voxelMatrix(x1, x2, x3);
-         }
-      }
-   }
-   std::swap(this->voxelMatrix, voxelMatrix_temp);
+    double tempMinPunktX1 = getX1Maximum() - cX1;
+    //   double tempMinPunktX2 = minX2-cX2;
+    double tempMinPunktX3 = minX3 - cX3;
+
+    double tempMinPunktX1tf = tempMinPunktX3;
+    //   double tempMinPunktX2tf = tempMinPunktX2;
+    double tempMinPunktX3tf = -tempMinPunktX1;
+
+    double minX1_temp = tempMinPunktX1tf + cX1;
+    //   double minX2_temp = tempMinPunktX2tf+cX2;
+    double minX3_temp = tempMinPunktX3tf + cX3;
+
+    minX1 = minX1_temp;
+    minX3 = minX3_temp;
+
+    int nx1 = (int)voxelMatrix.getNX1();
+    int nx2 = (int)voxelMatrix.getNX2();
+    int nx3 = (int)voxelMatrix.getNX3();
+
+    int nx1_new = nx3;
+    int nx2_new = nx2;
+    int nx3_new = nx1;
+
+    double delta_temp = deltaX1;
+    deltaX1           = deltaX3;
+    deltaX3           = delta_temp;
+
+    GbVoxelMatrix3D::Matrix3D voxelMatrix_temp(nx1_new, nx2_new, nx3_new);
+
+    for (int x3 = 0; x3 < nx3; x3++) {
+        for (int x2 = 0; x2 < nx2; x2++) {
+            for (int x1 = 0; x1 < nx1; x1++) {
+                voxelMatrix_temp(x3, x2, nx1 - x1 - 1) = this->voxelMatrix(x1, x2, x3);
+            }
+        }
+    }
+    std::swap(this->voxelMatrix, voxelMatrix_temp);
 }
 //////////////////////////////////////////////////////////////////////////
 void GbVoxelMatrix3D::rotate90aroundY()
 {
-   double cX1 = this->getX1Centroid();
-   double cX2 = this->getX2Centroid();
-   double cX3 = this->getX3Centroid();
+    double cX1 = this->getX1Centroid();
+    double cX2 = this->getX2Centroid();
+    double cX3 = this->getX3Centroid();
 
-   rotate90aroundY(cX1, cX2, cX3);
+    rotate90aroundY(cX1, cX2, cX3);
 }
 //////////////////////////////////////////////////////////////////////////
-void GbVoxelMatrix3D::rotate90aroundZ(double cX1, double cX2, double  /*cX3*/)
+void GbVoxelMatrix3D::rotate90aroundZ(double cX1, double cX2, double /*cX3*/)
 {
-   double tempMinPunktX1 = minX1-cX1;
-   double tempMinPunktX2 = getX2Maximum()-cX2;
-//   double tempMinPunktX3 = minX3-cX3;
-
-   double tempMinPunktX1tf = -tempMinPunktX2;
-   double tempMinPunktX2tf = tempMinPunktX1;
-//   double tempMinPunktX3tf = tempMinPunktX3;
-
-   double minX1_temp = tempMinPunktX1tf+cX1;
-   double minX2_temp = tempMinPunktX2tf+cX2;
-//   double minX3_temp = tempMinPunktX3tf+cX3;
-
-   minX1 = minX1_temp;
-   minX2 = minX2_temp;
-
-   int nx1 = (int)voxelMatrix.getNX1();
-   int nx2 = (int)voxelMatrix.getNX2();
-   int nx3 = (int)voxelMatrix.getNX3();
-
-   int nx1_new = nx2;
-   int nx2_new = nx1;
-   int nx3_new = nx3;
-
-   double delta_temp = deltaX1;
-   deltaX1 = deltaX2;
-   deltaX2 = delta_temp;
-
-   GbVoxelMatrix3D::Matrix3D voxelMatrix_temp(nx1_new, nx2_new, nx3_new);
-
-   for (int x3 = 0; x3<nx3; x3++) {
-      for (int x2 = 0; x2<nx2; x2++) {
-         for (int x1 = 0; x1<nx1; x1++)
-         {
-            voxelMatrix_temp(nx2-x2-1, x1, x3) = this->voxelMatrix(x1, x2, x3);
-         }
-      }
-   }
-   std::swap(this->voxelMatrix, voxelMatrix_temp);
+    double tempMinPunktX1 = minX1 - cX1;
+    double tempMinPunktX2 = getX2Maximum() - cX2;
+    //   double tempMinPunktX3 = minX3-cX3;
+
+    double tempMinPunktX1tf = -tempMinPunktX2;
+    double tempMinPunktX2tf = tempMinPunktX1;
+    //   double tempMinPunktX3tf = tempMinPunktX3;
+
+    double minX1_temp = tempMinPunktX1tf + cX1;
+    double minX2_temp = tempMinPunktX2tf + cX2;
+    //   double minX3_temp = tempMinPunktX3tf+cX3;
+
+    minX1 = minX1_temp;
+    minX2 = minX2_temp;
+
+    int nx1 = (int)voxelMatrix.getNX1();
+    int nx2 = (int)voxelMatrix.getNX2();
+    int nx3 = (int)voxelMatrix.getNX3();
+
+    int nx1_new = nx2;
+    int nx2_new = nx1;
+    int nx3_new = nx3;
+
+    double delta_temp = deltaX1;
+    deltaX1           = deltaX2;
+    deltaX2           = delta_temp;
+
+    GbVoxelMatrix3D::Matrix3D voxelMatrix_temp(nx1_new, nx2_new, nx3_new);
+
+    for (int x3 = 0; x3 < nx3; x3++) {
+        for (int x2 = 0; x2 < nx2; x2++) {
+            for (int x1 = 0; x1 < nx1; x1++) {
+                voxelMatrix_temp(nx2 - x2 - 1, x1, x3) = this->voxelMatrix(x1, x2, x3);
+            }
+        }
+    }
+    std::swap(this->voxelMatrix, voxelMatrix_temp);
 }
 //////////////////////////////////////////////////////////////////////////
 void GbVoxelMatrix3D::rotate90aroundZ()
 {
-   double cX1 = this->getX1Centroid();
-   double cX2 = this->getX2Centroid();
-   double cX3 = this->getX3Centroid();
+    double cX1 = this->getX1Centroid();
+    double cX2 = this->getX2Centroid();
+    double cX3 = this->getX3Centroid();
 
-   rotate90aroundZ(cX1, cX2, cX3);
+    rotate90aroundZ(cX1, cX2, cX3);
 }
 //////////////////////////////////////////////////////////////////////////
 void GbVoxelMatrix3D::mirrorX()
 {
-   int nx1 = (int)voxelMatrix.getNX1();
-   int nx2 = (int)voxelMatrix.getNX2();
-   int nx3 = (int)voxelMatrix.getNX3();
-
-   GbVoxelMatrix3D::Matrix3D voxelMatrix_temp(nx1, nx2, nx3);
-
-   for (int x3 = 0; x3<nx3; x3++) {
-      for (int x2 = 0; x2<nx2; x2++) {
-         for (int x1 = 0; x1<nx1; x1++)
-         {
-            voxelMatrix_temp(nx1-x1-1, x2, x3) = this->voxelMatrix(x1, x2, x3);
-         }
-      }
-   }
-   std::swap(this->voxelMatrix, voxelMatrix_temp);
+    int nx1 = (int)voxelMatrix.getNX1();
+    int nx2 = (int)voxelMatrix.getNX2();
+    int nx3 = (int)voxelMatrix.getNX3();
+
+    GbVoxelMatrix3D::Matrix3D voxelMatrix_temp(nx1, nx2, nx3);
+
+    for (int x3 = 0; x3 < nx3; x3++) {
+        for (int x2 = 0; x2 < nx2; x2++) {
+            for (int x1 = 0; x1 < nx1; x1++) {
+                voxelMatrix_temp(nx1 - x1 - 1, x2, x3) = this->voxelMatrix(x1, x2, x3);
+            }
+        }
+    }
+    std::swap(this->voxelMatrix, voxelMatrix_temp);
 }
 //////////////////////////////////////////////////////////////////////////
 void GbVoxelMatrix3D::mirrorY()
 {
-   int nx1 = (int)voxelMatrix.getNX1();
-   int nx2 = (int)voxelMatrix.getNX2();
-   int nx3 = (int)voxelMatrix.getNX3();
-
-   GbVoxelMatrix3D::Matrix3D voxelMatrix_temp(nx1, nx2, nx3);
-
-   for (int x3 = 0; x3<nx3; x3++) {
-      for (int x2 = 0; x2<nx2; x2++) {
-         for (int x1 = 0; x1<nx1; x1++)
-         {
-            voxelMatrix_temp(x1, nx2-x2-1, x3) = this->voxelMatrix(x1, x2, x3);
-         }
-      }
-   }
-   std::swap(this->voxelMatrix, voxelMatrix_temp);
+    int nx1 = (int)voxelMatrix.getNX1();
+    int nx2 = (int)voxelMatrix.getNX2();
+    int nx3 = (int)voxelMatrix.getNX3();
+
+    GbVoxelMatrix3D::Matrix3D voxelMatrix_temp(nx1, nx2, nx3);
+
+    for (int x3 = 0; x3 < nx3; x3++) {
+        for (int x2 = 0; x2 < nx2; x2++) {
+            for (int x1 = 0; x1 < nx1; x1++) {
+                voxelMatrix_temp(x1, nx2 - x2 - 1, x3) = this->voxelMatrix(x1, x2, x3);
+            }
+        }
+    }
+    std::swap(this->voxelMatrix, voxelMatrix_temp);
 }
 //////////////////////////////////////////////////////////////////////////
 void GbVoxelMatrix3D::mirrorZ()
 {
-   int nx1 = (int)voxelMatrix.getNX1();
-   int nx2 = (int)voxelMatrix.getNX2();
-   int nx3 = (int)voxelMatrix.getNX3();
-
-   GbVoxelMatrix3D::Matrix3D voxelMatrix_temp(nx1, nx2, nx3);
-
-   for (int x3 = 0; x3<nx3; x3++) {
-      for (int x2 = 0; x2<nx2; x2++) {
-         for (int x1 = 0; x1<nx1; x1++)
-         {
-            voxelMatrix_temp(x1, x2, nx3-x3-1) = this->voxelMatrix(x1, x2, x3);
-         }
-      }
-   }
-   std::swap(this->voxelMatrix, voxelMatrix_temp);
+    int nx1 = (int)voxelMatrix.getNX1();
+    int nx2 = (int)voxelMatrix.getNX2();
+    int nx3 = (int)voxelMatrix.getNX3();
+
+    GbVoxelMatrix3D::Matrix3D voxelMatrix_temp(nx1, nx2, nx3);
+
+    for (int x3 = 0; x3 < nx3; x3++) {
+        for (int x2 = 0; x2 < nx2; x2++) {
+            for (int x1 = 0; x1 < nx1; x1++) {
+                voxelMatrix_temp(x1, x2, nx3 - x3 - 1) = this->voxelMatrix(x1, x2, x3);
+            }
+        }
+    }
+    std::swap(this->voxelMatrix, voxelMatrix_temp);
 }
 //////////////////////////////////////////////////////////////////////////
 void GbVoxelMatrix3D::rotateAroundY(double theta)
 {
-   int nx1 = (int)voxelMatrix.getNX1();
-   int nx2 = (int)voxelMatrix.getNX2();
-   int nx3 = (int)voxelMatrix.getNX3();
-
-   GbVoxelMatrix3D::Matrix3D voxelMatrix_temp(nx1, nx2, nx3, FLUID);
-
-   for (int x3 = 0; x3<nx3; x3++) {
-      for (int x2 = 0; x2<nx2; x2++) {
-         for (int x1 = 0; x1<nx1; x1++)
-         {
-            if (voxelMatrix(x1, x2, x3)==SOLID)
-            {
-               double rcX1 = minX1+deltaX1*x1;
-               double rcX3 = minX3+deltaX3*x3;
-
-               double nrcX1 = cos(theta)*rcX1+sin(theta)*rcX3;
-               double nrcX3 = -sin(theta)*rcX1+cos(theta)*rcX3;
-
-               int newX1 = UbMath::integerRounding((nrcX1-minX1)/deltaX1);
-               int newX2 = x2;
-               int newX3 = UbMath::integerRounding((nrcX3-minX3)/deltaX3);
-
-               if (newX1>0 && newX3>0 && newX1<nx1 && newX3<nx3)
-               {
-                  voxelMatrix_temp(newX1, newX2, newX3) = voxelMatrix(x1, x2, x3);
-               }
-
-               //int ix1, ix2, ix3;
-               //double ixx1 = (abs(nrcX1-minX1)/deltaX1);
-               //ix2 = x2;
-               //double ixx3 = (abs(nrcX3-minX3)/deltaX3);
-               //if (ixx1-(int)ixx1>.9999999999) ix1 = (int)ixx1+1; else ix1 = (int)ixx1;
-               ////if (ixx2-(int)ixx2>.9999999999) ix2 = (int)ixx2+1; else ix2 = (int)ixx2;
-               //if (ixx3-(int)ixx3>.9999999999) ix3 = (int)ixx3+1; else ix3 = (int)ixx3;
-
-               //if (ix1>=0 && ix3>=0 && ix1<nx1 && ix3<nx3)
-               //{
-               //   voxelMatrix_temp(ix1, ix2, ix3) = voxelMatrix(x1, x2, x3);
-               //}
+    int nx1 = (int)voxelMatrix.getNX1();
+    int nx2 = (int)voxelMatrix.getNX2();
+    int nx3 = (int)voxelMatrix.getNX3();
+
+    GbVoxelMatrix3D::Matrix3D voxelMatrix_temp(nx1, nx2, nx3, FLUID);
+
+    for (int x3 = 0; x3 < nx3; x3++) {
+        for (int x2 = 0; x2 < nx2; x2++) {
+            for (int x1 = 0; x1 < nx1; x1++) {
+                if (voxelMatrix(x1, x2, x3) == SOLID) {
+                    double rcX1 = minX1 + deltaX1 * x1;
+                    double rcX3 = minX3 + deltaX3 * x3;
+
+                    double nrcX1 = cos(theta) * rcX1 + sin(theta) * rcX3;
+                    double nrcX3 = -sin(theta) * rcX1 + cos(theta) * rcX3;
+
+                    int newX1 = UbMath::integerRounding((nrcX1 - minX1) / deltaX1);
+                    int newX2 = x2;
+                    int newX3 = UbMath::integerRounding((nrcX3 - minX3) / deltaX3);
+
+                    if (newX1 > 0 && newX3 > 0 && newX1 < nx1 && newX3 < nx3) {
+                        voxelMatrix_temp(newX1, newX2, newX3) = voxelMatrix(x1, x2, x3);
+                    }
+
+                    // int ix1, ix2, ix3;
+                    // double ixx1 = (abs(nrcX1-minX1)/deltaX1);
+                    // ix2 = x2;
+                    // double ixx3 = (abs(nrcX3-minX3)/deltaX3);
+                    // if (ixx1-(int)ixx1>.9999999999) ix1 = (int)ixx1+1; else ix1 = (int)ixx1;
+                    ////if (ixx2-(int)ixx2>.9999999999) ix2 = (int)ixx2+1; else ix2 = (int)ixx2;
+                    // if (ixx3-(int)ixx3>.9999999999) ix3 = (int)ixx3+1; else ix3 = (int)ixx3;
+
+                    // if (ix1>=0 && ix3>=0 && ix1<nx1 && ix3<nx3)
+                    //{
+                    //   voxelMatrix_temp(ix1, ix2, ix3) = voxelMatrix(x1, x2, x3);
+                    //}
+                }
             }
-
-         }
-      }
-   }
-   std::swap(voxelMatrix, voxelMatrix_temp);
-
-   for (int x3 = 0; x3<nx3; x3++)
-      for (int x2 = 0; x2<nx2; x2++)
-         for (int x1 = 0; x1<nx1; x1++)
-         {
-            int count = 0;
-            for (int k3 = -1; k3<=1; k3++)
-               for (int k1 = -1; k1<=1; k1++)
-               {
-                  int j1 = x1+k1;
-                  int j3 = x3+k3;
-                  if (j1>=0 && j3>=0 && j1<nx1 && j3<nx3)
-                  {
-                     if (voxelMatrix(j1, x2, j3)==SOLID)
-                     {
-                        count++;
-                     }
-                  }
-
-               }
-            if (count == 8)
-            {
-               voxelMatrix(x1, x2, x3) = SOLID;
+        }
+    }
+    std::swap(voxelMatrix, voxelMatrix_temp);
+
+    for (int x3 = 0; x3 < nx3; x3++)
+        for (int x2 = 0; x2 < nx2; x2++)
+            for (int x1 = 0; x1 < nx1; x1++) {
+                int count = 0;
+                for (int k3 = -1; k3 <= 1; k3++)
+                    for (int k1 = -1; k1 <= 1; k1++) {
+                        int j1 = x1 + k1;
+                        int j3 = x3 + k3;
+                        if (j1 >= 0 && j3 >= 0 && j1 < nx1 && j3 < nx3) {
+                            if (voxelMatrix(j1, x2, j3) == SOLID) {
+                                count++;
+                            }
+                        }
+                    }
+                if (count == 8) {
+                    voxelMatrix(x1, x2, x3) = SOLID;
+                }
             }
-         }
 }
 //////////////////////////////////////////////////////////////////////////
-void GbVoxelMatrix3D::writeToLegacyVTKASCII(const std::string& fileName)
-{
-   string fn = fileName+".ascii.vtk";
-
-   FILE *file;
-   file = fopen(fn.c_str(), "w");
-
-   if (file==NULL)
-   {
-      std::string pathf = UbSystem::getPathFromString(fn);
-      if (fn.size()>0) { UbSystem::makeDirectory(pathf); file = fopen(fn.c_str(), "w"); }
-      if (file==NULL) throw UbException(UB_EXARGS, "can not open "+fn);
-   }
-
-   if (file==NULL)
-      throw UbException(UB_EXARGS, "can not open "+fn);
-
-   int nx1 = (int)voxelMatrix.getNX1();
-   int nx2 = (int)voxelMatrix.getNX2();
-   int nx3 = (int)voxelMatrix.getNX3();
-
-   int nn = nx1*nx2*nx3;
-
-   fprintf(file, "# vtk DataFile Version 2.0\n");
-   fprintf(file, "vtk output\n");
-   fprintf(file, "ASCII\n");
-   fprintf(file, "DATASET STRUCTURED_POINTS\n");
-   fprintf(file, "DIMENSIONS %d %d %d\n", nx1, nx2, nx3);
-   fprintf(file, "ORIGIN %g %g %g\n", minX1, minX2, minX3);
-   fprintf(file, "SPACING %g %g %g\n", deltaX1, deltaX2, deltaX3);
-   fprintf(file, "POINT_DATA %d\n", nn);
-   fprintf(file, "SCALARS Geo float\n");
-   fprintf(file, "LOOKUP_TABLE default\n");
-
-   for (int k = 0; k<nx3; k++) {
-      for (int j = 0; j<nx2; j++) {
-         for (int i = 0; i<nx1; i++) {
-            fprintf(file, "%g ", voxelMatrix(i, j, k));
-         }
-      }
-   }
-
-   fprintf(file, "\n");
-
-   fclose(file);
+void GbVoxelMatrix3D::writeToLegacyVTKASCII(const std::string &fileName)
+{
+    string fn = fileName + ".ascii.vtk";
+
+    FILE *file;
+    file = fopen(fn.c_str(), "w");
+
+    if (file == NULL) {
+        std::string pathf = UbSystem::getPathFromString(fn);
+        if (fn.size() > 0) {
+            UbSystem::makeDirectory(pathf);
+            file = fopen(fn.c_str(), "w");
+        }
+        if (file == NULL)
+            throw UbException(UB_EXARGS, "can not open " + fn);
+    }
+
+    if (file == NULL)
+        throw UbException(UB_EXARGS, "can not open " + fn);
+
+    int nx1 = (int)voxelMatrix.getNX1();
+    int nx2 = (int)voxelMatrix.getNX2();
+    int nx3 = (int)voxelMatrix.getNX3();
+
+    int nn = nx1 * nx2 * nx3;
+
+    fprintf(file, "# vtk DataFile Version 2.0\n");
+    fprintf(file, "vtk output\n");
+    fprintf(file, "ASCII\n");
+    fprintf(file, "DATASET STRUCTURED_POINTS\n");
+    fprintf(file, "DIMENSIONS %d %d %d\n", nx1, nx2, nx3);
+    fprintf(file, "ORIGIN %g %g %g\n", minX1, minX2, minX3);
+    fprintf(file, "SPACING %g %g %g\n", deltaX1, deltaX2, deltaX3);
+    fprintf(file, "POINT_DATA %d\n", nn);
+    fprintf(file, "SCALARS Geo float\n");
+    fprintf(file, "LOOKUP_TABLE default\n");
+
+    for (int k = 0; k < nx3; k++) {
+        for (int j = 0; j < nx2; j++) {
+            for (int i = 0; i < nx1; i++) {
+                fprintf(file, "%g ", voxelMatrix(i, j, k));
+            }
+        }
+    }
+
+    fprintf(file, "\n");
+
+    fclose(file);
 }
 //////////////////////////////////////////////////////////////////////////
-void GbVoxelMatrix3D::writeToLegacyVTKBinary(const std::string& fileName)
-{
-   string fn = fileName+".binary.vtk";
-
-   FILE *file;
-   file = fopen(fn.c_str(), "w");
-
-   if (file==NULL)
-   {
-      std::string pathf = UbSystem::getPathFromString(fn);
-      if (fn.size()>0) { UbSystem::makeDirectory(pathf); file = fopen(fn.c_str(), "w"); }
-      if (file==NULL) throw UbException(UB_EXARGS, "can not open "+fn);
-   }
-
-   int nx1 = (int)voxelMatrix.getNX1();
-   int nx2 = (int)voxelMatrix.getNX2();
-   int nx3 = (int)voxelMatrix.getNX3();
-
-   int nn = nx1*nx2*nx3;
-
-   char LF = 0x0A;
-
-   fprintf(file, "# vtk DataFile Version 3.0\n");
-   fprintf(file, "vtk output\n");
-   fprintf(file, "BINARY\n");
-   fprintf(file, "DATASET STRUCTURED_POINTS\n");
-   fprintf(file, "DIMENSIONS %d %d %d\n", nx1, nx2, nx3);
-   fprintf(file, "ORIGIN %g %g %g\n", minX1, minX2, minX3);
-   fprintf(file, "SPACING %g %g %g\n", deltaX1, deltaX2, deltaX3);
-   fprintf(file, "POINT_DATA %d\n", nn);
-   fprintf(file, "SCALARS Geo float\n");
-   fprintf(file, "LOOKUP_TABLE default");
-   fclose(file);
-
-   GbVoxelMatrix3D::Matrix3D voxelMatrix_temp(nx1, nx2, nx3);
-
-   if (UbSystem::isLittleEndian())
-   {
-      for (int x3 = 0; x3<nx3; x3++) {
-         for (int x2 = 0; x2<nx2; x2++) {
-            for (int x1 = 0; x1<nx1; x1++)
-            {
-               float tmp = this->voxelMatrix(x1, x2, x3);
-               UbSystem::swapByteOrder((unsigned char*)(&(tmp)), sizeof(float));
-               voxelMatrix_temp(x1, x2, x3) = tmp;
+void GbVoxelMatrix3D::writeToLegacyVTKBinary(const std::string &fileName)
+{
+    string fn = fileName + ".binary.vtk";
+
+    FILE *file;
+    file = fopen(fn.c_str(), "w");
+
+    if (file == NULL) {
+        std::string pathf = UbSystem::getPathFromString(fn);
+        if (fn.size() > 0) {
+            UbSystem::makeDirectory(pathf);
+            file = fopen(fn.c_str(), "w");
+        }
+        if (file == NULL)
+            throw UbException(UB_EXARGS, "can not open " + fn);
+    }
+
+    int nx1 = (int)voxelMatrix.getNX1();
+    int nx2 = (int)voxelMatrix.getNX2();
+    int nx3 = (int)voxelMatrix.getNX3();
+
+    int nn = nx1 * nx2 * nx3;
+
+    char LF = 0x0A;
+
+    fprintf(file, "# vtk DataFile Version 3.0\n");
+    fprintf(file, "vtk output\n");
+    fprintf(file, "BINARY\n");
+    fprintf(file, "DATASET STRUCTURED_POINTS\n");
+    fprintf(file, "DIMENSIONS %d %d %d\n", nx1, nx2, nx3);
+    fprintf(file, "ORIGIN %g %g %g\n", minX1, minX2, minX3);
+    fprintf(file, "SPACING %g %g %g\n", deltaX1, deltaX2, deltaX3);
+    fprintf(file, "POINT_DATA %d\n", nn);
+    fprintf(file, "SCALARS Geo float\n");
+    fprintf(file, "LOOKUP_TABLE default");
+    fclose(file);
+
+    GbVoxelMatrix3D::Matrix3D voxelMatrix_temp(nx1, nx2, nx3);
+
+    if (UbSystem::isLittleEndian()) {
+        for (int x3 = 0; x3 < nx3; x3++) {
+            for (int x2 = 0; x2 < nx2; x2++) {
+                for (int x1 = 0; x1 < nx1; x1++) {
+                    float tmp = this->voxelMatrix(x1, x2, x3);
+                    UbSystem::swapByteOrder((unsigned char *)(&(tmp)), sizeof(float));
+                    voxelMatrix_temp(x1, x2, x3) = tmp;
+                }
             }
-         }
-      }
-   }
+        }
+    }
 
-   file = fopen(fn.c_str(), "ab");
+    file = fopen(fn.c_str(), "ab");
 
-   fwrite(&LF, sizeof(char), 1, file);
-   fwrite(voxelMatrix_temp.getStartAdressOfSortedArray(0, 0, 0), sizeof(float), voxelMatrix_temp.getDataVector().size(), file);
-   fwrite(&LF, sizeof(char), 1, file);
-   fclose(file);
+    fwrite(&LF, sizeof(char), 1, file);
+    fwrite(voxelMatrix_temp.getStartAdressOfSortedArray(0, 0, 0), sizeof(float),
+           voxelMatrix_temp.getDataVector().size(), file);
+    fwrite(&LF, sizeof(char), 1, file);
+    fclose(file);
 }
 //////////////////////////////////////////////////////////////////////////
-void GbVoxelMatrix3D::writeToVTKImageDataASCII(const std::string& fileName)
-{
-   int nx1 = (int)voxelMatrix.getNX1();
-   int nx2 = (int)voxelMatrix.getNX2();
-   int nx3 = (int)voxelMatrix.getNX3();
-
-   string fn = fileName+".ascii.vti";
-
-   FILE *file;
-   file = fopen(fn.c_str(), "w");
-
-   if (file==NULL)
-   {
-      std::string pathf = UbSystem::getPathFromString(fn);
-      if (fn.size()>0) { UbSystem::makeDirectory(pathf); file = fopen(fn.c_str(), "w"); }
-      if (file==NULL) throw UbException(UB_EXARGS, "can not open "+fn);
-   }
-
-   fprintf(file, "<VTKFile type=\"ImageData\" version=\"1.0\" byte_order=\"LittleEndian\" header_type=\"UInt64\">\n"); //paraview 4.1
-   //fprintf(file,"<VTKFile type=\"ImageData\" version=\"0.1\" byte_order=\"LittleEndian\">\n"); //paraview 3.1
-   fprintf(file, "  <ImageData WholeExtent=\"%d %d %d %d %d %d\" Origin=\"%g %g %g\" Spacing=\"%g %g %g\">\n", 0, nx1-1, 0, nx2-1, 0, nx3-1, minX1, minX2, minX3, deltaX1, deltaX2, deltaX3);
-   fprintf(file, "  <Piece Extent=\"%d %d %d %d %d %d\">\n", 0, nx1-1, 0, nx2-1, 0, nx3-1);
-   fprintf(file, "    <PointData Scalars=\"VoxelMatrix\">\n");
-   fprintf(file, "      <DataArray type=\"Float32\" Name=\"VoxelMatrix\" format=\"ascii\" RangeMin=\"0\" RangeMax=\"1\">\n        ");
-
-   for (int k = 0; k<nx3; k++) {
-      for (int j = 0; j<nx2; j++) {
-         for (int i = 0; i<nx1; i++) {
-            fprintf(file, "%g ", voxelMatrix(i, j, k));
-         }
-      }
-   }
-
-   fprintf(file, "\n      </DataArray>\n");
-   fprintf(file, "    </PointData>\n");
-   fprintf(file, "    <CellData>\n");
-   fprintf(file, "    </CellData>\n");
-   fprintf(file, "  </Piece>\n");
-   fprintf(file, "  </ImageData>\n");
-   fprintf(file, "</VTKFile>\n");
-
-   fclose(file);
+void GbVoxelMatrix3D::writeToVTKImageDataASCII(const std::string &fileName)
+{
+    int nx1 = (int)voxelMatrix.getNX1();
+    int nx2 = (int)voxelMatrix.getNX2();
+    int nx3 = (int)voxelMatrix.getNX3();
+
+    string fn = fileName + ".ascii.vti";
+
+    FILE *file;
+    file = fopen(fn.c_str(), "w");
+
+    if (file == NULL) {
+        std::string pathf = UbSystem::getPathFromString(fn);
+        if (fn.size() > 0) {
+            UbSystem::makeDirectory(pathf);
+            file = fopen(fn.c_str(), "w");
+        }
+        if (file == NULL)
+            throw UbException(UB_EXARGS, "can not open " + fn);
+    }
+
+    fprintf(file,
+            "<VTKFile type=\"ImageData\" version=\"1.0\" byte_order=\"LittleEndian\" header_type=\"UInt64\">\n"); // paraview
+                                                                                                                  // 4.1
+    // fprintf(file,"<VTKFile type=\"ImageData\" version=\"0.1\" byte_order=\"LittleEndian\">\n"); //paraview 3.1
+    fprintf(file, "  <ImageData WholeExtent=\"%d %d %d %d %d %d\" Origin=\"%g %g %g\" Spacing=\"%g %g %g\">\n", 0,
+            nx1 - 1, 0, nx2 - 1, 0, nx3 - 1, minX1, minX2, minX3, deltaX1, deltaX2, deltaX3);
+    fprintf(file, "  <Piece Extent=\"%d %d %d %d %d %d\">\n", 0, nx1 - 1, 0, nx2 - 1, 0, nx3 - 1);
+    fprintf(file, "    <PointData Scalars=\"VoxelMatrix\">\n");
+    fprintf(file, "      <DataArray type=\"Float32\" Name=\"VoxelMatrix\" format=\"ascii\" RangeMin=\"0\" "
+                  "RangeMax=\"1\">\n        ");
+
+    for (int k = 0; k < nx3; k++) {
+        for (int j = 0; j < nx2; j++) {
+            for (int i = 0; i < nx1; i++) {
+                fprintf(file, "%g ", voxelMatrix(i, j, k));
+            }
+        }
+    }
+
+    fprintf(file, "\n      </DataArray>\n");
+    fprintf(file, "    </PointData>\n");
+    fprintf(file, "    <CellData>\n");
+    fprintf(file, "    </CellData>\n");
+    fprintf(file, "  </Piece>\n");
+    fprintf(file, "  </ImageData>\n");
+    fprintf(file, "</VTKFile>\n");
+
+    fclose(file);
 }
 //////////////////////////////////////////////////////////////////////////
-void GbVoxelMatrix3D::writeToVTKImageDataAppended(const std::string& fileName)
-{
-   int nx1 = (int)voxelMatrix.getNX1();
-   int nx2 = (int)voxelMatrix.getNX2();
-   int nx3 = (int)voxelMatrix.getNX3();
-
-   string fn = fileName+".appended.vti";
-
-   FILE *file;
-   file = fopen(fn.c_str(), "w");
-
-   if (file==NULL)
-   {
-      std::string pathf = UbSystem::getPathFromString(fn);
-      if (fn.size()>0) { UbSystem::makeDirectory(pathf); file = fopen(fn.c_str(), "w"); }
-      if (file==NULL) throw UbException(UB_EXARGS, "can not open "+fn);
-   }
-
-   fprintf(file, "<VTKFile type=\"ImageData\" version=\"1.0\" byte_order=\"LittleEndian\" header_type=\"UInt64\">\n"); //paraview 4.1
-   fprintf(file, "  <ImageData WholeExtent=\"%d %d %d %d %d %d\" Origin=\"%g %g %g\" Spacing=\"%g %g %g\">\n", 0, nx1-1, 0, nx2-1, 0, nx3-1, minX1, minX2, minX3, deltaX1, deltaX2, deltaX3);
-   fprintf(file, "  <Piece Extent=\"%d %d %d %d %d %d\">\n", 0, nx1-1, 0, nx2-1, 0, nx3-1);
-   fprintf(file, "    <PointData Scalars=\"VoxelMatrix\">\n");
-   fprintf(file, "      <DataArray type=\"Float32\" Name=\"VoxelMatrix\" format=\"appended\" RangeMin=\"0\" RangeMax=\"1\" offset=\"0\" />\n");
-   fprintf(file, "    </PointData>\n");
-   fprintf(file, "    <CellData>\n");
-   fprintf(file, "    </CellData>\n");
-   fprintf(file, "  </Piece>\n");
-   fprintf(file, "  </ImageData>\n");
-   fprintf(file, "  <AppendedData encoding=\"raw\">\n");
-   fprintf(file, "   _");
-   fclose(file);
-
-   file = fopen(fn.c_str(), "ab");
-   unsigned long long size = (unsigned long long)voxelMatrix.getDataVector().size()*sizeof(float);
-   fwrite(&size, sizeof(unsigned long long), 1, file);
-   fwrite(voxelMatrix.getStartAdressOfSortedArray(0, 0, 0), sizeof(float), voxelMatrix.getDataVector().size(), file);
-   fclose(file);
-
-   file = fopen(fn.c_str(), "a");
-   fprintf(file, "\n");
-   fprintf(file, "  </AppendedData>\n");
-   fprintf(file, "</VTKFile>\n");
-   fclose(file);
+void GbVoxelMatrix3D::writeToVTKImageDataAppended(const std::string &fileName)
+{
+    int nx1 = (int)voxelMatrix.getNX1();
+    int nx2 = (int)voxelMatrix.getNX2();
+    int nx3 = (int)voxelMatrix.getNX3();
+
+    string fn = fileName + ".appended.vti";
+
+    FILE *file;
+    file = fopen(fn.c_str(), "w");
+
+    if (file == NULL) {
+        std::string pathf = UbSystem::getPathFromString(fn);
+        if (fn.size() > 0) {
+            UbSystem::makeDirectory(pathf);
+            file = fopen(fn.c_str(), "w");
+        }
+        if (file == NULL)
+            throw UbException(UB_EXARGS, "can not open " + fn);
+    }
+
+    fprintf(file,
+            "<VTKFile type=\"ImageData\" version=\"1.0\" byte_order=\"LittleEndian\" header_type=\"UInt64\">\n"); // paraview
+                                                                                                                  // 4.1
+    fprintf(file, "  <ImageData WholeExtent=\"%d %d %d %d %d %d\" Origin=\"%g %g %g\" Spacing=\"%g %g %g\">\n", 0,
+            nx1 - 1, 0, nx2 - 1, 0, nx3 - 1, minX1, minX2, minX3, deltaX1, deltaX2, deltaX3);
+    fprintf(file, "  <Piece Extent=\"%d %d %d %d %d %d\">\n", 0, nx1 - 1, 0, nx2 - 1, 0, nx3 - 1);
+    fprintf(file, "    <PointData Scalars=\"VoxelMatrix\">\n");
+    fprintf(file, "      <DataArray type=\"Float32\" Name=\"VoxelMatrix\" format=\"appended\" RangeMin=\"0\" "
+                  "RangeMax=\"1\" offset=\"0\" />\n");
+    fprintf(file, "    </PointData>\n");
+    fprintf(file, "    <CellData>\n");
+    fprintf(file, "    </CellData>\n");
+    fprintf(file, "  </Piece>\n");
+    fprintf(file, "  </ImageData>\n");
+    fprintf(file, "  <AppendedData encoding=\"raw\">\n");
+    fprintf(file, "   _");
+    fclose(file);
+
+    file                    = fopen(fn.c_str(), "ab");
+    unsigned long long size = (unsigned long long)voxelMatrix.getDataVector().size() * sizeof(float);
+    fwrite(&size, sizeof(unsigned long long), 1, file);
+    fwrite(voxelMatrix.getStartAdressOfSortedArray(0, 0, 0), sizeof(float), voxelMatrix.getDataVector().size(), file);
+    fclose(file);
+
+    file = fopen(fn.c_str(), "a");
+    fprintf(file, "\n");
+    fprintf(file, "  </AppendedData>\n");
+    fprintf(file, "</VTKFile>\n");
+    fclose(file);
 }
-
-
diff --git a/src/basics/geometry3d/GbVoxelMatrix3D.h b/src/basics/geometry3d/GbVoxelMatrix3D.h
index 69af1e54795606f2251063370f8b2f75908d8ffa..ba4b3b420e7ac25c79b870d6472716e392409437 100644
--- a/src/basics/geometry3d/GbVoxelMatrix3D.h
+++ b/src/basics/geometry3d/GbVoxelMatrix3D.h
@@ -7,13 +7,12 @@
 #ifndef GBVOXELMATRIX3D_H
 #define GBVOXELMATRIX3D_H
 
-
-#include <vector>
 #include <cmath>
+#include <vector>
 
-#include <geometry3d/GbObject3D.h>
-#include <basics/utilities/UbObserver.h>
 #include <basics/container/CbArray3D.h>
+#include <basics/utilities/UbObserver.h>
+#include <geometry3d/GbObject3D.h>
 
 #include <PointerDefinitions.h>
 
@@ -24,279 +23,302 @@ class GbObject3DCreator;
 class GbVoxelMatrix3D : public GbObject3D, public UbObserver
 {
 public:
-   using Matrix3D = CbArray3D<float>;
-   static const float SOLID;
-   static const float FLUID;
-   enum  Endian { BigEndian, LittleEndian };
-
-   GbVoxelMatrix3D();
-   GbVoxelMatrix3D(int nx1, int nx2, int nx3, float initVal, double lowerThreshold = 0, double upperThreshold = 0);
-   GbVoxelMatrix3D(const Matrix3D& voxelMatrix, double lowerThreshold = 0, double upperThreshold = 0);
-   ~GbVoxelMatrix3D() override = default;
-
-   void finalize() override {};
-   GbVoxelMatrix3D* clone() override;
-
-   /*=======================================================================*/
-   Matrix3D::reference operator() (const Matrix3D::size_type& x1, const Matrix3D::size_type& x2, const Matrix3D::size_type& x3)
-   {
-      return voxelMatrix(x1, x2, x3);
-   }
-   /*=======================================================================*/
-   Matrix3D::const_reference operator() (const Matrix3D::size_type& x1, const Matrix3D::size_type& x2, const Matrix3D::size_type& x3)	const
-   {
-      return voxelMatrix(x1, x2, x3);
-   }
-   /*=======================================================================*/
-   void setTransferViaFilename(bool transferViaFilename, std::string filename)
-   {
-      this->filename = filename;
-      this->transferViaFilename = transferViaFilename;
-   }
-   void setThreshold(double lowerThreshold, double upperThreshold) { this->lowerThreshold = lowerThreshold; this->upperThreshold = upperThreshold; }
-   void setAddSurfaceTriangleSetFlag(bool flag) { this->addSurfaceTriangleSetFlag = flag; }
-
-   /*=======================================================================*/
-   void setVoxelMatrixMininum(double minX1, double minX2, double minX3) { this->minX1 = minX1; this->minX2 = minX2; this->minX3 = minX3; }
-   void setVoxelMatrixMinX1(double minX1) { this->minX1 = minX1; }
-   void setVoxelMatrixMinX2(double minX2) { this->minX2 = minX2; }
-   void setVoxelMatrixMinX3(double minX3) { this->minX3 = minX3; }
-
-   /*=======================================================================*/
-   void setVoxelMatrixDelta(double deltaX1, double deltaX2, double deltaX3) { this->deltaX1 = deltaX1; this->deltaX2 = deltaX2; this->deltaX3 = deltaX3; }
-   void setVoxelMatrixDeltaX1(double deltaX1) { this->deltaX1 = deltaX1; }
-   void setVoxelMatrixDeltaX2(double deltaX2) { this->deltaX2 = deltaX2; }
-   void setVoxelMatrixDeltaX3(double deltaX3) { this->deltaX3 = deltaX3; }
-
-   /*=======================================================================*/
-   double getX1Centroid() override { return 0.5 * (minX1+this->getX1Maximum()); }
-   double getX1Minimum() override { return minX1; }
-   double getX1Maximum() override { return minX1+deltaX1*voxelMatrix.getNX1(); }
-
-   double getX2Centroid() override { return 0.5 * (minX2+this->getX2Maximum()); }
-   double getX2Minimum() override { return minX2; }
-   double getX2Maximum() override { return minX2+deltaX2*voxelMatrix.getNX2(); }
-
-   double getX3Centroid() override { return 0.5 * (this->getX3Minimum()+this->getX3Maximum()); }
-   double getX3Minimum() override { return minX3; }
-   double getX3Maximum() override { return minX3+deltaX3*voxelMatrix.getNX3(); }
-
-   double getLengthX1() { return this->getX1Maximum()-minX1; }
-   double getLengthX2() { return this->getX2Maximum()-minX2; }
-   double getLengthX3() { return this->getX3Maximum()-minX3; }
-
-   void setCenterCoordinates(const double& x1, const double& x2, const double& x3) override;
-   void translate(const double& tx1, const double& tx2, const double& tx3) override;
-
-   bool isPointInGbObject3D(const double& x1p, const double& x2p, const double& x3p, bool& pointIsOnBoundary) override;
-   bool isPointInGbObject3D(const double& x1p, const double& x2p, const double& x3p) override;
-   bool isCellInsideGbObject3D(const double& x1a, const double& x2a, const double& x3a, const double& x1b, const double& x2b, const double& x3b) override;
-   bool isCellCuttingGbObject3D(const double& x1a, const double& x2a, const double& x3a, const double& x1b, const double& x2b, const double& x3b) override;
-   bool isCellInsideOrCuttingGbObject3D(const double& x1a, const double& x2a, const double& x3a, const double& x1b, const double& x2b, const double& x3b) override;
-   //double getCellVolumeInsideGbObject3D(const double& x1a,const double& x2a,const double& x3a,const double& x1b,const double& x2b,const double& x3b);
-
-   GbPoint3D*  calculateInterSectionPoint3D(GbPoint3D&  /*point1*/, GbPoint3D & /*point2*/) { throw UbException(__FILE__, __LINE__, UB_FUNCTION, "not implemented"); }
-   GbLine3D*   createClippedLine3D(GbPoint3D&  /*point1*/, GbPoint3D&  /*point2*/) override { throw UbException(__FILE__, __LINE__, UB_FUNCTION, "not implemented"); }
-
-   std::vector<GbTriangle3D*> getSurfaceTriangleSet() override;
-   void addSurfaceTriangleSet(std::vector<UbTupleFloat3>& nodes, std::vector<UbTupleInt3>& triangles) override;
-
-   bool hasRaytracing() override { return true; }
-   /*|r| must be 1! einheitsvector!!*/
-   double getIntersectionRaytraceFactor(const double& x1, const double& x2, const double& x3, const double& rx1, const double& rx2, const double& rx3) override;
-
-   std::string toString() override;
-
-   //virtuelle Methoden von UbObserver
-   void objectChanged(UbObservable* changedObject) override {}
-   void objectWillBeDeleted(UbObservable* objectForDeletion) override {}
-
-   template <class T>
-   void readMatrixFromRawFile(std::string filename, GbVoxelMatrix3D::Endian endian);
-   template <class T>
-   void readBufferedMatrixFromRawFile(std::string filename, GbVoxelMatrix3D::Endian endian);
-   void readMatrixFromVtiASCIIFile(std::string filename);
-
-   void rotate90aroundX();
-   void rotate90aroundY();
-   void rotate90aroundZ();
-   void rotate90aroundX(double cX1, double cX2, double cX3);
-   void rotate90aroundY(double cX1, double cX2, double cX3);
-   void rotate90aroundZ(double cX1, double cX2, double cX3);
-   void mirrorX();
-   void mirrorY();
-   void mirrorZ();
-
-   void rotateAroundY(double theta);
-
-   void writeToLegacyVTKASCII(const std::string& fileName);
-   void writeToLegacyVTKBinary(const std::string& fileName);
-   void writeToVTKImageDataASCII(const std::string& fileName);
-   void writeToVTKImageDataAppended(const std::string& fileName);
-
-   void setClosedVoidSpaceToSolid();
-
-   void calculateNumberOfSolidAndFluid();
-   long getNumberOfSolid();
-   long getNumberOfFluid();
+    using Matrix3D = CbArray3D<float>;
+    static const float SOLID;
+    static const float FLUID;
+    enum Endian { BigEndian, LittleEndian };
+
+    GbVoxelMatrix3D();
+    GbVoxelMatrix3D(int nx1, int nx2, int nx3, float initVal, double lowerThreshold = 0, double upperThreshold = 0);
+    GbVoxelMatrix3D(const Matrix3D &voxelMatrix, double lowerThreshold = 0, double upperThreshold = 0);
+    ~GbVoxelMatrix3D() override = default;
+
+    void finalize() override{};
+    GbVoxelMatrix3D *clone() override;
+
+    /*=======================================================================*/
+    Matrix3D::reference operator()(const Matrix3D::size_type &x1, const Matrix3D::size_type &x2,
+                                   const Matrix3D::size_type &x3)
+    {
+        return voxelMatrix(x1, x2, x3);
+    }
+    /*=======================================================================*/
+    Matrix3D::const_reference operator()(const Matrix3D::size_type &x1, const Matrix3D::size_type &x2,
+                                         const Matrix3D::size_type &x3) const
+    {
+        return voxelMatrix(x1, x2, x3);
+    }
+    /*=======================================================================*/
+    void setTransferViaFilename(bool transferViaFilename, std::string filename)
+    {
+        this->filename            = filename;
+        this->transferViaFilename = transferViaFilename;
+    }
+    void setThreshold(double lowerThreshold, double upperThreshold)
+    {
+        this->lowerThreshold = lowerThreshold;
+        this->upperThreshold = upperThreshold;
+    }
+    void setAddSurfaceTriangleSetFlag(bool flag) { this->addSurfaceTriangleSetFlag = flag; }
+
+    /*=======================================================================*/
+    void setVoxelMatrixMininum(double minX1, double minX2, double minX3)
+    {
+        this->minX1 = minX1;
+        this->minX2 = minX2;
+        this->minX3 = minX3;
+    }
+    void setVoxelMatrixMinX1(double minX1) { this->minX1 = minX1; }
+    void setVoxelMatrixMinX2(double minX2) { this->minX2 = minX2; }
+    void setVoxelMatrixMinX3(double minX3) { this->minX3 = minX3; }
+
+    /*=======================================================================*/
+    void setVoxelMatrixDelta(double deltaX1, double deltaX2, double deltaX3)
+    {
+        this->deltaX1 = deltaX1;
+        this->deltaX2 = deltaX2;
+        this->deltaX3 = deltaX3;
+    }
+    void setVoxelMatrixDeltaX1(double deltaX1) { this->deltaX1 = deltaX1; }
+    void setVoxelMatrixDeltaX2(double deltaX2) { this->deltaX2 = deltaX2; }
+    void setVoxelMatrixDeltaX3(double deltaX3) { this->deltaX3 = deltaX3; }
+
+    /*=======================================================================*/
+    double getX1Centroid() override { return 0.5 * (minX1 + this->getX1Maximum()); }
+    double getX1Minimum() override { return minX1; }
+    double getX1Maximum() override { return minX1 + deltaX1 * voxelMatrix.getNX1(); }
+
+    double getX2Centroid() override { return 0.5 * (minX2 + this->getX2Maximum()); }
+    double getX2Minimum() override { return minX2; }
+    double getX2Maximum() override { return minX2 + deltaX2 * voxelMatrix.getNX2(); }
+
+    double getX3Centroid() override { return 0.5 * (this->getX3Minimum() + this->getX3Maximum()); }
+    double getX3Minimum() override { return minX3; }
+    double getX3Maximum() override { return minX3 + deltaX3 * voxelMatrix.getNX3(); }
+
+    double getLengthX1() { return this->getX1Maximum() - minX1; }
+    double getLengthX2() { return this->getX2Maximum() - minX2; }
+    double getLengthX3() { return this->getX3Maximum() - minX3; }
+
+    void setCenterCoordinates(const double &x1, const double &x2, const double &x3) override;
+    void translate(const double &tx1, const double &tx2, const double &tx3) override;
+
+    bool isPointInGbObject3D(const double &x1p, const double &x2p, const double &x3p, bool &pointIsOnBoundary) override;
+    bool isPointInGbObject3D(const double &x1p, const double &x2p, const double &x3p) override;
+    bool isCellInsideGbObject3D(const double &x1a, const double &x2a, const double &x3a, const double &x1b,
+                                const double &x2b, const double &x3b) override;
+    bool isCellCuttingGbObject3D(const double &x1a, const double &x2a, const double &x3a, const double &x1b,
+                                 const double &x2b, const double &x3b) override;
+    bool isCellInsideOrCuttingGbObject3D(const double &x1a, const double &x2a, const double &x3a, const double &x1b,
+                                         const double &x2b, const double &x3b) override;
+    // double getCellVolumeInsideGbObject3D(const double& x1a,const double& x2a,const double& x3a,const double&
+    // x1b,const double& x2b,const double& x3b);
+
+    GbPoint3D *calculateInterSectionPoint3D(GbPoint3D & /*point1*/, GbPoint3D & /*point2*/)
+    {
+        throw UbException(__FILE__, __LINE__, UB_FUNCTION, "not implemented");
+    }
+    GbLine3D *createClippedLine3D(GbPoint3D & /*point1*/, GbPoint3D & /*point2*/) override
+    {
+        throw UbException(__FILE__, __LINE__, UB_FUNCTION, "not implemented");
+    }
+
+    std::vector<GbTriangle3D *> getSurfaceTriangleSet() override;
+    void addSurfaceTriangleSet(std::vector<UbTupleFloat3> &nodes, std::vector<UbTupleInt3> &triangles) override;
+
+    bool hasRaytracing() override { return true; }
+    /*|r| must be 1! einheitsvector!!*/
+    double getIntersectionRaytraceFactor(const double &x1, const double &x2, const double &x3, const double &rx1,
+                                         const double &rx2, const double &rx3) override;
+
+    std::string toString() override;
+
+    // virtuelle Methoden von UbObserver
+    void objectChanged(UbObservable *changedObject) override {}
+    void objectWillBeDeleted(UbObservable *objectForDeletion) override {}
+
+    template <class T>
+    void readMatrixFromRawFile(std::string filename, GbVoxelMatrix3D::Endian endian);
+    template <class T>
+    void readBufferedMatrixFromRawFile(std::string filename, GbVoxelMatrix3D::Endian endian);
+    void readMatrixFromVtiASCIIFile(std::string filename);
+
+    void rotate90aroundX();
+    void rotate90aroundY();
+    void rotate90aroundZ();
+    void rotate90aroundX(double cX1, double cX2, double cX3);
+    void rotate90aroundY(double cX1, double cX2, double cX3);
+    void rotate90aroundZ(double cX1, double cX2, double cX3);
+    void mirrorX();
+    void mirrorY();
+    void mirrorZ();
+
+    void rotateAroundY(double theta);
+
+    void writeToLegacyVTKASCII(const std::string &fileName);
+    void writeToLegacyVTKBinary(const std::string &fileName);
+    void writeToVTKImageDataASCII(const std::string &fileName);
+    void writeToVTKImageDataAppended(const std::string &fileName);
+
+    void setClosedVoidSpaceToSolid();
+
+    void calculateNumberOfSolidAndFluid();
+    long getNumberOfSolid();
+    long getNumberOfFluid();
 
 protected:
-   void findFluidNeighbor(int cx1, int cx2, int cx3);
-   Matrix3D voxelMatrixTemp;
-   CbArray3D<char> flagMatrix;
+    void findFluidNeighbor(int cx1, int cx2, int cx3);
+    Matrix3D voxelMatrixTemp;
+    CbArray3D<char> flagMatrix;
 
-   std::vector<int> x1Nbr;
-   std::vector<int> x2Nbr;
-   std::vector<int> x3Nbr;
+    std::vector<int> x1Nbr;
+    std::vector<int> x2Nbr;
+    std::vector<int> x3Nbr;
 
-   std::vector<int> x1NbrTemp;
-   std::vector<int> x2NbrTemp;
-   std::vector<int> x3NbrTemp;
-
-   using GbObject3D::isPointInGbObject3D; //Grund: dadurch muss man hier  isPointInGbObject3D(GbPoint3D*) nicht ausprogrammieren, welche sonst hier "ueberdeckt" waere
+    std::vector<int> x1NbrTemp;
+    std::vector<int> x2NbrTemp;
+    std::vector<int> x3NbrTemp;
 
+    using GbObject3D::isPointInGbObject3D; // Grund: dadurch muss man hier  isPointInGbObject3D(GbPoint3D*) nicht
+                                           // ausprogrammieren, welche sonst hier "ueberdeckt" waere
 
 protected:
-   //for transfer
-   std::string filename;
-   bool transferViaFilename{false};
-
-   bool addSurfaceTriangleSetFlag{true};
+    // for transfer
+    std::string filename;
+    bool transferViaFilename{ false };
 
-   int nodesX1{0};
-   int nodesX2{0};
-   int nodesX3{0};
-   double lowerThreshold{0.0}, upperThreshold{0.0};
+    bool addSurfaceTriangleSetFlag{ true };
 
-   double minX1{0.0};
-   double minX2{0.0};
-   double minX3{0.0};
-   double deltaX1{1.0};
-   double deltaX2{1.0};
-   double deltaX3{1.0};
+    int nodesX1{ 0 };
+    int nodesX2{ 0 };
+    int nodesX3{ 0 };
+    double lowerThreshold{ 0.0 }, upperThreshold{ 0.0 };
 
-   Matrix3D voxelMatrix;
+    double minX1{ 0.0 };
+    double minX2{ 0.0 };
+    double minX3{ 0.0 };
+    double deltaX1{ 1.0 };
+    double deltaX2{ 1.0 };
+    double deltaX3{ 1.0 };
 
-   long numberOfSolid;
-   long numberOfFluid;
+    Matrix3D voxelMatrix;
 
+    long numberOfSolid;
+    long numberOfFluid;
 };
 
 //////////////////////////////////////////////////////////////////////////
 template <class T>
 void GbVoxelMatrix3D::readMatrixFromRawFile(std::string filename, GbVoxelMatrix3D::Endian endian)
 {
-   using namespace std;
-   //UBLOG(logINFO,"GbVoxelMatrix3D::readMatrixFromFile \""<<filename<<"\" nodes("<<nodesX1<<"/"<<nodesX2<<"/"<<nodesX3<<") - start");
-   ifstream in(filename.c_str(), ios::binary);
-   if (!in) throw UbException(UB_EXARGS, "could not open file "+filename);
-
-   in.seekg(0, ios::end);     //Ende springen
-   fstream::off_type length = in.tellg(); //Position abfragen
-   in.seekg(0, ios::beg);    //An den Anfang springen 
-
-   //UBLOG(logINFO,"number of nodes = "<<nodesX1*nodesX2*nodesX3*sizeof(T)<<" file size = "<<(long)length);
-   //if( (nodesX1*nodesX2*nodesX3)*sizeof(float) != (long)length )
-   unsigned long long nofn = (unsigned long long)nodesX1*(unsigned long long)nodesX2*(unsigned long long)nodesX3*(unsigned long long)sizeof(T);
-   if (nofn!=(unsigned long long)length)
-   {
-      throw UbException(UB_EXARGS, "number of nodes("+UbSystem::toString(nofn)+") doesn't match file size("+UbSystem::toString((long)length)+")");
-   }
-
-   //UBLOG(logINFO,"  - create GbVoxelMatrix3D");
-   //GbVoxelMatrix3D* voxelGeo = new GbVoxelMatrix3D(nodesX1,nodesX2,nodesX3,GbVoxelMatrix3D::FLUID);
-   voxelMatrix = Matrix3D(nodesX1, nodesX2, nodesX3, GbVoxelMatrix3D::FLUID);
-
-   //UBLOG(logINFO,"  - init values");
-   //float val;
-   T val;
-   for (int x3 = 0; x3<nodesX3; x3++)
-      for (int x2 = 0; x2<nodesX2; x2++)
-         for (int x1 = 0; x1<nodesX1; x1++)
-         {
-            //in.read((char*)&val,sizeof(float));
-            in.read((char*)&val, sizeof(T));
-            if (endian==BigEndian)
-               UbSystem::swapByteOrder((unsigned char*)(&(val)), sizeof(T));
-            //if( UbMath::equal((double)val, threshold) ) 
-            //if( UbMath::greater((double)val, threshold) )
-            if ((double)val>=lowerThreshold&&(double)val<=upperThreshold)
-            {
-               (voxelMatrix)(x1, x2, x3) = GbVoxelMatrix3D::SOLID;
+    using namespace std;
+    // UBLOG(logINFO,"GbVoxelMatrix3D::readMatrixFromFile \""<<filename<<"\"
+    // nodes("<<nodesX1<<"/"<<nodesX2<<"/"<<nodesX3<<") - start");
+    ifstream in(filename.c_str(), ios::binary);
+    if (!in)
+        throw UbException(UB_EXARGS, "could not open file " + filename);
+
+    in.seekg(0, ios::end);                 // Ende springen
+    fstream::off_type length = in.tellg(); // Position abfragen
+    in.seekg(0, ios::beg);                 // An den Anfang springen
+
+    // UBLOG(logINFO,"number of nodes = "<<nodesX1*nodesX2*nodesX3*sizeof(T)<<" file size = "<<(long)length);
+    // if( (nodesX1*nodesX2*nodesX3)*sizeof(float) != (long)length )
+    unsigned long long nofn = (unsigned long long)nodesX1 * (unsigned long long)nodesX2 * (unsigned long long)nodesX3 *
+                              (unsigned long long)sizeof(T);
+    if (nofn != (unsigned long long)length) {
+        throw UbException(UB_EXARGS, "number of nodes(" + UbSystem::toString(nofn) + ") doesn't match file size(" +
+                                         UbSystem::toString((long)length) + ")");
+    }
+
+    // UBLOG(logINFO,"  - create GbVoxelMatrix3D");
+    // GbVoxelMatrix3D* voxelGeo = new GbVoxelMatrix3D(nodesX1,nodesX2,nodesX3,GbVoxelMatrix3D::FLUID);
+    voxelMatrix = Matrix3D(nodesX1, nodesX2, nodesX3, GbVoxelMatrix3D::FLUID);
+
+    // UBLOG(logINFO,"  - init values");
+    // float val;
+    T val;
+    for (int x3 = 0; x3 < nodesX3; x3++)
+        for (int x2 = 0; x2 < nodesX2; x2++)
+            for (int x1 = 0; x1 < nodesX1; x1++) {
+                // in.read((char*)&val,sizeof(float));
+                in.read((char *)&val, sizeof(T));
+                if (endian == BigEndian)
+                    UbSystem::swapByteOrder((unsigned char *)(&(val)), sizeof(T));
+                // if( UbMath::equal((double)val, threshold) )
+                // if( UbMath::greater((double)val, threshold) )
+                if ((double)val >= lowerThreshold && (double)val <= upperThreshold) {
+                    (voxelMatrix)(x1, x2, x3) = GbVoxelMatrix3D::SOLID;
+                }
+                //(voxelMatrix)(x1, x2, x3) = (float)val;
             }
-            //(voxelMatrix)(x1, x2, x3) = (float)val;
-         }
 
-   //UBLOG(logINFO,"GbVoxelMatrix3D::readMatrixFromFile \""<<filename<<"\" nodes("<<nodesX1<<"/"<<nodesX2<<"/"<<nodesX3<<") - end");
+    // UBLOG(logINFO,"GbVoxelMatrix3D::readMatrixFromFile \""<<filename<<"\"
+    // nodes("<<nodesX1<<"/"<<nodesX2<<"/"<<nodesX3<<") - end");
 }
 
 //////////////////////////////////////////////////////////////////////////
 template <class T>
 void GbVoxelMatrix3D::readBufferedMatrixFromRawFile(std::string filename, GbVoxelMatrix3D::Endian endian)
 {
-   using namespace std;
-   UBLOG(logINFO, "GbVoxelMatrix3D::readMatrixFromRawFile \""<<filename<<"\" nodes("<<nodesX1<<"/"<<nodesX2<<"/"<<nodesX3<<") - start");
-
-   FILE *file;
-   file = fopen(filename.c_str(), "rb");
-   if (file==NULL)
-   {
-      throw UbException(UB_EXARGS, "Could not open file "+filename);
-   }
-
-   // obtain file size:
-   fseek(file, 0, SEEK_END);
-   unsigned long int length = ftell(file);
-   rewind(file);
-
-   UBLOG(logINFO, "number of nodes = "<<(long)nodesX1*(long)nodesX2*(long)nodesX3<<" file size = "<<length);
-
-   unsigned long int nofn = (long)nodesX1*(long)nodesX2*(long)nodesX3*(long)sizeof(T);
-   if (nofn!=length)
-   {
-      //throw UbException(UB_EXARGS, "number of nodes("+UbSystem::toString(nofn)+") doesn't match file size("+UbSystem::toString(length)+")");
-   }
-
-   UBLOG(logINFO, "  - create GbVoxelMatrix3D");
-   voxelMatrix = Matrix3D(nodesX1, nodesX2, nodesX3, GbVoxelMatrix3D::FLUID);
-
-   CbArray3D<T> readMatrix(nodesX1, nodesX2, nodesX3);
-
-   UBLOG(logINFO, "  - read file to matrix");
-   fread(readMatrix.getStartAdressOfSortedArray(0, 0, 0), sizeof(T), readMatrix.getDataVector().size(), file);
-   fclose(file);
-
-   UBLOG(logINFO, "  - init values");
-
-   numberOfSolid = 0;
-   T val;
-   for (int x3 = 0; x3<nodesX3; x3++)
-      for (int x2 = 0; x2<nodesX2; x2++)
-         for (int x1 = 0; x1<nodesX1; x1++)
-         {
-            val = readMatrix(x1, x2, x3);
-
-            if (endian==BigEndian)
-            {
-               UbSystem::swapByteOrder((unsigned char*)(&(val)), sizeof(T));
-            }
-
-            if ((double)val>=lowerThreshold&&(double)val<=upperThreshold)
-            {
-               voxelMatrix(x1, x2, x3) = GbVoxelMatrix3D::SOLID;
+    using namespace std;
+    UBLOG(logINFO, "GbVoxelMatrix3D::readMatrixFromRawFile \"" << filename << "\" nodes(" << nodesX1 << "/" << nodesX2
+                                                               << "/" << nodesX3 << ") - start");
+
+    FILE *file;
+    file = fopen(filename.c_str(), "rb");
+    if (file == NULL) {
+        throw UbException(UB_EXARGS, "Could not open file " + filename);
+    }
+
+    // obtain file size:
+    fseek(file, 0, SEEK_END);
+    unsigned long int length = ftell(file);
+    rewind(file);
+
+    UBLOG(logINFO, "number of nodes = " << (long)nodesX1 * (long)nodesX2 * (long)nodesX3 << " file size = " << length);
+
+    unsigned long int nofn = (long)nodesX1 * (long)nodesX2 * (long)nodesX3 * (long)sizeof(T);
+    if (nofn != length) {
+        // throw UbException(UB_EXARGS, "number of nodes("+UbSystem::toString(nofn)+") doesn't match file
+        // size("+UbSystem::toString(length)+")");
+    }
+
+    UBLOG(logINFO, "  - create GbVoxelMatrix3D");
+    voxelMatrix = Matrix3D(nodesX1, nodesX2, nodesX3, GbVoxelMatrix3D::FLUID);
+
+    CbArray3D<T> readMatrix(nodesX1, nodesX2, nodesX3);
+
+    UBLOG(logINFO, "  - read file to matrix");
+    fread(readMatrix.getStartAdressOfSortedArray(0, 0, 0), sizeof(T), readMatrix.getDataVector().size(), file);
+    fclose(file);
+
+    UBLOG(logINFO, "  - init values");
+
+    numberOfSolid = 0;
+    T val;
+    for (int x3 = 0; x3 < nodesX3; x3++)
+        for (int x2 = 0; x2 < nodesX2; x2++)
+            for (int x1 = 0; x1 < nodesX1; x1++) {
+                val = readMatrix(x1, x2, x3);
+
+                if (endian == BigEndian) {
+                    UbSystem::swapByteOrder((unsigned char *)(&(val)), sizeof(T));
+                }
+
+                if ((double)val >= lowerThreshold && (double)val <= upperThreshold) {
+                    voxelMatrix(x1, x2, x3) = GbVoxelMatrix3D::SOLID;
+                }
             }
-         }
 
-   UBLOG(logINFO, "GbVoxelMatrix3D::readMatrixFromRawFile \""<<filename<<"\" nodes("<<nodesX1<<"/"<<nodesX2<<"/"<<nodesX3<<") - end");
+    UBLOG(logINFO, "GbVoxelMatrix3D::readMatrixFromRawFile \"" << filename << "\" nodes(" << nodesX1 << "/" << nodesX2
+                                                               << "/" << nodesX3 << ") - end");
 }
 
-
-
 //#if defined(RCF_USE_SF_SERIALIZATION) && !defined(SWIG)
-//UB_AUTO_RUN_NAMED(SF::registerType<GbVoxelMatrix3D>("GbVoxelMatrix3D"), SF_GbVoxelMatrix3D);
-//UB_AUTO_RUN_NAMED((SF::registerBaseAndDerived< GbObject3D, GbVoxelMatrix3D >()), SF_GbVoxelMatrix3D_BD1);
-//UB_AUTO_RUN_NAMED((SF::registerBaseAndDerived< UbObserver, GbVoxelMatrix3D>()), SF_GbVoxelMatrix3D_BD2);
+// UB_AUTO_RUN_NAMED(SF::registerType<GbVoxelMatrix3D>("GbVoxelMatrix3D"), SF_GbVoxelMatrix3D);
+// UB_AUTO_RUN_NAMED((SF::registerBaseAndDerived< GbObject3D, GbVoxelMatrix3D >()), SF_GbVoxelMatrix3D_BD1);
+// UB_AUTO_RUN_NAMED((SF::registerBaseAndDerived< UbObserver, GbVoxelMatrix3D>()), SF_GbVoxelMatrix3D_BD2);
 //#endif //RCF_USE_SF_SERIALIZATION
 
-
-#endif   
+#endif
diff --git a/src/basics/geometry3d/KdTree/KdNode.h b/src/basics/geometry3d/KdTree/KdNode.h
index 0ccacc6e1c83423bbea0901da0b5ab19be769fab..eef1eb69614b9167fe9710d56f2766c1de4eab13 100644
--- a/src/basics/geometry3d/KdTree/KdNode.h
+++ b/src/basics/geometry3d/KdTree/KdNode.h
@@ -3,85 +3,94 @@
 
 #include <basics/memory/MbSmartPtr.h>
 
-#include <basics/utilities/UbMath.h>
-#include <basics/utilities/UbTuple.h>
 #include <basics/utilities/UbException.h>
 #include <basics/utilities/UbKeys.h>
+#include <basics/utilities/UbMath.h>
+#include <basics/utilities/UbTuple.h>
 
 #include <geometry3d/GbTriFaceMesh3D.h>
-#include <geometry3d/KdTree/KdUtilities.h>
 #include <geometry3d/KdTree/KdRay.h>
 #include <geometry3d/KdTree/KdSplitCandidate.h>
-#include <geometry3d/KdTree/splitalgorithms/KdSplitAlgorithm.h>
+#include <geometry3d/KdTree/KdUtilities.h>
 #include <geometry3d/KdTree/intersectionhandler/KdLineIntersectionHandler.h>
 #include <geometry3d/KdTree/intersectionhandler/KdRayIntersectionHandler.h>
+#include <geometry3d/KdTree/splitalgorithms/KdSplitAlgorithm.h>
 
-
-#include <vector>
 #include <string>
+#include <vector>
 
 namespace Kd
 {
-   template< typename T >
-   class Node 
-   {
-   public:
-      Node(  const T& x1, const T& y1, const T& z1
-           , const T& x2, const T& y2, const T& z2
-           , const MbSmartPtr< std::vector<GbTriFaceMesh3D::TriFace> > triFaces
-           , std::vector<GbTriFaceMesh3D::Vertex>* ptrNodes ) 
-         : child1(NULL)
-         , child2(NULL)
-         , triFaces(triFaces)
-         , ptrNodes(ptrNodes)
-      {
-         if( x1 < x2 ) { this->x[0] = x1; this->x[1] = x2; }
-         else          { this->x[0] = x2; this->x[1] = x1; }
+template <typename T>
+class Node
+{
+public:
+    Node(const T &x1, const T &y1, const T &z1, const T &x2, const T &y2, const T &z2,
+         const MbSmartPtr<std::vector<GbTriFaceMesh3D::TriFace>> triFaces,
+         std::vector<GbTriFaceMesh3D::Vertex> *ptrNodes)
+        : child1(NULL), child2(NULL), triFaces(triFaces), ptrNodes(ptrNodes)
+    {
+        if (x1 < x2) {
+            this->x[0] = x1;
+            this->x[1] = x2;
+        } else {
+            this->x[0] = x2;
+            this->x[1] = x1;
+        }
 
-         if( y1 < y2 ) { this->y[0] = y1; this->y[1] = y2; }
-         else          { this->y[0] = y2; this->y[1] = y1; }
+        if (y1 < y2) {
+            this->y[0] = y1;
+            this->y[1] = y2;
+        } else {
+            this->y[0] = y2;
+            this->y[1] = y1;
+        }
 
-         if( z1 < z2 ) { this->z[0] = z1; this->z[1] = z2; }
-         else          { this->z[0] = z2; this->z[1] = z1; }
-      }
-      /* ======================================================================================= */
-      ~Node()
-      {
-         if(child1) { delete child1; child1 = NULL;  }
-         if(child2) { delete child2; child2 = NULL;  }
-      }
-      /* ======================================================================================= */
-      bool isLeaf() 
-      {
-         return child1 == NULL && child2 == NULL;
-      }
-      /* ======================================================================================= */
-      void deleteTriFaces() 
-      {
-         triFaces = MbSmartPtr< std::vector<GbTriFaceMesh3D::TriFace> >();
-      }
-      /* ======================================================================================= */
-      const MbSmartPtr< std::vector<GbTriFaceMesh3D::TriFace> >& getTriFaces() 
-      {
-         return triFaces;
-      }
-      /* ======================================================================================= */
-      std::vector<GbTriFaceMesh3D::Vertex>& getNodes() 
-      {
-         if(!ptrNodes) throw UbException(UB_EXARGS,"ups,no nodes");
-         return *ptrNodes;
-      }
+        if (z1 < z2) {
+            this->z[0] = z1;
+            this->z[1] = z2;
+        } else {
+            this->z[0] = z2;
+            this->z[1] = z1;
+        }
+    }
+    /* ======================================================================================= */
+    ~Node()
+    {
+        if (child1) {
+            delete child1;
+            child1 = NULL;
+        }
+        if (child2) {
+            delete child2;
+            child2 = NULL;
+        }
+    }
+    /* ======================================================================================= */
+    bool isLeaf() { return child1 == NULL && child2 == NULL; }
+    /* ======================================================================================= */
+    void deleteTriFaces() { triFaces = MbSmartPtr<std::vector<GbTriFaceMesh3D::TriFace>>(); }
+    /* ======================================================================================= */
+    const MbSmartPtr<std::vector<GbTriFaceMesh3D::TriFace>> &getTriFaces() { return triFaces; }
+    /* ======================================================================================= */
+    std::vector<GbTriFaceMesh3D::Vertex> &getNodes()
+    {
+        if (!ptrNodes)
+            throw UbException(UB_EXARGS, "ups,no nodes");
+        return *ptrNodes;
+    }
 
-      /* ======================================================================================= */
-      void buildTree(const int& level, const int& maxLevel, const SplitAlgorithm<T>& splitAlg) 
-      {
-         SplitCandidate<T> splitCandidate = splitAlg.findBestSplitCandidate(level, maxLevel, *this);
+    /* ======================================================================================= */
+    void buildTree(const int &level, const int &maxLevel, const SplitAlgorithm<T> &splitAlg)
+    {
+        SplitCandidate<T> splitCandidate = splitAlg.findBestSplitCandidate(level, maxLevel, *this);
 
-         if( splitCandidate.isValid ) 
-         {
+        if (splitCandidate.isValid) {
 
-            MbSmartPtr< std::vector<GbTriFaceMesh3D::TriFace> > triFacesForChild1( new std::vector<GbTriFaceMesh3D::TriFace> );
-            MbSmartPtr< std::vector<GbTriFaceMesh3D::TriFace> > triFacesForChild2( new std::vector<GbTriFaceMesh3D::TriFace> );
+            MbSmartPtr<std::vector<GbTriFaceMesh3D::TriFace>> triFacesForChild1(
+                new std::vector<GbTriFaceMesh3D::TriFace>);
+            MbSmartPtr<std::vector<GbTriFaceMesh3D::TriFace>> triFacesForChild2(
+                new std::vector<GbTriFaceMesh3D::TriFace>);
 
             splitAlg.distributeTriFaces(splitCandidate, *triFacesForChild1, *triFacesForChild2, *this);
 
@@ -92,185 +101,183 @@ namespace Kd
             T x1_r = x[0], y1_r = y[0], z1_r = z[0];
             T x2_r = x[1], y2_r = y[1], z2_r = z[1];
 
-            if (splitCandidate.axis == Axis::X) 
-            {
-               x2_l = splitCandidate.position;
-               x1_r = splitCandidate.position;
-            } 
-            else if (splitCandidate.axis == Axis::Y)
-            {
-               y2_l = splitCandidate.position;
-               y1_r = splitCandidate.position;
-            } 
-            else 
-            {
-               z2_l = splitCandidate.position;
-               z1_r = splitCandidate.position;
+            if (splitCandidate.axis == Axis::X) {
+                x2_l = splitCandidate.position;
+                x1_r = splitCandidate.position;
+            } else if (splitCandidate.axis == Axis::Y) {
+                y2_l = splitCandidate.position;
+                y1_r = splitCandidate.position;
+            } else {
+                z2_l = splitCandidate.position;
+                z1_r = splitCandidate.position;
             }
             // ----------------------------------------------------------------------
             // ----------------------------------------------------------------------
 
-            if (triFacesForChild1->size() > 0) 
-            {
-               if( this->child1 ) delete this->child1;
-               this->child1 = new Node(x1_l, y1_l, z1_l, x2_l, y2_l, z2_l, triFacesForChild1, ptrNodes);
-               this->child1->buildTree(level + 1, maxLevel, splitAlg);
+            if (triFacesForChild1->size() > 0) {
+                if (this->child1)
+                    delete this->child1;
+                this->child1 = new Node(x1_l, y1_l, z1_l, x2_l, y2_l, z2_l, triFacesForChild1, ptrNodes);
+                this->child1->buildTree(level + 1, maxLevel, splitAlg);
             }
-            
-            if (triFacesForChild2->size() > 0) 
-            {
-               if( this->child2 ) delete this->child2;
-               this->child2 = new Node(x1_r, y1_r, z1_r, x2_r, y2_r, z2_r, triFacesForChild2, ptrNodes);
-               this->child2->buildTree(level + 1, maxLevel, splitAlg);
+
+            if (triFacesForChild2->size() > 0) {
+                if (this->child2)
+                    delete this->child2;
+                this->child2 = new Node(x1_r, y1_r, z1_r, x2_r, y2_r, z2_r, triFacesForChild2, ptrNodes);
+                this->child2->buildTree(level + 1, maxLevel, splitAlg);
             }
-         }
-      }
-      /* ======================================================================================= */
-      int intersectLineBoundingBox(const UbTuple<T,T,T>& n1, const UbTuple<T,T,T>& n2) 
-      {
-         const T& n1X = val<1>(n1);
-         const T& n1Y = val<2>(n1);
-         const T& n1Z = val<3>(n1);
+        }
+    }
+    /* ======================================================================================= */
+    int intersectLineBoundingBox(const UbTuple<T, T, T> &n1, const UbTuple<T, T, T> &n2)
+    {
+        const T &n1X = val<1>(n1);
+        const T &n1Y = val<2>(n1);
+        const T &n1Z = val<3>(n1);
 
-         const T& n2X = val<1>(n2);
-         const T& n2Y = val<2>(n2);
-         const T& n2Z = val<3>(n2);
+        const T &n2X = val<1>(n2);
+        const T &n2Y = val<2>(n2);
+        const T &n2Z = val<3>(n2);
 
-         if ( UbMath::greater(  UbMath::max(  ( (n1X <= n2X ? x[0] : x[1]) - n1X) / (n2X - n1X)
-                                            , ( (n1Y <= n2Y ? y[0] : y[1]) - n1Y) / (n2Y - n1Y)
-                                            , ( (n1Z <= n2Z ? z[0] : z[1]) - n1Z) / (n2Z - n1Z) )
-                              , UbMath::min(  ( (n1X >  n2X ? x[0] : x[1]) - n1X) / (n2X - n1X)
-                                            , ( (n1Y >  n2Y ? y[0] : y[1]) - n1Y) / (n2Y - n1Y)
-                                            , ( (n1Z >  n2Z ? z[0] : z[1]) - n1Z) / (n2Z - n1Z) ) ) )
-         {
+        if (UbMath::greater(UbMath::max(((n1X <= n2X ? x[0] : x[1]) - n1X) / (n2X - n1X),
+                                        ((n1Y <= n2Y ? y[0] : y[1]) - n1Y) / (n2Y - n1Y),
+                                        ((n1Z <= n2Z ? z[0] : z[1]) - n1Z) / (n2Z - n1Z)),
+                            UbMath::min(((n1X > n2X ? x[0] : x[1]) - n1X) / (n2X - n1X),
+                                        ((n1Y > n2Y ? y[0] : y[1]) - n1Y) / (n2Y - n1Y),
+                                        ((n1Z > n2Z ? z[0] : z[1]) - n1Z) / (n2Z - n1Z)))) {
             return Intersection::NO_INTERSECTION;
-         } 
-         else
-         {
+        } else {
             return Intersection::INTERSECTION;
-         }
-      }
-      /* ======================================================================================= */
-      int intersectRayBoundingBox(const Ray<T>& ray) 
-      {
-         T tmin  = (x[  ray.signX] - ray.originX) * ray.inv_directionX;
-         T tmax  = (x[1-ray.signX] - ray.originX) * ray.inv_directionX;
-        
-         T tymin = (y[  ray.signY] - ray.originY) * ray.inv_directionY;
-         T tymax = (y[1-ray.signY] - ray.originY) * ray.inv_directionY;
-         
-         if( (tmin > tymax) || (tymin > tmax) ) 
-         {
+        }
+    }
+    /* ======================================================================================= */
+    int intersectRayBoundingBox(const Ray<T> &ray)
+    {
+        T tmin = (x[ray.signX] - ray.originX) * ray.inv_directionX;
+        T tmax = (x[1 - ray.signX] - ray.originX) * ray.inv_directionX;
+
+        T tymin = (y[ray.signY] - ray.originY) * ray.inv_directionY;
+        T tymax = (y[1 - ray.signY] - ray.originY) * ray.inv_directionY;
+
+        if ((tmin > tymax) || (tymin > tmax)) {
             return false;
-         }
-         if( tymin > tmin ) tmin = tymin;
-         if( tymax < tmax ) tmax = tymax;
+        }
+        if (tymin > tmin)
+            tmin = tymin;
+        if (tymax < tmax)
+            tmax = tymax;
+
+        T tzmin = (z[ray.signZ] - ray.originZ) * ray.inv_directionZ;
+        T tzmax = (z[1 - ray.signZ] - ray.originZ) * ray.inv_directionZ;
 
-         T tzmin = (z[  ray.signZ] - ray.originZ) * ray.inv_directionZ;
-         T tzmax = (z[1-ray.signZ] - ray.originZ) * ray.inv_directionZ;
-         
-         //if( (UbMath::greater( tmin, tzmax) ) || ( UbMath::greater( tzmin, tmax) ) ) 
-         if( ( tmin > tzmax) || ( tzmin > tmax)  ) 
-         {
+        // if( (UbMath::greater( tmin, tzmax) ) || ( UbMath::greater( tzmin, tmax) ) )
+        if ((tmin > tzmax) || (tzmin > tmax)) {
             return false;
-         }
-         //if(tzmin > tmin) tmin = tzmin;
-         if(tzmax < tmax) tmax = tzmax;
-         
-         //return ( (tmin =< t1) && (tmax >= t0) );
-         if( UbMath::greaterEqual( tmax, T(0.0) ) )   
-         {
+        }
+        // if(tzmin > tmin) tmin = tzmin;
+        if (tzmax < tmax)
+            tmax = tzmax;
+
+        // return ( (tmin =< t1) && (tmax >= t0) );
+        if (UbMath::greaterEqual(tmax, T(0.0))) {
             return Intersection::INTERSECTION;
-         }
-         else
-         {
+        } else {
             return Intersection::NO_INTERSECTION;
-         }
-      }
-      /* ======================================================================================= */
-      bool intersectLine(const UbTuple<T,T,T>& n1, const UbTuple<T,T,T>& n2, const LineIntersectionHandler<T>& iHandler) 
-      {
-         return iHandler.intersectLine(n1, n2, *this, child1, child2);
-      }
-      /* ======================================================================================= */
-      int intersectRay(const Ray<T>& ray, const RayIntersectionHandler<T>& iHandler, std::set< UbKeys::Key3<int> >& mailbox) 
-      {
-         return iHandler.intersectRay(ray, *this, child1, child2, mailbox);
-      }
-      /* ======================================================================================= */
-      int getNumOfTriFaces()
-      {
-         if(!child1 && !child2)
-         {  
-            if(triFaces) return (int)triFaces->size();
-            else         return 0;
-         } 
-         else 
-         {
+        }
+    }
+    /* ======================================================================================= */
+    bool intersectLine(const UbTuple<T, T, T> &n1, const UbTuple<T, T, T> &n2,
+                       const LineIntersectionHandler<T> &iHandler)
+    {
+        return iHandler.intersectLine(n1, n2, *this, child1, child2);
+    }
+    /* ======================================================================================= */
+    int intersectRay(const Ray<T> &ray, const RayIntersectionHandler<T> &iHandler, std::set<UbKeys::Key3<int>> &mailbox)
+    {
+        return iHandler.intersectRay(ray, *this, child1, child2, mailbox);
+    }
+    /* ======================================================================================= */
+    int getNumOfTriFaces()
+    {
+        if (!child1 && !child2) {
+            if (triFaces)
+                return (int)triFaces->size();
+            else
+                return 0;
+        } else {
             int sum = 0;
 
-            if(child1) sum += child1->getNumOfTriFaces();
-            if(child2) sum += child2->getNumOfTriFaces();
+            if (child1)
+                sum += child1->getNumOfTriFaces();
+            if (child2)
+                sum += child2->getNumOfTriFaces();
 
             return sum;
-         }
-      }
-      /* ======================================================================================= */
-      int getNumOfNodes()
-      {
-         if( !child1 && !child2) 
-         {
+        }
+    }
+    /* ======================================================================================= */
+    int getNumOfNodes()
+    {
+        if (!child1 && !child2) {
             return 1;
-         } 
-         else
-         {
+        } else {
             int sum = 0;
-            if(child1) sum += child1->getNumOfNodes();
-            if(child2) sum += child2->getNumOfNodes();
+            if (child1)
+                sum += child1->getNumOfNodes();
+            if (child2)
+                sum += child2->getNumOfNodes();
 
             return 1 + sum;
-         }
-      }
-      /* ======================================================================================= */
-      std::string toString()
-      {
-         return "";//"[" + x1 + "," + y1 + "," + z1 + "]  -" + "  [" + x2 + "," + y2 + "," + z2 + "]";
-      }
-      /* ======================================================================================= */
-      void addCubeInfo(std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt8 >& cells, std::vector<std::string >& datanames, std::vector<std::vector<double > >& celldata)
-      {
-         nodes.push_back( makeUbTuple(float(x[0]), float(y[0]), float(z[0]) ) );
-         nodes.push_back( makeUbTuple(float(x[1]), float(y[0]), float(z[0]) ) );
-         nodes.push_back( makeUbTuple(float(x[1]), float(y[1]), float(z[0]) ) );
-         nodes.push_back( makeUbTuple(float(x[0]), float(y[1]), float(z[0]) ) );
-         
-         nodes.push_back( makeUbTuple(float(x[0]), float(y[0]), float(z[1]) ) );
-         nodes.push_back( makeUbTuple(float(x[1]), float(y[0]), float(z[1]) ) );
-         nodes.push_back( makeUbTuple(float(x[1]), float(y[1]), float(z[1]) ) );
-         nodes.push_back( makeUbTuple(float(x[0]), float(y[1]), float(z[1]) ) );
+        }
+    }
+    /* ======================================================================================= */
+    std::string toString()
+    {
+        return ""; //"[" + x1 + "," + y1 + "," + z1 + "]  -" + "  [" + x2 + "," + y2 + "," + z2 + "]";
+    }
+    /* ======================================================================================= */
+    void addCubeInfo(std::vector<UbTupleFloat3> &nodes, std::vector<UbTupleInt8> &cells,
+                     std::vector<std::string> &datanames, std::vector<std::vector<double>> &celldata)
+    {
+        nodes.push_back(makeUbTuple(float(x[0]), float(y[0]), float(z[0])));
+        nodes.push_back(makeUbTuple(float(x[1]), float(y[0]), float(z[0])));
+        nodes.push_back(makeUbTuple(float(x[1]), float(y[1]), float(z[0])));
+        nodes.push_back(makeUbTuple(float(x[0]), float(y[1]), float(z[0])));
+
+        nodes.push_back(makeUbTuple(float(x[0]), float(y[0]), float(z[1])));
+        nodes.push_back(makeUbTuple(float(x[1]), float(y[0]), float(z[1])));
+        nodes.push_back(makeUbTuple(float(x[1]), float(y[1]), float(z[1])));
+        nodes.push_back(makeUbTuple(float(x[0]), float(y[1]), float(z[1])));
 
-         cells.push_back( makeUbTuple( int(nodes.size()-8), int(nodes.size()-7), int(nodes.size()-6), int(nodes.size()-5), 
-                                       int(nodes.size()-4), int(nodes.size()-3), int(nodes.size()-2), int(nodes.size()-1) ) );
-         datanames.resize(1);
-         datanames[0] = "childs";
-         celldata.resize( datanames.size() );
-         if     ( child1 && child2 ) celldata[0].push_back(2);
-         else if( child1 || child2 ) celldata[0].push_back(1);
-         else                        celldata[0].push_back(0);
+        cells.push_back(makeUbTuple(int(nodes.size() - 8), int(nodes.size() - 7), int(nodes.size() - 6),
+                                    int(nodes.size() - 5), int(nodes.size() - 4), int(nodes.size() - 3),
+                                    int(nodes.size() - 2), int(nodes.size() - 1)));
+        datanames.resize(1);
+        datanames[0] = "childs";
+        celldata.resize(datanames.size());
+        if (child1 && child2)
+            celldata[0].push_back(2);
+        else if (child1 || child2)
+            celldata[0].push_back(1);
+        else
+            celldata[0].push_back(0);
 
-         if(child1) child1->addCubeInfo(nodes, cells, datanames, celldata);
-         if(child2) child2->addCubeInfo(nodes, cells, datanames, celldata);
-      }
+        if (child1)
+            child1->addCubeInfo(nodes, cells, datanames, celldata);
+        if (child2)
+            child2->addCubeInfo(nodes, cells, datanames, celldata);
+    }
 
-   public:
-      T x[2], y[2], z[2];
+public:
+    T x[2], y[2], z[2];
 
-   private:
-      Node* child1;
-      Node* child2;
+private:
+    Node *child1;
+    Node *child2;
 
-      MbSmartPtr< std::vector<GbTriFaceMesh3D::TriFace> > triFaces;
-      std::vector<GbTriFaceMesh3D::Vertex>*               ptrNodes;  //lediglich f�r Zugriff auf die Knoten!!!
-   };
-}
-#endif //KDNODE_H
+    MbSmartPtr<std::vector<GbTriFaceMesh3D::TriFace>> triFaces;
+    std::vector<GbTriFaceMesh3D::Vertex> *ptrNodes; // lediglich f�r Zugriff auf die Knoten!!!
+};
+} // namespace Kd
+#endif // KDNODE_H
diff --git a/src/basics/geometry3d/KdTree/KdRay.h b/src/basics/geometry3d/KdTree/KdRay.h
index 8465b83083ddc06fc1c1f965e02c74987cb02e2d..b37e30ce6666fdc8d061a4341dce810a077644f4 100644
--- a/src/basics/geometry3d/KdTree/KdRay.h
+++ b/src/basics/geometry3d/KdTree/KdRay.h
@@ -4,66 +4,70 @@
 #include <basics/utilities/UbException.h>
 #include <basics/utilities/UbMath.h>
 
-
 namespace Kd
 {
-   /*
-   * Ray class, for use with the optimized ray-box intersection test
-   * described in:
-   *
-   *      Amy Williams, Steve Barrus, R. Keith Morley, and Peter Shirley
-   *      "An Efficient and Robust Ray-Box Intersection Algorithm"
-   *      Journal of graphics tools, 10(1):49-54, 2005
-   * 
-   */
-   template< typename T>
-   class Ray 
-   {
-   public:
-      Ray(  const T& originX   , const T& originY   , const T& originZ
-          , const T& directionX, const T& directionY, const T& directionZ ) 
-      {
-         this->originX        = originX;
-         this->originY        = originY;
-         this->originZ        = originZ;
+/*
+ * Ray class, for use with the optimized ray-box intersection test
+ * described in:
+ *
+ *      Amy Williams, Steve Barrus, R. Keith Morley, and Peter Shirley
+ *      "An Efficient and Robust Ray-Box Intersection Algorithm"
+ *      Journal of graphics tools, 10(1):49-54, 2005
+ *
+ */
+template <typename T>
+class Ray
+{
+public:
+    Ray(const T &originX, const T &originY, const T &originZ, const T &directionX, const T &directionY,
+        const T &directionZ)
+    {
+        this->originX = originX;
+        this->originY = originY;
+        this->originZ = originZ;
+
+        // normierung (fuer ray-triangle-intersection)
+        T oneOverLength =
+            T(1.0 / std::sqrt(directionX * directionX + directionY * directionY + directionZ * directionZ));
+
+        this->directionX = directionX * oneOverLength;
+        this->directionY = directionY * oneOverLength;
+        this->directionZ = directionZ * oneOverLength;
+
+        this->inv_directionX = T(1.0 / this->directionX); // ACHTUNG: BEWUSST KEINE ==0 Abfrage
+        this->inv_directionY = T(1.0 / this->directionY); // Alg verwendet exlitzit INF
+        this->inv_directionZ = T(1.0 / this->directionZ);
+
+        if (this->inv_directionX < 0.0)
+            this->signX = 1;
+        else
+            this->signX = 0;
+        if (this->inv_directionY < 0.0)
+            this->signY = 1;
+        else
+            this->signY = 0;
+        if (this->inv_directionZ < 0.0)
+            this->signZ = 1;
+        else
+            this->signZ = 0;
+    }
 
-         //normierung (fuer ray-triangle-intersection)
-         T oneOverLength = T(1.0/std::sqrt(  directionX*directionX 
-                                            + directionY*directionY 
-                                            + directionZ*directionZ ) );
+    T originX;
+    T originY;
+    T originZ;
 
-         this->directionX     = directionX*oneOverLength;
-         this->directionY     = directionY*oneOverLength;
-         this->directionZ     = directionZ*oneOverLength;
+    T directionX;
+    T directionY;
+    T directionZ;
 
-         this->inv_directionX = T(1.0/this->directionX);   //ACHTUNG: BEWUSST KEINE ==0 Abfrage
-         this->inv_directionY = T(1.0/this->directionY);   //Alg verwendet exlitzit INF
-         this->inv_directionZ = T(1.0/this->directionZ);
-         
-         if(this->inv_directionX < 0.0) this->signX = 1;
-         else                           this->signX = 0;
-         if(this->inv_directionY < 0.0) this->signY = 1;
-         else                           this->signY = 0;
-         if(this->inv_directionZ < 0.0) this->signZ = 1;
-         else                           this->signZ = 0;
-      }
+    T inv_directionX;
+    T inv_directionY;
+    T inv_directionZ;
 
-      T   originX;
-      T   originY;
-      T   originZ;
-        
-      T   directionX;
-      T   directionY;
-      T   directionZ;
-        
-      T   inv_directionX;
-      T   inv_directionY;
-      T   inv_directionZ;
-      
-      int signX;
-      int signY;
-      int signZ;
-   };
-} //namespace Kd
+    int signX;
+    int signY;
+    int signZ;
+};
+} // namespace Kd
 
-#endif //KDRAY_H
+#endif // KDRAY_H
diff --git a/src/basics/geometry3d/KdTree/KdSplitCandidate.h b/src/basics/geometry3d/KdTree/KdSplitCandidate.h
index b7719ebf388cb1359653887ee9e409677d3886d4..b937a1235b732d420483f1fb8580ce396a874641 100644
--- a/src/basics/geometry3d/KdTree/KdSplitCandidate.h
+++ b/src/basics/geometry3d/KdTree/KdSplitCandidate.h
@@ -5,46 +5,39 @@
 
 namespace Kd
 {
-   template< typename T >
-   class SplitCandidate   
-   {
-   public:
-      SplitCandidate() = default;
-      /* ======================================================================================= */
-      SplitCandidate(const int& axis, const T& position, const int& starting, const int& ending, const int& insidePlane) :
-           axis(axis)
-         , position(position)
-         , starting(starting)
-         , ending(ending)
-         , np(insidePlane)
-         , isValid(true) //FIXME: isValid default false is correct?
-      {
-      }
-      /* ======================================================================================= */
-      bool operator!() const
-      {
-         return isValid; 
-      }
-      /* ======================================================================================= */
-      friend inline bool operator< (const SplitCandidate& lhs, const SplitCandidate& rhs)  
-      {
-         return  lhs.position < rhs.position;
-      }
-      /* ======================================================================================= */
+template <typename T>
+class SplitCandidate
+{
+public:
+    SplitCandidate() = default;
+    /* ======================================================================================= */
+    SplitCandidate(const int &axis, const T &position, const int &starting, const int &ending, const int &insidePlane)
+        : axis(axis), position(position), starting(starting), ending(ending), np(insidePlane),
+          isValid(true) // FIXME: isValid default false is correct?
+    {
+    }
+    /* ======================================================================================= */
+    bool operator!() const { return isValid; }
+    /* ======================================================================================= */
+    friend inline bool operator<(const SplitCandidate &lhs, const SplitCandidate &rhs)
+    {
+        return lhs.position < rhs.position;
+    }
+    /* ======================================================================================= */
 
-   public:
-      int     axis{0};
-      T       Cn {0.0};
-      T       position {0.0};
-      int     nl{0};
-      int     nr{0};
-      int     np;
-      int     starting{0};
-      int     ending{0};
-      bool    np_left{false};
-      bool    np_right{false};
-      bool    isValid{false};
-   };
-}
+public:
+    int axis{ 0 };
+    T Cn{ 0.0 };
+    T position{ 0.0 };
+    int nl{ 0 };
+    int nr{ 0 };
+    int np;
+    int starting{ 0 };
+    int ending{ 0 };
+    bool np_left{ false };
+    bool np_right{ false };
+    bool isValid{ false };
+};
+} // namespace Kd
 
-#endif //KDSPLITCANDIDATE_H
+#endif // KDSPLITCANDIDATE_H
diff --git a/src/basics/geometry3d/KdTree/KdSplitCandidateManager.h b/src/basics/geometry3d/KdTree/KdSplitCandidateManager.h
index f107bac602c658527f943c13c1dacd64a9cc506c..cf32711b14a6acfc0d5fb2c1afc37aeda68e504a 100644
--- a/src/basics/geometry3d/KdTree/KdSplitCandidateManager.h
+++ b/src/basics/geometry3d/KdTree/KdSplitCandidateManager.h
@@ -3,70 +3,66 @@
 
 #include <geometry3d/KdTree/KdSplitCandidate.h>
 
+#include <algorithm>
 #include <map>
 #include <vector>
-#include <algorithm>
-
 
 namespace Kd
 {
-   template< typename T >
-   class SplitCandidateManager  
-   {
-   public:
-      SplitCandidateManager()
-          
-      = default;
-      /* ======================================================================================= */
-      SplitCandidate<T>& operator[] (const std::size_t& i)
-      { 
-         #ifdef DEBUG
-            return splitCandidatesVec.at(i);
-         #else
-            return splitCandidatesVec[i];
-         #endif  
-      }
-      /* ======================================================================================= */
-      typename std::vector< SplitCandidate< T > >::size_type size()
-      { 
-         return splitCandidatesVec.size();
-      }
-      /* ======================================================================================= */
-      void add(const T& pos, const int& axis, const int& starting, const int& ending, const int& np)
-      {
-         typename std::map<T, SplitCandidate<T> >::iterator it = splitCandidates.find(pos); 
-         if ( it != splitCandidates.end() )   //split candidate is already available -> increase parameter (starting, ending and np)
-         {
-            SplitCandidate<T>& sc = it->second;
-            sc.np       += np;
+template <typename T>
+class SplitCandidateManager
+{
+public:
+    SplitCandidateManager()
+
+        = default;
+    /* ======================================================================================= */
+    SplitCandidate<T> &operator[](const std::size_t &i)
+    {
+#ifdef DEBUG
+        return splitCandidatesVec.at(i);
+#else
+        return splitCandidatesVec[i];
+#endif
+    }
+    /* ======================================================================================= */
+    typename std::vector<SplitCandidate<T>>::size_type size() { return splitCandidatesVec.size(); }
+    /* ======================================================================================= */
+    void add(const T &pos, const int &axis, const int &starting, const int &ending, const int &np)
+    {
+        typename std::map<T, SplitCandidate<T>>::iterator it = splitCandidates.find(pos);
+        if (it != splitCandidates
+                      .end()) // split candidate is already available -> increase parameter (starting, ending and np)
+        {
+            SplitCandidate<T> &sc = it->second;
+            sc.np += np;
             sc.starting += starting;
-            sc.ending   += ending;
-         } 
-         else // split candidate is not available -> add new split candidate
-         {
+            sc.ending += ending;
+        } else // split candidate is not available -> add new split candidate
+        {
             this->splitCandidates[pos] = SplitCandidate<T>(axis, pos, starting, ending, np);
-         }
-      }
-      /* ======================================================================================= */
-      void createSortedArray()
-      {
-         splitCandidatesVec.clear();
-         typename std::map<T, SplitCandidate<T> >::iterator it;
-         for( it=splitCandidates.begin(); it!=splitCandidates.end(); ++it)
+        }
+    }
+    /* ======================================================================================= */
+    void createSortedArray()
+    {
+        splitCandidatesVec.clear();
+        typename std::map<T, SplitCandidate<T>>::iterator it;
+        for (it = splitCandidates.begin(); it != splitCandidates.end(); ++it)
             splitCandidatesVec.push_back(it->second);
-         splitCandidates.clear();
-         std::sort(splitCandidatesVec.begin(), splitCandidatesVec.end(), std::less< SplitCandidate<T> >() );
-      }
-      /* ======================================================================================= */
+        splitCandidates.clear();
+        std::sort(splitCandidatesVec.begin(), splitCandidatesVec.end(), std::less<SplitCandidate<T>>());
+    }
+    /* ======================================================================================= */
 
-   public:
-      int objects_starting_outside_left{0};
-      int objects_fully_outside_node{0};
+public:
+    int objects_starting_outside_left{ 0 };
+    int objects_fully_outside_node{ 0 };
 
-   private:
-      std::map<T, SplitCandidate<T> > splitCandidates;
-      std::vector< SplitCandidate<T> >    splitCandidatesVec;
-   };
-}
+private:
+    std::map<T, SplitCandidate<T>> splitCandidates;
+    std::vector<SplitCandidate<T>> splitCandidatesVec;
+};
+} // namespace Kd
 
-#endif //KDSPLITCANDIDATEMANAGER_H
+#endif // KDSPLITCANDIDATEMANAGER_H
diff --git a/src/basics/geometry3d/KdTree/KdTree.h b/src/basics/geometry3d/KdTree/KdTree.h
index c3f76d22bcff4f5b04d5032a4f72037d0091a733..42c337f66cdddb450108e973fc0a75323512a149 100644
--- a/src/basics/geometry3d/KdTree/KdTree.h
+++ b/src/basics/geometry3d/KdTree/KdTree.h
@@ -1,100 +1,103 @@
 #ifndef KDTREE_H
 #define KDTREE_H
 
+#include <basics/utilities/UbKeys.h>
 #include <basics/writer/WbWriterVtkXmlBinary.h>
 #include <geometry3d/GbTriFaceMesh3D.h>
-#include <basics/utilities/UbKeys.h>
 
 #include <geometry3d/KdTree/KdNode.h>
 #include <geometry3d/KdTree/KdRay.h>
 #include <geometry3d/KdTree/KdSplitCandidate.h>
 #include <geometry3d/KdTree/splitalgorithms/KdSplitAlgorithm.h>
 
-#include <string>
 #include <cmath>
+#include <string>
 
 namespace Kd
 {
-   template< typename T >
-   class Tree 
-   {
-   public:
-      /* ======================================================================================= */
-      Tree(GbTriFaceMesh3D& mesh, const SplitAlgorithm<T>& splitAlg) 
-         : rootNode(NULL)
-      {
-         this->buildTree(mesh, splitAlg);
-      }
-      /* ======================================================================================= */
-      ~Tree()
-      {
-         if(rootNode)  { delete rootNode; rootNode = NULL; }
-      }
-      /* ======================================================================================= */
-      // the IntersectionHandler specifies how to handle the intersection
-      bool intersectLine(const UbTuple< T, T, T >& n1, const UbTuple< T, T, T >& n2, const LineIntersectionHandler<T>& iHandler) 
-      {
-         return rootNode->intersectLine(n1, n2, iHandler);
-      }
-      /* ======================================================================================= */
-      // the IntersectionHandler specifies how to handle the intersection
-      int intersectRay(const Ray<T>& ray, const RayIntersectionHandler<T>& iHandler) 
-      {
-         std::set< UbKeys::Key3<int> > mailbox;
-         return rootNode->intersectRay(ray, iHandler, mailbox);
-      }
-      /* ======================================================================================= */
-      int getNumOfNodes() 
-      {                                               
-         if(rootNode) return rootNode->getNumOfNodes();
-         return 0;
-      }
-      /* ======================================================================================= */
-      int getNumOfTriFaces() 
-      {
-         if(rootNode) return rootNode->getNumOfTriFaces();
-         return 0;
-      }
-      /* ======================================================================================= */
-      std::string toString() 
-      {
-         return "";//Tree:: num of nodes: " + rootNode.getNumOfNodes() + ", primitives:" + rootNode.getNumOfPrimitives() + ", root_primitives:" + getNumOfPrimitives() + ", max_level:" + max_level;
-      }
-      /* ======================================================================================= */
-      void buildTree(GbTriFaceMesh3D& mesh, const SplitAlgorithm<T>& splitAlg ) 
-      {
-         if(rootNode) delete rootNode;
-          
-         // create a copy of triangles 
-         MbSmartPtr< std::vector<GbTriFaceMesh3D::TriFace> > triFaces(new std::vector<GbTriFaceMesh3D::TriFace>(*mesh.getTriangles() ) );
+template <typename T>
+class Tree
+{
+public:
+    /* ======================================================================================= */
+    Tree(GbTriFaceMesh3D &mesh, const SplitAlgorithm<T> &splitAlg) : rootNode(NULL) { this->buildTree(mesh, splitAlg); }
+    /* ======================================================================================= */
+    ~Tree()
+    {
+        if (rootNode) {
+            delete rootNode;
+            rootNode = NULL;
+        }
+    }
+    /* ======================================================================================= */
+    // the IntersectionHandler specifies how to handle the intersection
+    bool intersectLine(const UbTuple<T, T, T> &n1, const UbTuple<T, T, T> &n2,
+                       const LineIntersectionHandler<T> &iHandler)
+    {
+        return rootNode->intersectLine(n1, n2, iHandler);
+    }
+    /* ======================================================================================= */
+    // the IntersectionHandler specifies how to handle the intersection
+    int intersectRay(const Ray<T> &ray, const RayIntersectionHandler<T> &iHandler)
+    {
+        std::set<UbKeys::Key3<int>> mailbox;
+        return rootNode->intersectRay(ray, iHandler, mailbox);
+    }
+    /* ======================================================================================= */
+    int getNumOfNodes()
+    {
+        if (rootNode)
+            return rootNode->getNumOfNodes();
+        return 0;
+    }
+    /* ======================================================================================= */
+    int getNumOfTriFaces()
+    {
+        if (rootNode)
+            return rootNode->getNumOfTriFaces();
+        return 0;
+    }
+    /* ======================================================================================= */
+    std::string toString()
+    {
+        return ""; // Tree:: num of nodes: " + rootNode.getNumOfNodes() + ", primitives:" +
+                   // rootNode.getNumOfPrimitives() + ", root_primitives:" + getNumOfPrimitives() + ", max_level:" +
+                   // max_level;
+    }
+    /* ======================================================================================= */
+    void buildTree(GbTriFaceMesh3D &mesh, const SplitAlgorithm<T> &splitAlg)
+    {
+        if (rootNode)
+            delete rootNode;
+
+        // create a copy of triangles
+        MbSmartPtr<std::vector<GbTriFaceMesh3D::TriFace>> triFaces(
+            new std::vector<GbTriFaceMesh3D::TriFace>(*mesh.getTriangles()));
 
-         const int maxLevel = static_cast<int>(lround(8.0 + 1.3 * std::log( (double)triFaces->size() ))); //TODO: remove magic numbers
+        const int maxLevel =
+            static_cast<int>(lround(8.0 + 1.3 * std::log((double)triFaces->size()))); // TODO: remove magic numbers
 
-         rootNode = new Node<T>(   T( mesh.getX1Minimum() )
-                                 , T( mesh.getX2Minimum() )
-                                 , T( mesh.getX3Minimum() )
-                                 , T( mesh.getX1Maximum() )
-                                 , T( mesh.getX2Maximum() )
-                                 , T( mesh.getX3Maximum() )
-                                 , triFaces, mesh.getNodes() );
+        rootNode =
+            new Node<T>(T(mesh.getX1Minimum()), T(mesh.getX2Minimum()), T(mesh.getX3Minimum()), T(mesh.getX1Maximum()),
+                        T(mesh.getX2Maximum()), T(mesh.getX3Maximum()), triFaces, mesh.getNodes());
 
-         rootNode->buildTree(0, maxLevel, splitAlg);
-      }
-      void writeTree(const std::string& filename, WbWriter* writer = WbWriterVtkXmlBinary::getInstance())
-      {
-         if(rootNode)
-         {
-            std::vector<UbTupleFloat3 >        nodes;
-            std::vector<UbTupleInt8 >          cubes;
-            std::vector<std::string >          datanames;
-            std::vector<std::vector<double > > cubesdata;
+        rootNode->buildTree(0, maxLevel, splitAlg);
+    }
+    void writeTree(const std::string &filename, WbWriter *writer = WbWriterVtkXmlBinary::getInstance())
+    {
+        if (rootNode) {
+            std::vector<UbTupleFloat3> nodes;
+            std::vector<UbTupleInt8> cubes;
+            std::vector<std::string> datanames;
+            std::vector<std::vector<double>> cubesdata;
             rootNode->addCubeInfo(nodes, cubes, datanames, cubesdata);
-            writer->writeOctsWithCellData(filename,nodes,cubes,datanames,cubesdata);
-         }
-      }
-   private:
-      Node<T>* rootNode;    
-   };
-}
+            writer->writeOctsWithCellData(filename, nodes, cubes, datanames, cubesdata);
+        }
+    }
+
+private:
+    Node<T> *rootNode;
+};
+} // namespace Kd
 
-#endif //KDTREE_H
+#endif // KDTREE_H
diff --git a/src/basics/geometry3d/KdTree/KdUtilities.cpp b/src/basics/geometry3d/KdTree/KdUtilities.cpp
index 3eca9f3562b7947d6dde8b94b248c26b84f25fb5..b2b56b0912297cbfb355d97a4a120f54820828ab 100644
--- a/src/basics/geometry3d/KdTree/KdUtilities.cpp
+++ b/src/basics/geometry3d/KdTree/KdUtilities.cpp
@@ -2,12 +2,12 @@
 
 namespace Kd
 {
-   const int Axis::X = 0;
-   const int Axis::Y = 1;
-   const int Axis::Z = 2;
+const int Axis::X = 0;
+const int Axis::Y = 1;
+const int Axis::Z = 2;
 
-   const int Intersection::ON_BOUNDARY     = -2;
-   const int Intersection::INTERSECT_EDGE  = -1;
-   const int Intersection::INTERSECTION    =  1;
-const int Intersection::NO_INTERSECTION =  0;
-} //namespace Kd
+const int Intersection::ON_BOUNDARY     = -2;
+const int Intersection::INTERSECT_EDGE  = -1;
+const int Intersection::INTERSECTION    = 1;
+const int Intersection::NO_INTERSECTION = 0;
+} // namespace Kd
diff --git a/src/basics/geometry3d/KdTree/KdUtilities.h b/src/basics/geometry3d/KdTree/KdUtilities.h
index 2c56652d2be8c30afb481834b9fe84e4f815d088..bf02ee4443f24782875478d4e30431fcb8910b9b 100644
--- a/src/basics/geometry3d/KdTree/KdUtilities.h
+++ b/src/basics/geometry3d/KdTree/KdUtilities.h
@@ -2,8 +2,8 @@
 #define KDUTILIES_H
 
 #include <basics/utilities/UbException.h>
-#include <basics/utilities/UbTuple.h>
 #include <basics/utilities/UbMath.h>
+#include <basics/utilities/UbTuple.h>
 
 #include <geometry3d/GbTriFaceMesh3D.h>
 
@@ -12,153 +12,153 @@
 
 namespace Kd
 {
-   struct  Axis 
-   {
-      static const int X;// = 0;
-      static const int Y;// = 1;
-      static const int Z;// = 2;
-   };
-   /* ======================================================================================= */
-   struct Intersection 
-   {
-      static const int ON_BOUNDARY;    // = -2;
-      static const int INTERSECT_EDGE; // = -1;
-      static const int INTERSECTION;   // = 1;
-      static const int NO_INTERSECTION;// = 0;
-   };
-   /* ======================================================================================= */
-   template< typename T>
-   inline void project2Axis(GbTriFaceMesh3D::TriFace& triFace, std::vector<GbTriFaceMesh3D::Vertex>& nodes, const int& axis, std::vector<T>& projection) 
-   {
-      projection.resize(3);
-   
-      if(axis==Axis::X)
-      {
-         projection[0] = triFace.getV1x(nodes);
-         projection[1] = triFace.getV2x(nodes);
-         projection[2] = triFace.getV3x(nodes);
-      }
-      else if(axis==Axis::Y)
-      {
-         projection[0] = triFace.getV1y(nodes);
-         projection[1] = triFace.getV2y(nodes);
-         projection[2] = triFace.getV3y(nodes);
-      }
-      else if(axis==Axis::Z)
-      {
-         projection[0] = triFace.getV1z(nodes);
-         projection[1] = triFace.getV2z(nodes);
-         projection[2] = triFace.getV3z(nodes);
-      }
-      else throw UbException(UB_EXARGS,"unknown axis");
-      
-      std::sort( projection.begin(), projection.end(), std::less<>() );
-   }
-   /* ======================================================================================= */
-   template< typename T>
-   inline bool isPointOnPlane(const T& px, const T& py, const T& pz, const T& precision, GbTriFaceMesh3D::Vertex& pointOfTriFace, GbTriFaceMesh3D::TriFace& triFace) 
-   {
-      return std::fabs( (px - pointOfTriFace.x) * triFace.nx + (py - pointOfTriFace.y) * triFace.ny + (pz - pointOfTriFace.z) * triFace.nz ) < precision;
-   }
-   /* ======================================================================================= */
-   template< typename T>
-   inline bool isPointOnTriangle( const T& px, const T& py, const T& pz, const T& precision
-                               , GbTriFaceMesh3D::Vertex& p1, GbTriFaceMesh3D::Vertex& p2, GbTriFaceMesh3D::Vertex& p3
-                               , GbTriFaceMesh3D::TriFace& triFace  ) 
-   {
-      if( Kd::isPointOnPlane(px, py, pz, precision, p1, triFace) ) 
-      {
-         T a_x = p1.x - px;
-         T a_y = p1.y - py;
-         T a_z = p1.z - pz;
-         T b_x = p2.x - px;
-         T b_y = p2.y - py;
-         T b_z = p2.z - pz;
-         T c_x = p3.x - px;
-         T c_y = p3.y - py;
-         T c_z = p3.z - pz;
-
-         const T factor = 0.5;
-         T Q1_x = (a_y * b_z - a_z * b_y) * factor;
-         T Q1_y = (a_z * b_x - a_x * b_z) * factor;
-         T Q1_z = (a_x * b_y - a_y * b_x) * factor;
-
-         T Q2_x = (b_y * c_z - b_z * c_y) * factor;
-         T Q2_y = (b_z * c_x - b_x * c_z) * factor;
-         T Q2_z = (b_x * c_y - b_y * c_x) * factor;
-
-         T Q3_x = (c_y * a_z - c_z * a_y) * factor;
-         T Q3_y = (c_z * a_x - c_x * a_z) * factor;
-         T Q3_z = (c_x * a_y - c_y * a_x) * factor;
-
-         T Q_x = Q1_x + Q2_x + Q3_x;
-         T Q_y = Q1_y + Q2_y + Q3_y;
-         T Q_z = Q1_z + Q2_z + Q3_z;
-
-
-         if     ( UbMath::zero(Q_x * Q1_x + Q_y * Q1_y + Q_z * Q1_z         ) ) return true;
-         else if( UbMath::zero(Q_x * Q2_x + Q_y * Q2_y + Q_z * Q2_z         ) ) return true;
-         else if( UbMath::zero(Q_x * Q3_x + Q_y * Q3_y + Q_z * Q3_z         ) ) return true;
-         else if( UbMath::less(Q_x * Q1_x + Q_y * Q1_y + Q_z * Q1_z, T(0.0) ) ) return false;
-         else if( UbMath::less(Q_x * Q2_x + Q_y * Q2_y + Q_z * Q2_z, T(0.0) ) ) return false;
-         else if( UbMath::less(Q_x * Q3_x + Q_y * Q3_y + Q_z * Q3_z, T(0.0) ) ) return false;
-
-         return true;
-      } 
-      
-      return false;
-   }
-   /* ======================================================================================= */
-   template< typename T>
-   inline bool intersectLine(const UbTuple<T,T,T>& n1, const UbTuple<T,T,T>& n2, GbTriFaceMesh3D::TriFace& triFace, std::vector<GbTriFaceMesh3D::Vertex>& nodes) 
-   {
-      GbTriFaceMesh3D::Vertex& p0=triFace.getNode(0,nodes);
-      
-      const T& n1X = val<1>(n1);
-      const T& n1Y = val<2>(n1);
-      const T& n1Z = val<3>(n1);
-
-      const T& n2X = val<1>(n2);
-      const T& n2Y = val<2>(n2);
-      const T& n2Z = val<3>(n2);
-
-      //if(   Kd::isPointOnPlane(n1X, n1Y, n1Z, T(1.0E-6), p0, triFace) 
-      //   && Kd::isPointOnPlane(n2X, n2Y, n2Z, T(1.0E-6), p0, triFace)) 
-      //{
-      //   return true;
-      //}
-
-         T denom = ( n2X - n1X ) * triFace.nx + ( n2Y - n1Y ) * triFace.ny + ( n2Z - n1Z ) * triFace.nz;
-
-         if( UbMath::zero( denom ) )  //line does not intersect the plane of the triangle !
-         {
-         return false;
-         } 
-         else 
-         {
-            T d  = - triFace.nx * p0.x - triFace.ny * p0.y - triFace.nz * p0.z;
-            T mu = T(-1.0 * (d + n1X * triFace.nx + n1Y * triFace.ny + n1Z * triFace.nz ) / denom);
-
-            if( !UbMath::inClosedInterval( mu, T(0.0), T(1.0)) )  // Point of intersection of line and plane does not lie on the triangle
-            {
+struct Axis {
+    static const int X; // = 0;
+    static const int Y; // = 1;
+    static const int Z; // = 2;
+};
+/* ======================================================================================= */
+struct Intersection {
+    static const int ON_BOUNDARY;     // = -2;
+    static const int INTERSECT_EDGE;  // = -1;
+    static const int INTERSECTION;    // = 1;
+    static const int NO_INTERSECTION; // = 0;
+};
+/* ======================================================================================= */
+template <typename T>
+inline void project2Axis(GbTriFaceMesh3D::TriFace &triFace, std::vector<GbTriFaceMesh3D::Vertex> &nodes,
+                         const int &axis, std::vector<T> &projection)
+{
+    projection.resize(3);
+
+    if (axis == Axis::X) {
+        projection[0] = triFace.getV1x(nodes);
+        projection[1] = triFace.getV2x(nodes);
+        projection[2] = triFace.getV3x(nodes);
+    } else if (axis == Axis::Y) {
+        projection[0] = triFace.getV1y(nodes);
+        projection[1] = triFace.getV2y(nodes);
+        projection[2] = triFace.getV3y(nodes);
+    } else if (axis == Axis::Z) {
+        projection[0] = triFace.getV1z(nodes);
+        projection[1] = triFace.getV2z(nodes);
+        projection[2] = triFace.getV3z(nodes);
+    } else
+        throw UbException(UB_EXARGS, "unknown axis");
+
+    std::sort(projection.begin(), projection.end(), std::less<>());
+}
+/* ======================================================================================= */
+template <typename T>
+inline bool isPointOnPlane(const T &px, const T &py, const T &pz, const T &precision,
+                           GbTriFaceMesh3D::Vertex &pointOfTriFace, GbTriFaceMesh3D::TriFace &triFace)
+{
+    return std::fabs((px - pointOfTriFace.x) * triFace.nx + (py - pointOfTriFace.y) * triFace.ny +
+                     (pz - pointOfTriFace.z) * triFace.nz) < precision;
+}
+/* ======================================================================================= */
+template <typename T>
+inline bool isPointOnTriangle(const T &px, const T &py, const T &pz, const T &precision, GbTriFaceMesh3D::Vertex &p1,
+                              GbTriFaceMesh3D::Vertex &p2, GbTriFaceMesh3D::Vertex &p3,
+                              GbTriFaceMesh3D::TriFace &triFace)
+{
+    if (Kd::isPointOnPlane(px, py, pz, precision, p1, triFace)) {
+        T a_x = p1.x - px;
+        T a_y = p1.y - py;
+        T a_z = p1.z - pz;
+        T b_x = p2.x - px;
+        T b_y = p2.y - py;
+        T b_z = p2.z - pz;
+        T c_x = p3.x - px;
+        T c_y = p3.y - py;
+        T c_z = p3.z - pz;
+
+        const T factor = 0.5;
+        T Q1_x         = (a_y * b_z - a_z * b_y) * factor;
+        T Q1_y         = (a_z * b_x - a_x * b_z) * factor;
+        T Q1_z         = (a_x * b_y - a_y * b_x) * factor;
+
+        T Q2_x = (b_y * c_z - b_z * c_y) * factor;
+        T Q2_y = (b_z * c_x - b_x * c_z) * factor;
+        T Q2_z = (b_x * c_y - b_y * c_x) * factor;
+
+        T Q3_x = (c_y * a_z - c_z * a_y) * factor;
+        T Q3_y = (c_z * a_x - c_x * a_z) * factor;
+        T Q3_z = (c_x * a_y - c_y * a_x) * factor;
+
+        T Q_x = Q1_x + Q2_x + Q3_x;
+        T Q_y = Q1_y + Q2_y + Q3_y;
+        T Q_z = Q1_z + Q2_z + Q3_z;
+
+        if (UbMath::zero(Q_x * Q1_x + Q_y * Q1_y + Q_z * Q1_z))
+            return true;
+        else if (UbMath::zero(Q_x * Q2_x + Q_y * Q2_y + Q_z * Q2_z))
+            return true;
+        else if (UbMath::zero(Q_x * Q3_x + Q_y * Q3_y + Q_z * Q3_z))
+            return true;
+        else if (UbMath::less(Q_x * Q1_x + Q_y * Q1_y + Q_z * Q1_z, T(0.0)))
+            return false;
+        else if (UbMath::less(Q_x * Q2_x + Q_y * Q2_y + Q_z * Q2_z, T(0.0)))
+            return false;
+        else if (UbMath::less(Q_x * Q3_x + Q_y * Q3_y + Q_z * Q3_z, T(0.0)))
+            return false;
+
+        return true;
+    }
+
+    return false;
+}
+/* ======================================================================================= */
+template <typename T>
+inline bool intersectLine(const UbTuple<T, T, T> &n1, const UbTuple<T, T, T> &n2, GbTriFaceMesh3D::TriFace &triFace,
+                          std::vector<GbTriFaceMesh3D::Vertex> &nodes)
+{
+    GbTriFaceMesh3D::Vertex &p0 = triFace.getNode(0, nodes);
+
+    const T &n1X = val<1>(n1);
+    const T &n1Y = val<2>(n1);
+    const T &n1Z = val<3>(n1);
+
+    const T &n2X = val<1>(n2);
+    const T &n2Y = val<2>(n2);
+    const T &n2Z = val<3>(n2);
+
+    // if(   Kd::isPointOnPlane(n1X, n1Y, n1Z, T(1.0E-6), p0, triFace)
+    //   && Kd::isPointOnPlane(n2X, n2Y, n2Z, T(1.0E-6), p0, triFace))
+    //{
+    //   return true;
+    //}
+
+    T denom = (n2X - n1X) * triFace.nx + (n2Y - n1Y) * triFace.ny + (n2Z - n1Z) * triFace.nz;
+
+    if (UbMath::zero(denom)) // line does not intersect the plane of the triangle !
+    {
+        return false;
+    } else {
+        T d  = -triFace.nx * p0.x - triFace.ny * p0.y - triFace.nz * p0.z;
+        T mu = T(-1.0 * (d + n1X * triFace.nx + n1Y * triFace.ny + n1Z * triFace.nz) / denom);
+
+        if (!UbMath::inClosedInterval(mu, T(0.0),
+                                      T(1.0))) // Point of intersection of line and plane does not lie on the triangle
+        {
             return false;
-            } 
-            else 
-            {
-               // intersection with plane
- 
-               //Test whether Point lies inside the triangle or not
-            GbTriFaceMesh3D::Vertex& p1=triFace.getNode(1,nodes);
-            GbTriFaceMesh3D::Vertex& p2=triFace.getNode(2,nodes);
-               
-               return Kd::isPointOnTriangle(  n1X + ( (n2X - n1X) * mu )   //intersectionPointX
-                                            , n1Y + ( (n2Y - n1Y) * mu )   //intersectionPointY
-                                            , n1Z + ( (n2Z - n1Z) * mu )   //intersectionPointZ
-                                            , T(0.001)
-                                            , p0, p1, p2, triFace );
-            }
-         }
-      } 
-} //namespace Kd
-
-#endif //KDUTILIES_H
+        } else {
+            // intersection with plane
+
+            // Test whether Point lies inside the triangle or not
+            GbTriFaceMesh3D::Vertex &p1 = triFace.getNode(1, nodes);
+            GbTriFaceMesh3D::Vertex &p2 = triFace.getNode(2, nodes);
+
+            return Kd::isPointOnTriangle(n1X + ((n2X - n1X) * mu) // intersectionPointX
+                                         ,
+                                         n1Y + ((n2Y - n1Y) * mu) // intersectionPointY
+                                         ,
+                                         n1Z + ((n2Z - n1Z) * mu) // intersectionPointZ
+                                         ,
+                                         T(0.001), p0, p1, p2, triFace);
+        }
+    }
+}
+} // namespace Kd
+
+#endif // KDUTILIES_H
diff --git a/src/basics/geometry3d/KdTree/intersectionhandler/KdCountLineIntersectionHandler.h b/src/basics/geometry3d/KdTree/intersectionhandler/KdCountLineIntersectionHandler.h
index 89501b60ef3dee57446ea58aeef26e9544be1138..0e5a9eb02569e1408dceb2a04ca8fdf97e658260 100644
--- a/src/basics/geometry3d/KdTree/intersectionhandler/KdCountLineIntersectionHandler.h
+++ b/src/basics/geometry3d/KdTree/intersectionhandler/KdCountLineIntersectionHandler.h
@@ -1,8 +1,8 @@
 #ifndef KDCOUNTLINEINTERSECTIONHANDLER_H
 #define KDCOUNTLINEINTERSECTIONHANDLER_H
 
-#include <basics/utilities/UbTuple.h>
 #include <basics/utilities/UbKeys.h>
+#include <basics/utilities/UbTuple.h>
 
 #include <geometry3d/GbTriFaceMesh3D.h>
 
@@ -14,43 +14,40 @@
 
 namespace Kd
 {
-   template< typename T >
-   class CountLineIntersectionHandler : public LineIntersectionHandler<T> 
-   {
-   public:
-      bool intersectLine(const UbTuple<T,T,T>& n1, const UbTuple<T,T,T>& n2, Node<T>& parent, Node<T>*& child1, Node<T>*& child2) const override
-      {
-         if( parent.intersectLineBoundingBox(n1, n2)  == Intersection::INTERSECTION)
-         {
-            if( parent.isLeaf() ) 
-            {
-               std::vector<GbTriFaceMesh3D::TriFace>& triFaces = *parent.getTriFaces();
-               std::vector<GbTriFaceMesh3D::Vertex>& nodes = parent.getNodes();
-
-         for( std::size_t i=0; i<triFaces.size(); i++ )
-         {
-            GbTriFaceMesh3D::TriFace& triFace = triFaces[i];
-
-                  if( Kd::intersectLine(n1, n2, triFace, nodes) ) return true;
-               }
-               return false;
-               }
-            else
-               {
-               if( child1 )
-               {
-                  if (child1->intersectLine(n1, n2, *this)) return true;
-               }
-               if( child2 ) 
-               {
-                  if (child2->intersectLine(n1, n2, *this)) return true;
-               }
+template <typename T>
+class CountLineIntersectionHandler : public LineIntersectionHandler<T>
+{
+public:
+    bool intersectLine(const UbTuple<T, T, T> &n1, const UbTuple<T, T, T> &n2, Node<T> &parent, Node<T> *&child1,
+                       Node<T> *&child2) const override
+    {
+        if (parent.intersectLineBoundingBox(n1, n2) == Intersection::INTERSECTION) {
+            if (parent.isLeaf()) {
+                std::vector<GbTriFaceMesh3D::TriFace> &triFaces = *parent.getTriFaces();
+                std::vector<GbTriFaceMesh3D::Vertex> &nodes     = parent.getNodes();
+
+                for (std::size_t i = 0; i < triFaces.size(); i++) {
+                    GbTriFaceMesh3D::TriFace &triFace = triFaces[i];
+
+                    if (Kd::intersectLine(n1, n2, triFace, nodes))
+                        return true;
+                }
+                return false;
+            } else {
+                if (child1) {
+                    if (child1->intersectLine(n1, n2, *this))
+                        return true;
+                }
+                if (child2) {
+                    if (child2->intersectLine(n1, n2, *this))
+                        return true;
+                }
             }
-         }
-         return false;
-      }
-      /* ======================================================================================= */
-   };
-}
-
-#endif //KDCOUNTLINEINTERSECTIONHANDLER_H
+        }
+        return false;
+    }
+    /* ======================================================================================= */
+};
+} // namespace Kd
+
+#endif // KDCOUNTLINEINTERSECTIONHANDLER_H
diff --git a/src/basics/geometry3d/KdTree/intersectionhandler/KdCountRayIntersectionHandler.h b/src/basics/geometry3d/KdTree/intersectionhandler/KdCountRayIntersectionHandler.h
index 460ec2174e592950157c04b5d9c6632fe2079975..2fab632ff78b60cd7d6dd2f595aba3562d1f9804 100644
--- a/src/basics/geometry3d/KdTree/intersectionhandler/KdCountRayIntersectionHandler.h
+++ b/src/basics/geometry3d/KdTree/intersectionhandler/KdCountRayIntersectionHandler.h
@@ -1,8 +1,8 @@
 #ifndef KDCOUNTRAYINTERSECTIONHANDLER_H
 #define KDCOUNTRAYINTERSECTIONHANDLER_H
 
-#include <basics/utilities/UbTuple.h>
 #include <basics/utilities/UbKeys.h>
+#include <basics/utilities/UbTuple.h>
 
 #include <geometry3d/GbTriFaceMesh3D.h>
 
@@ -14,151 +14,146 @@
 
 namespace Kd
 {
-   template< typename T >
-   class CountRayIntersectionHandler : public RayIntersectionHandler<T> 
-   {
-   public:
-      int intersectRay(const Ray<T>& ray, Node<T>& parent, Node<T>*& child1, Node<T>*& child2, std::set< UbKeys::Key3<int> >& mailbox) const override
-      {
-         if( parent.intersectRayBoundingBox(ray)  == Intersection::INTERSECTION)
-         {
-            if( parent.isLeaf() ) 
-            {
-               return this->checkIntersectionWithTriFaces(ray, *parent.getTriFaces(), parent.getNodes(), mailbox);
-            } 
-            else
-            {
-               int sum = 0;
-               if( child1 )
-               {
-                  int erg = child1->intersectRay(ray, *this, mailbox);
-                  if(erg < 0)
-                  {
-                     return erg;
-                  }
-                  sum += erg;
-               }
-               if( child2 ) 
-               {
-                  int erg = child2->intersectRay(ray, *this, mailbox);
-                  if(erg < 0)
-                  {
-                     return erg;
-                  }
-                  sum += erg;
-               }
-               return sum;
+template <typename T>
+class CountRayIntersectionHandler : public RayIntersectionHandler<T>
+{
+public:
+    int intersectRay(const Ray<T> &ray, Node<T> &parent, Node<T> *&child1, Node<T> *&child2,
+                     std::set<UbKeys::Key3<int>> &mailbox) const override
+    {
+        if (parent.intersectRayBoundingBox(ray) == Intersection::INTERSECTION) {
+            if (parent.isLeaf()) {
+                return this->checkIntersectionWithTriFaces(ray, *parent.getTriFaces(), parent.getNodes(), mailbox);
+            } else {
+                int sum = 0;
+                if (child1) {
+                    int erg = child1->intersectRay(ray, *this, mailbox);
+                    if (erg < 0) {
+                        return erg;
+                    }
+                    sum += erg;
+                }
+                if (child2) {
+                    int erg = child2->intersectRay(ray, *this, mailbox);
+                    if (erg < 0) {
+                        return erg;
+                    }
+                    sum += erg;
+                }
+                return sum;
             }
-         } 
-         else 
-         {
+        } else {
             return 0;
-         }
-      }
-      /* ======================================================================================= */
-
-   private:
-      int checkIntersectionWithTriFaces(const Ray<T>& ray, std::vector<GbTriFaceMesh3D::TriFace>& triFaces, std::vector<GbTriFaceMesh3D::Vertex>& nodes, std::set< UbKeys::Key3<int> >& mailbox) const
-      {
-         T e1x,e1y,e1z,e2x,e2y,e2z,px,py,pz,a,f,sx,sy,sz,u,qx,qy,qz,v,factor;
-
-         int counter = 0;
-
-         for(std::size_t i=0; i<triFaces.size(); i++ )
-         {
-            GbTriFaceMesh3D::TriFace& triFace = triFaces[i];
-
-            if( mailbox.find( UbKeys::Key3<int>(triFace.getIndexVertex1(), triFace.getIndexVertex2(), triFace.getIndexVertex3() ) )==mailbox.end() ) 
-            {
-               mailbox.insert( UbKeys::Key3<int>(triFace.getIndexVertex1(), triFace.getIndexVertex2(), triFace.getIndexVertex3() ) ); //schon hier rein, ansonsten muss man es unten bei JEDEm continue und am ende des ifs machen
-
-               GbTriFaceMesh3D::Vertex& v1 = triFace.getNode(0, nodes);
-               GbTriFaceMesh3D::Vertex& v2 = triFace.getNode(1, nodes);
-               GbTriFaceMesh3D::Vertex& v3 = triFace.getNode(2, nodes);
-
-               //////////////////////////////////////////////////////////////////////////
-               //Raytracing - start(  Anm.: pr�ft NUR in Strahlrichtung
-               // Grundidee: Schnittpunkt in Baryzentrischen Koordinaten besimmten
-               // t(u,v,w) = w*v0 + u*v1 + v*v2 
-               // mit w = 1.0-u-v, da fuer alle Punkte (u,v,w) im Dreick gilt u+v+w = 1
-               // wenn u, v oder w == 0 -> Punkt liegt auf Kante
-               // wenn u, v oder w == 1 -> Punkt liegt auf Eckpunkt (-> die anderen Werte muessen 0 )
-               
-               //e1 = v1 - v0
-               e1x = v2.x-v1.x;
-               e1y = v2.y-v1.y;
-               e1z = v2.z-v1.z;
-
-               //e2 = v2 - v0
-               e2x = v3.x-v1.x;
-               e2y = v3.y-v1.y;
-               e2z = v3.z-v1.z;
-
-               //p = d x e2
-               px = ray.directionY*e2z - ray.directionZ*e2y;
-               py = ray.directionZ*e2x - ray.directionX*e2z;
-               pz = ray.directionX*e2y - ray.directionY*e2x;
-
-               //a = e1 dot p
-               a = e1x*px + e1y*py + e1z*pz;
-               //if( fabs(a)<1.E-10 ) continue;
-               if( fabs(a) < UbMath::Epsilon<T>::val() ) continue;
-               f = T(1.0/a);
-
-               //s = o - v0
-               sx = ray.originX - v1.x;
-               sy = ray.originY - v1.y;
-               sz = ray.originZ - v1.z;
-
-               //u = f * ( s dot p)
-               u = f * ( sx*px + sy*py + sz*pz );
-               
-               //u ist nur gueltig in [0;1] 
-               if( ( UbMath::less(   u, T(0.0) ) ) || ( UbMath::greater(u, T(1.0) ) ) ) 
-               {
-                  continue;
-               }
-
-               //q = s x e1
-               qx = sy*e1z - sz*e1y;
-               qy = sz*e1x - sx*e1z;
-               qz = sx*e1y - sy*e1x;
-
-               //v = f*(e2 dot q)
-               v = f * (ray.directionX*qx + ray.directionY*qy + ray.directionZ*qz);
-               
-               //v ist nur gueltig in [0;1] da aber v bereits gueltig ist -> u+v darf nicht > 1.0 sein ;-)
-               if(   ( UbMath::less(v, T(0.0) ) ) || ( UbMath::greater(u+v, T(1.0) ) ) ) 
-               {
-                  continue;
-               }
-
-               //t = f * (e2 dot q)
-               factor = f * (e2x*qx + e2y*qy + e2z*qz);
-               //Raytracing - end
-               //////////////////////////////////////////////////////////////////////////
-
-               if( UbMath::zero( factor ) ) 
-               {
-                  return Intersection::ON_BOUNDARY; //ray.Org liegt direkt auf einem dreieck --> boundary
-               }
-               if( factor < 0.0 )
-               {
-                  continue;  //Schnittpunkt liegt in entgegengesetzter Strahlrichtung
-               }
-
-               //edge tests
-               //wenn u, v oder w ==0 -> Punkt liegt auf Kante bzw. Eckpunkt
-               if( UbMath::zero(u)          )  return Intersection::INTERSECT_EDGE;
-               if( UbMath::zero(v)          )  return Intersection::INTERSECT_EDGE;
-               if( UbMath::zero(T(1.0)-u-v) )  return Intersection::INTERSECT_EDGE;
-
-               counter++;
+        }
+    }
+    /* ======================================================================================= */
+
+private:
+    int checkIntersectionWithTriFaces(const Ray<T> &ray, std::vector<GbTriFaceMesh3D::TriFace> &triFaces,
+                                      std::vector<GbTriFaceMesh3D::Vertex> &nodes,
+                                      std::set<UbKeys::Key3<int>> &mailbox) const
+    {
+        T e1x, e1y, e1z, e2x, e2y, e2z, px, py, pz, a, f, sx, sy, sz, u, qx, qy, qz, v, factor;
+
+        int counter = 0;
+
+        for (std::size_t i = 0; i < triFaces.size(); i++) {
+            GbTriFaceMesh3D::TriFace &triFace = triFaces[i];
+
+            if (mailbox.find(UbKeys::Key3<int>(triFace.getIndexVertex1(), triFace.getIndexVertex2(),
+                                               triFace.getIndexVertex3())) == mailbox.end()) {
+                mailbox.insert(
+                    UbKeys::Key3<int>(triFace.getIndexVertex1(), triFace.getIndexVertex2(),
+                                      triFace.getIndexVertex3())); // schon hier rein, ansonsten muss man es unten bei
+                                                                   // JEDEm continue und am ende des ifs machen
+
+                GbTriFaceMesh3D::Vertex &v1 = triFace.getNode(0, nodes);
+                GbTriFaceMesh3D::Vertex &v2 = triFace.getNode(1, nodes);
+                GbTriFaceMesh3D::Vertex &v3 = triFace.getNode(2, nodes);
+
+                //////////////////////////////////////////////////////////////////////////
+                // Raytracing - start(  Anm.: pr�ft NUR in Strahlrichtung
+                // Grundidee: Schnittpunkt in Baryzentrischen Koordinaten besimmten
+                // t(u,v,w) = w*v0 + u*v1 + v*v2
+                // mit w = 1.0-u-v, da fuer alle Punkte (u,v,w) im Dreick gilt u+v+w = 1
+                // wenn u, v oder w == 0 -> Punkt liegt auf Kante
+                // wenn u, v oder w == 1 -> Punkt liegt auf Eckpunkt (-> die anderen Werte muessen 0 )
+
+                // e1 = v1 - v0
+                e1x = v2.x - v1.x;
+                e1y = v2.y - v1.y;
+                e1z = v2.z - v1.z;
+
+                // e2 = v2 - v0
+                e2x = v3.x - v1.x;
+                e2y = v3.y - v1.y;
+                e2z = v3.z - v1.z;
+
+                // p = d x e2
+                px = ray.directionY * e2z - ray.directionZ * e2y;
+                py = ray.directionZ * e2x - ray.directionX * e2z;
+                pz = ray.directionX * e2y - ray.directionY * e2x;
+
+                // a = e1 dot p
+                a = e1x * px + e1y * py + e1z * pz;
+                // if( fabs(a)<1.E-10 ) continue;
+                if (fabs(a) < UbMath::Epsilon<T>::val())
+                    continue;
+                f = T(1.0 / a);
+
+                // s = o - v0
+                sx = ray.originX - v1.x;
+                sy = ray.originY - v1.y;
+                sz = ray.originZ - v1.z;
+
+                // u = f * ( s dot p)
+                u = f * (sx * px + sy * py + sz * pz);
+
+                // u ist nur gueltig in [0;1]
+                if ((UbMath::less(u, T(0.0))) || (UbMath::greater(u, T(1.0)))) {
+                    continue;
+                }
+
+                // q = s x e1
+                qx = sy * e1z - sz * e1y;
+                qy = sz * e1x - sx * e1z;
+                qz = sx * e1y - sy * e1x;
+
+                // v = f*(e2 dot q)
+                v = f * (ray.directionX * qx + ray.directionY * qy + ray.directionZ * qz);
+
+                // v ist nur gueltig in [0;1] da aber v bereits gueltig ist -> u+v darf nicht > 1.0 sein ;-)
+                if ((UbMath::less(v, T(0.0))) || (UbMath::greater(u + v, T(1.0)))) {
+                    continue;
+                }
+
+                // t = f * (e2 dot q)
+                factor = f * (e2x * qx + e2y * qy + e2z * qz);
+                // Raytracing - end
+                //////////////////////////////////////////////////////////////////////////
+
+                if (UbMath::zero(factor)) {
+                    return Intersection::ON_BOUNDARY; // ray.Org liegt direkt auf einem dreieck --> boundary
+                }
+                if (factor < 0.0) {
+                    continue; // Schnittpunkt liegt in entgegengesetzter Strahlrichtung
+                }
+
+                // edge tests
+                // wenn u, v oder w ==0 -> Punkt liegt auf Kante bzw. Eckpunkt
+                if (UbMath::zero(u))
+                    return Intersection::INTERSECT_EDGE;
+                if (UbMath::zero(v))
+                    return Intersection::INTERSECT_EDGE;
+                if (UbMath::zero(T(1.0) - u - v))
+                    return Intersection::INTERSECT_EDGE;
+
+                counter++;
             }
-         }
-         return counter;
-      }
-   };
-}
+        }
+        return counter;
+    }
+};
+} // namespace Kd
 
-#endif //KDCOUNTRAYLINEINTERSECTIONHANDLER_H
+#endif // KDCOUNTRAYLINEINTERSECTIONHANDLER_H
diff --git a/src/basics/geometry3d/KdTree/intersectionhandler/KdLineIntersectionHandler.h b/src/basics/geometry3d/KdTree/intersectionhandler/KdLineIntersectionHandler.h
index 156dd720b4719a62423efc50bd616a249fe2a516..61d4800d22fa6b8e204c1325f781b9fbf411c057 100644
--- a/src/basics/geometry3d/KdTree/intersectionhandler/KdLineIntersectionHandler.h
+++ b/src/basics/geometry3d/KdTree/intersectionhandler/KdLineIntersectionHandler.h
@@ -11,20 +11,21 @@
 // #end
 namespace Kd
 {
-   template< typename T>
-   class Node;
+template <typename T>
+class Node;
 
-   template< typename T>
-   class LineIntersectionHandler 
-   {
-   public:
-      virtual bool intersectLine(const UbTuple<T,T,T>& n1, const UbTuple<T,T,T>& n2, Node<T>& parent, Node<T>*& child1, Node<T>*& child2) const = 0;
-      virtual ~LineIntersectionHandler() = default;
-   };
-}
+template <typename T>
+class LineIntersectionHandler
+{
+public:
+    virtual bool intersectLine(const UbTuple<T, T, T> &n1, const UbTuple<T, T, T> &n2, Node<T> &parent,
+                               Node<T> *&child1, Node<T> *&child2) const = 0;
+    virtual ~LineIntersectionHandler()                                   = default;
+};
+} // namespace Kd
 
 // #if defined(RCF_USE_SF_SERIALIZATION) && !defined(SWIG)
 //    SF_NO_CTOR(Kd::LineIntersectionHandler<float>);
 //    SF_NO_CTOR(Kd::LineIntersectionHandler<double>);
 // #endif //RCF_USE_SF_SERIALIZATI
-#endif //KDLINEINTERSECTIONHANDLER_H
+#endif // KDLINEINTERSECTIONHANDLER_H
diff --git a/src/basics/geometry3d/KdTree/intersectionhandler/KdRayIntersectionHandler.h b/src/basics/geometry3d/KdTree/intersectionhandler/KdRayIntersectionHandler.h
index 99803aa152b41033c638b84500f1f2911c6b142d..2965b0b393c5e324af0a7d3dea593f703f208db1 100644
--- a/src/basics/geometry3d/KdTree/intersectionhandler/KdRayIntersectionHandler.h
+++ b/src/basics/geometry3d/KdTree/intersectionhandler/KdRayIntersectionHandler.h
@@ -8,13 +8,14 @@
 
 namespace Kd
 {
-   template< typename T>
-   class RayIntersectionHandler 
-   {
-   public:
-      virtual int intersectRay(const Ray<T>& ray, Node<T>& parent, Node<T>*& child1, Node<T>*& child2, std::set< UbKeys::Key3<int> >& mailbox) const = 0;
-      virtual ~RayIntersectionHandler() = default;
-   };
-}
+template <typename T>
+class RayIntersectionHandler
+{
+public:
+    virtual int intersectRay(const Ray<T> &ray, Node<T> &parent, Node<T> *&child1, Node<T> *&child2,
+                             std::set<UbKeys::Key3<int>> &mailbox) const = 0;
+    virtual ~RayIntersectionHandler()                                    = default;
+};
+} // namespace Kd
 
-#endif //KDRAYINTERSECTIONHANDLER_H
+#endif // KDRAYINTERSECTIONHANDLER_H
diff --git a/src/basics/geometry3d/KdTree/splitalgorithms/KdSAHSplit.cpp b/src/basics/geometry3d/KdTree/splitalgorithms/KdSAHSplit.cpp
index 98fc024dbfc4612f99cef66afe5c9d74d5eeaf67..31cfa74d8bc32628e87a8db5e184b9df5134b3a8 100644
--- a/src/basics/geometry3d/KdTree/splitalgorithms/KdSAHSplit.cpp
+++ b/src/basics/geometry3d/KdTree/splitalgorithms/KdSAHSplit.cpp
@@ -1,10 +1,7 @@
 //#include <geometry3d/KdTree/SAHSplit.h>
 
-
 // namespace Kd
 // {
 //    const double SAHSplit::Ct = 3.0; //traversal cost
 //    const double SAHSplit::Ci = 4.0; //ray-patch-intersection-cost
 // }
-
-
diff --git a/src/basics/geometry3d/KdTree/splitalgorithms/KdSAHSplit.h b/src/basics/geometry3d/KdTree/splitalgorithms/KdSAHSplit.h
index 07e9013cbe3e318f702f739825f41ec448778cba..c828f5f7fdc95000f64a83e964c0697649e31f97 100644
--- a/src/basics/geometry3d/KdTree/splitalgorithms/KdSAHSplit.h
+++ b/src/basics/geometry3d/KdTree/splitalgorithms/KdSAHSplit.h
@@ -2,286 +2,254 @@
 #define KDSAHSPLIT_H
 
 #include <basics/utilities/UbException.h>
-#include <basics/utilities/UbMath.h>
 #include <basics/utilities/UbInfinity.h>
+#include <basics/utilities/UbMath.h>
 #include <geometry3d/GbTriFaceMesh3D.h>
 
 #include <geometry3d/KdTree/KdNode.h>
-#include <geometry3d/KdTree/KdUtilities.h>
 #include <geometry3d/KdTree/KdSplitCandidateManager.h>
+#include <geometry3d/KdTree/KdUtilities.h>
 #include <geometry3d/KdTree/splitalgorithms/KdSplitAlgorithm.h>
 
-#include <vector>
 #include <cmath>
+#include <vector>
 
 namespace Kd
 {
-   template< typename T >
-   class SAHSplit : public SplitAlgorithm<T> 
-   {
-   public:
-      /* ======================================================================================= */
-      SplitCandidate<T> findBestSplitCandidate(const int& level, const int& maxLevel, Node<T>& node ) const override
-      {
-         if( !node.getTriFaces() )  throw UbException(UB_EXARGS, "triFace NULL pointer");
-
-         if(   node.getTriFaces()->size() <= 1 //max triangles in node
-            || level >= maxLevel     )
-         {
+template <typename T>
+class SAHSplit : public SplitAlgorithm<T>
+{
+public:
+    /* ======================================================================================= */
+    SplitCandidate<T> findBestSplitCandidate(const int &level, const int &maxLevel, Node<T> &node) const override
+    {
+        if (!node.getTriFaces())
+            throw UbException(UB_EXARGS, "triFace NULL pointer");
+
+        if (node.getTriFaces()->size() <= 1 // max triangles in node
+            || level >= maxLevel) {
             return SplitCandidate<T>();
-         }
+        }
 
-         SplitCandidate<T> bestSplitCandidate;
-         T minCN = Ub::inf;
+        SplitCandidate<T> bestSplitCandidate;
+        T minCN = Ub::inf;
 
-         for(int splitAxis = 0; splitAxis < 3; splitAxis++) 
-         {
+        for (int splitAxis = 0; splitAxis < 3; splitAxis++) {
             SplitCandidateManager<T> sc;
             findPossibleSplitCandidates(splitAxis, node, sc);
 
             // incremental sweep to find best split position
-            for( std::size_t i = 0; i < sc.size(); i++)
-            {
-               if (i == 0) 
-               {
-                  sc[i].nl = sc.objects_starting_outside_left + sc.objects_fully_outside_node;
-                  sc[i].nr = int(node.getTriFaces()->size()) - sc[0].np - sc[0].ending;
-               } 
-               else 
-               {
-                  sc[i].nl = sc[i - 1].nl + sc[i - 1].starting + sc[i - 1].np;
-                  sc[i].nr = sc[i - 1].nr - sc[i    ].ending   - sc[i    ].np;
-               }
-
-               this->calcSAH(sc[i], node);
-
-               if (sc[i].Cn < minCN)
-               {
-                  minCN              = sc[i].Cn;
-                  bestSplitCandidate = sc[i];
-               }
+            for (std::size_t i = 0; i < sc.size(); i++) {
+                if (i == 0) {
+                    sc[i].nl = sc.objects_starting_outside_left + sc.objects_fully_outside_node;
+                    sc[i].nr = int(node.getTriFaces()->size()) - sc[0].np - sc[0].ending;
+                } else {
+                    sc[i].nl = sc[i - 1].nl + sc[i - 1].starting + sc[i - 1].np;
+                    sc[i].nr = sc[i - 1].nr - sc[i].ending - sc[i].np;
+                }
+
+                this->calcSAH(sc[i], node);
+
+                if (sc[i].Cn < minCN) {
+                    minCN              = sc[i].Cn;
+                    bestSplitCandidate = sc[i];
+                }
             }
-         }
+        }
 
-         // automatic termination criterion (SAH)
-         if ( bestSplitCandidate.isValid && bestSplitCandidate.Cn >= node.getTriFaces()->size() * Ci) 
-         {
+        // automatic termination criterion (SAH)
+        if (bestSplitCandidate.isValid && bestSplitCandidate.Cn >= node.getTriFaces()->size() * Ci) {
             return SplitCandidate<T>();
-         }
-
-         return bestSplitCandidate;
-      }
-      /* ======================================================================================= */
-      void distributeTriFaces(const SplitCandidate<T>& candidate, std::vector<GbTriFaceMesh3D::TriFace>& triFacesForChild1, std::vector<GbTriFaceMesh3D::TriFace>& triFacesForChild2, Node<T>& node) const override
-      {  
-         if( !node.getTriFaces() )  throw UbException(UB_EXARGS, "null pointer at triface list");
-
-         std::vector<GbTriFaceMesh3D::TriFace>& srcTriFaces = *node.getTriFaces();
-         std::vector<GbTriFaceMesh3D::Vertex>&  srcNodes    = node.getNodes();
-         std::vector<T> projection;
-
-         for(std::size_t i=0; i<srcTriFaces.size(); i++) 
-         {
-            GbTriFaceMesh3D::TriFace& triFace = srcTriFaces[i];
+        }
+
+        return bestSplitCandidate;
+    }
+    /* ======================================================================================= */
+    void distributeTriFaces(const SplitCandidate<T> &candidate,
+                            std::vector<GbTriFaceMesh3D::TriFace> &triFacesForChild1,
+                            std::vector<GbTriFaceMesh3D::TriFace> &triFacesForChild2, Node<T> &node) const override
+    {
+        if (!node.getTriFaces())
+            throw UbException(UB_EXARGS, "null pointer at triface list");
+
+        std::vector<GbTriFaceMesh3D::TriFace> &srcTriFaces = *node.getTriFaces();
+        std::vector<GbTriFaceMesh3D::Vertex> &srcNodes     = node.getNodes();
+        std::vector<T> projection;
+
+        for (std::size_t i = 0; i < srcTriFaces.size(); i++) {
+            GbTriFaceMesh3D::TriFace &triFace = srcTriFaces[i];
             Kd::project2Axis(triFace, srcNodes, candidate.axis, projection);
 
-            T& min = projection[0];
-            T& max = projection[2];
+            T &min = projection[0];
+            T &max = projection[2];
             // --------------------------------------------------- //
             // case 1 : object inside plane
-            if( UbMath::equal(min, max) )
-            {
-               if( UbMath::equal(min, candidate.position) ) 
-               {
-                  if(candidate.np_left)
-                  {
-                     triFacesForChild1.push_back(triFace);
-                  } 
-                  else if(candidate.np_right) 
-                  {
-                     triFacesForChild2.push_back(triFace);
-                  }
-               } 
-               else if( UbMath::less(min, candidate.position) )
-               {
-                  triFacesForChild1.push_back(triFace);
-               } 
-               else //if( UbMath::greater(min, candidate.position) 
-               {
-                  triFacesForChild2.push_back(triFace);
-               }
+            if (UbMath::equal(min, max)) {
+                if (UbMath::equal(min, candidate.position)) {
+                    if (candidate.np_left) {
+                        triFacesForChild1.push_back(triFace);
+                    } else if (candidate.np_right) {
+                        triFacesForChild2.push_back(triFace);
+                    }
+                } else if (UbMath::less(min, candidate.position)) {
+                    triFacesForChild1.push_back(triFace);
+                } else // if( UbMath::greater(min, candidate.position)
+                {
+                    triFacesForChild2.push_back(triFace);
+                }
             } //
             // --------------------------------------------------- //
             // case 2 : object on left side of plane
-            else if( UbMath::lessEqual(max,candidate.position) )
-            {
-               triFacesForChild1.push_back(triFace);
+            else if (UbMath::lessEqual(max, candidate.position)) {
+                triFacesForChild1.push_back(triFace);
             } // --------------------------------------------------- //
             // case 3 : object on right side of plane
-            else if ( UbMath::greaterEqual( min, candidate.position) ) 
-            {
-               triFacesForChild2.push_back(triFace);
-            }//
+            else if (UbMath::greaterEqual(min, candidate.position)) {
+                triFacesForChild2.push_back(triFace);
+            } //
             // --------------------------------------------------- //
             // case 4 : object in both nodes
-            else 
-            {
-               triFacesForChild1.push_back(triFace);
-               triFacesForChild2.push_back(triFace);
-            }//
-            // --------------------------------------------------- //
-         }
-
-         node.deleteTriFaces();
-      }
-
-
-   private:
-      /* ======================================================================================= */
-      // cost function
-      inline T calcCosts(const int& nl, const int& nr, const T& SA_VL, const T& SA_VR, const T& SA_V) const
-      {
-         return Ct + Ci * (nl * SA_VL / SA_V + nr * SA_VR / SA_V);
-      }
-      /* ======================================================================================= */
-      void findPossibleSplitCandidates(const int& splitAxis, Node<T>& node, SplitCandidateManager<T>& splitCandidateManager) const
-      {
-         T p1_node = (splitAxis == Axis::X ? node.x[0] : splitAxis == Axis::Y ? node.y[0] : node.z[0]);
-         T p2_node = (splitAxis == Axis::X ? node.x[1] : splitAxis == Axis::Y ? node.y[1] : node.z[1]);
-
-         if( !node.getTriFaces() )  throw UbException(UB_EXARGS, "null pointer");
-
-         std::vector<GbTriFaceMesh3D::TriFace>& srcTriFaces = *node.getTriFaces();
-         std::vector<GbTriFaceMesh3D::Vertex >& srcNodes    = node.getNodes();
-         std::vector<T> projection;
-
-         for(std::size_t i=0; i<srcTriFaces.size(); i++) 
-         {
-            GbTriFaceMesh3D::TriFace& triFace = srcTriFaces[i];
+            else {
+                triFacesForChild1.push_back(triFace);
+                triFacesForChild2.push_back(triFace);
+            } //
+              // --------------------------------------------------- //
+        }
+
+        node.deleteTriFaces();
+    }
+
+private:
+    /* ======================================================================================= */
+    // cost function
+    inline T calcCosts(const int &nl, const int &nr, const T &SA_VL, const T &SA_VR, const T &SA_V) const
+    {
+        return Ct + Ci * (nl * SA_VL / SA_V + nr * SA_VR / SA_V);
+    }
+    /* ======================================================================================= */
+    void findPossibleSplitCandidates(const int &splitAxis, Node<T> &node,
+                                     SplitCandidateManager<T> &splitCandidateManager) const
+    {
+        T p1_node = (splitAxis == Axis::X ? node.x[0] : splitAxis == Axis::Y ? node.y[0] : node.z[0]);
+        T p2_node = (splitAxis == Axis::X ? node.x[1] : splitAxis == Axis::Y ? node.y[1] : node.z[1]);
+
+        if (!node.getTriFaces())
+            throw UbException(UB_EXARGS, "null pointer");
+
+        std::vector<GbTriFaceMesh3D::TriFace> &srcTriFaces = *node.getTriFaces();
+        std::vector<GbTriFaceMesh3D::Vertex> &srcNodes     = node.getNodes();
+        std::vector<T> projection;
+
+        for (std::size_t i = 0; i < srcTriFaces.size(); i++) {
+            GbTriFaceMesh3D::TriFace &triFace = srcTriFaces[i];
 
             // project object to axis
-            Kd::project2Axis(triFace,srcNodes,splitAxis, projection);
+            Kd::project2Axis(triFace, srcNodes, splitAxis, projection);
             // left point
-            T& p1 = projection[0];
+            T &p1 = projection[0];
             // right point
-            T& p2 = projection[2];
+            T &p2 = projection[2];
 
             // --------------------------------------------------- //
             // --------------------------------------------------- //
             // case 1 : object is fully inside the current node
-            if(   UbMath::greaterEqual(p1, p1_node)   
-               && UbMath::lessEqual(p2, p2_node) )   
-            {
-               if( UbMath::equal(p1, p2) ) 
-               {
-                  // object is inside the plane
-                  splitCandidateManager.add(p1, splitAxis, 0, 0, 1);
-               } 
-               else 
-               {
-                  splitCandidateManager.add(p1, splitAxis, 1, 0, 0);
-                  splitCandidateManager.add(p2, splitAxis, 0, 1, 0);
-               }
+            if (UbMath::greaterEqual(p1, p1_node) && UbMath::lessEqual(p2, p2_node)) {
+                if (UbMath::equal(p1, p2)) {
+                    // object is inside the plane
+                    splitCandidateManager.add(p1, splitAxis, 0, 0, 1);
+                } else {
+                    splitCandidateManager.add(p1, splitAxis, 1, 0, 0);
+                    splitCandidateManager.add(p2, splitAxis, 0, 1, 0);
+                }
             } //
             // --------------------------------------------------- //
             // --------------------------------------------------- //
             // case 2 : just the right point (p2) is inside the current node
-            else if(    UbMath::less(p1, p1_node) 
-                     && UbMath::lessEqual(p2,p2_node)
-                     && UbMath::greaterEqual(p2, p1_node)   )
-            {
-               splitCandidateManager.add(p2, splitAxis, 0, 1, 0);
-               splitCandidateManager.objects_starting_outside_left++;
+            else if (UbMath::less(p1, p1_node) && UbMath::lessEqual(p2, p2_node) && UbMath::greaterEqual(p2, p1_node)) {
+                splitCandidateManager.add(p2, splitAxis, 0, 1, 0);
+                splitCandidateManager.objects_starting_outside_left++;
             } //
             // --------------------------------------------------- //
             // --------------------------------------------------- //
             // case 3 : just the left point (p1) is inside the current node
-            else if(    UbMath::greaterEqual(p1, p1_node) 
-                     && UbMath::greater(p2, p2_node) 
-                     && UbMath::lessEqual(p1, p2_node)   ) 
-            {
-               splitCandidateManager.add(p1, splitAxis, 1, 0, 0);
+            else if (UbMath::greaterEqual(p1, p1_node) && UbMath::greater(p2, p2_node) &&
+                     UbMath::lessEqual(p1, p2_node)) {
+                splitCandidateManager.add(p1, splitAxis, 1, 0, 0);
             } //
             // --------------------------------------------------- //
             // --------------------------------------------------- //
             // case 4 : left and right point are outside the current node
-            else if(   UbMath::less(p1, p1_node)
-                    && UbMath::greater(p2, p2_node) )
-            {
-               splitCandidateManager.objects_fully_outside_node++;
+            else if (UbMath::less(p1, p1_node) && UbMath::greater(p2, p2_node)) {
+                splitCandidateManager.objects_fully_outside_node++;
             } //
-            // --------------------------------------------------- //
-            // --------------------------------------------------- //
-         }
-
-         splitCandidateManager.createSortedArray();
-      }
+              // --------------------------------------------------- //
+              // --------------------------------------------------- //
+        }
 
+        splitCandidateManager.createSortedArray();
+    }
 
-      /* ======================================================================================= */
-      // calculates the costs for a given splitCandidate based on the Surface Area Heuristic (SAH)
-      void calcSAH(SplitCandidate<T>& candidate, Node<T>& node) const 
-      {
-         T p1_node = (candidate.axis == Axis::X ? node.x[0] : candidate.axis == Axis::Y ? node.y[0] : node.z[0]);
+    /* ======================================================================================= */
+    // calculates the costs for a given splitCandidate based on the Surface Area Heuristic (SAH)
+    void calcSAH(SplitCandidate<T> &candidate, Node<T> &node) const
+    {
+        T p1_node = (candidate.axis == Axis::X ? node.x[0] : candidate.axis == Axis::Y ? node.y[0] : node.z[0]);
 
-         // edges of (root) voxel
-         T dx = std::fabs(node.x[1] - node.x[0]);
-         T dy = std::fabs(node.y[1] - node.y[0]);
-         T dz = std::fabs(node.z[1] - node.z[0]);
+        // edges of (root) voxel
+        T dx = std::fabs(node.x[1] - node.x[0]);
+        T dy = std::fabs(node.y[1] - node.y[0]);
+        T dz = std::fabs(node.z[1] - node.z[0]);
 
-         // surface area (root) voxel
-         T SA_V = T((2.0 * dx * dy) + (2.0 * dx * dz) + (2.0 * dy * dz));
+        // surface area (root) voxel
+        T SA_V = T((2.0 * dx * dy) + (2.0 * dx * dz) + (2.0 * dy * dz));
 
-         T delta = (candidate.axis == Axis::X ? dx : candidate.axis == Axis::Y ? dy : dz);
-         T deltaL = std::fabs(candidate.position - p1_node);
-         T deltaR = std::fabs(delta - deltaL);
+        T delta  = (candidate.axis == Axis::X ? dx : candidate.axis == Axis::Y ? dy : dz);
+        T deltaL = std::fabs(candidate.position - p1_node);
+        T deltaR = std::fabs(delta - deltaL);
 
-         // edges of sub voxel left
-         T dx_l = (candidate.axis == Axis::X ? deltaL : dx), dy_l = (candidate.axis == Axis::Y ? deltaL : dy), dz_l = (candidate.axis == Axis::Z ? deltaL : dz);
+        // edges of sub voxel left
+        T dx_l = (candidate.axis == Axis::X ? deltaL : dx), dy_l = (candidate.axis == Axis::Y ? deltaL : dy),
+          dz_l = (candidate.axis == Axis::Z ? deltaL : dz);
 
-         // surface area sub voxel left
-         T SA_VL = T( (2.0 * dx_l * dy_l) + (2.0 * dx_l * dz_l) + (2.0 * dy_l * dz_l) );
+        // surface area sub voxel left
+        T SA_VL = T((2.0 * dx_l * dy_l) + (2.0 * dx_l * dz_l) + (2.0 * dy_l * dz_l));
 
-         // edges of sub voxel right
-         T dx_r = (candidate.axis == Axis::X ? deltaR : dx), dy_r = (candidate.axis == Axis::Y ? deltaR : dy), dz_r = (candidate.axis == Axis::Z ? deltaR : dz);
+        // edges of sub voxel right
+        T dx_r = (candidate.axis == Axis::X ? deltaR : dx), dy_r = (candidate.axis == Axis::Y ? deltaR : dy),
+          dz_r = (candidate.axis == Axis::Z ? deltaR : dz);
 
-         // surface area sub voxel right
-         T SA_VR = T( (2.0 * dx_r * dy_r) + (2.0 * dx_r * dz_r) + (2.0 * dy_r * dz_r) );
+        // surface area sub voxel right
+        T SA_VR = T((2.0 * dx_r * dy_r) + (2.0 * dx_r * dz_r) + (2.0 * dy_r * dz_r));
 
-         if (candidate.np == 0) 
-         {
+        if (candidate.np == 0) {
             candidate.Cn = calcCosts(candidate.nl, candidate.nr, SA_VL, SA_VR, SA_V);
             return;
-         }
-
-         // once putting np with nl, and once with nr - and select the one with lowest cost
-         // see: Wald, Havran: "On building fast kd-Trees for Ray Tracing, and doing that in O(N log N)", 2006
-         T CP_L = calcCosts(candidate.nl + candidate.np, candidate.nr               , SA_VL, SA_VR, SA_V);
-         T CP_R = calcCosts(candidate.nl               , candidate.nr + candidate.np, SA_VL, SA_VR, SA_V);
-         
-         if(CP_L < CP_R) 
-         {
+        }
+
+        // once putting np with nl, and once with nr - and select the one with lowest cost
+        // see: Wald, Havran: "On building fast kd-Trees for Ray Tracing, and doing that in O(N log N)", 2006
+        T CP_L = calcCosts(candidate.nl + candidate.np, candidate.nr, SA_VL, SA_VR, SA_V);
+        T CP_R = calcCosts(candidate.nl, candidate.nr + candidate.np, SA_VL, SA_VR, SA_V);
+
+        if (CP_L < CP_R) {
             candidate.Cn       = CP_L;
             candidate.np_right = true;
-         } 
-         else 
-         {
+        } else {
             candidate.Cn      = CP_R;
             candidate.np_left = true;
-         }
-      }
-      /* ======================================================================================= */
-
-   protected:
-      static const T Ct;// = 3.0; traversal cost
-      static const T Ci;// = 4.0; ray-patch-intersection-cost
-   };
-
-   
-   template< typename T>
-   const T SAHSplit<T>::Ct = 3.0; //traversal cost
-   template< typename T>
-   const T SAHSplit<T>::Ci = 4.0; //ray-patch-intersection-cost
-}
-
-#endif //KDSAHSPLIT_H
+        }
+    }
+    /* ======================================================================================= */
+
+protected:
+    static const T Ct; // = 3.0; traversal cost
+    static const T Ci; // = 4.0; ray-patch-intersection-cost
+};
+
+template <typename T>
+const T SAHSplit<T>::Ct = 3.0; // traversal cost
+template <typename T>
+const T SAHSplit<T>::Ci = 4.0; // ray-patch-intersection-cost
+} // namespace Kd
+
+#endif // KDSAHSPLIT_H
diff --git a/src/basics/geometry3d/KdTree/splitalgorithms/KdSpatiallMedianSplit.h b/src/basics/geometry3d/KdTree/splitalgorithms/KdSpatiallMedianSplit.h
index a2c32fdf9b798280778885853de70abf8aca9064..518ac967ae1f26d6c67cd6946fbaf8ce1360c4bc 100644
--- a/src/basics/geometry3d/KdTree/splitalgorithms/KdSpatiallMedianSplit.h
+++ b/src/basics/geometry3d/KdTree/splitalgorithms/KdSpatiallMedianSplit.h
@@ -8,83 +8,76 @@
 
 namespace Kd
 {
-   template< typename T >
-   class SpatialMedianSplit : public SplitAlgorithm<T> 
-   {
-      /* ======================================================================================= */
-      SplitCandidate<T> findBestSplitCandidate(const int& level, const int& maxLevel, Node<T>& node )  const override
-      {
-         if(   node.getTriFaces()->size() <= 24 //max triangles in node 
-            || level >= maxLevel        )
-         {
+template <typename T>
+class SpatialMedianSplit : public SplitAlgorithm<T>
+{
+    /* ======================================================================================= */
+    SplitCandidate<T> findBestSplitCandidate(const int &level, const int &maxLevel, Node<T> &node) const override
+    {
+        if (node.getTriFaces()->size() <= 24 // max triangles in node
+            || level >= maxLevel) {
             return SplitCandidate<T>();
-         }
-
-         T dx = std::fabs(node.x[1] - node.x[0]);
-         T dy = std::fabs(node.y[1] - node.y[0]);
-         T dz = std::fabs(node.z[1] - node.z[0]);
+        }
 
-         if     ( UbMath::equal(dx, UbMath::max(dx, dy, dz) ) ) return SplitCandidate<T>(Axis::X, node.x[0] + 0.5 * dx, 0, 0, 0);
-         else if( UbMath::equal(dy, UbMath::max(dy, dz    ) ) ) return SplitCandidate<T>(Axis::Y, node.y[0] + 0.5 * dy, 0, 0, 0);
+        T dx = std::fabs(node.x[1] - node.x[0]);
+        T dy = std::fabs(node.y[1] - node.y[0]);
+        T dz = std::fabs(node.z[1] - node.z[0]);
 
-         return SplitCandidate<T>(Axis::Z, node.z[0] + 0.5 * dz, 0, 0, 0);
+        if (UbMath::equal(dx, UbMath::max(dx, dy, dz)))
+            return SplitCandidate<T>(Axis::X, node.x[0] + 0.5 * dx, 0, 0, 0);
+        else if (UbMath::equal(dy, UbMath::max(dy, dz)))
+            return SplitCandidate<T>(Axis::Y, node.y[0] + 0.5 * dy, 0, 0, 0);
 
-      }
-      /* ======================================================================================= */
-      void distributeTriFaces(const SplitCandidate<T>& candidate, std::vector<GbTriFaceMesh3D::TriFace>& primitives_child1, std::vector<GbTriFaceMesh3D::TriFace>& primitives_child2, Node<T>& node) const override
-      {
-         if( !node.getTriFaces() )  throw UbException(UB_EXARGS, "null pointer");
+        return SplitCandidate<T>(Axis::Z, node.z[0] + 0.5 * dz, 0, 0, 0);
+    }
+    /* ======================================================================================= */
+    void distributeTriFaces(const SplitCandidate<T> &candidate,
+                            std::vector<GbTriFaceMesh3D::TriFace> &primitives_child1,
+                            std::vector<GbTriFaceMesh3D::TriFace> &primitives_child2, Node<T> &node) const override
+    {
+        if (!node.getTriFaces())
+            throw UbException(UB_EXARGS, "null pointer");
 
-         std::vector<GbTriFaceMesh3D::TriFace>& srcTriFaces = *node.getTriFaces();
-         std::vector<GbTriFaceMesh3D::Vertex>&  srcNodes    =  node.getNodes();
-         std::vector<T> projection;
+        std::vector<GbTriFaceMesh3D::TriFace> &srcTriFaces = *node.getTriFaces();
+        std::vector<GbTriFaceMesh3D::Vertex> &srcNodes     = node.getNodes();
+        std::vector<T> projection;
 
-         for(std::size_t i=0; i<srcTriFaces.size(); i++) 
-         {
-            GbTriFaceMesh3D::TriFace& triFace = srcTriFaces[i];
+        for (std::size_t i = 0; i < srcTriFaces.size(); i++) {
+            GbTriFaceMesh3D::TriFace &triFace = srcTriFaces[i];
             Kd::project2Axis(triFace, srcNodes, candidate.axis, projection);
 
-            T& min = projection[0];
-            T& max = projection[2];
-         
+            T &min = projection[0];
+            T &max = projection[2];
+
             // case 1 : object inside plane
-            if( UbMath::equal(min,max) )
-            {
-               if( UbMath::equal(min,candidate.position) ) 
-               {
-                  primitives_child1.push_back(triFace);
-                  primitives_child2.push_back(triFace);
-               }
-               else if( UbMath::less(min, candidate.position) )
-               {
-                  primitives_child1.push_back(triFace);
-               } 
-               else if( UbMath::greater(min, candidate.position) )
-               {
-                  primitives_child2.push_back(triFace);
-               }
-            } 
+            if (UbMath::equal(min, max)) {
+                if (UbMath::equal(min, candidate.position)) {
+                    primitives_child1.push_back(triFace);
+                    primitives_child2.push_back(triFace);
+                } else if (UbMath::less(min, candidate.position)) {
+                    primitives_child1.push_back(triFace);
+                } else if (UbMath::greater(min, candidate.position)) {
+                    primitives_child2.push_back(triFace);
+                }
+            }
             // case 2 : object on left side of plane
-            else if( UbMath::lessEqual(max, candidate.position) )
-            {
-               primitives_child1.push_back(triFace);
-            } 
+            else if (UbMath::lessEqual(max, candidate.position)) {
+                primitives_child1.push_back(triFace);
+            }
             // case 3 : object on right side of plane
-            else if( UbMath::greaterEqual(min, candidate.position) )
-            {
-               primitives_child2.push_back(triFace);
+            else if (UbMath::greaterEqual(min, candidate.position)) {
+                primitives_child2.push_back(triFace);
             }
             // case 4 : object in both nodes
-            else 
-            {
-               primitives_child1.push_back(triFace);
-               primitives_child2.push_back(triFace);
+            else {
+                primitives_child1.push_back(triFace);
+                primitives_child2.push_back(triFace);
             }
-         }
+        }
 
-         node.deleteTriFaces();
-      }
-   };
-}
+        node.deleteTriFaces();
+    }
+};
+} // namespace Kd
 
-#endif //SPATIALLMEDIANSPLIT_H
+#endif // SPATIALLMEDIANSPLIT_H
diff --git a/src/basics/geometry3d/KdTree/splitalgorithms/KdSplitAlgorithm.h b/src/basics/geometry3d/KdTree/splitalgorithms/KdSplitAlgorithm.h
index 4a8caa6975e1e3d007c9df25f6e6d65788503629..c767a0c0d1013441610e6b1eb20501796c42c78e 100644
--- a/src/basics/geometry3d/KdTree/splitalgorithms/KdSplitAlgorithm.h
+++ b/src/basics/geometry3d/KdTree/splitalgorithms/KdSplitAlgorithm.h
@@ -9,18 +9,19 @@
 
 namespace Kd
 {
-   template< typename T >
-   class Node;
-
-   template< typename T >
-   class SplitAlgorithm 
-   {
-   public:
-      virtual SplitCandidate<T> findBestSplitCandidate(const int& level, const int& maxLevel, Node<T>& node ) const = 0;
-      virtual void distributeTriFaces(const SplitCandidate<T>& candidate, std::vector<GbTriFaceMesh3D::TriFace>& triFacesForChild1, std::vector<GbTriFaceMesh3D::TriFace>& triFacesForChild2, Node<T>& node) const=0;
-      virtual ~SplitAlgorithm() = default;
-   };
-}
+template <typename T>
+class Node;
 
+template <typename T>
+class SplitAlgorithm
+{
+public:
+    virtual SplitCandidate<T> findBestSplitCandidate(const int &level, const int &maxLevel, Node<T> &node) const   = 0;
+    virtual void distributeTriFaces(const SplitCandidate<T> &candidate,
+                                    std::vector<GbTriFaceMesh3D::TriFace> &triFacesForChild1,
+                                    std::vector<GbTriFaceMesh3D::TriFace> &triFacesForChild2, Node<T> &node) const = 0;
+    virtual ~SplitAlgorithm() = default;
+};
+} // namespace Kd
 
-#endif  //KDSPLITALGORITHM_H
+#endif // KDSPLITALGORITHM_H