Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/integrating b solver #118

Closed
Closed
Changes from 21 commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
f2a78b7
Merge pull request #1 from KATRIN-Experiment/master
nsoblath Mar 11, 2016
ef1e19b
Cherry pick: Minor changes to build system to allow building as a sub…
Mar 10, 2016
fea57ea
CMake policy fixes
Mar 11, 2016
30dcbb1
A few more cmake changes
Mar 11, 2016
6a1f644
Merge branch 'feature/kassfixes' into develop
Mar 11, 2016
7b9d0a1
Allow the KVariableProcessor variable map to be set after construction
Mar 14, 2016
4db786c
Added KSEventModifier, and KSRootEventModifier, and implement use by …
Mar 14, 2016
b0b4fd6
Added KSRootEventModifierBuilder
Mar 28, 2016
aa86f4c
Added temporary pthreads to KSRoot.cxx for purpose of generating sign…
pslocum Apr 5, 2016
a078fe6
Added pre and post event conditions for triggering events in Kassiope…
pslocum Apr 25, 2016
99dbab5
Moved post-KSStep code for Locust_mc out of KSRoot.cxx and into Cyclo…
pslocum May 11, 2016
1b0ff23
Reset digitizer t_old in KSRoot::ReceivedEventStartCondition at the s…
pslocum May 12, 2016
22ca12f
Tuned thread signals for faster Locust-Kassiopeia.
pslocum May 19, 2016
606e990
Tweaked timing of thread signals to interface with Locust.
pslocum Jun 20, 2016
dcf4956
Commented out step_msg updates in KSRoot.cxx. Moved print statement …
Jul 19, 2016
821caba
Adjusted thread signals to accomodate isotropic Kr spectrum with low …
Oct 7, 2016
0b27181
Removed unnecessary fKassReadycondition.notify_one() from KSRoot::Wak…
Oct 8, 2016
7e0a0ca
Tuned final thread stop signal in KSRoot.cxx
Oct 13, 2016
9e0c131
Removed initialization and finalization of derivative calculations in…
pslocum Dec 27, 2016
c08dbdb
Routine update
Jan 5, 2017
38533ef
Merge pull request #4 from KATRIN-Experiment/master
pslocum Jun 16, 2017
c08c2f3
Merge branch 'master' into feature/eventmod
pslocum Jun 16, 2017
ae0e94e
Merge pull request #5 from project8/feature/eventmod
pslocum Jun 16, 2017
3bc2725
Revert "Feature/eventmod"
pslocum Jun 16, 2017
6660bd5
Merge pull request #6 from project8/revert-5-feature/eventmod
pslocum Jun 16, 2017
f327337
Merge pull request #8 from KATRIN-Experiment/master
pslocum Oct 21, 2018
723d37a
Merge pull request #11 from KATRIN-Experiment/master
pslocum Feb 21, 2019
94544df
Check for Boost library as variable or imported target
nsoblath May 1, 2020
92014ed
Merge pull request #12 from project8/feature/boostlibfix
pslocum May 2, 2020
bc26686
Merge pull request #13 from KATRIN-Experiment/master
pslocum May 4, 2020
588ef5f
Merge pull request #14 from KATRIN-Experiment/master
pslocum May 8, 2020
91acc4c
Merge pull request #15 from KATRIN-Experiment/master
nsoblath Jun 23, 2020
c13e0f0
Merge pull request #16 from KATRIN-Experiment/master
pslocum Jul 17, 2020
27f13f1
Merge pull request #17 from KATRIN-Experiment/master
pslocum Jul 22, 2020
c09f4d6
Merge pull request #18 from KATRIN-Experiment/master
pslocum Jul 25, 2020
c809f34
Merge pull request #19 from KATRIN-Experiment/master
pslocum Mar 17, 2021
0354497
Commented out find_package() lines for Boost and Root in CMakeLists.txt
pslocum Apr 13, 2021
ab11297
Update CMakeLists.txt to v3.8.0 for purpose of merge test.
pslocum Aug 31, 2021
4792469
Merge pull request #20 from KATRIN-Experiment/main
pslocum Aug 31, 2021
1829313
Comment out find_package ROOT. Now it builds on Ubuntu laptop.
pslocum Sep 14, 2021
8f70bde
Reinstate find_package(ROOT). Standalone Kass configures on Ubuntu l…
pslocum Sep 17, 2021
e1ce604
Uncomment more lines for finding ROOT > v6.16 .
pslocum Sep 20, 2021
4b81b7c
Comment out Applications/Validation subdirectory to allow build with …
pslocum Oct 1, 2021
d83902a
Uncomment add_submodule(Applications/Validation) which relies on vtk.…
pslocum Oct 18, 2021
81e0fac
Merge pull request #21 from project8/feature/v3.8.0
pslocum Dec 20, 2022
1ffb134
Merge pull request #22 from KATRIN-Experiment/main
pslocum Dec 20, 2022
11b9f39
Merge branch 'KATRIN-Experiment:main' into master
pslocum Jul 31, 2023
1c0bdf3
Merge branch 'KATRIN-Experiment:main' into master
pslocum Sep 21, 2023
be68071
Merge pull request #25 from KATRIN-Experiment/main
pslocum Dec 19, 2023
73c6159
Merge pull request #27 from KATRIN-Experiment/main
pslocum Apr 24, 2024
bf39b45
Merge branch 'KATRIN-Experiment:main' into master
pslocum Oct 1, 2024
261f3a4
Remove accumulation of field during iteration through vector components.
pslocum Oct 1, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
cmake_minimum_required( VERSION 2.8.6 )
if(POLICY CMP0048)
cmake_policy(SET CMP0048 OLD)
endif()

