Skip to content

Commit

Permalink
Update to Kassiopeia 3.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
buzinsky committed Jan 7, 2019
1 parent 8251064 commit 037d938
Show file tree
Hide file tree
Showing 621 changed files with 8,157 additions and 4,176 deletions.
29 changes: 15 additions & 14 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
/*install*
/*Install*
/IndependentKassiopeia/
/.settings
*~
*.bak
*.tmp
Expand All @@ -12,27 +13,27 @@
*.cbp
*.cproject
*.DS_store
*.DS_Store
*.kdev4*
*.vscode
*.doxygen
*.pc
*.vtp
*.vti
*.pyc
*.creator
*.files
*.includes
*.srctrl*
CMakeCache.txt
CMakeLists.txt.user
CMakeLists.txt.user.*
/.settings
CMakeFiles/
.idea/
*.kdev4*
home/
CTestTestfile.cmake
cmake_install.cmake
*Config.cmake
*ConfigVersion.cmake
*ConfigInstalled.cmake
*.doxygen
*.pc
*.vtp
*.vti
*.pyc
home/
.idea/
.ipynb_checkpoints/
*.DS_Store
Kasper.config
Kasper.creator
Kasper.files
Kasper.includes
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,6 @@ endif()

install( EXPORT KasperTargets DESTINATION ${CMAKE_INSTALL_DIR} )

configure_file( Kommon/kasperenv.sh ${CMAKE_CURRENT_BINARY_DIR}/kasperenv.sh @ONLY )
configure_file( Kommon/create_kasper_user_directory.sh ${CMAKE_CURRENT_BINARY_DIR}/create_kasper_user_directory.sh @ONLY )
configure_file( kasperenv.sh.in ${CMAKE_CURRENT_BINARY_DIR}/kasperenv.sh @ONLY )
configure_file( create_kasper_user_directory.sh.in ${CMAKE_CURRENT_BINARY_DIR}/create_kasper_user_directory.sh @ONLY )
install( PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/kasperenv.sh ${CMAKE_CURRENT_BINARY_DIR}/create_kasper_user_directory.sh DESTINATION ${BIN_INSTALL_DIR} )
63 changes: 35 additions & 28 deletions KEMField/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,48 +1,54 @@
cmake_minimum_required( VERSION ${CMAKE_MINIMUM_VERSION} )

if(POLICY CMP0053)
cmake_policy(SET CMP0053 NEW)
endif()

# KEMField version
set(MODULE_VERSION_MAJOR 3)
set(MODULE_VERSION_MINOR 0)
set(MODULE_VERSION_MINOR 6)
set(MODULE_VERSION_PATCH 0)
set(MODULE_VERSION "${MODULE_VERSION_MAJOR}.${MODULE_VERSION_MINOR}.${MODULE_VERSION_PATCH}")

#project(KEMField VERSION ${MODULE_VERSION})
project(KEMField)

include(KasperDefaults)
project( KEMField )

if(POLICY CMP0053)
cmake_policy(SET CMP0053 OLD)
endif()
include( KasperDefaults )

# paths
kasper_module_paths( KEMField )
# require c++11
kasper_require_cpp11()

#set(MODULE_HEADER_DIRS)
#set(MODULE_CFLAGS)
#set(KASPER_INCLUDE_DIRS)
#set(EXTERNAL_INCLUDE_DIRS)
# module options

kasper_find_module(Kommon)

#option (@PROJECT_NAME@_USE_VTK "Enables the use of VTK for visualization" OFF)
set (@PROJECT_NAME@_USE_VTK ${KASPER_USE_VTK})
if (@PROJECT_NAME@_USE_VTK)
#option (${PROJECT_NAME}_USE_VTK "Enables the use of VTK for visualization" OFF)
set (${PROJECT_NAME}_USE_VTK ${KASPER_USE_VTK})
if (${PROJECT_NAME}_USE_VTK)
kasper_find_vtk()
endif()

#option (@PROJECT_NAME@_USE_ROOT "Link against ROOT" OFF)
set (@PROJECT_NAME@_USE_ROOT ${KASPER_USE_ROOT})
if (@PROJECT_NAME@_USE_ROOT)
#option (${PROJECT_NAME}_USE_ROOT "Link against ROOT" OFF)
set (${PROJECT_NAME}_USE_ROOT ${KASPER_USE_ROOT})
if (${PROJECT_NAME}_USE_ROOT)
find_package(ROOT REQUIRED)
endif()

#option (KEMField_USE_GSL "Use GSL" OFF)
set (@PROJECT_NAME@_USE_GSL ${KASPER_USE_GSL})
if (@PROJECT_NAME@_USE_GSL)
set (${PROJECT_NAME}_USE_GSL ${KASPER_USE_GSL})
if (${PROJECT_NAME}_USE_GSL)
find_package(GSL REQUIRED)
endif ()

# paths
kasper_module_paths( KEMField )

# internal dependencies: kommon
kasper_find_module( Kommon )
add_cflag (KEMFIELD_USE_KOMMON)

# internal dependencies: kgeobag
kasper_find_module( KGeoBag )
add_cflag (KEMFIELD_USE_KGEOBAG)


# Input files
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/data)

Expand Down Expand Up @@ -94,12 +100,13 @@ add_subdirectory(${SOURCE}/Interface/FieldSolvers/Electric)
add_subdirectory(${SOURCE}/Interface/FieldSolvers/Magnetic)
add_subdirectory(${SOURCE}/Interface/Fields/Magnetic)
add_subdirectory(${SOURCE}/Interface/Fields/Electric)
add_subdirectory(${SOURCE}/Plugins/KGeoBag)
add_subdirectory(${SOURCE}/Interface/KGeoBag)
add_subdirectory(${SOURCE}/Plugins/VTKPart2)
add_subdirectory(${SOURCE}/Plugins/Bindings)
add_subdirectory(${SOURCE}/Bindings)
add_subdirectory(${SOURCE}/Plugins/Root)
add_subdirectory(${SOURCE}/Applications)
add_subdirectory(${SOURCE}/Tests)
add_subdirectory(${SOURCE}/Applications/Calculation)
add_subdirectory(${SOURCE}/Applications/Test)
add_subdirectory(${SOURCE}/Applications/Tools)
add_subdirectory(${SOURCE}/FastMultipole/Test)
add_subdirectory(${SOURCE}/FastMultipole/Applications)
add_subdirectory(${SOURCE}/XML)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ namespace KEMField
double& operator()( int aRow, int aColumn );
const double& operator()( int aRow, int aColumn ) const;

void SetComponents( const double* aData );

//properties

KEMThreeMatrix Inverse() const;
Expand Down Expand Up @@ -195,6 +197,19 @@ namespace KEMField
return fData[3 * aRow + aColumn];
}

inline void KEMThreeMatrix::SetComponents( const double* aData )
{
fData[ 0 ] = aData[ 0 ];
fData[ 1 ] = aData[ 1 ];
fData[ 2 ] = aData[ 2 ];
fData[ 3 ] = aData[ 3 ];
fData[ 4 ] = aData[ 4 ];
fData[ 5 ] = aData[ 5 ];
fData[ 6 ] = aData[ 6 ];
fData[ 7 ] = aData[ 7 ];
fData[ 8 ] = aData[ 8 ];
}

inline KEMThreeMatrix KEMThreeMatrix::Inverse() const
{
double tDeterminant = Determinant();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class AspectRatioVisitor :

void ProcessTriangle(KTriangle& tri)
{
fShapeType = KEMThreeVector(1, 0, 0);
fShapeType = KThreeVector(1, 0, 0);

const double data[11] = {
tri.GetA(),
Expand Down Expand Up @@ -89,37 +89,37 @@ class AspectRatioVisitor :

c = std::sqrt( delx * delx + dely * dely + delz * delz );

KEMThreeVector PA;
KEMThreeVector PB;
KEMThreeVector PC;
KEMThreeVector V;
KEMThreeVector X;
KEMThreeVector Y;
KEMThreeVector Q;
KEMThreeVector SUB;
KThreeVector PA;
KThreeVector PB;
KThreeVector PC;
KThreeVector V;
KThreeVector X;
KThreeVector Y;
KThreeVector Q;
KThreeVector SUB;

//find the longest side:
if( a > b )
{
max = a;
PA = KEMThreeVector( P2[ 0 ], P2[ 1 ], P2[ 2 ] );
PB = KEMThreeVector( P0[ 0 ], P0[ 1 ], P0[ 2 ] );
PC = KEMThreeVector( P1[ 0 ], P1[ 1 ], P1[ 2 ] );
PA = KThreeVector( P2[ 0 ], P2[ 1 ], P2[ 2 ] );
PB = KThreeVector( P0[ 0 ], P0[ 1 ], P0[ 2 ] );
PC = KThreeVector( P1[ 0 ], P1[ 1 ], P1[ 2 ] );
}
else
{
max = b;
PA = KEMThreeVector( P1[ 0 ], P1[ 1 ], P1[ 2 ] );
PB = KEMThreeVector( P2[ 0 ], P2[ 1 ], P2[ 2 ] );
PC = KEMThreeVector( P0[ 0 ], P0[ 1 ], P0[ 2 ] );
PA = KThreeVector( P1[ 0 ], P1[ 1 ], P1[ 2 ] );
PB = KThreeVector( P2[ 0 ], P2[ 1 ], P2[ 2 ] );
PC = KThreeVector( P0[ 0 ], P0[ 1 ], P0[ 2 ] );
}

if( c > max )
{
max = c;
PA = KEMThreeVector( P0[ 0 ], P0[ 1 ], P0[ 2 ] );
PB = KEMThreeVector( P1[ 0 ], P1[ 1 ], P1[ 2 ] );
PC = KEMThreeVector( P2[ 0 ], P2[ 1 ], P2[ 2 ] );
PA = KThreeVector( P0[ 0 ], P0[ 1 ], P0[ 2 ] );
PB = KThreeVector( P1[ 0 ], P1[ 1 ], P1[ 2 ] );
PC = KThreeVector( P2[ 0 ], P2[ 1 ], P2[ 2 ] );
}

//the line pointing along v is the y-axis
Expand All @@ -144,10 +144,10 @@ class AspectRatioVisitor :

void ProcessRectangle(KRectangle& r)
{
fShapeType = KEMThreeVector(0, 1, 0);
fShapeType = KThreeVector(0, 1, 0);

//figure out which vertices make the sides
KEMThreeVector p[4];
KThreeVector p[4];
p[0] = r.GetP0();
p[1] = r.GetP1();
p[2] = r.GetP2();
Expand Down Expand Up @@ -175,21 +175,21 @@ class AspectRatioVisitor :

void ProcessLineSegment(KLineSegment& l)
{
fShapeType = KEMThreeVector(0, 0, 1);
fShapeType = KThreeVector(0, 0, 1);

fAspectRatio = (l.GetP1()-l.GetP0()).Magnitude()/l.GetDiameter();
}

double GetAspectRatio() { return fAspectRatio; }
KEMThreeVector GetShapeType(){ return fShapeType; }
KThreeVector GetShapeType(){ return fShapeType; }

private:
double fAspectRatio;
KEMThreeVector fShapeType; /* ( vector component 0=triangle, 1=rectangle, 2=line segment ) */
KThreeVector fShapeType; /* ( vector component 0=triangle, 1=rectangle, 2=line segment ) */
};
} /* KEMField namespace*/