project( Kasper )

10 changes: 6 additions & 4 deletions KEMField/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
cmake_minimum_required( VERSION 2.8.6 )
if(POLICY CMP0048)
cmake_policy(SET CMP0048 OLD)
endif()
if( POLICY CMP0053 )
cmake_policy( SET CMP0053 OLD )
endif( POLICY CMP0053 )

project(KEMField)
include(KasperDefaults)

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

# Module version
set(MODULE_VERSION_MAJOR 2)
set(MODULE_VERSION_MINOR 1)
3 changes: 3 additions & 0 deletions KGeoBag/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
cmake_minimum_required( VERSION 2.8.6 )
if(POLICY CMP0048)
cmake_policy(SET CMP0048 OLD)
endif()

project( KGeoBag )
include( KasperDefaults )
2 changes: 2 additions & 0 deletions Kassiopeia/Bindings/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -162,6 +162,7 @@ set( BINDINGS_HEADER_FILES
# simulation
Simulation/Include/KSRootMagneticFieldBuilder.h
Simulation/Include/KSRootElectricFieldBuilder.h
Simulation/Include/KSRootEventModifierBuilder.h
Simulation/Include/KSRootGeneratorBuilder.h
Simulation/Include/KSRootTrajectoryBuilder.h
Simulation/Include/KSRootSpaceInteractionBuilder.h
@@ -371,6 +372,7 @@ set( BINDINGS_SOURCE_FILES
# simulation
Simulation/Source/KSRootMagneticFieldBuilder.cxx
Simulation/Source/KSRootElectricFieldBuilder.cxx
Simulation/Source/KSRootEventModifierBuilder.cxx
Simulation/Source/KSRootGeneratorBuilder.cxx
Simulation/Source/KSRootTrajectoryBuilder.cxx
Simulation/Source/KSRootSpaceInteractionBuilder.cxx
10 changes: 6 additions & 4 deletions Kassiopeia/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -5,14 +5,16 @@
# thank you! -dan.

cmake_minimum_required( VERSION 2.8.6 )
if(POLICY CMP0048)
cmake_policy(SET CMP0048 OLD)
endif()
if( POLICY CMP0053 )
cmake_policy( SET CMP0053 OLD )
endif( POLICY CMP0053 )

project( Kassiopeia )
include( KasperDefaults )

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

# module version
set( MODULE_VERSION_MAJOR 3 )
set( MODULE_VERSION_MINOR 3 )
2 changes: 2 additions & 0 deletions Kassiopeia/Operators/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# header files
set( OPERATORS_HEADER_BASENAMES
KSEventModifier.h
KSOperatorsMessage.h
KSParticle.h
KSParticleFactory.h
@@ -30,6 +31,7 @@ endforeach( BASENAME )

# source files
set( OPERATORS_SOURCE_BASENAMES
KSEventModifier.cxx
KSOperatorsMessage.cxx
KSParticle.cxx
KSParticleFactory.cxx
5 changes: 4 additions & 1 deletion Kassiopeia/Operators/Include/KSEventModifier.h
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@

namespace Kassiopeia
{

class KSEvent;

class KSEventModifier:
@@ -16,12 +17,14 @@ namespace Kassiopeia

public:


//returns true if any of the state variables of anEvent are changed
virtual bool ExecutePreEventModification( KSEvent& anEvent ) = 0;

//returns true if any of the state variables of anEvent are changed
virtual bool ExecutePostEventModification( KSEvent& anEvent ) = 0;
};

};

}

2 changes: 2 additions & 0 deletions Kassiopeia/Simulation/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -11,6 +11,7 @@ set( SIMULATION_HEADER_BASENAMES
KSTrack.h
KSStep.h
KSRootElectricField.h
KSRootEventModifier.h
KSRootMagneticField.h
KSRootStepModifier.h
KSRootTrackModifier.h
@@ -47,6 +48,7 @@ set( SIMULATION_SOURCE_BASENAMES
KSTrack.cxx
KSStep.cxx
KSRootElectricField.cxx
KSRootEventModifier.cxx
KSRootMagneticField.cxx
KSRootStepModifier.cxx
KSRootTrackModifier.cxx
3 changes: 2 additions & 1 deletion Kassiopeia/Simulation/Include/KSRootEventModifier.h
Original file line number Diff line number Diff line change
@@ -25,6 +25,7 @@ namespace Kassiopeia
//**********

public:

bool ExecutePreEventModification( KSEvent& anEvent );
bool ExecutePostEventModification( KSEvent& anEvent );

@@ -45,6 +46,7 @@ namespace Kassiopeia
//******

public:

void SetEvent( KSEvent* anEvent );

bool ExecutePreEventModification();
@@ -54,7 +56,6 @@ namespace Kassiopeia
virtual void PushDeupdateComponent();

private:

KSEvent* fEvent;
};

1 change: 1 addition & 0 deletions Kassiopeia/Simulation/Include/KSStep.h
Original file line number Diff line number Diff line change
@@ -51,6 +51,7 @@ namespace Kassiopeia
public:
K_REFS( std::string, TerminatorName )
K_REFS( bool, TerminatorFlag )
K_REFS( bool, PauseFlag ); // pls addition.

//**********
//trajectory
64 changes: 57 additions & 7 deletions Kassiopeia/Simulation/Source/KSRoot.cxx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#include "LMCGlobalsDeclaration.hh" // pls addition
#include "LMCGlobalsDefinition.hh" // pls addition

#include "KSRoot.h"
#include "KSRunMessage.h"
#include "KSEventMessage.h"
@@ -262,9 +265,6 @@ namespace Kassiopeia
}
KSRoot::~KSRoot()
{
/*
* KToolbox takes care of destruction
*/
}

void KSRoot::Execute( KSSimulation* aSimulation )
@@ -379,6 +379,42 @@ namespace Kassiopeia
return;
}



void WakeAfterEvent(unsigned TotalEvents, unsigned EventsSoFar)
{
fEventInProgress = false;
if( TotalEvents == EventsSoFar-1 )
{
fRunInProgress = false;
fKassReadyCondition.notify_one();
}
fDigitizerCondition.notify_one(); // unlock
printf("Kass is waking after event\n");
return;
}



bool ReceivedEventStartCondition()
{
fKassEventReady = true;
fDigitizerCondition.notify_one(); // unlock if still locked.
if( fWaitBeforeEvent )
{

fKassReadyCondition.notify_one();
std::unique_lock< std::mutex >tLock( fMutex );
fPreEventCondition.wait( tLock );
fKassEventReady = false;
t_old = 0.; // reset time on digitizer.
return true;
}
return true; // check this. should return true if no wait.
}



void KSRoot::ExecuteRun()
{
// set random seed
@@ -423,8 +459,17 @@ namespace Kassiopeia
fEvent->ParentRunId() = fRun->GetRunId();

// execute event
printf("Kass is waiting for event trigger.\n");
if (ReceivedEventStartCondition())
{
// printf("testvar is %f\n", testvar); // pls
printf("Kass got the event trigger\n"); //getchar(); // pls
}

ExecuteEvent();

WakeAfterEvent(fRun->GetTotalEvents(), fSimulation->GetEvents()); // pls

// update run
fRun->TotalEvents() += 1;
fRun->TotalTracks() += fEvent->TotalTracks();
@@ -451,7 +496,6 @@ namespace Kassiopeia

// send report
runmsg( eNormal ) << "...run " << fRun->GetRunId() << " complete" << eom;

fStopRunSignal = false;
return;
}
@@ -479,6 +523,9 @@ namespace Kassiopeia
// generate primaries
fRootGenerator->ExecuteGeneration();

// execute post-step modification
fRootEventModifier->ExecutePreEventModification();

// send report
eventmsg( eNormal ) << "processing event " << fEvent->GetEventId() << " <" << fEvent->GetGeneratorName() << ">..." << eom;

@@ -508,7 +555,6 @@ namespace Kassiopeia
delete tParticle;
fEvent->ParticleQueue().pop_front();

// execute a track
ExecuteTrack();

// move particles in track queue to event queue
@@ -551,6 +597,7 @@ namespace Kassiopeia

void KSRoot::ExecuteTrack()
{

// reset track
fTrack->TrackId() = fTrackIndex;
fTrack->TotalSteps() = 0;
@@ -621,6 +668,7 @@ namespace Kassiopeia
fTrack->DiscreteEnergyChange() += fStep->DiscreteEnergyChange();
fTrack->DiscreteMomentumChange() += fStep->DiscreteMomentumChange();
fTrack->DiscreteSecondaries() += fStep->DiscreteSecondaries();

}
}