void GetMinMaxAspectRatio( double* retValues, unsigned int containerSize, std::vector<KEMThreeVector> &shapeTypes, std::vector<double> &arValues )
void GetMinMaxAspectRatio( double* retValues, unsigned int containerSize, std::vector<KThreeVector> &shapeTypes, std::vector<double> &arValues )
{
double aspectRatioTri = 0.;
double aspectRatioTriMin = 0.;
Expand Down Expand Up @@ -258,7 +258,7 @@ void GetMinMaxAspectRatio( double* retValues, unsigned int containerSize, std::v
return;
}

std::vector<TH1D*> ComputeAspectRatios( unsigned int contSize, std::vector<KEMThreeVector> &types, std::vector<double> &arvalues )
std::vector<TH1D*> ComputeAspectRatios( unsigned int contSize, std::vector<KThreeVector> &types, std::vector<double> &arvalues )
{
// get min and max aspect ratio values
double minmax[6];
Expand Down Expand Up @@ -401,8 +401,8 @@ int main(int argc, char* argv[])

AspectRatioVisitor fShapeVisitor;
std::vector<double> values;
std::vector<KEMThreeVector> types;
KEMThreeVector countShapeTypes( 0, 0, 0 );
std::vector<KThreeVector> types;
KThreeVector countShapeTypes( 0, 0, 0 );

KSurfaceContainer::iterator it;

Expand Down
Loading

0 comments on commit 037d938

Please sign in to comment.