@@ -693,15 +741,17 @@ namespace Kassiopeia
fStep->SurfaceNavigationFlag() = false;

// send report
/*
if( fStep->GetStepId() % fSimulation->GetStepReportIteration() == 0 )
{
stepmsg( eNormal ) << "processing step " << fStep->GetStepId() << "... (";
stepmsg << "z = " << fStep->InitialParticle().GetPosition().Z() << ", ";
stepmsg( eNormal ) << "processing step " << fStep->GetStepId() << "... (";
stepmsg << "z = " << fStep->InitialParticle().GetPosition().Z() << ", ";
stepmsg << "r = " << fStep->InitialParticle().GetPosition().Perp() << ", ";
stepmsg << "k = " << fStep->InitialParticle().GetKineticEnergy_eV() << ", ";
stepmsg << "e = " << fStep->InitialParticle().GetKineticEnergy_eV() + (fStep->InitialParticle().GetCharge() / KConst::Q()) * fStep->InitialParticle().GetElectricPotential();
stepmsg << ")" << reom;
}
*/

// debug spritz
stepmsg_debug( "processing step " << fStep->GetStepId() << eom )
3 changes: 3 additions & 0 deletions Kassiopeia/Trajectories/Source/KSTrajTrajectoryAdiabatic.cxx
Original file line number Diff line number Diff line change
@@ -52,6 +52,8 @@ namespace Kassiopeia
{
}



void KSTrajTrajectoryAdiabatic::SetIntegrator( KSTrajAdiabaticIntegrator* anIntegrator )
{
if( fIntegrator == NULL )
@@ -62,6 +64,7 @@ namespace Kassiopeia
trajmsg( eError ) << "cannot set integrator in <" << this->GetName() << "> with <" << anIntegrator << ">" << eom;
return;
}

void KSTrajTrajectoryAdiabatic::ClearIntegrator( KSTrajAdiabaticIntegrator* anIntegrator )
{
if( fIntegrator == anIntegrator )
3 changes: 3 additions & 0 deletions Kommon/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
cmake_minimum_required( VERSION 2.8.6 )
if(POLICY CMP0048)
cmake_policy(SET CMP0048 OLD)
endif()

project( Kommon )
set( CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake ${PROJECT_SOURCE_DIR}/GoogleTest/cmake )
7 changes: 7 additions & 0 deletions Kommon/Core/Initialization/KVariableProcessor.cc
Original file line number Diff line number Diff line change
@@ -41,6 +41,13 @@ namespace katrin
delete fLocalMap;
}

void KVariableProcessor::SetExternalMap( const VariableMap& anExternalMap )
{
delete fExternalMap;
fExternalMap = new VariableMap( anExternalMap );
return;
}

void KVariableProcessor::ProcessToken( KBeginFileToken* aToken )
{
if( fElementState == eElementInactive )
2 changes: 2 additions & 0 deletions Kommon/Core/Initialization/KVariableProcessor.hh
Original file line number Diff line number Diff line change
@@ -23,6 +23,8 @@ namespace katrin
KVariableProcessor( const VariableMap& anExternalMap );
virtual ~KVariableProcessor();

void SetExternalMap( const VariableMap& anExternalMap );

virtual void ProcessToken( KBeginFileToken* aToken );
virtual void ProcessToken( KBeginElementToken* aToken );
virtual void ProcessToken( KBeginAttributeToken* aToken );
5 changes: 3 additions & 2 deletions Kommon/cmake/KasperDefaults.cmake
Original file line number Diff line number Diff line change
@@ -9,8 +9,9 @@ endmacro(set_path)
include(CMakeDependentOption)
include(MacroParseArguments)

if( ${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR} )
cmake_policy( SET CMP0011 NEW )

if( "${Kasper_SOURCE_DIR}" STREQUAL "${PROJECT_SOURCE_DIR}" )
set(STANDALONE true)

# use this section to modifiy initial values of builtin CMAKE variables
@@ -176,7 +177,7 @@ macro(kasper_find_module NAME)
set( VERSION "0" )
endif()

find_package( ${NAME} ${VERSION} REQUIRED NO_MODULE )
find_package( ${NAME} ${VERSION} REQUIRED NO_MODULE HINTS ${Kasper_BINARY_DIR}/${NAME} )
#message("${NAME}_INCLUDE_DIRS: ${${NAME}_INCLUDE_DIRS}")
kasper_internal_include_directories( ${${NAME}_INCLUDE_DIRS} )
#kasper_external_include_directories( ${${NAME}_INCLUDE_DIRS} )