From 82510642da1c01fc6fd0eafbe8a69be5d734cf8b Mon Sep 17 00:00:00 2001 From: buzinsky Date: Fri, 16 Feb 2018 16:19:12 -0500 Subject: [PATCH] Update to Kassiopeia 3.5.0 Drawn from the Katrin-independent components of kasper --- .gitignore | 2 +- CMakeLists.txt | 49 +- KEMField/CMakeLists.txt | 19 +- .../KElectrostaticBoundaryFieldBuilder.hh | 186 - .../src/KMagnetostaticFieldmapBuilder.cc | 62 - .../Applications/ApplicationFiles/.gitignore | 0 .../Applications/AspectRatioFromKbdROOT.cc | 0 .../{2.0 => }/Applications/CMakeLists.txt | 30 +- .../CompareFieldsAndPotentialsROOT.cc | 0 .../Applications/ComputeChargeDensities.cc | 0 .../ComputeChargeDensitiesFromElcd33File.cc | 0 .../Applications/ComputeSphericalCapacitor.cc | 0 .../Applications/DistanceRatioFromKbdROOT.cc | 0 .../{2.0 => }/Applications/HashEMGeometry.cc | 0 .../{2.0 => }/Applications/InspectEMFile.cc | 0 .../{2.0 => }/Applications/KdbConverter.cc | 0 .../Applications/TransferEMElement.cc | 0 .../Applications/VisualizeEMGeometry.cc | 11 +- .../Source/Applications/WriteAsciiToPCD.cc | 181 + .../{2.0 => }/Applications/WriteKbdToAscii.cc | 2 +- .../Source/Applications/greedy_projection.cpp | 209 + .../BoundaryIntegrals/Core/CMakeLists.txt | 0 .../Core/include/KBoundaryIntegralMatrix.hh | 0 .../KBoundaryIntegralSolutionVector.hh | 0 .../Core/include/KBoundaryIntegralVector.hh | 0 .../Core/include/KBoundaryMatrixGenerator.hh | 0 ...trostaticAnalyticConicSectionIntegrator.hh | 0 ...ctrostaticAnalyticLineSegmentIntegrator.hh | 0 ...lectrostaticAnalyticRectangleIntegrator.hh | 0 .../KElectrostaticAnalyticRingIntegrator.hh | 0 ...ElectrostaticAnalyticTriangleIntegrator.hh | 0 ...trostaticAnalyticConicSectionIntegrator.cc | 0 ...ctrostaticAnalyticLineSegmentIntegrator.cc | 0 ...lectrostaticAnalyticRectangleIntegrator.cc | 0 .../KElectrostaticAnalyticRingIntegrator.cc | 0 ...ElectrostaticAnalyticTriangleIntegrator.cc | 0 .../Electrostatic/CMakeLists.txt | 0 .../KElectrostaticBoundaryIntegrator.hh | 0 ...KElectrostaticBoundaryIntegratorFactory.hh | 0 .../KElectrostaticElementIntegrator.hh | 0 .../src/KElectrostaticBoundaryIntegrator.cc | 0 ...KElectrostaticBoundaryIntegratorFactory.cc | 0 ...lectrostaticCubatureRectangleIntegrator.hh | 0 ...ElectrostaticCubatureTriangleIntegrator.hh | 0 ...rostaticQuadratureLineSegmentIntegrator.hh | 0 ...lectrostaticCubatureRectangleIntegrator.cc | 0 ...ElectrostaticCubatureTriangleIntegrator.cc | 0 ...rostaticQuadratureLineSegmentIntegrator.cc | 0 .../KElectrostaticRWGRectangleIntegrator.hh | 0 .../KElectrostaticRWGTriangleIntegrator.hh | 0 .../RWG/include/KRWGFunctions.hh | 0 .../RWG/include/KTFaceRFBasis.hh | 0 .../KElectrostaticRWGRectangleIntegrator.cc | 0 .../KElectrostaticRWGTriangleIntegrator.cc | 0 .../Electrostatic/RWG/src/KTFaceRFBasis.cc | 0 .../Electrostatic/RWG/src/KTRWGFunctions.cc | 0 ...c256NodeQuadratureLineSegmentIntegrator.hh | 0 ...rostaticBiQuadratureRectangleIntegrator.hh | 0 ...trostaticBiQuadratureTriangleIntegrator.hh | 0 ...c256NodeQuadratureLineSegmentIntegrator.cc | 0 ...rostaticBiQuadratureRectangleIntegrator.cc | 0 ...trostaticBiQuadratureTriangleIntegrator.cc | 0 .../Magnetostatic/CMakeLists.txt | 0 .../KMagnetostaticBoundaryIntegrator.hh | 0 .../KMagnetostaticLineSegmentIntegrator.hh | 0 .../include/KMagnetostaticRingIntegrator.hh | 0 .../src/KMagnetostaticBoundaryIntegrator.cc | 0 .../KMagnetostaticLineSegmentIntegrator.cc | 0 .../src/KMagnetostaticRingIntegrator.cc | 0 KEMField/Source/{2.0 => }/Core/CMakeLists.txt | 0 .../Core/include/KComplexStreamer.hh | 0 .../{2.0 => }/Core/include/KDataComparator.hh | 0 .../{2.0 => }/Core/include/KDataDisplay.hh | 0 .../{2.0 => }/Core/include/KEMConstants.hh | 0 .../Source/{2.0 => }/Core/include/KEMCout.hh | 0 .../{2.0 => }/Core/include/KEMStringUtils.hh | 0 .../{2.0 => }/Core/include/KEMTicker.hh | 0 .../Core/include/KFundamentalTypeCounter.hh | 0 .../Core/include/KFundamentalTypes.hh | 0 .../{2.0 => }/Core/include/KMPIEnvironment.hh | 0 .../{2.0 => }/Core/include/KMPIInterface.hh | 0 .../Core/include/KMessageInterface.hh | 0 .../{2.0 => }/Core/include/KSmartPointer.hh | 0 .../Source/{2.0 => }/Core/include/KTimer.hh | 0 .../Core/include/KTypeManipulation.hh | 0 .../{2.0 => }/Core/include/KTypelist.hh | 0 .../Core/include/KTypelistVisitor.hh | 0 .../Source/{2.0 => }/Core/src/KEMConstants.cc | 0 KEMField/Source/{2.0 => }/Core/src/KEMCout.cc | 0 .../{2.0 => }/Core/src/KEMStringUtils.cc | 0 .../Source/{2.0 => }/Core/src/KEMTicker.cc | 0 .../{2.0 => }/Core/src/KFundamentalTypes.cc | 0 .../{2.0 => }/Core/src/KMPIInterface.cc | 0 .../{2.0 => }/Core/src/KMessageInterface.cc | 0 KEMField/Source/{2.0 => }/Core/src/KTimer.cc | 0 .../{2.0 => }/Core/test/KSmartPointer_test.cc | 0 .../{2.0 => }/Exceptions/CMakeLists.txt | 0 .../Exceptions/include/KEMSimpleException.hh | 0 .../include/KKeyNotFoundException.hh | 0 .../Exceptions/src/KEMSimpleException.cc | 0 .../Exceptions/src/KKeyNotFoundException.cc | 0 .../Electromagnets/CMakeLists.txt | 0 .../Electromagnets/include/KCoil.hh | 0 .../Electromagnets/include/KCoilIntegrator.hh | 0 .../Electromagnets/include/KCurrentLoop.hh | 0 .../include/KCurrentLoopIntegrator.hh | 0 .../Electromagnets/include/KElectromagnet.hh | 0 .../include/KElectromagnetContainer.hh | 0 .../KElectromagnetIntegratingFieldSolver.hh | 0 .../include/KElectromagnetIntegrator.hh | 0 .../include/KElectromagnetTypes.hh | 0 .../include/KElectromagnetVisitor.hh | 0 .../Electromagnets/include/KLineCurrent.hh | 0 .../include/KLineCurrentIntegrator.hh | 0 .../Electromagnets/include/KSolenoid.hh | 0 .../include/KSolenoidIntegrator.hh | 0 .../Electromagnets/src/KCoil.cc | 0 .../Electromagnets/src/KCoilIntegrator.cc | 0 .../Electromagnets/src/KCurrentLoop.cc | 0 .../src/KCurrentLoopIntegrator.cc | 0 .../KElectromagnetIntegratingFieldSolver.cc | 0 .../Electromagnets/src/KLineCurrent.cc | 0 .../src/KLineCurrentIntegrator.cc | 0 .../Electromagnets/src/KSolenoid.cc | 0 .../Electromagnets/src/KSolenoidIntegrator.cc | 0 .../AccuracyComparisonFastMultipole.cc | 0 .../FastMultipole/Applications/CMakeLists.txt | 13 +- .../Applications/CompareChargeDensities.cc | 0 .../ComputeResidualNormFastMultipole.cc | 0 .../Applications/ConvertFieldMapToROOT.cc | 0 .../Applications/ConvertFieldMapToVTK.cc | 0 ...isonFastMultipole_ConfigurationExample.xml | 0 ...itorFastMultipole_ConfigurationExample.xml | 0 ...ltipoleFieldSolverConfigurationExample.xml | 0 .../Applications/PlotSparseMatrixStructure.cc | 0 .../Applications/TestFastMultipoleDualTree.cc | 0 .../TestFastMultipoleGeometryAnalysis.cc | 0 .../VisualizeElectrostaticMultipoleTree.cc | 23 +- .../FastMultipole/Core/CMakeLists.txt | 0 .../Core/include/KFMBasisData.hh | 0 .../include/KFMCollocationPointIdentitySet.hh | 0 .../Core/include/KFMCompoundActor.hh | 0 .../include/KFMCompoundInspectingActor.hh | 0 .../Core/include/KFMConditionalActor.hh | 0 .../Core/include/KFMCorecursiveActor.hh | 0 .../include/KFMElementLocalInfluenceRange.hh | 0 .../include/KFMEmptyIdentitySetRemover.hh | 0 .../Core/include/KFMExternalIdentitySet.hh | 0 .../include/KFMExternalIdentitySetSorter.hh | 0 .../Core/include/KFMIdentityPair.hh | 0 .../Core/include/KFMIdentitySet.hh | 0 .../Core/include/KFMIdentitySetList.hh | 0 .../Core/include/KFMIdentitySetSorter.hh | 0 .../Core/include/KFMInspectingActor.hh | 0 .../Core/include/KFMLeafConditionActor.hh | 0 .../Core/include/KFMLevelConditionActor.hh | 0 .../FastMultipole/Core/include/KFMNode.hh | 0 .../Core/include/KFMNodeActor.hh | 0 ...FMNodeChildToParentFlagValueInitializer.hh | 0 .../FastMultipole/Core/include/KFMNodeData.hh | 0 .../Core/include/KFMNodeFinder.hh | 0 .../Core/include/KFMNodeFlagInitializer.hh | 0 .../include/KFMNodeFlagValueInitializer.hh | 0 .../Core/include/KFMNodeFlagValueInspector.hh | 0 .../Core/include/KFMNodeFlags.hh | 0 .../include/KFMNodeIdentityListCreator.hh | 0 .../Core/include/KFMNodeIdentityListRange.hh | 0 .../KFMNodeIdentityListRangeAssociator.hh | 0 .../Core/include/KFMNodeObjectNullifier.hh | 0 .../Core/include/KFMNodeObjectRemover.hh | 0 .../KFMNodeParentToChildFlagValueInspector.hh | 0 .../include/KFMNonEmptyIdentitySetActor.hh | 0 .../Core/include/KFMObjectCollection.hh | 0 .../Core/include/KFMObjectCollector.hh | 0 .../Core/include/KFMObjectContainer.hh | 0 .../Core/include/KFMObjectHolder.hh | 0 .../Core/include/KFMObjectRetriever.hh | 0 .../Core/include/KFMRecursiveActor.hh | 0 .../FastMultipole/Core/include/KFMTree.hh | 0 .../Core/include/KFMTreeStructureExtractor.hh | 0 .../Core/src/KFMElementLocalInfluenceRange.cc | 0 .../FastMultipole/Core/src/KFMIdentitySet.cc | 0 .../Core/src/KFMIdentitySetList.cc | 0 .../Electrostatics/CMakeLists.txt | 0 ...icBoundaryIntegratorEngine_SingleThread.hh | 0 .../include/KFMElectrostaticElement.hh | 0 .../KFMElectrostaticElementContainer.hh | 0 .../KFMElectrostaticElementContainerBase.hh | 0 ...FMElectrostaticFieldMapper_SingleThread.hh | 0 ...staticLocalCoefficientCalculatorNumeric.hh | 0 ...rostaticLocalCoefficientFieldCalculator.hh | 0 .../KFMElectrostaticLocalCoefficientSet.hh | 0 ...FMElectrostaticMultipoleBatchCalculator.hh | 0 ...ectrostaticMultipoleBatchCalculatorBase.hh | 0 .../KFMElectrostaticMultipoleCalculator.hh | 0 ...lectrostaticMultipoleCalculatorAnalytic.hh | 0 ...ElectrostaticMultipoleCalculatorNumeric.hh | 0 .../include/KFMElectrostaticMultipoleSet.hh | 0 ...icNearFieldToLocalCoefficientCalculator.hh | 0 .../include/KFMElectrostaticNode.hh | 0 .../include/KFMElectrostaticNodeInspector.hh | 0 ...KFMElectrostaticNodeWorkScoreCalculator.hh | 0 .../include/KFMElectrostaticParameters.hh | 0 .../KFMElectrostaticRegionSizeEstimator.hh | 0 .../include/KFMElectrostaticTree.hh | 0 .../include/KFMElectrostaticTreeBuilder.hh | 0 .../KFMElectrostaticTreeBuilder_MPI.hh | 0 .../include/KFMElectrostaticTreeData.hh | 0 ...FMElectrostaticTreeInformationExtractor.hh | 0 ...icBoundaryIntegratorEngine_SingleThread.cc | 0 ...FMElectrostaticFieldMapper_SingleThread.cc | 0 ...staticLocalCoefficientCalculatorNumeric.cc | 0 ...rostaticLocalCoefficientFieldCalculator.cc | 0 .../KFMElectrostaticLocalCoefficientSet.cc | 0 ...FMElectrostaticMultipoleBatchCalculator.cc | 0 ...lectrostaticMultipoleCalculatorAnalytic.cc | 0 ...ElectrostaticMultipoleCalculatorNumeric.cc | 0 .../src/KFMElectrostaticMultipoleSet.cc | 0 ...icNearFieldToLocalCoefficientCalculator.cc | 0 .../src/KFMElectrostaticNodeInspector.cc | 0 ...KFMElectrostaticNodeWorkScoreCalculator.cc | 0 .../KFMElectrostaticRegionSizeEstimator.cc | 0 .../src/KFMElectrostaticTreeBuilder.cc | 0 .../src/KFMElectrostaticTreeBuilder_MPI.cc | 0 .../src/KFMElectrostaticTreeData.cc | 0 .../BoundaryIntegrals/CMakeLists.txt | 0 .../include/KFMBoundaryIntegralMatrix.hh | 0 ...MDenseBlockSparseBoundaryIntegralMatrix.hh | 0 .../include/KFMDenseBoundaryIntegralMatrix.hh | 0 .../KFMElectrostaticBoundaryIntegrator.hh | 0 .../KFMElectrostaticBoundaryIntegrator_MPI.hh | 0 .../KFMSparseBoundaryIntegralMatrix.hh | 0 ...undaryIntegralMatrix_BlockCompressedRow.hh | 0 ...rseBoundaryIntegralMatrix_CompressedRow.hh | 0 .../Interface/Extraction/CMakeLists.txt | 0 .../include/KFMBoundingBallContainer.hh | 0 .../KFMElectrostaticBasisDataContainer.hh | 0 .../KFMElectrostaticBasisDataExtractor.hh | 0 ...MElectrostaticElementContainerFlyweight.hh | 0 .../KFMElectrostaticSurfaceConverter.hh | 0 .../include/KFMElementAspectRatioExtractor.hh | 0 .../include/KFMPointCloudContainer.hh | 0 .../KFMSurfaceToPointCloudConverter.hh | 0 .../KFMTreeSurfaceOrderingPredicate.hh | 0 ...MElectrostaticElementContainerFlyweight.cc | 0 .../src/KFMElectrostaticSurfaceConverter.cc | 0 .../src/KFMElementAspectRatioExtractor.cc | 0 .../src/KFMSurfaceToPointCloudConverter.cc | 0 .../Interface/FieldSolvers/CMakeLists.txt | 0 ...FMElectrostaticFastMultipoleFieldSolver.hh | 0 ...ticFastMultipoleMultipleTreeFieldSolver.hh | 0 .../KFMElectrostaticTreeConstructor.hh | 0 ...FMElectrostaticFastMultipoleFieldSolver.cc | 0 ...ticFastMultipoleMultipleTreeFieldSolver.cc | 0 .../FastMultipole/Kernel/CMakeLists.txt | 0 .../Kernel/include/KFMKernelExpansion.hh | 0 .../Kernel/include/KFMKernelResponseArray.hh | 0 .../include/KFMKernelResponseArrayTypes.hh | 0 .../Kernel/include/KFMMomentTransformer.hh | 0 .../include/KFMMomentTransformerTypes.hh | 0 .../include/KFMReducedKernelResponseArray.hh | 0 .../include/KFMResponseKernel_3DLaplaceL2L.hh | 0 .../include/KFMResponseKernel_3DLaplaceM2L.hh | 0 .../include/KFMResponseKernel_3DLaplaceM2M.hh | 0 .../include/KFMResponseKernel_LaplaceM2L.hh | 0 .../include/KFMScalarMomentExpansion.hh | 0 .../include/KFMScalarMultipoleExpansion.hh | 0 .../KFMScaleInvariantKernelExpansion.hh | 0 .../Kernel/src/KFMResponseKernel.cc | 0 .../src/KFMResponseKernel_3DLaplaceL2L.cc | 0 .../src/KFMResponseKernel_3DLaplaceM2L.cc | 0 .../src/KFMResponseKernel_3DLaplaceM2M.cc | 0 .../Kernel/src/KFMScalarMultipoleExpansion.cc | 0 .../FastMultipole/Math/CMakeLists.txt | 0 .../FastMultipole/Math/include/KFMBall.hh | 0 .../Math/include/KFMBallCloud.hh | 0 .../Math/include/KFMBallSupportSet.hh | 0 .../Math/include/KFMBoundaryCalculator.hh | 0 .../FastMultipole/Math/include/KFMBox.hh | 0 .../Math/include/KFMBoxSupportSet.hh | 0 ...omplexSphericalHarmonicExpansionRotator.hh | 0 .../FastMultipole/Math/include/KFMCube.hh | 0 .../Math/include/KFMCubicVolumeCollection.hh | 0 .../Math/include/KFMDenseBlockSparseMatrix.hh | 0 .../KFMDenseBlockSparseMatrixStructure.hh | 0 .../include/KFMDenseBlockSparseMatrix_MPI.hh | 0 .../include/KFMPinchonGMatrixCalculator.hh | 0 .../include/KFMPinchonJMatrixCalculator.hh | 0 .../FastMultipole/Math/include/KFMPoint.hh | 0 .../Math/include/KFMPointCloud.hh | 0 .../KFMPointCloudToBoundingBallConverter.hh | 0 ...FMRealSphericalHarmonicExpansionRotator.hh | 0 .../KFMTrianglePolarBasisCalculator.hh | 0 ...omplexSphericalHarmonicExpansionRotator.cc | 0 .../src/KFMDenseBlockSparseMatrixStructure.cc | 0 .../Math/src/KFMPinchonGMatrixCalculator.cc | 0 .../Math/src/KFMPinchonJMatrixCalculator.cc | 0 ...FMRealSphericalHarmonicExpansionRotator.cc | 0 .../src/KFMTrianglePolarBasisCalculator.cc | 0 .../FastMultipole/Test/CMakeLists.txt | 0 .../FastMultipole/Test/TestArrayMath.cc | 0 .../Test/TestBasicMatrixOperations.cc | 0 .../Test/TestBasicMatrixVectorOperations.cc | 0 .../Test/TestBasicVectorOperations.cc | 0 .../Test/TestBitReversalPermutation.cc | 0 .../FastMultipole/Test/TestBoundingBall.cc | 0 .../{2.0 => }/FastMultipole/Test/TestCube.cc | 0 .../Test/TestFastFourierTransformBluestein.cc | 0 .../TestFastFourierTransformRadixThree.cc | 0 .../Test/TestFastFourierTransformRadixTwo.cc | 0 .../Test/TestFastMultipoleDualTree.cc | 0 .../Test/TestFastMultipoleFieldMap.cc | 0 .../Test/TestFastMultipoleFieldSolver.cc | 0 .../Test/TestFastMultipoleTranslation.cc | 0 .../FastMultipole/Test/TestKrylovSolvers.cc | 0 .../FastMultipole/Test/TestM2LCoefficients.cc | 0 .../TestMatrixSingularValueDecomposition.cc | 0 ...estMultidimensionalFastFourierTransform.cc | 0 ...tidimensionalFastFourierTransformOpenCL.cc | 0 ...ltidimensionalFastFourierTransformSpeed.cc | 0 .../Test/TestMultilevelPreconditioners.cc | 0 .../Test/TestMultipoleCalculators.cc | 0 .../Test/TestMultipoleExpansionSpeed.cc | 0 .../Test/TestNumericalIntegrator.cc | 0 .../Test/TestPinchonJMatrixCalculator.cc | 0 .../Test/TestQuadratureTableCalculator.cc | 0 .../TestSingleTriangleMultipoleExpansion.cc | 0 .../FastMultipole/Test/TestStructuredASCII.cc | 0 .../Test/TestStructuredASCIICompressed.cc | 0 .../FastMultipole/Test/TestVectorMath.cc | 0 .../FastMultipole/Tree/CMakeLists.txt | 0 .../KFMCollocationPointIdentitySetCreator.hh | 0 .../Tree/include/KFMCubicSpaceBallSorter.hh | 0 .../KFMCubicSpaceNodeAdjacencyProgenitor.hh | 0 .../KFMCubicSpaceNodeNeighborFinder.hh | 0 .../include/KFMCubicSpaceNodeProgenitor.hh | 0 .../Tree/include/KFMCubicSpaceTree.hh | 0 .../include/KFMCubicSpaceTreeNavigator.hh | 0 .../include/KFMCubicSpaceTreeProperties.hh | 0 .../KFMCubicSpaceTreeStaticLoadBalancer.hh | 0 .../KFMDenseBlockSparseMatrixGenerator.hh | 0 ...enseBlockSparseMatrixStructureGenerator.hh | 0 .../Tree/include/KFMDirectCallCounter.hh | 0 .../KFMElementLocalInfluenceRangeCollector.hh | 0 .../Tree/include/KFMElementLocator.hh | 0 .../KFMElementMomentBatchCalculator.hh | 0 .../Tree/include/KFMElementNodeAssociator.hh | 0 .../KFMElementScalarMomentDistributor.hh | 0 .../include/KFMExternalIdentitySetCreator.hh | 0 .../KFMExternalIdentitySetNullifier.hh | 0 .../Tree/include/KFMIdentitySetCollector.hh | 0 .../Tree/include/KFMIdentitySetListCreator.hh | 0 .../Tree/include/KFMIdentitySetMerger.hh | 0 .../Tree/include/KFMInsertionCondition.hh | 0 .../Tree/include/KFMNearbyElementCounter.hh | 0 .../Tree/include/KFMNodeCollector.hh | 0 .../KFMReducedScalarMomentCollector.hh | 0 ...ducedScalarMomentRemoteToLocalConverter.hh | 0 .../KFMRemoteToLocalConverterInterface.hh | 0 .../Tree/include/KFMScalarMomentCollector.hh | 0 .../include/KFMScalarMomentDistributor.hh | 0 .../include/KFMScalarMomentInitializer.hh | 0 .../KFMScalarMomentLocalToLocalConverter.hh | 0 .../KFMScalarMomentRemoteToLocalConverter.hh | 0 .../KFMScalarMomentRemoteToRemoteConverter.hh | 0 .../Tree/include/KFMScalarMomentResetter.hh | 0 .../Tree/include/KFMSpecialNodeSet.hh | 0 .../Tree/include/KFMSpecialNodeSetCreator.hh | 0 .../Tree/include/KFMSubdivisionCondition.hh | 0 .../KFMSubdivisionConditionAggressive.hh | 0 .../KFMSubdivisionConditionBalanced.hh | 0 .../include/KFMSubdivisionConditionGuided.hh | 0 .../Tree/include/KFMSubdivisionStrategy.hh | 0 .../Tree/include/KFMWorkLoadBalanceWeights.hh | 0 .../src/KFMElementMomentBatchCalculator.cc | 0 .../Tree/src/KFMSubdivisionStrategy.cc | 0 .../FastMultipole/Utility/CMakeLists.txt | 0 ...ostaticFastMultipoleBoundaryValueSolver.hh | 0 ...ltipoleBoundaryValueSolverConfiguration.hh | 0 .../KFMElectrostaticMatrixGenerator.hh | 0 ...KFMElectrostaticParametersConfiguration.hh | 0 .../Utility/include/KFMElectrostaticTypes.hh | 0 .../Utility/include/KFMNamedScalarData.hh | 0 .../include/KFMNamedScalarDataCollection.hh | 0 .../include/KFastMultipoleMatrixGenerator.hh | 0 ...ostaticFastMultipoleBoundaryValueSolver.cc | 0 ...ltipoleBoundaryValueSolverConfiguration.cc | 0 .../Utility/src/KFMNamedScalarData.cc | 0 .../src/KFMNamedScalarDataCollection.cc | 0 .../src/KFastMultipoleMatrixGenerator.cc | 0 .../FieldSolvers/Core/CMakeLists.txt | 0 .../KIntegratingFieldSolverTemplate.hh | 0 .../FieldSolvers/Integrating/CMakeLists.txt | 0 .../KElectrostaticIntegratingFieldSolver.hh | 0 .../ZonalHarmonic/Generator/CMakeLists.txt | 0 .../include/KZHCoefficientGeneratorCoil.hh | 0 .../KZHCoefficientGeneratorConicSection.hh | 0 .../KZHCoefficientGeneratorCurrentLoop.hh | 0 .../include/KZHCoefficientGeneratorElement.hh | 0 .../include/KZHCoefficientGeneratorRing.hh | 0 .../KZHCoefficientGeneratorSolenoid.hh | 0 .../include/KZHLegendreCoefficients.hh | 0 .../KZonalHarmonicCoefficientGenerator.hh | 0 .../include/KZonalHarmonicContainer.hh | 0 .../include/KZonalHarmonicParameters.hh | 0 .../include/KZonalHarmonicSourcePoint.hh | 0 .../Generator/include/KZonalHarmonicTypes.hh | 0 .../src/KZHCoefficientGeneratorCoil.cc | 0 .../KZHCoefficientGeneratorConicSection.cc | 0 .../src/KZHCoefficientGeneratorCurrentLoop.cc | 0 .../src/KZHCoefficientGeneratorElement.cc | 0 .../src/KZHCoefficientGeneratorRing.cc | 0 .../src/KZHCoefficientGeneratorSolenoid.cc | 0 .../Generator/src/KZHLegendreCoefficients.cc | 0 .../src/KZonalHarmonicSourcePoint.cc | 0 .../ZonalHarmonic/Solver/CMakeLists.txt | 0 .../KElectromagnetZonalHarmonicFieldSolver.hh | 0 .../KElectrostaticZonalHarmonicFieldSolver.hh | 0 .../Solver/include/KZonalHarmonicComputer.hh | 0 .../Solver/include/KZonalHarmonicComputer.icc | 0 .../KElectromagnetZonalHarmonicFieldSolver.cc | 0 .../KElectrostaticZonalHarmonicFieldSolver.cc | 0 .../IO/FileManipulation/CMakeLists.txt | 0 .../include/KEMChunkedFileInterface.hh | 0 .../IO/FileManipulation/include/KEMFile.hh | 0 .../include/KEMFileInterface.hh | 0 .../include/KEMKSAFileInterface.hh | 0 .../include/KEMSparseMatrixFileInterface.hh | 0 .../IO/FileManipulation/src/KEMFile.cc | 0 .../FileManipulation/src/KEMFileInterface.cc | 0 .../src/KEMKSAFileInterface.cc | 0 .../{2.0 => }/IO/HashGenerator/CMakeLists.txt | 0 .../include/KMD5HashGenerator.hh | 0 .../{2.0 => }/IO/HashGenerator/include/md5.hh | 0 .../{2.0 => }/IO/HashGenerator/src/md5.cc | 0 .../{2.0 => }/IO/Streamers/CMakeLists.txt | 0 .../Streamers/include/KBinaryDataStreamer.hh | 0 .../IO/Streamers/include/KMetadataStreamer.hh | 0 .../IO/Streamers/include/KSABuffer.hh | 0 .../IO/Streamers/include/KSADataStreamer.hh | 0 .../IO/Streamers/include/KSerializer.hh | 0 .../IO/Streamers/include/KStreamedSizeOf.hh | 0 .../Streamers/include/KTransitiveStreamer.hh | 0 .../IO/Streamers/src/KBinaryDataStreamer.cc | 0 .../IO/Streamers/src/KMetadataStreamer.cc | 0 .../{2.0 => }/IO/Streamers/src/KSABuffer.cc | 0 .../IO/Streamers/src/KSADataStreamer.cc | 0 .../IO/StructuredASCII/CMakeLists.txt | 0 ...sociatedPassedPointerPODArrayOutputNode.hh | 0 ...KSAAssociatedPassedPointerPODOutputNode.hh | 0 .../KSAAssociatedPointerObjectOutputNode.hh | 0 .../KSAAssociatedPointerPODArrayInputNode.hh | 0 .../KSAAssociatedPointerPODArrayOutputNode.hh | 0 .../KSAAssociatedPointerPODInputNode.hh | 0 .../KSAAssociatedPointerPODOutputNode.hh | 0 .../KSAAssociatedReferencePODInputNode.hh | 0 .../include/KSAAssociatedValuePODInputNode.hh | 0 .../KSAAssociatedValuePODOutputNode.hh | 0 .../include/KSACallbackTypes.hh | 0 .../StructuredASCII/include/KSADefinitions.hh | 0 .../StructuredASCII/include/KSAFileReader.hh | 0 .../StructuredASCII/include/KSAFileWriter.hh | 0 .../include/KSAFixedSizeInputOutputObject.hh | 0 .../include/KSAInputCollector.hh | 0 .../StructuredASCII/include/KSAInputNode.hh | 0 .../StructuredASCII/include/KSAInputObject.hh | 0 .../include/KSAInputOutputObject.hh | 0 .../include/KSAIsDerivedFrom.hh | 0 .../IO/StructuredASCII/include/KSAObject.hh | 0 .../include/KSAObjectInputNode.hh | 0 .../include/KSAObjectOutputNode.hh | 0 .../include/KSAOutputCollector.hh | 0 .../StructuredASCII/include/KSAOutputNode.hh | 0 .../include/KSAOutputObject.hh | 0 .../include/KSAPODArrayOutputNode.hh | 0 .../include/KSAPODConverter.hh | 0 .../include/KSAPODInputNode.hh | 0 .../include/KSAPODOutputNode.hh | 0 .../include/KSAStructuredASCIIHeaders.hh | 0 .../IO/StructuredASCII/include/KSATestA.hh | 0 .../IO/StructuredASCII/include/KSATestB.hh | 0 .../IO/StructuredASCII/include/KSATestC.hh | 0 .../IO/StructuredASCII/include/KSATestD.hh | 0 .../StructuredASCII/include/KSATokenizer.hh | 0 .../IO/StructuredASCII/include/miniz.c | 0 .../IO/StructuredASCII/include/miniz.hh | 0 .../IO/StructuredASCII/src/KSAFileReader.cc | 0 .../IO/StructuredASCII/src/KSAFileWriter.cc | 0 .../StructuredASCII/src/KSAInputCollector.cc | 0 .../StructuredASCII/src/KSAOutputCollector.cc | 0 .../IO/StructuredASCII/src/KSATestA.cc | 0 .../IO/StructuredASCII/src/KSATestB.cc | 0 .../IO/StructuredASCII/src/KSATestC.cc | 0 .../IO/StructuredASCII/src/KSATestD.cc | 0 .../Electric/CMakeLists.txt | 0 .../KElectrostaticBoundaryIntegratorPolicy.hh | 0 .../KElectrostaticBoundaryIntegratorPolicy.cc | 0 .../Electric/CMakeLists.txt | 0 .../include/KCachedChargeDensitySolver.hh | 0 .../Electric/include/KChargeDensitySolver.hh | 0 ...tSuperpositionCachedChargeDensitySolver.hh | 0 ...KExplicitSuperpositionSolutionComponent.hh | 0 ...KGaussianEliminationChargeDensitySolver.hh | 0 .../include/KKrylovChargeDensitySolver.hh | 0 .../include/KKrylovChargeDensitySolverOld.hh | 0 .../include/KKrylovPreconditionerGenerator.hh | 0 .../include/KRobinHoodChargeDensitySolver.hh | 0 .../src/KCachedChargeDensitySolver.cc | 0 .../Electric/src/KChargeDensitySolver.cc | 0 ...tSuperpositionCachedChargeDensitySolver.cc | 0 ...KGaussianEliminationChargeDensitySolver.cc | 0 .../src/KKrylovChargeDensitySolver.cc | 0 .../src/KKrylovChargeDensitySolverOld.cc | 0 .../src/KKrylovPreconditionerGenerator.cc | 0 .../src/KRobinHoodChargeDensitySolver.cc | 0 .../test/KChargeDensitySolver_test.cc | 0 .../FieldSolvers/Electric/CMakeLists.txt | 12 +- .../KElectricFastMultipoleFieldSolver.hh | 0 .../Electric/include/KElectricFieldSolver.hh | 0 .../include/KElectricZHFieldSolver.hh | 0 .../KIntegratingElectrostaticFieldSolver.hh | 0 .../src/KElectricFastMultipoleFieldSolver.cc | 0 .../Electric/src/KElectricZHFieldSolver.cc | 0 .../KIntegratingElectrostaticFieldSolver.cc | 0 .../FieldSolvers/Magnetic/CMakeLists.txt | 0 .../KIntegratingMagnetostaticFieldSolver.hh | 0 .../Magnetic/include/KMagneticFieldSolver.hh | 0 .../KZonalHarmonicMagnetostaticFieldSolver.hh | 0 .../KIntegratingMagnetostaticFieldSolver.cc | 0 .../KZonalHarmonicMagnetostaticFieldSolver.cc | 0 .../Interface/Fields/Electric/CMakeLists.txt | 0 .../include/KBoundaryElementInfoDisplay.hh | 0 .../Fields/Electric/include/KElectricField.hh | 0 .../include/KElectricQuadrupoleField.hh | 0 .../include/KElectrostaticBoundaryField.hh | 0 .../KElectrostaticBoundaryFieldTimer.hh | 0 .../include/KElectrostaticConstantField.hh | 0 .../Electric/include/KElectrostaticField.hh | 0 .../include/KInducedAzimuthalElectricField.hh | 0 .../Electric/include/KRampedElectric2Field.hh | 0 .../Electric/include/KRampedElectricField.hh | 0 .../src/KBoundaryElementInfoDisplay.cc | 0 .../Electric/src/KElectricQuadrupoleField.cc | 0 .../src/KElectrostaticBoundaryField.cc | 0 .../src/KElectrostaticBoundaryFieldTimer.cc | 0 .../src/KInducedAzimuthalElectricField.cc | 0 .../Electric/src/KRampedElectric2Field.cc | 0 .../Electric/src/KRampedElectricField.cc | 0 .../Interface/Fields/Magnetic/CMakeLists.txt | 0 .../Magnetic/include/KMagneticDipoleField.hh | 0 .../Fields/Magnetic/include/KMagneticField.hh | 0 .../include/KMagneticSuperpositionField.hh | 0 .../include/KMagnetostaticConstantField.hh | 0 .../Magnetic/include/KMagnetostaticField.hh | 0 .../Magnetic/include/KRampedMagneticField.hh | 0 .../include/KStaticElectromagnetField.hh | 0 .../Magnetic/src/KMagneticDipoleField.cc | 0 .../src/KMagneticSuperpositionField.cc | 0 .../Magnetic/src/KRampedMagneticField.cc | 0 .../Magnetic/src/KStaticElectromagnetField.cc | 0 .../LinearAlgebra/Core/CMakeLists.txt | 0 .../LinearAlgebra/Core/include/KMatrix.hh | 0 .../Core/include/KSimpleMatrix.hh | 0 .../Core/include/KSimpleSquareMatrix.hh | 0 .../Core/include/KSimpleVector.hh | 0 .../Core/include/KSquareMatrix.hh | 0 .../LinearAlgebra/Core/include/KVector.hh | 0 .../Preconditioners/CMakeLists.txt | 0 .../include/KBlockJacobiPreconditioner.hh | 0 .../include/KIdentityPreconditioner.hh | 0 .../include/KImplicitKrylovPreconditioner.hh | 0 .../include/KJacobiPreconditioner.hh | 0 .../include/KMatrixPreconditioner.hh | 0 .../include/KPreconditioner.hh | 0 .../LinearAlgebra/Solvers/CMakeLists.txt | 0 .../include/KBiconjugateGradientStabilized.hh | 0 .../KBiconjugateGradientStabilizedState.hh | 0 .../Solvers/include/KGaussSeidel.hh | 0 .../Solvers/include/KGaussSeidel_MPI.hh | 0 .../include/KGaussSeidel_SingleThread.hh | 0 .../Solvers/include/KGaussianElimination.hh | 0 .../include/KGeneralizedMinimalResidual.hh | 0 .../KGeneralizedMinimalResidualState.hh | 0 .../KGeneralizedMinimalResidual_MPI.hh | 0 .../KIterativeKrylovRestartCondition.hh | 0 .../Solvers/include/KIterativeKrylovSolver.hh | 0 .../Solvers/include/KIterativeSolver.hh | 0 .../include/KKrylovSolverConfiguration.hh | 0 .../Solvers/include/KKrylovSolverFactory.hh | 0 .../Solvers/include/KMultiElementRobinHood.hh | 0 .../KMultiElementRobinHood_SingleThread.hh | 0 ...onditionedBiconjugateGradientStabilized.hh | 0 ...reconditionedGeneralizedMinimalResidual.hh | 0 ...ditionedGeneralizedMinimalResidualState.hh | 0 ...nditionedGeneralizedMinimalResidual_MPI.hh | 0 .../KPreconditionedIterativeKrylovSolver.hh | 0 .../Solvers/include/KProjectionSolver.hh | 0 .../Solvers/include/KRobinHood.hh | 0 .../Solvers/include/KRobinHood_MPI.hh | 0 .../include/KRobinHood_SingleThread.hh | 0 .../Solvers/include/KSVDSolver.hh | 0 .../include/KSimpleIterativeKrylovSolver.hh | 0 .../include/KSuccessiveSubspaceCorrection.hh | 0 ...ccessiveSubspaceCorrection_SingleThread.hh | 0 .../Solvers/include/KSuperpositionSolver.hh | 0 .../Solvers/src/KKrylovSolverConfiguration.cc | 0 .../LinearAlgebra/Visitors/CMakeLists.txt | 0 .../Visitors/include/KIterationTerminator.hh | 0 .../Visitors/include/KIterationTracker.hh | 0 .../include/KIterativeKrylovStateReader.hh | 0 .../include/KIterativeKrylovStateWriter.hh | 0 .../Visitors/include/KIterativeSolverTimer.hh | 0 .../Visitors/include/KIterativeStateReader.hh | 0 .../Visitors/include/KIterativeStateWriter.hh | 0 ...reconditionedIterativeKrylovStateReader.hh | 0 ...reconditionedIterativeKrylovStateWriter.hh | 0 .../Visitors/include/KResidualVector.hh | 0 .../Visitors/include/KTimeTerminator.hh | 0 .../{2.0 => }/Math/Array/CMakeLists.txt | 0 .../Array/include/KFMArrayFillingOperator.hh | 0 .../Math/Array/include/KFMArrayMath.hh | 0 .../Math/Array/include/KFMArrayOperator.hh | 0 .../Array/include/KFMArrayScalarMultiplier.hh | 0 .../Math/Array/include/KFMArrayWrapper.hh | 0 .../Array/include/KFMBinaryArrayOperator.hh | 0 .../Math/Array/include/KFMMessaging.hh | 0 .../Array/include/KFMPointwiseArrayAdder.hh | 0 .../include/KFMPointwiseArrayMultiplier.hh | 0 ...intwiseArrayReversedConjugateMultiplier.hh | 0 .../include/KFMPointwiseArrayScaledAdder.hh | 0 .../Array/include/KFMUnaryArrayOperator.hh | 0 KEMField/Source/{2.0 => }/Math/CMakeLists.txt | 0 .../{2.0 => }/Math/Utilities/CMakeLists.txt | 0 .../include/KFMBitReversalPermutation.hh | 0 .../include/KFMFastFourierTransform.hh | 0 .../KFMFastFourierTransformUtilities.hh | 0 ...MGaussLegendreQuadratureTableCalculator.hh | 0 .../include/KFMLinearAlgebraDefinitions.hh | 0 .../include/KFMLinearSystemSolver.hh | 0 .../Math/Utilities/include/KFMMath.hh | 0 .../Utilities/include/KFMMatrixOperations.hh | 0 .../include/KFMMatrixVectorOperations.hh | 0 ...KFMMultidimensionalFastFourierTransform.hh | 0 ...ultidimensionalFastFourierTransformFFTW.hh | 0 .../include/KFMNumericalConstants.hh | 0 .../include/KFMSquareRootUtilities.hh | 0 .../Utilities/include/KFMVectorOperations.hh | 0 .../src/KFMBitReversalPermutation.cc | 0 .../Utilities/src/KFMFastFourierTransform.cc | 0 .../src/KFMFastFourierTransformUtilities.cc | 0 ...MGaussLegendreQuadratureTableCalculator.cc | 0 .../Utilities/src/KFMLinearSystemSolver.cc | 0 .../{2.0 => }/Math/Utilities/src/KFMMath.cc | 0 .../Math/Utilities/src/KFMMatrixOperations.cc | 0 .../src/KFMMatrixVectorOperations.cc | 0 .../Utilities/src/KFMSquareRootUtilities.cc | 0 .../Math/Utilities/src/KFMVectorOperations.cc | 0 .../{2.0 => }/Math/VectorMath/CMakeLists.txt | 0 .../VectorMath/include/KVMCompactCurve.hh | 0 .../VectorMath/include/KVMCompactSurface.hh | 0 .../VectorMath/include/KVMCompactVolume.hh | 0 .../Math/VectorMath/include/KVMField.hh | 0 .../VectorMath/include/KVMFieldWrapper.hh | 0 .../Math/VectorMath/include/KVMFixedArray.hh | 0 .../VectorMath/include/KVMFluxIntegral.hh | 0 .../VectorMath/include/KVMLineIntegral.hh | 0 .../Math/VectorMath/include/KVMLineSegment.hh | 0 .../Math/VectorMath/include/KVMMap.hh | 0 .../include/KVMNumericalIntegrator.hh | 0 .../VectorMath/include/KVMPathIntegral.hh | 0 .../include/KVMRectangularSurface.hh | 0 .../VectorMath/include/KVMSpaceLineSegment.hh | 0 .../VectorMath/include/KVMSpaceRectangle.hh | 0 .../VectorMath/include/KVMSpaceTriangle.hh | 0 .../VectorMath/include/KVMSurfaceIntegral.hh | 0 .../include/KVMTriangularSurface.hh | 0 .../Math/VectorMath/src/KVMCompactCurve.cc | 0 .../Math/VectorMath/src/KVMCompactSurface.cc | 0 .../Math/VectorMath/src/KVMCompactVolume.cc | 0 .../Math/VectorMath/src/KVMFluxIntegral.cc | 0 .../Math/VectorMath/src/KVMLineIntegral.cc | 0 .../Math/VectorMath/src/KVMLineSegment.cc | 0 .../VectorMath/src/KVMRectangularSurface.cc | 0 .../VectorMath/src/KVMSpaceLineSegment.cc | 0 .../Math/VectorMath/src/KVMSpaceRectangle.cc | 0 .../Math/VectorMath/src/KVMSpaceTriangle.cc | 0 .../VectorMath/src/KVMTriangularSurface.cc | 0 .../Math/include/KEMCoordinateSystem.hh | 0 .../Math/include/KEMStreamableThreeVector.hh | 0 .../{2.0 => }/Math/include/KEMThreeMatrix.hh | 0 .../{2.0 => }/Math/include/KEMThreeVector.hh | 0 .../Math/include/KEMTransformation.hh | 0 .../Math/include/KEllipticIntegrals.hh | 0 .../Math/include/KGaussLegendreQuadrature.hh | 0 .../Math/include/KGaussianQuadrature.hh | 0 .../Math/include/KShanksTransformation.hh | 0 .../{2.0 => }/Math/src/KEMCoordinateSystem.cc | 0 .../{2.0 => }/Math/src/KEMThreeMatrix.cc | 0 .../{2.0 => }/Math/src/KEMThreeVector.cc | 0 .../{2.0 => }/Math/src/KEllipticIntegrals.cc | 0 .../Math/src/KGaussLegendreQuadrature.cc | 0 .../{2.0 => }/Math/src/KGaussianQuadrature.cc | 0 .../{2.0 => }/Plugins/Bindings/CMakeLists.txt | 11 + .../KCachedChargeDensitySolverBuilder.hh | 0 ...ticBoundaryIntegratorAttributeProcessor.hh | 0 ...ositionCachedChargeDensitySolverBuilder.hh | 0 ...itSuperpositionSolutionComponentBuilder.hh | 0 .../KFMElectrostaticParametersBuilder.hh | 0 .../KFastMultipoleMatrixGeneratorBuilder.hh | 0 ...anEliminationChargeDensitySolverBuilder.hh | 0 .../KKrylovChargeDensitySolverBuilder.hh | 0 .../KKrylovChargeDensitySolverOldBuilder.hh | 0 .../KKrylovPreconditionerGeneratorBuilder.hh | 0 .../KKrylovSolverConfigurationReader.hh | 0 .../KRobinHoodChargeDensitySolverBuilder.hh | 0 .../src/KCachedChargeDensitySolverBuilder.cc | 0 ...ositionCachedChargeDensitySolverBuilder.cc | 0 ...itSuperpositionSolutionComponentBuilder.cc | 0 .../src/KFMElectrostaticParametersBuilder.cc | 0 .../KFastMultipoleMatrixGeneratorBuilder.cc | 0 ...anEliminationChargeDensitySolverBuilder.cc | 0 .../src/KKrylovChargeDensitySolverBuilder.cc | 0 .../KKrylovChargeDensitySolverOldBuilder.cc | 0 .../KKrylovPreconditionerGeneratorBuilder.cc | 0 .../KRobinHoodChargeDensitySolverBuilder.cc | 0 ...ElectricFastMultipoleFieldSolverBuilder.hh | 0 .../include/KElectricZHFieldSolverBuilder.hh | 0 .../KFMVTKElectrostaticTreeViewerBuilder.hh | 72 + ...egratingElectrostaticFieldSolverBuilder.hh | 0 ...ElectricFastMultipoleFieldSolverBuilder.cc | 0 .../src/KElectricZHFieldSolverBuilder.cc | 0 .../KFMVTKElectrostaticTreeViewerBuilder.cc | 27 + ...egratingElectrostaticFieldSolverBuilder.cc | 0 ...egratingMagnetostaticFieldSolverBuilder.hh | 0 ...HarmonicMagnetostaticFieldSolverBuilder.hh | 0 ...egratingMagnetostaticFieldSolverBuilder.cc | 0 ...HarmonicMagnetostaticFieldSolverBuilder.cc | 0 .../KBoundaryElementInfoDisplayBuilder.hh | 0 .../KElectricQuadrupoleFieldBuilder.hh | 0 .../KElectrostaticBoundaryFieldBuilder.hh | 186 + ...KElectrostaticBoundaryFieldTimerBuilder.hh | 0 .../KElectrostaticConstantFieldBuilder.hh | 0 .../KElectrostaticPotentialmapBuilder.hh | 4 +- .../KInducedAzimuthalElectricFieldBuilder.hh | 0 .../include/KRampedElectric2FieldBuilder.hh | 0 .../include/KRampedElectricFieldBuilder.hh | 0 .../include/KVTKViewerVisitorBuilder.hh | 0 .../src/KBoundaryElementInfoDisplayBuilder.cc | 0 .../src/KElectricQuadrupoleFieldBuilder.cc | 0 .../src/KElectrostaticBoundaryFieldBuilder.cc | 0 ...KElectrostaticBoundaryFieldTimerBuilder.cc | 0 .../src/KElectrostaticConstantFieldBuilder.cc | 0 .../src/KElectrostaticPotentialmapBuilder.cc | 2 +- .../KInducedAzimuthalElectricFieldBuilder.cc | 0 .../src/KRampedElectric2FieldBuilder.cc | 0 .../src/KRampedElectricFieldBuilder.cc | 0 .../Electric/src/KVTKViewerVisitorBuilder.cc | 0 .../include/KMagneticDipoleFieldBuilder.hh | 0 .../KMagneticSuperpositionFieldBuilder.hh | 0 .../KMagnetostaticConstantFieldBuilder.hh | 0 .../include/KMagnetostaticFieldmapBuilder.hh | 26 +- .../include/KRampedMagneticFieldBuilder.hh | 0 .../KStaticElectromagnetFieldBuilder.hh | 4 +- .../src/KMagneticDipoleFieldBuilder.cc | 0 .../src/KMagneticSuperpositionFieldBuilder.cc | 0 .../src/KMagnetostaticConstantFieldBuilder.cc | 0 .../src/KMagnetostaticFieldmapBuilder.cc | 62 + .../src/KRampedMagneticFieldBuilder.cc | 0 .../src/KStaticElectromagnetFieldBuilder.cc | 0 .../Utilities/include/KEMBindingsMessage.hh | 0 .../Bindings/Utilities/include/KEMToolbox.hh | 0 .../Utilities/include/KEMToolboxBuilder.hh | 0 .../Utilities/include/KEMToolboxHelper.hh | 0 .../Utilities/include/KSmartPointerRelease.hh | 0 .../Utilities/src/KEMBindingsMessage.cc | 0 .../Bindings/Utilities/src/KEMToolbox.cc | 0 .../Utilities/src/KEMToolboxBuilder.cc | 0 .../{2.0 => }/Plugins/KGeoBag/CMakeLists.txt | 0 .../KGeoBag/include/KEMVectorConverters.hh | 0 .../KElectrostaticBoundaryFieldWithKGeoBag.hh | 0 .../Plugins/KGeoBag/include/KGBEM.hh | 0 .../Plugins/KGeoBag/include/KGBEMBuilder.hh | 4 +- .../Plugins/KGeoBag/include/KGBEMConverter.hh | 0 .../KGeoBag/include/KGElectromagnet.hh | 0 .../KGeoBag/include/KGElectromagnetBuilder.hh | 30 +- .../include/KGElectromagnetConverter.hh | 0 .../KStaticElectromagnetFieldWithKGeoBag.hh | 0 .../KElectrostaticBoundaryFieldWithKGeoBag.cc | 0 .../{2.0 => }/Plugins/KGeoBag/src/KGBEM.cc | 0 .../Plugins/KGeoBag/src/KGBEMBuilder.cc | 0 .../Plugins/KGeoBag/src/KGBEMConverter.cc | 0 .../Plugins/KGeoBag/src/KGElectromagnet.cc | 0 .../KGeoBag/src/KGElectromagnetBuilder.cc | 0 .../KGeoBag/src/KGElectromagnetConverter.cc | 0 .../KStaticElectromagnetFieldWithKGeoBag.cc | 0 .../Core/cl/kEMField_BoundaryIntegrals.cl | 0 .../include/KOpenCLBoundaryIntegralMatrix.hh | 0 .../KOpenCLBoundaryIntegralSolutionVector.hh | 0 .../include/KOpenCLBoundaryIntegralVector.hh | 0 .../Core/include/KOpenCLBoundaryIntegrator.hh | 0 ...kEMField_ElectrostaticBoundaryIntegrals.cl | 0 ...d_ElectrostaticBoundaryIntegrals_kernel.cl | 0 .../cl/kEMField_ElectrostaticConicSection.cl | 0 .../cl/kEMField_ElectrostaticLineSegment.cl | 0 .../cl/kEMField_ElectrostaticRectangle.cl | 0 .../cl/kEMField_ElectrostaticTriangle.cl | 0 .../KOpenCLElectrostaticBoundaryIntegrator.hh | 0 ...CLElectrostaticBoundaryIntegratorConfig.hh | 0 ...LElectrostaticBoundaryIntegratorFactory.hh | 0 .../KOpenCLElectrostaticBoundaryIntegrator.cc | 0 ...LElectrostaticBoundaryIntegratorFactory.cc | 0 ..._ElectrostaticCubatureRectangle_12Point.cl | 0 ..._ElectrostaticCubatureRectangle_33Point.cl | 0 ...d_ElectrostaticCubatureRectangle_7Point.cl | 0 ...d_ElectrostaticCubatureTriangle_12Point.cl | 0 ...d_ElectrostaticCubatureTriangle_33Point.cl | 0 ...ld_ElectrostaticCubatureTriangle_7Point.cl | 0 ...d_ElectrostaticCubature_CommonFunctions.cl | 0 ...d_ElectrostaticNumericBoundaryIntegrals.cl | 0 ...rostaticNumericBoundaryIntegrals_kernel.cl | 0 ...ield_ElectrostaticQuadratureLineSegment.cl | 0 ...LElectrostaticNumericBoundaryIntegrator.hh | 0 ...LElectrostaticNumericBoundaryIntegrator.cc | 0 ...Field_ElectrostaticRWGBoundaryIntegrals.cl | 0 ...lectrostaticRWGBoundaryIntegrals_kernel.cl | 0 .../cl/kEMField_ElectrostaticRWGRectangle.cl | 0 .../cl/kEMField_ElectrostaticRWGTriangle.cl | 0 ...penCLElectrostaticRWGBoundaryIntegrator.hh | 0 ...penCLElectrostaticRWGBoundaryIntegrator.cc | 0 .../{2.0 => }/Plugins/OpenCL/CMakeLists.txt | 9 + .../Core/cl/kEMField_ParallelReduction.cl | 0 .../OpenCL/Core/include/KOpenCLAction.hh | 0 .../OpenCL/Core/include/KOpenCLData.hh | 0 .../Core/include/KOpenCLHeaderWrapper.hh | 0 .../OpenCL/Core/include/KOpenCLInterface.hh | 0 .../Core/include/KOpenCLKernelBuilder.hh | 0 .../OpenCL/Core/src/GenerateOpenCLHeader.cc | 0 .../Plugins/OpenCL/Core/src/KOpenCLAction.cc | 0 .../Plugins/OpenCL/Core/src/KOpenCLData.cc | 0 .../OpenCL/Core/src/KOpenCLInterface.cc | 0 .../OpenCL/Core/src/KOpenCLKernelBuilder.cc | 0 ...atchedLocalToLocalTransformation_kernel.cl | 0 ...tchedRemoteToLocalTransformation_kernel.cl | 0 ...taticBatchedRemoteToRemoteReduce_kernel.cl | 0 ...chedRemoteToRemoteTransformation_kernel.cl | 0 ...ufferedRemoteToLocalCopyAndScale_kernel.cl | 0 ...feredRemoteToLocalReduceAndScale_kernel.cl | 0 ...staticLocalToLocalTransformation_kernel.cl | 0 ...ectrostaticMultipoleDistribution_kernel.cl | 0 ...MField_KFMElectrostaticMultipole_kernel.cl | 0 ...ostaticRemoteToLocalCopyAndScale_kernel.cl | 0 ...taticRemoteToLocalReduceAndScale_kernel.cl | 0 ...staticRemoteToRemoteCopyAndScale_kernel.cl | 0 ...aticRemoteToRemoteReduceAndScale_kernel.cl | 0 ...aticRemoteToRemoteTransformation_kernel.cl | 0 ...icSparseShellMatrixVectorProduct_kernel.cl | 0 ...Field_KFMElementCentroidFieldEvaluation.cl | 0 ...d_KFMElementCentroidPotentialEvaluation.cl | 0 .../cl/kEMField_KFMLineSegmentMultipole.cl | 0 ...MField_KFMLineSegmentMultipoleNumerical.cl | 0 .../cl/kEMField_KFMRaggedElementLookUp.cl | 0 .../cl/kEMField_KFMRectangleMultipole.cl | 0 ...kEMField_KFMRectangleMultipoleNumerical.cl | 0 .../cl/kEMField_KFMTriangleMultipole.cl | 0 .../kEMField_KFMTriangleMultipoleNumerical.cl | 0 ...aticBatchedLocalToLocalConverter_OpenCL.hh | 0 ...ticBatchedRemoteToLocalConverter_OpenCL.hh | 0 ...icBatchedRemoteToRemoteConverter_OpenCL.hh | 0 ...rostaticBoundaryIntegratorEngine_OpenCL.hh | 0 ...rostaticFastMultipoleFieldSolver_OpenCL.hh | 0 .../KFMElectrostaticFieldMapper_OpenCL.hh | 0 ...ectrostaticLocalToLocalConverter_OpenCL.hh | 0 ...rostaticMultipoleBatchCalculator_OpenCL.hh | 0 ...ElectrostaticMultipoleCalculator_OpenCL.hh | 0 ...lectrostaticMultipoleDistributor_OpenCL.hh | 0 ...ctrostaticRemoteToLocalConverter_OpenCL.hh | 0 ...trostaticRemoteToRemoteConverter_OpenCL.hh | 0 ...eBoundaryIntegralShellMatrix_MPI_OpenCL.hh | 0 ...parseBoundaryIntegralShellMatrix_OpenCL.hh | 0 ...rostaticBoundaryIntegratorEngine_OpenCL.hh | 0 ...aticBatchedLocalToLocalConverter_OpenCL.cc | 0 ...ticBatchedRemoteToLocalConverter_OpenCL.cc | 0 ...icBatchedRemoteToRemoteConverter_OpenCL.cc | 0 ...rostaticBoundaryIntegratorEngine_OpenCL.cc | 0 ...rostaticFastMultipoleFieldSolver_OpenCL.cc | 0 .../src/KFMElectrostaticFieldMapper_OpenCL.cc | 0 ...ectrostaticLocalToLocalConverter_OpenCL.cc | 0 ...rostaticMultipoleBatchCalculator_OpenCL.cc | 0 ...ElectrostaticMultipoleCalculator_OpenCL.cc | 0 ...lectrostaticMultipoleDistributor_OpenCL.cc | 0 ...ctrostaticRemoteToLocalConverter_OpenCL.cc | 0 ...trostaticRemoteToRemoteConverter_OpenCL.cc | 0 ...rostaticBoundaryIntegratorEngine_OpenCL.cc | 0 .../Math/cl/kEMField_KFMArrayMath.cl | 0 .../Math/cl/kEMField_KFMComplexMultiply.cl | 0 ...MField_KFMFastFourierTransformUtilities.cl | 0 ...d_KFMFastFourierTransformUtilitiesLocal.cl | 0 ...KFMFastFourierTransformUtilitiesPrivate.cl | 0 ...nsionalFastFourierTransformLocal_kernel.cl | 0 ...ionalFastFourierTransformPrivate_kernel.cl | 0 ...idimensionalFastFourierTransform_kernel.cl | 0 .../Math/cl/kEMField_KFMMultipoleRotation.cl | 0 .../cl/kEMField_KFMMultipoleTranslation.cl | 0 ...eld_KFMPointwiseComplexVectorAdd_kernel.cl | 0 ...FMPointwiseComplexVectorMultiply_kernel.cl | 0 .../Math/cl/kEMField_KFMRotationMatrix.cl | 0 ...FMSphericalMultipoleExpansionEvaluation.cl | 0 ...ultipoleExpansionEvaluation_Precomputed.cl | 0 .../cl/kEMField_KFMSphericalMultipoleMath.cl | 0 .../Math/cl/kEMField_KFMVectorScale_kernel.cl | 0 .../cl/kEMField_KFMZeroComplexArray_kernel.cl | 0 ...idimensionalFastFourierTransform_OpenCL.hh | 0 ...alarMomentRemoteToLocalConverter_kernel.cl | 0 ...alarMomentRemoteToLocalConverter_kernel.cl | 0 ..._KFMScalarMomentApplyScaleFactor_kernel.cl | 0 ...ld_KFMScalarMomentArrayReduction_kernel.cl | 0 ...calarMomentLocalToLocalConverter_kernel.cl | 0 ...alarMomentRemoteToLocalConverter_kernel.cl | 0 ...larMomentRemoteToRemoteConverter_kernel.cl | 0 ...EMField_KFMSparseScalarMomentAdd_kernel.cl | 0 ...alarMomentRemoteToLocalConverter_OpenCL.hh | 0 ...calarMomentLocalToLocalConverter_OpenCL.hh | 0 ...alarMomentRemoteToLocalConverter_OpenCL.hh | 0 ...larMomentRemoteToRemoteConverter_OpenCL.hh | 0 ...alarMomentRemoteToLocalConverter_OpenCL.hh | 0 ...ctrostaticIntegratingFieldSolver_kernel.cl | 0 ...enCLElectrostaticIntegratingFieldSolver.hh | 0 .../IO/include/KOpenCLBufferStreamer.hh | 0 ...seBlockSparseMatrixVectorProduct_kernel.cl | 0 .../cl/kEMField_GaussSeidel_kernel.cl | 0 .../cl/kEMField_LinearAlgebra.cl | 0 .../cl/kEMField_LinearAlgebra_kernel.cl | 0 .../cl/kEMField_RobinHood_kernel.cl | 64 +- .../KFMDenseBlockSparseMatrix_OpenCL.hh | 0 .../include/KGaussSeidel_OpenCL.hh | 0 .../include/KRobinHood_MPI_OpenCL.hh | 13 +- .../include/KRobinHood_OpenCL.hh | 15 +- .../Math/cl/kEMField_GaussianCubature.cl | 0 .../Math/cl/kEMField_GaussianQuadrature.cl | 0 .../Math/cl/kEMField_VectorOperations.cl | 0 .../Surfaces/cl/kEMField_ConicSection.cl | 0 .../Surfaces/cl/kEMField_LineSegment.cl | 0 .../OpenCL/Surfaces/cl/kEMField_Rectangle.cl | 0 .../OpenCL/Surfaces/cl/kEMField_SolidAngle.cl | 0 .../OpenCL/Surfaces/cl/kEMField_Triangle.cl | 0 .../include/KOpenCLSurfaceContainer.hh | 0 .../Surfaces/src/KOpenCLSurfaceContainer.cc | 0 .../{2.0 => }/Plugins/PETSc/CMakeLists.txt | 0 .../Plugins/PETSc/include/KPETScInterface.hh | 0 .../Plugins/PETSc/include/KPETScSolver.hh | 0 .../Plugins/PETSc/src/KPETScInterface.cc | 0 .../{2.0 => }/Plugins/Root/CMakeLists.txt | 0 .../include/KEMElectricFieldPointsRootFile.hh | 0 .../Root/include/KEMRootFieldCanvas.hh | 0 .../Plugins/Root/include/KEMRootSVDSolver.hh | 0 .../src/KEMElectricFieldPointsRootFile.cc | 0 .../Plugins/Root/src/KEMRootFieldCanvas.cc | 0 .../Plugins/Root/src/KEMRootSVDSolver.cc | 0 .../{2.0 => }/Plugins/VTK/CMakeLists.txt | 5 +- .../VTK/include/KEMVTKElectromagnetViewer.hh | 0 .../Plugins/VTK/include/KEMVTKFieldCanvas.hh | 0 .../Plugins/VTK/include/KEMVTKViewer.hh | 0 .../include/KFMVTKElectrostaticTreeViewer.hh | 3 + .../VTK/include/KVTKIterationPlotter.hh | 0 .../Plugins/VTK/include/KVTKResidualGraph.hh | 0 .../VTK/src/KEMVTKElectromagnetViewer.cc | 0 .../Plugins/VTK/src/KEMVTKFieldCanvas.cc | 0 .../{2.0 => }/Plugins/VTK/src/KEMVTKViewer.cc | 7 +- .../VTK/src/KFMVTKElectrostaticTreeViewer.cc | 90 +- .../{2.0 => }/Plugins/VTKPart2/CMakeLists.txt | 8 +- .../include/KElectrostaticPotentialmap.hh} | 2 +- .../include/KMagnetostaticFieldmap.hh} | 2 +- .../KVTKViewerAsBoundaryFieldVisitor.hh | 0 .../src/KElectrostaticPotentialmap.cc} | 10 +- .../VTKPart2/src/KMagnetostaticFieldmap.cc} | 8 +- .../src/KVTKViewerAsBoundaryFieldVisitor.cc | 0 .../Source/{2.0 => }/Surfaces/CMakeLists.txt | 0 .../{2.0 => }/Surfaces/include/KBasis.hh | 0 .../{2.0 => }/Surfaces/include/KBoundary.hh | 0 .../Surfaces/include/KConicSection.hh | 0 .../Surfaces/include/KElectromagneticBasis.hh | 0 .../Surfaces/include/KElectrostaticBasis.hh | 0 .../Surfaces/include/KLineSegment.hh | 0 .../Surfaces/include/KMagnetostaticBasis.hh | 0 .../include/KOrderedSurfaceContainer.hh | 0 .../{2.0 => }/Surfaces/include/KRectangle.hh | 0 .../{2.0 => }/Surfaces/include/KRing.hh | 0 .../{2.0 => }/Surfaces/include/KShape.hh | 0 .../{2.0 => }/Surfaces/include/KSolidAngle.hh | 0 .../include/KSortedSurfaceContainer.hh | 0 .../{2.0 => }/Surfaces/include/KSurface.hh | 0 .../Surfaces/include/KSurfaceAction.hh | 0 .../Surfaces/include/KSurfaceContainer.hh | 0 .../{2.0 => }/Surfaces/include/KSurfaceID.hh | 0 .../include/KSurfaceOrderingPredicate.hh | 0 .../Surfaces/include/KSurfacePrimitive.hh | 0 .../Surfaces/include/KSurfaceTypes.hh | 0 .../Surfaces/include/KSurfaceVisitors.hh | 0 .../Surfaces/include/KSymmetryGroup.hh | 0 .../{2.0 => }/Surfaces/include/KTriangle.hh | 0 .../{2.0 => }/Surfaces/src/KConicSection.cc | 0 .../{2.0 => }/Surfaces/src/KLineSegment.cc | 0 .../Surfaces/src/KOrderedSurfaceContainer.cc | 0 .../{2.0 => }/Surfaces/src/KRectangle.cc | 0 .../Source/{2.0 => }/Surfaces/src/KRing.cc | 0 .../{2.0 => }/Surfaces/src/KSolidAngle.cc | 0 .../Surfaces/src/KSortedSurfaceContainer.cc | 0 .../Source/{2.0 => }/Surfaces/src/KSurface.cc | 0 .../Surfaces/src/KSurfaceContainer.cc | 0 .../{2.0 => }/Surfaces/src/KTriangle.cc | 0 .../Source/{2.0 => }/Tests/CMakeLists.txt | 35 +- .../{2.0 => }/Tests/TestAnisotropicPoisson.cc | 0 .../{2.0 => }/Tests/TestBinaryTruncation.cc | 0 .../Tests/TestCubatureSpeedStandAlone.cc | 4 +- .../{2.0 => }/Tests/TestCubeCapacitance.cc | 4 +- KEMField/Source/Tests/TestDielectrics.cc | 1353 +++++ .../{2.0 => }/Tests/TestDiskCapacitance.cc | 0 .../{2.0 => }/Tests/TestEMFileInterface.cc | 0 .../Tests/TestElectromagnetViewer.cc | 0 .../{2.0 => }/Tests/TestElectromagnets.cc | 0 .../Source/{2.0 => }/Tests/TestGeometry.cc | 0 .../TestIntegratorDistRatioLineSegmentROOT.cc | 0 .../TestIntegratorDistRatioRectangleROOT.cc | 0 .../TestIntegratorDistRatioTriangleROOT.cc | 0 .../Tests/TestIntegratorFunctionality.cc | 0 .../TestIntegratorFunctionalityOpenCL.cc | 0 .../TestIntegratorLineSegmentROOTOpenCL.cc | 0 .../{2.0 => }/Tests/TestIntegratorRWG.cc | 0 .../Tests/TestIntegratorRWGAccuracy.cc | 0 .../TestIntegratorRectangleROOTOpenCL.cc | 0 .../{2.0 => }/Tests/TestIntegratorSpeed.cc | 0 .../Tests/TestIntegratorSpeedWithKbdInput.cc | 0 .../Tests/TestIntegratorTriangleROOTOpenCL.cc | 0 .../{2.0 => }/Tests/TestInverseDistance.cc | 0 .../{2.0 => }/Tests/TestKMessageInterface.cc | 0 KEMField/Source/{2.0 => }/Tests/TestKSP1.cc | 0 KEMField/Source/{2.0 => }/Tests/TestKSP2.cc | 0 KEMField/Source/{2.0 => }/Tests/TestOpenCL.cc | 0 .../{2.0 => }/Tests/TestOpenCLPlugin.cc | 0 KEMField/Source/{2.0 => }/Tests/TestPETSc.cc | 0 KEMField/Source/{2.0 => }/Tests/TestPETSc1.cc | 0 KEMField/Source/{2.0 => }/Tests/TestPETSc2.cc | 0 .../Source/{2.0 => }/Tests/TestSVDSolver.cc | 0 .../{2.0 => }/Tests/TestSphereCapacitance.cc | 0 .../{2.0 => }/Tests/TestSuperposition.cc | 4 +- .../{2.0 => }/Tests/TestSymmetryGroups.cc | 0 .../Source/{2.0 => }/Tests/TestTriangles.cc | 0 .../Source/{2.0 => }/Tests/TestTypelists.cc | 0 .../Source/{2.0 => }/Tests/TestVectorTypes.cc | 0 .../Source/{2.0 => }/Tests/TestVisitor.cc | 0 .../{2.0 => }/Tests/TestZonalHarmonics.cc | 0 ...KElectrostaticBoundaryIntegratorOptions.hh | 0 .../TestCubatureTriangleIntegrator.hh | 0 .../include}/TestRWGTriangleIntegrator.hh | 0 .../{2.0 => }/Visualization/CMakeLists.txt | 0 .../Visualization/include/KEMFieldCanvas.hh | 0 .../Visualization/src/KEMFieldCanvas.cc | 0 KEMField/Source/{2.0 => }/XML/CMakeLists.txt | 0 .../ElectricFieldExplicitSuperposition.xml | 0 .../{2.0 => }/XML/Complete/ElectricFields.xml | 0 .../{2.0 => }/XML/Complete/MagneticFields.xml | 0 KGeoBag/CMakeLists.txt | 27 +- KGeoBag/Source/Bindings/CMakeLists.txt | 2 + .../Appearance/Include/KGAppearanceBuilder.hh | 4 +- .../AxialMesh/Include/KGAxialMeshBuilder.hh | 4 +- .../Include/KGMeshDeformerBuilder.hh | 4 +- .../KGDiscreteRotationalMeshBuilder.hh | 4 +- .../Extensions/Mesh/Include/KGMeshBuilder.hh | 4 +- .../Include/KGComplexAnnulusBuilder.hh | 111 + .../Include/KGROOTGeometryPainterBuilder.hh | 16 +- .../Include/KGVTKAxialMeshPainterBuilder.hh | 4 +- .../Vtk/Include/KGVTKDistanceTesterBuilder.hh | 4 +- .../Include/KGVTKGeometryPainterBuilder.hh | 4 +- .../Vtk/Include/KGVTKMeshPainterBuilder.hh | 4 +- .../Vtk/Include/KGVTKNormalTesterBuilder.hh | 4 +- .../Vtk/Include/KGVTKOutsideTesterBuilder.hh | 4 +- .../Vtk/Include/KGVTKPointTesterBuilder.hh | 4 +- .../Include/KGVTKRandomPointTesterBuilder.hh | 4 +- KGeoBag/Source/Core/Include/KGInterface.hh | 2 +- KGeoBag/Source/Core/Source/KGInterface.cc | 50 +- KGeoBag/Source/Math/Include/KThreeVector.hh | 8 +- KGeoBag/Source/Shapes/CMakeLists.txt | 4 + .../Complex/Include/KGComplexAnnulus.hh | 138 + .../Include/KGComplexAnnulusSurface.hh | 15 + .../Shapes/Complex/Source/KGComplexAnnulus.cc | 345 ++ .../Complex/Source/KGComplexAnnulusBuilder.cc | 28 + .../Root/Include/KGROOTGeometryPainter.hh | 105 +- .../Root/Source/KGROOTGeometryPainter.cc | 4340 +++++++++++------ .../Vtk/Source/KGVTKGeometryPainter.cc | 229 +- .../Applications/Examples/CMakeLists.txt | 2 + .../Source/CrossSectionBrCalculator.cxx | 192 + .../Source/CrossSectionBthetaCalculator.cxx | 192 + .../CrossSectionMagneticFieldCalculator.cxx | 193 + .../Examples/Source/MultiFileAnalysis.cxx | 236 + Kassiopeia/Bindings/CMakeLists.txt | 8 +- .../Source/KSFieldKEMFieldObjectsBuilder.cxx | 6 +- .../KSGenDirectionSurfaceCompositeBuilder.h | 2 +- .../Include/KSGenPositionMaskBuilder.h | 4 +- .../KSGenPositionMeshSurfaceRandomBuilder.h | 2 +- .../Include/KSGenPositionSpaceRandomBuilder.h | 30 +- .../KSGenPositionSurfaceRandomBuilder.h | 2 +- .../Generators/Include/KSGenValueSetBuilder.h | 5 + .../Source/KSGenGeneratorCompositeBuilder.cxx | 2 +- .../Source/KSGenPositionMaskBuilder.cxx | 2 +- .../Source/KSGenValueSetBuilder.cxx | 1 + .../Geometry/Include/KSGeoSideBuilder.h | 4 +- .../Geometry/Include/KSGeoSurfaceBuilder.h | 4 +- .../Include/KSIntSurfaceSpinFlipBuilder.h | 31 + .../Include/KSIntSurfaceUCNBuilder.h | 35 + .../Source/KSIntSurfaceSpinFlipBuilder.cxx | 19 + .../Source/KSIntSurfaceUCNBuilder.cxx | 22 + .../Include/KSModSplitOnTurnBuilder.h | 45 + .../Source/KSModSplitOnTurnBuilder.cxx | 20 + .../Objects/Include/KSCommandMemberBuilder.h | 35 +- .../Include/KSCommandMemberSimpleBuilder.h | 43 +- .../Include/KSComponentMemberBuilder.h | 26 +- .../Include/KSTermMinDistanceBuilder.h | 32 +- Kassiopeia/CMakeLists.txt | 46 +- Kassiopeia/Fields/Source/KSFieldFinder.cxx | 41 +- .../Include/KSGenGeneratorSimulation.h | 6 + Kassiopeia/Generators/Include/KSGenValueSet.h | 1 + .../Source/KSGenGeneratorSimulation.cxx | 18 +- .../Generators/Source/KSGenValueSet.cxx | 19 +- Kassiopeia/Interactions/CMakeLists.txt | 6 + .../Include/KSIntSurfaceSpinFlip.h | 33 + .../Interactions/Include/KSIntSurfaceUCN.h | 35 + .../Source/KSIntSurfaceSpinFlip.cxx | 49 + .../Interactions/Source/KSIntSurfaceUCN.cxx | 112 + Kassiopeia/Modifiers/CMakeLists.txt | 2 + .../Modifiers/Include/KSModSplitOnTurn.h | 47 + .../Modifiers/Source/KSModSplitOnTurn.cxx | 75 + Kassiopeia/Navigators/Source/KSNavSurface.cxx | 9 +- .../Objects/Include/KSComponentTemplate.h | 6 + Kassiopeia/Operators/Include/KSParticle.h | 5 +- Kassiopeia/Operators/Source/KSParticle.cxx | 363 +- .../Operators/Source/KSParticleFactory.cxx | 12 +- Kassiopeia/Python/CMakeLists.txt | 7 + Kassiopeia/Python/KassiopeiaReader.py | 353 ++ Kassiopeia/Simulation/Include/KSMainMessage.h | 2 +- Kassiopeia/Simulation/Include/KSRoot.h | 6 +- Kassiopeia/Simulation/Include/KSStep.h | 8 + Kassiopeia/Simulation/Source/KSRoot.cxx | 245 +- .../Simulation/Source/KSRootStepModifier.cxx | 38 +- .../Source/KSRootSurfaceNavigator.cxx | 8 +- .../Simulation/Source/KSRootTerminator.cxx | 1 + .../Simulation/Source/KSRootTrajectory.cxx | 13 + Kassiopeia/Simulation/Source/KSSimulation.cxx | 17 + Kassiopeia/Simulation/Source/KSStep.cxx | 8 + .../Terminators/Include/KSTermTrapped.h | 4 +- .../Terminators/Source/KSTermTrapped.cxx | 3 + .../Source/KSTrajTermPropagation.cxx | 66 +- .../Include/KSROOTTrackPainter.h | 19 +- .../Source/KSROOTTrackPainter.cxx | 955 ++-- Kassiopeia/Writers/Source/KSWriteASCII.cxx | 1387 +++--- Kassiopeia/Writers/Source/KSWriteHDF5.cxx | 527 ++ Kassiopeia/Writers/Source/KSWriteROOT.cxx | 38 +- Kassiopeia/Writers/Source/KSWriteVTK.cxx | 15 +- Kommon/Boost/CMakeLists.txt | 9 +- Kommon/Boost/Utility/KPathUtils.h | 168 + Kommon/CMakeLists.txt | 28 +- .../Initialization/KConditionProcessor.cc | 128 +- .../Initialization/KConditionProcessor.hh | 11 +- .../Core/Initialization/KIncludeProcessor.cc | 29 +- .../Core/Initialization/KIncludeProcessor.hh | 2 + Kommon/Core/Initialization/KPrintProcessor.cc | 34 +- Kommon/Core/Initialization/KPrintProcessor.hh | 1 + Kommon/Core/Initialization/KToken.hh | 84 +- .../Core/Initialization/KVariableProcessor.cc | 316 +- .../Core/Initialization/KVariableProcessor.hh | 16 +- Kommon/Core/Initialization/KXMLTokenizer.cc | 34 +- Kommon/Core/Utility/KConst.h | 22 +- Kommon/Core/Utility/KMessage.cxx | 28 +- Kommon/Core/Utility/KMessage.h | 8 +- Kommon/Core/Utility/KMessageBuilder.h | 30 +- Kommon/Root/Utility/KROOTWindow.cxx | 251 +- Kommon/cmake/KasperDefaults.cmake | 16 + Kommon/kasperenv.sh | 6 +- README.md | 2 +- 1178 files changed, 11504 insertions(+), 3854 deletions(-) delete mode 100644 KEMField/Source/2.0/Plugins/Bindings/Fields/Electric/include/KElectrostaticBoundaryFieldBuilder.hh delete mode 100644 KEMField/Source/2.0/Plugins/Bindings/Fields/Magnetic/src/KMagnetostaticFieldmapBuilder.cc rename KEMField/Source/{2.0 => }/Applications/ApplicationFiles/.gitignore (100%) rename KEMField/Source/{2.0 => }/Applications/AspectRatioFromKbdROOT.cc (100%) rename KEMField/Source/{2.0 => }/Applications/CMakeLists.txt (83%) rename KEMField/Source/{2.0 => }/Applications/CompareFieldsAndPotentialsROOT.cc (100%) rename KEMField/Source/{2.0 => }/Applications/ComputeChargeDensities.cc (100%) rename KEMField/Source/{2.0 => }/Applications/ComputeChargeDensitiesFromElcd33File.cc (100%) rename KEMField/Source/{2.0 => }/Applications/ComputeSphericalCapacitor.cc (100%) rename KEMField/Source/{2.0 => }/Applications/DistanceRatioFromKbdROOT.cc (100%) rename KEMField/Source/{2.0 => }/Applications/HashEMGeometry.cc (100%) rename KEMField/Source/{2.0 => }/Applications/InspectEMFile.cc (100%) rename KEMField/Source/{2.0 => }/Applications/KdbConverter.cc (100%) rename KEMField/Source/{2.0 => }/Applications/TransferEMElement.cc (100%) rename KEMField/Source/{2.0 => }/Applications/VisualizeEMGeometry.cc (90%) create mode 100644 KEMField/Source/Applications/WriteAsciiToPCD.cc rename KEMField/Source/{2.0 => }/Applications/WriteKbdToAscii.cc (98%) create mode 100644 KEMField/Source/Applications/greedy_projection.cpp rename KEMField/Source/{2.0 => }/BoundaryIntegrals/Core/CMakeLists.txt (100%) rename KEMField/Source/{2.0 => }/BoundaryIntegrals/Core/include/KBoundaryIntegralMatrix.hh (100%) rename KEMField/Source/{2.0 => }/BoundaryIntegrals/Core/include/KBoundaryIntegralSolutionVector.hh (100%) rename KEMField/Source/{2.0 => }/BoundaryIntegrals/Core/include/KBoundaryIntegralVector.hh (100%) rename KEMField/Source/{2.0 => }/BoundaryIntegrals/Core/include/KBoundaryMatrixGenerator.hh (100%) rename KEMField/Source/{2.0 => }/BoundaryIntegrals/Electrostatic/Analytic/include/KElectrostaticAnalyticConicSectionIntegrator.hh (100%) rename KEMField/Source/{2.0 => }/BoundaryIntegrals/Electrostatic/Analytic/include/KElectrostaticAnalyticLineSegmentIntegrator.hh (100%) rename KEMField/Source/{2.0 => }/BoundaryIntegrals/Electrostatic/Analytic/include/KElectrostaticAnalyticRectangleIntegrator.hh (100%) rename KEMField/Source/{2.0 => }/BoundaryIntegrals/Electrostatic/Analytic/include/KElectrostaticAnalyticRingIntegrator.hh (100%) rename KEMField/Source/{2.0 => }/BoundaryIntegrals/Electrostatic/Analytic/include/KElectrostaticAnalyticTriangleIntegrator.hh (100%) rename KEMField/Source/{2.0 => }/BoundaryIntegrals/Electrostatic/Analytic/src/KElectrostaticAnalyticConicSectionIntegrator.cc (100%) rename KEMField/Source/{2.0 => }/BoundaryIntegrals/Electrostatic/Analytic/src/KElectrostaticAnalyticLineSegmentIntegrator.cc (100%) rename KEMField/Source/{2.0 => }/BoundaryIntegrals/Electrostatic/Analytic/src/KElectrostaticAnalyticRectangleIntegrator.cc (100%) rename KEMField/Source/{2.0 => }/BoundaryIntegrals/Electrostatic/Analytic/src/KElectrostaticAnalyticRingIntegrator.cc (100%) rename KEMField/Source/{2.0 => }/BoundaryIntegrals/Electrostatic/Analytic/src/KElectrostaticAnalyticTriangleIntegrator.cc (100%) rename KEMField/Source/{2.0 => }/BoundaryIntegrals/Electrostatic/CMakeLists.txt (100%) rename KEMField/Source/{2.0 => }/BoundaryIntegrals/Electrostatic/Core/include/KElectrostaticBoundaryIntegrator.hh (100%) rename KEMField/Source/{2.0 => }/BoundaryIntegrals/Electrostatic/Core/include/KElectrostaticBoundaryIntegratorFactory.hh (100%) rename KEMField/Source/{2.0 => }/BoundaryIntegrals/Electrostatic/Core/include/KElectrostaticElementIntegrator.hh (100%) rename KEMField/Source/{2.0 => }/BoundaryIntegrals/Electrostatic/Core/src/KElectrostaticBoundaryIntegrator.cc (100%) rename KEMField/Source/{2.0 => }/BoundaryIntegrals/Electrostatic/Core/src/KElectrostaticBoundaryIntegratorFactory.cc (100%) rename KEMField/Source/{2.0 => }/BoundaryIntegrals/Electrostatic/Numeric/include/KElectrostaticCubatureRectangleIntegrator.hh (100%) rename KEMField/Source/{2.0 => }/BoundaryIntegrals/Electrostatic/Numeric/include/KElectrostaticCubatureTriangleIntegrator.hh (100%) rename KEMField/Source/{2.0 => }/BoundaryIntegrals/Electrostatic/Numeric/include/KElectrostaticQuadratureLineSegmentIntegrator.hh (100%) rename KEMField/Source/{2.0 => }/BoundaryIntegrals/Electrostatic/Numeric/src/KElectrostaticCubatureRectangleIntegrator.cc (100%) rename KEMField/Source/{2.0 => }/BoundaryIntegrals/Electrostatic/Numeric/src/KElectrostaticCubatureTriangleIntegrator.cc (100%) rename KEMField/Source/{2.0 => }/BoundaryIntegrals/Electrostatic/Numeric/src/KElectrostaticQuadratureLineSegmentIntegrator.cc (100%) rename KEMField/Source/{2.0 => }/BoundaryIntegrals/Electrostatic/RWG/include/KElectrostaticRWGRectangleIntegrator.hh (100%) rename KEMField/Source/{2.0 => }/BoundaryIntegrals/Electrostatic/RWG/include/KElectrostaticRWGTriangleIntegrator.hh (100%) rename KEMField/Source/{2.0 => }/BoundaryIntegrals/Electrostatic/RWG/include/KRWGFunctions.hh (100%) rename KEMField/Source/{2.0 => }/BoundaryIntegrals/Electrostatic/RWG/include/KTFaceRFBasis.hh (100%) rename KEMField/Source/{2.0 => }/BoundaryIntegrals/Electrostatic/RWG/src/KElectrostaticRWGRectangleIntegrator.cc (100%) rename KEMField/Source/{2.0 => }/BoundaryIntegrals/Electrostatic/RWG/src/KElectrostaticRWGTriangleIntegrator.cc (100%) rename KEMField/Source/{2.0 => }/BoundaryIntegrals/Electrostatic/RWG/src/KTFaceRFBasis.cc (100%) rename KEMField/Source/{2.0 => }/BoundaryIntegrals/Electrostatic/RWG/src/KTRWGFunctions.cc (100%) rename KEMField/Source/{2.0 => }/BoundaryIntegrals/Electrostatic/Reference/include/KElectrostatic256NodeQuadratureLineSegmentIntegrator.hh (100%) rename KEMField/Source/{2.0 => }/BoundaryIntegrals/Electrostatic/Reference/include/KElectrostaticBiQuadratureRectangleIntegrator.hh (100%) rename KEMField/Source/{2.0 => }/BoundaryIntegrals/Electrostatic/Reference/include/KElectrostaticBiQuadratureTriangleIntegrator.hh (100%) rename KEMField/Source/{2.0 => }/BoundaryIntegrals/Electrostatic/Reference/src/KElectrostatic256NodeQuadratureLineSegmentIntegrator.cc (100%) rename KEMField/Source/{2.0 => }/BoundaryIntegrals/Electrostatic/Reference/src/KElectrostaticBiQuadratureRectangleIntegrator.cc (100%) rename KEMField/Source/{2.0 => }/BoundaryIntegrals/Electrostatic/Reference/src/KElectrostaticBiQuadratureTriangleIntegrator.cc (100%) rename KEMField/Source/{2.0 => }/BoundaryIntegrals/Magnetostatic/CMakeLists.txt (100%) rename KEMField/Source/{2.0 => }/BoundaryIntegrals/Magnetostatic/include/KMagnetostaticBoundaryIntegrator.hh (100%) rename KEMField/Source/{2.0 => }/BoundaryIntegrals/Magnetostatic/include/KMagnetostaticLineSegmentIntegrator.hh (100%) rename KEMField/Source/{2.0 => }/BoundaryIntegrals/Magnetostatic/include/KMagnetostaticRingIntegrator.hh (100%) rename KEMField/Source/{2.0 => }/BoundaryIntegrals/Magnetostatic/src/KMagnetostaticBoundaryIntegrator.cc (100%) rename KEMField/Source/{2.0 => }/BoundaryIntegrals/Magnetostatic/src/KMagnetostaticLineSegmentIntegrator.cc (100%) rename KEMField/Source/{2.0 => }/BoundaryIntegrals/Magnetostatic/src/KMagnetostaticRingIntegrator.cc (100%) rename KEMField/Source/{2.0 => }/Core/CMakeLists.txt (100%) rename KEMField/Source/{2.0 => }/Core/include/KComplexStreamer.hh (100%) rename KEMField/Source/{2.0 => }/Core/include/KDataComparator.hh (100%) rename KEMField/Source/{2.0 => }/Core/include/KDataDisplay.hh (100%) rename KEMField/Source/{2.0 => }/Core/include/KEMConstants.hh (100%) rename KEMField/Source/{2.0 => }/Core/include/KEMCout.hh (100%) rename KEMField/Source/{2.0 => }/Core/include/KEMStringUtils.hh (100%) rename KEMField/Source/{2.0 => }/Core/include/KEMTicker.hh (100%) rename KEMField/Source/{2.0 => }/Core/include/KFundamentalTypeCounter.hh (100%) rename KEMField/Source/{2.0 => }/Core/include/KFundamentalTypes.hh (100%) rename KEMField/Source/{2.0 => }/Core/include/KMPIEnvironment.hh (100%) rename KEMField/Source/{2.0 => }/Core/include/KMPIInterface.hh (100%) rename KEMField/Source/{2.0 => }/Core/include/KMessageInterface.hh (100%) rename KEMField/Source/{2.0 => }/Core/include/KSmartPointer.hh (100%) rename KEMField/Source/{2.0 => }/Core/include/KTimer.hh (100%) rename KEMField/Source/{2.0 => }/Core/include/KTypeManipulation.hh (100%) rename KEMField/Source/{2.0 => }/Core/include/KTypelist.hh (100%) rename KEMField/Source/{2.0 => }/Core/include/KTypelistVisitor.hh (100%) rename KEMField/Source/{2.0 => }/Core/src/KEMConstants.cc (100%) rename KEMField/Source/{2.0 => }/Core/src/KEMCout.cc (100%) rename KEMField/Source/{2.0 => }/Core/src/KEMStringUtils.cc (100%) rename KEMField/Source/{2.0 => }/Core/src/KEMTicker.cc (100%) rename KEMField/Source/{2.0 => }/Core/src/KFundamentalTypes.cc (100%) rename KEMField/Source/{2.0 => }/Core/src/KMPIInterface.cc (100%) rename KEMField/Source/{2.0 => }/Core/src/KMessageInterface.cc (100%) rename KEMField/Source/{2.0 => }/Core/src/KTimer.cc (100%) rename KEMField/Source/{2.0 => }/Core/test/KSmartPointer_test.cc (100%) rename KEMField/Source/{2.0 => }/Exceptions/CMakeLists.txt (100%) rename KEMField/Source/{2.0 => }/Exceptions/include/KEMSimpleException.hh (100%) rename KEMField/Source/{2.0 => }/Exceptions/include/KKeyNotFoundException.hh (100%) rename KEMField/Source/{2.0 => }/Exceptions/src/KEMSimpleException.cc (100%) rename KEMField/Source/{2.0 => }/Exceptions/src/KKeyNotFoundException.cc (100%) rename KEMField/Source/{2.0 => }/ExternalFields/Electromagnets/CMakeLists.txt (100%) rename KEMField/Source/{2.0 => }/ExternalFields/Electromagnets/include/KCoil.hh (100%) rename KEMField/Source/{2.0 => }/ExternalFields/Electromagnets/include/KCoilIntegrator.hh (100%) rename KEMField/Source/{2.0 => }/ExternalFields/Electromagnets/include/KCurrentLoop.hh (100%) rename KEMField/Source/{2.0 => }/ExternalFields/Electromagnets/include/KCurrentLoopIntegrator.hh (100%) rename KEMField/Source/{2.0 => }/ExternalFields/Electromagnets/include/KElectromagnet.hh (100%) rename KEMField/Source/{2.0 => }/ExternalFields/Electromagnets/include/KElectromagnetContainer.hh (100%) rename KEMField/Source/{2.0 => }/ExternalFields/Electromagnets/include/KElectromagnetIntegratingFieldSolver.hh (100%) rename KEMField/Source/{2.0 => }/ExternalFields/Electromagnets/include/KElectromagnetIntegrator.hh (100%) rename KEMField/Source/{2.0 => }/ExternalFields/Electromagnets/include/KElectromagnetTypes.hh (100%) rename KEMField/Source/{2.0 => }/ExternalFields/Electromagnets/include/KElectromagnetVisitor.hh (100%) rename KEMField/Source/{2.0 => }/ExternalFields/Electromagnets/include/KLineCurrent.hh (100%) rename KEMField/Source/{2.0 => }/ExternalFields/Electromagnets/include/KLineCurrentIntegrator.hh (100%) rename KEMField/Source/{2.0 => }/ExternalFields/Electromagnets/include/KSolenoid.hh (100%) rename KEMField/Source/{2.0 => }/ExternalFields/Electromagnets/include/KSolenoidIntegrator.hh (100%) rename KEMField/Source/{2.0 => }/ExternalFields/Electromagnets/src/KCoil.cc (100%) rename KEMField/Source/{2.0 => }/ExternalFields/Electromagnets/src/KCoilIntegrator.cc (100%) rename KEMField/Source/{2.0 => }/ExternalFields/Electromagnets/src/KCurrentLoop.cc (100%) rename KEMField/Source/{2.0 => }/ExternalFields/Electromagnets/src/KCurrentLoopIntegrator.cc (100%) rename KEMField/Source/{2.0 => }/ExternalFields/Electromagnets/src/KElectromagnetIntegratingFieldSolver.cc (100%) rename KEMField/Source/{2.0 => }/ExternalFields/Electromagnets/src/KLineCurrent.cc (100%) rename KEMField/Source/{2.0 => }/ExternalFields/Electromagnets/src/KLineCurrentIntegrator.cc (100%) rename KEMField/Source/{2.0 => }/ExternalFields/Electromagnets/src/KSolenoid.cc (100%) rename KEMField/Source/{2.0 => }/ExternalFields/Electromagnets/src/KSolenoidIntegrator.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Applications/AccuracyComparisonFastMultipole.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Applications/CMakeLists.txt (95%) rename KEMField/Source/{2.0 => }/FastMultipole/Applications/CompareChargeDensities.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Applications/ComputeResidualNormFastMultipole.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Applications/ConvertFieldMapToROOT.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Applications/ConvertFieldMapToVTK.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Applications/FastMultipoleApplicationFiles/AccuracyComparisonFastMultipole_ConfigurationExample.xml (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Applications/FastMultipoleApplicationFiles/ComputeSphericalCapacitorFastMultipole_ConfigurationExample.xml (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Applications/FastMultipoleApplicationFiles/TestFastMultipoleFieldSolverConfigurationExample.xml (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Applications/PlotSparseMatrixStructure.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Applications/TestFastMultipoleDualTree.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Applications/TestFastMultipoleGeometryAnalysis.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Applications/VisualizeElectrostaticMultipoleTree.cc (74%) rename KEMField/Source/{2.0 => }/FastMultipole/Core/CMakeLists.txt (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Core/include/KFMBasisData.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Core/include/KFMCollocationPointIdentitySet.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Core/include/KFMCompoundActor.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Core/include/KFMCompoundInspectingActor.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Core/include/KFMConditionalActor.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Core/include/KFMCorecursiveActor.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Core/include/KFMElementLocalInfluenceRange.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Core/include/KFMEmptyIdentitySetRemover.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Core/include/KFMExternalIdentitySet.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Core/include/KFMExternalIdentitySetSorter.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Core/include/KFMIdentityPair.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Core/include/KFMIdentitySet.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Core/include/KFMIdentitySetList.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Core/include/KFMIdentitySetSorter.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Core/include/KFMInspectingActor.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Core/include/KFMLeafConditionActor.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Core/include/KFMLevelConditionActor.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Core/include/KFMNode.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Core/include/KFMNodeActor.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Core/include/KFMNodeChildToParentFlagValueInitializer.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Core/include/KFMNodeData.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Core/include/KFMNodeFinder.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Core/include/KFMNodeFlagInitializer.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Core/include/KFMNodeFlagValueInitializer.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Core/include/KFMNodeFlagValueInspector.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Core/include/KFMNodeFlags.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Core/include/KFMNodeIdentityListCreator.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Core/include/KFMNodeIdentityListRange.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Core/include/KFMNodeIdentityListRangeAssociator.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Core/include/KFMNodeObjectNullifier.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Core/include/KFMNodeObjectRemover.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Core/include/KFMNodeParentToChildFlagValueInspector.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Core/include/KFMNonEmptyIdentitySetActor.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Core/include/KFMObjectCollection.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Core/include/KFMObjectCollector.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Core/include/KFMObjectContainer.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Core/include/KFMObjectHolder.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Core/include/KFMObjectRetriever.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Core/include/KFMRecursiveActor.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Core/include/KFMTree.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Core/include/KFMTreeStructureExtractor.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Core/src/KFMElementLocalInfluenceRange.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Core/src/KFMIdentitySet.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Core/src/KFMIdentitySetList.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Electrostatics/CMakeLists.txt (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Electrostatics/include/KFMElectrostaticBoundaryIntegratorEngine_SingleThread.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Electrostatics/include/KFMElectrostaticElement.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Electrostatics/include/KFMElectrostaticElementContainer.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Electrostatics/include/KFMElectrostaticElementContainerBase.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Electrostatics/include/KFMElectrostaticFieldMapper_SingleThread.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Electrostatics/include/KFMElectrostaticLocalCoefficientCalculatorNumeric.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Electrostatics/include/KFMElectrostaticLocalCoefficientFieldCalculator.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Electrostatics/include/KFMElectrostaticLocalCoefficientSet.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Electrostatics/include/KFMElectrostaticMultipoleBatchCalculator.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Electrostatics/include/KFMElectrostaticMultipoleBatchCalculatorBase.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Electrostatics/include/KFMElectrostaticMultipoleCalculator.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Electrostatics/include/KFMElectrostaticMultipoleCalculatorAnalytic.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Electrostatics/include/KFMElectrostaticMultipoleCalculatorNumeric.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Electrostatics/include/KFMElectrostaticMultipoleSet.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Electrostatics/include/KFMElectrostaticNearFieldToLocalCoefficientCalculator.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Electrostatics/include/KFMElectrostaticNode.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Electrostatics/include/KFMElectrostaticNodeInspector.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Electrostatics/include/KFMElectrostaticNodeWorkScoreCalculator.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Electrostatics/include/KFMElectrostaticParameters.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Electrostatics/include/KFMElectrostaticRegionSizeEstimator.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Electrostatics/include/KFMElectrostaticTree.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Electrostatics/include/KFMElectrostaticTreeBuilder.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Electrostatics/include/KFMElectrostaticTreeBuilder_MPI.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Electrostatics/include/KFMElectrostaticTreeData.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Electrostatics/include/KFMElectrostaticTreeInformationExtractor.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Electrostatics/src/KFMElectrostaticBoundaryIntegratorEngine_SingleThread.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Electrostatics/src/KFMElectrostaticFieldMapper_SingleThread.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Electrostatics/src/KFMElectrostaticLocalCoefficientCalculatorNumeric.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Electrostatics/src/KFMElectrostaticLocalCoefficientFieldCalculator.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Electrostatics/src/KFMElectrostaticLocalCoefficientSet.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Electrostatics/src/KFMElectrostaticMultipoleBatchCalculator.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Electrostatics/src/KFMElectrostaticMultipoleCalculatorAnalytic.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Electrostatics/src/KFMElectrostaticMultipoleCalculatorNumeric.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Electrostatics/src/KFMElectrostaticMultipoleSet.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Electrostatics/src/KFMElectrostaticNearFieldToLocalCoefficientCalculator.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Electrostatics/src/KFMElectrostaticNodeInspector.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Electrostatics/src/KFMElectrostaticNodeWorkScoreCalculator.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Electrostatics/src/KFMElectrostaticRegionSizeEstimator.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Electrostatics/src/KFMElectrostaticTreeBuilder.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Electrostatics/src/KFMElectrostaticTreeBuilder_MPI.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Electrostatics/src/KFMElectrostaticTreeData.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Interface/BoundaryIntegrals/CMakeLists.txt (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Interface/BoundaryIntegrals/include/KFMBoundaryIntegralMatrix.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Interface/BoundaryIntegrals/include/KFMDenseBlockSparseBoundaryIntegralMatrix.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Interface/BoundaryIntegrals/include/KFMDenseBoundaryIntegralMatrix.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Interface/BoundaryIntegrals/include/KFMElectrostaticBoundaryIntegrator.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Interface/BoundaryIntegrals/include/KFMElectrostaticBoundaryIntegrator_MPI.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Interface/BoundaryIntegrals/include/KFMSparseBoundaryIntegralMatrix.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Interface/BoundaryIntegrals/include/KFMSparseBoundaryIntegralMatrix_BlockCompressedRow.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Interface/BoundaryIntegrals/include/KFMSparseBoundaryIntegralMatrix_CompressedRow.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Interface/Extraction/CMakeLists.txt (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Interface/Extraction/include/KFMBoundingBallContainer.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Interface/Extraction/include/KFMElectrostaticBasisDataContainer.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Interface/Extraction/include/KFMElectrostaticBasisDataExtractor.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Interface/Extraction/include/KFMElectrostaticElementContainerFlyweight.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Interface/Extraction/include/KFMElectrostaticSurfaceConverter.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Interface/Extraction/include/KFMElementAspectRatioExtractor.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Interface/Extraction/include/KFMPointCloudContainer.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Interface/Extraction/include/KFMSurfaceToPointCloudConverter.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Interface/Extraction/include/KFMTreeSurfaceOrderingPredicate.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Interface/Extraction/src/KFMElectrostaticElementContainerFlyweight.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Interface/Extraction/src/KFMElectrostaticSurfaceConverter.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Interface/Extraction/src/KFMElementAspectRatioExtractor.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Interface/Extraction/src/KFMSurfaceToPointCloudConverter.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Interface/FieldSolvers/CMakeLists.txt (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Interface/FieldSolvers/include/KFMElectrostaticFastMultipoleFieldSolver.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Interface/FieldSolvers/include/KFMElectrostaticFastMultipoleMultipleTreeFieldSolver.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Interface/FieldSolvers/include/KFMElectrostaticTreeConstructor.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Interface/FieldSolvers/src/KFMElectrostaticFastMultipoleFieldSolver.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Interface/FieldSolvers/src/KFMElectrostaticFastMultipoleMultipleTreeFieldSolver.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Kernel/CMakeLists.txt (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Kernel/include/KFMKernelExpansion.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Kernel/include/KFMKernelResponseArray.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Kernel/include/KFMKernelResponseArrayTypes.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Kernel/include/KFMMomentTransformer.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Kernel/include/KFMMomentTransformerTypes.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Kernel/include/KFMReducedKernelResponseArray.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Kernel/include/KFMResponseKernel_3DLaplaceL2L.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Kernel/include/KFMResponseKernel_3DLaplaceM2L.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Kernel/include/KFMResponseKernel_3DLaplaceM2M.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Kernel/include/KFMResponseKernel_LaplaceM2L.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Kernel/include/KFMScalarMomentExpansion.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Kernel/include/KFMScalarMultipoleExpansion.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Kernel/include/KFMScaleInvariantKernelExpansion.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Kernel/src/KFMResponseKernel.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Kernel/src/KFMResponseKernel_3DLaplaceL2L.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Kernel/src/KFMResponseKernel_3DLaplaceM2L.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Kernel/src/KFMResponseKernel_3DLaplaceM2M.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Kernel/src/KFMScalarMultipoleExpansion.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Math/CMakeLists.txt (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Math/include/KFMBall.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Math/include/KFMBallCloud.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Math/include/KFMBallSupportSet.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Math/include/KFMBoundaryCalculator.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Math/include/KFMBox.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Math/include/KFMBoxSupportSet.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Math/include/KFMComplexSphericalHarmonicExpansionRotator.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Math/include/KFMCube.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Math/include/KFMCubicVolumeCollection.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Math/include/KFMDenseBlockSparseMatrix.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Math/include/KFMDenseBlockSparseMatrixStructure.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Math/include/KFMDenseBlockSparseMatrix_MPI.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Math/include/KFMPinchonGMatrixCalculator.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Math/include/KFMPinchonJMatrixCalculator.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Math/include/KFMPoint.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Math/include/KFMPointCloud.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Math/include/KFMPointCloudToBoundingBallConverter.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Math/include/KFMRealSphericalHarmonicExpansionRotator.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Math/include/KFMTrianglePolarBasisCalculator.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Math/src/KFMComplexSphericalHarmonicExpansionRotator.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Math/src/KFMDenseBlockSparseMatrixStructure.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Math/src/KFMPinchonGMatrixCalculator.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Math/src/KFMPinchonJMatrixCalculator.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Math/src/KFMRealSphericalHarmonicExpansionRotator.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Math/src/KFMTrianglePolarBasisCalculator.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Test/CMakeLists.txt (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Test/TestArrayMath.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Test/TestBasicMatrixOperations.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Test/TestBasicMatrixVectorOperations.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Test/TestBasicVectorOperations.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Test/TestBitReversalPermutation.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Test/TestBoundingBall.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Test/TestCube.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Test/TestFastFourierTransformBluestein.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Test/TestFastFourierTransformRadixThree.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Test/TestFastFourierTransformRadixTwo.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Test/TestFastMultipoleDualTree.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Test/TestFastMultipoleFieldMap.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Test/TestFastMultipoleFieldSolver.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Test/TestFastMultipoleTranslation.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Test/TestKrylovSolvers.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Test/TestM2LCoefficients.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Test/TestMatrixSingularValueDecomposition.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Test/TestMultidimensionalFastFourierTransform.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Test/TestMultidimensionalFastFourierTransformOpenCL.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Test/TestMultidimensionalFastFourierTransformSpeed.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Test/TestMultilevelPreconditioners.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Test/TestMultipoleCalculators.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Test/TestMultipoleExpansionSpeed.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Test/TestNumericalIntegrator.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Test/TestPinchonJMatrixCalculator.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Test/TestQuadratureTableCalculator.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Test/TestSingleTriangleMultipoleExpansion.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Test/TestStructuredASCII.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Test/TestStructuredASCIICompressed.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Test/TestVectorMath.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Tree/CMakeLists.txt (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Tree/include/KFMCollocationPointIdentitySetCreator.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Tree/include/KFMCubicSpaceBallSorter.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Tree/include/KFMCubicSpaceNodeAdjacencyProgenitor.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Tree/include/KFMCubicSpaceNodeNeighborFinder.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Tree/include/KFMCubicSpaceNodeProgenitor.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Tree/include/KFMCubicSpaceTree.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Tree/include/KFMCubicSpaceTreeNavigator.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Tree/include/KFMCubicSpaceTreeProperties.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Tree/include/KFMCubicSpaceTreeStaticLoadBalancer.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Tree/include/KFMDenseBlockSparseMatrixGenerator.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Tree/include/KFMDenseBlockSparseMatrixStructureGenerator.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Tree/include/KFMDirectCallCounter.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Tree/include/KFMElementLocalInfluenceRangeCollector.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Tree/include/KFMElementLocator.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Tree/include/KFMElementMomentBatchCalculator.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Tree/include/KFMElementNodeAssociator.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Tree/include/KFMElementScalarMomentDistributor.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Tree/include/KFMExternalIdentitySetCreator.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Tree/include/KFMExternalIdentitySetNullifier.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Tree/include/KFMIdentitySetCollector.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Tree/include/KFMIdentitySetListCreator.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Tree/include/KFMIdentitySetMerger.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Tree/include/KFMInsertionCondition.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Tree/include/KFMNearbyElementCounter.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Tree/include/KFMNodeCollector.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Tree/include/KFMReducedScalarMomentCollector.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Tree/include/KFMReducedScalarMomentRemoteToLocalConverter.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Tree/include/KFMRemoteToLocalConverterInterface.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Tree/include/KFMScalarMomentCollector.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Tree/include/KFMScalarMomentDistributor.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Tree/include/KFMScalarMomentInitializer.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Tree/include/KFMScalarMomentLocalToLocalConverter.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Tree/include/KFMScalarMomentRemoteToLocalConverter.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Tree/include/KFMScalarMomentRemoteToRemoteConverter.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Tree/include/KFMScalarMomentResetter.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Tree/include/KFMSpecialNodeSet.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Tree/include/KFMSpecialNodeSetCreator.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Tree/include/KFMSubdivisionCondition.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Tree/include/KFMSubdivisionConditionAggressive.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Tree/include/KFMSubdivisionConditionBalanced.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Tree/include/KFMSubdivisionConditionGuided.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Tree/include/KFMSubdivisionStrategy.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Tree/include/KFMWorkLoadBalanceWeights.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Tree/src/KFMElementMomentBatchCalculator.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Tree/src/KFMSubdivisionStrategy.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Utility/CMakeLists.txt (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Utility/include/KFMElectrostaticFastMultipoleBoundaryValueSolver.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Utility/include/KFMElectrostaticFastMultipoleBoundaryValueSolverConfiguration.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Utility/include/KFMElectrostaticMatrixGenerator.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Utility/include/KFMElectrostaticParametersConfiguration.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Utility/include/KFMElectrostaticTypes.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Utility/include/KFMNamedScalarData.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Utility/include/KFMNamedScalarDataCollection.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Utility/include/KFastMultipoleMatrixGenerator.hh (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Utility/src/KFMElectrostaticFastMultipoleBoundaryValueSolver.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Utility/src/KFMElectrostaticFastMultipoleBoundaryValueSolverConfiguration.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Utility/src/KFMNamedScalarData.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Utility/src/KFMNamedScalarDataCollection.cc (100%) rename KEMField/Source/{2.0 => }/FastMultipole/Utility/src/KFastMultipoleMatrixGenerator.cc (100%) rename KEMField/Source/{2.0 => }/FieldSolvers/Core/CMakeLists.txt (100%) rename KEMField/Source/{2.0 => }/FieldSolvers/Core/include/KIntegratingFieldSolverTemplate.hh (100%) rename KEMField/Source/{2.0 => }/FieldSolvers/Integrating/CMakeLists.txt (100%) rename KEMField/Source/{2.0 => }/FieldSolvers/Integrating/include/KElectrostaticIntegratingFieldSolver.hh (100%) rename KEMField/Source/{2.0 => }/FieldSolvers/ZonalHarmonic/Generator/CMakeLists.txt (100%) rename KEMField/Source/{2.0 => }/FieldSolvers/ZonalHarmonic/Generator/include/KZHCoefficientGeneratorCoil.hh (100%) rename KEMField/Source/{2.0 => }/FieldSolvers/ZonalHarmonic/Generator/include/KZHCoefficientGeneratorConicSection.hh (100%) rename KEMField/Source/{2.0 => }/FieldSolvers/ZonalHarmonic/Generator/include/KZHCoefficientGeneratorCurrentLoop.hh (100%) rename KEMField/Source/{2.0 => }/FieldSolvers/ZonalHarmonic/Generator/include/KZHCoefficientGeneratorElement.hh (100%) rename KEMField/Source/{2.0 => }/FieldSolvers/ZonalHarmonic/Generator/include/KZHCoefficientGeneratorRing.hh (100%) rename KEMField/Source/{2.0 => }/FieldSolvers/ZonalHarmonic/Generator/include/KZHCoefficientGeneratorSolenoid.hh (100%) rename KEMField/Source/{2.0 => }/FieldSolvers/ZonalHarmonic/Generator/include/KZHLegendreCoefficients.hh (100%) rename KEMField/Source/{2.0 => }/FieldSolvers/ZonalHarmonic/Generator/include/KZonalHarmonicCoefficientGenerator.hh (100%) rename KEMField/Source/{2.0 => }/FieldSolvers/ZonalHarmonic/Generator/include/KZonalHarmonicContainer.hh (100%) rename KEMField/Source/{2.0 => }/FieldSolvers/ZonalHarmonic/Generator/include/KZonalHarmonicParameters.hh (100%) rename KEMField/Source/{2.0 => }/FieldSolvers/ZonalHarmonic/Generator/include/KZonalHarmonicSourcePoint.hh (100%) rename KEMField/Source/{2.0 => }/FieldSolvers/ZonalHarmonic/Generator/include/KZonalHarmonicTypes.hh (100%) rename KEMField/Source/{2.0 => }/FieldSolvers/ZonalHarmonic/Generator/src/KZHCoefficientGeneratorCoil.cc (100%) rename KEMField/Source/{2.0 => }/FieldSolvers/ZonalHarmonic/Generator/src/KZHCoefficientGeneratorConicSection.cc (100%) rename KEMField/Source/{2.0 => }/FieldSolvers/ZonalHarmonic/Generator/src/KZHCoefficientGeneratorCurrentLoop.cc (100%) rename KEMField/Source/{2.0 => }/FieldSolvers/ZonalHarmonic/Generator/src/KZHCoefficientGeneratorElement.cc (100%) rename KEMField/Source/{2.0 => }/FieldSolvers/ZonalHarmonic/Generator/src/KZHCoefficientGeneratorRing.cc (100%) rename KEMField/Source/{2.0 => }/FieldSolvers/ZonalHarmonic/Generator/src/KZHCoefficientGeneratorSolenoid.cc (100%) rename KEMField/Source/{2.0 => }/FieldSolvers/ZonalHarmonic/Generator/src/KZHLegendreCoefficients.cc (100%) rename KEMField/Source/{2.0 => }/FieldSolvers/ZonalHarmonic/Generator/src/KZonalHarmonicSourcePoint.cc (100%) rename KEMField/Source/{2.0 => }/FieldSolvers/ZonalHarmonic/Solver/CMakeLists.txt (100%) rename KEMField/Source/{2.0 => }/FieldSolvers/ZonalHarmonic/Solver/include/KElectromagnetZonalHarmonicFieldSolver.hh (100%) rename KEMField/Source/{2.0 => }/FieldSolvers/ZonalHarmonic/Solver/include/KElectrostaticZonalHarmonicFieldSolver.hh (100%) rename KEMField/Source/{2.0 => }/FieldSolvers/ZonalHarmonic/Solver/include/KZonalHarmonicComputer.hh (100%) rename KEMField/Source/{2.0 => }/FieldSolvers/ZonalHarmonic/Solver/include/KZonalHarmonicComputer.icc (100%) rename KEMField/Source/{2.0 => }/FieldSolvers/ZonalHarmonic/Solver/src/KElectromagnetZonalHarmonicFieldSolver.cc (100%) rename KEMField/Source/{2.0 => }/FieldSolvers/ZonalHarmonic/Solver/src/KElectrostaticZonalHarmonicFieldSolver.cc (100%) rename KEMField/Source/{2.0 => }/IO/FileManipulation/CMakeLists.txt (100%) rename KEMField/Source/{2.0 => }/IO/FileManipulation/include/KEMChunkedFileInterface.hh (100%) rename KEMField/Source/{2.0 => }/IO/FileManipulation/include/KEMFile.hh (100%) rename KEMField/Source/{2.0 => }/IO/FileManipulation/include/KEMFileInterface.hh (100%) rename KEMField/Source/{2.0 => }/IO/FileManipulation/include/KEMKSAFileInterface.hh (100%) rename KEMField/Source/{2.0 => }/IO/FileManipulation/include/KEMSparseMatrixFileInterface.hh (100%) rename KEMField/Source/{2.0 => }/IO/FileManipulation/src/KEMFile.cc (100%) rename KEMField/Source/{2.0 => }/IO/FileManipulation/src/KEMFileInterface.cc (100%) rename KEMField/Source/{2.0 => }/IO/FileManipulation/src/KEMKSAFileInterface.cc (100%) rename KEMField/Source/{2.0 => }/IO/HashGenerator/CMakeLists.txt (100%) rename KEMField/Source/{2.0 => }/IO/HashGenerator/include/KMD5HashGenerator.hh (100%) rename KEMField/Source/{2.0 => }/IO/HashGenerator/include/md5.hh (100%) rename KEMField/Source/{2.0 => }/IO/HashGenerator/src/md5.cc (100%) rename KEMField/Source/{2.0 => }/IO/Streamers/CMakeLists.txt (100%) rename KEMField/Source/{2.0 => }/IO/Streamers/include/KBinaryDataStreamer.hh (100%) rename KEMField/Source/{2.0 => }/IO/Streamers/include/KMetadataStreamer.hh (100%) rename KEMField/Source/{2.0 => }/IO/Streamers/include/KSABuffer.hh (100%) rename KEMField/Source/{2.0 => }/IO/Streamers/include/KSADataStreamer.hh (100%) rename KEMField/Source/{2.0 => }/IO/Streamers/include/KSerializer.hh (100%) rename KEMField/Source/{2.0 => }/IO/Streamers/include/KStreamedSizeOf.hh (100%) rename KEMField/Source/{2.0 => }/IO/Streamers/include/KTransitiveStreamer.hh (100%) rename KEMField/Source/{2.0 => }/IO/Streamers/src/KBinaryDataStreamer.cc (100%) rename KEMField/Source/{2.0 => }/IO/Streamers/src/KMetadataStreamer.cc (100%) rename KEMField/Source/{2.0 => }/IO/Streamers/src/KSABuffer.cc (100%) rename KEMField/Source/{2.0 => }/IO/Streamers/src/KSADataStreamer.cc (100%) rename KEMField/Source/{2.0 => }/IO/StructuredASCII/CMakeLists.txt (100%) rename KEMField/Source/{2.0 => }/IO/StructuredASCII/include/KSAAssociatedPassedPointerPODArrayOutputNode.hh (100%) rename KEMField/Source/{2.0 => }/IO/StructuredASCII/include/KSAAssociatedPassedPointerPODOutputNode.hh (100%) rename KEMField/Source/{2.0 => }/IO/StructuredASCII/include/KSAAssociatedPointerObjectOutputNode.hh (100%) rename KEMField/Source/{2.0 => }/IO/StructuredASCII/include/KSAAssociatedPointerPODArrayInputNode.hh (100%) rename KEMField/Source/{2.0 => }/IO/StructuredASCII/include/KSAAssociatedPointerPODArrayOutputNode.hh (100%) rename KEMField/Source/{2.0 => }/IO/StructuredASCII/include/KSAAssociatedPointerPODInputNode.hh (100%) rename KEMField/Source/{2.0 => }/IO/StructuredASCII/include/KSAAssociatedPointerPODOutputNode.hh (100%) rename KEMField/Source/{2.0 => }/IO/StructuredASCII/include/KSAAssociatedReferencePODInputNode.hh (100%) rename KEMField/Source/{2.0 => }/IO/StructuredASCII/include/KSAAssociatedValuePODInputNode.hh (100%) rename KEMField/Source/{2.0 => }/IO/StructuredASCII/include/KSAAssociatedValuePODOutputNode.hh (100%) rename KEMField/Source/{2.0 => }/IO/StructuredASCII/include/KSACallbackTypes.hh (100%) rename KEMField/Source/{2.0 => }/IO/StructuredASCII/include/KSADefinitions.hh (100%) rename KEMField/Source/{2.0 => }/IO/StructuredASCII/include/KSAFileReader.hh (100%) rename KEMField/Source/{2.0 => }/IO/StructuredASCII/include/KSAFileWriter.hh (100%) rename KEMField/Source/{2.0 => }/IO/StructuredASCII/include/KSAFixedSizeInputOutputObject.hh (100%) rename KEMField/Source/{2.0 => }/IO/StructuredASCII/include/KSAInputCollector.hh (100%) rename KEMField/Source/{2.0 => }/IO/StructuredASCII/include/KSAInputNode.hh (100%) rename KEMField/Source/{2.0 => }/IO/StructuredASCII/include/KSAInputObject.hh (100%) rename KEMField/Source/{2.0 => }/IO/StructuredASCII/include/KSAInputOutputObject.hh (100%) rename KEMField/Source/{2.0 => }/IO/StructuredASCII/include/KSAIsDerivedFrom.hh (100%) rename KEMField/Source/{2.0 => }/IO/StructuredASCII/include/KSAObject.hh (100%) rename KEMField/Source/{2.0 => }/IO/StructuredASCII/include/KSAObjectInputNode.hh (100%) rename KEMField/Source/{2.0 => }/IO/StructuredASCII/include/KSAObjectOutputNode.hh (100%) rename KEMField/Source/{2.0 => }/IO/StructuredASCII/include/KSAOutputCollector.hh (100%) rename KEMField/Source/{2.0 => }/IO/StructuredASCII/include/KSAOutputNode.hh (100%) rename KEMField/Source/{2.0 => }/IO/StructuredASCII/include/KSAOutputObject.hh (100%) rename KEMField/Source/{2.0 => }/IO/StructuredASCII/include/KSAPODArrayOutputNode.hh (100%) rename KEMField/Source/{2.0 => }/IO/StructuredASCII/include/KSAPODConverter.hh (100%) rename KEMField/Source/{2.0 => }/IO/StructuredASCII/include/KSAPODInputNode.hh (100%) rename KEMField/Source/{2.0 => }/IO/StructuredASCII/include/KSAPODOutputNode.hh (100%) rename KEMField/Source/{2.0 => }/IO/StructuredASCII/include/KSAStructuredASCIIHeaders.hh (100%) rename KEMField/Source/{2.0 => }/IO/StructuredASCII/include/KSATestA.hh (100%) rename KEMField/Source/{2.0 => }/IO/StructuredASCII/include/KSATestB.hh (100%) rename KEMField/Source/{2.0 => }/IO/StructuredASCII/include/KSATestC.hh (100%) rename KEMField/Source/{2.0 => }/IO/StructuredASCII/include/KSATestD.hh (100%) rename KEMField/Source/{2.0 => }/IO/StructuredASCII/include/KSATokenizer.hh (100%) rename KEMField/Source/{2.0 => }/IO/StructuredASCII/include/miniz.c (100%) rename KEMField/Source/{2.0 => }/IO/StructuredASCII/include/miniz.hh (100%) rename KEMField/Source/{2.0 => }/IO/StructuredASCII/src/KSAFileReader.cc (100%) rename KEMField/Source/{2.0 => }/IO/StructuredASCII/src/KSAFileWriter.cc (100%) rename KEMField/Source/{2.0 => }/IO/StructuredASCII/src/KSAInputCollector.cc (100%) rename KEMField/Source/{2.0 => }/IO/StructuredASCII/src/KSAOutputCollector.cc (100%) rename KEMField/Source/{2.0 => }/IO/StructuredASCII/src/KSATestA.cc (100%) rename KEMField/Source/{2.0 => }/IO/StructuredASCII/src/KSATestB.cc (100%) rename KEMField/Source/{2.0 => }/IO/StructuredASCII/src/KSATestC.cc (100%) rename KEMField/Source/{2.0 => }/IO/StructuredASCII/src/KSATestD.cc (100%) rename KEMField/Source/{2.0 => }/Interface/BoundaryIntegrators/Electric/CMakeLists.txt (100%) rename KEMField/Source/{2.0 => }/Interface/BoundaryIntegrators/Electric/include/KElectrostaticBoundaryIntegratorPolicy.hh (100%) rename KEMField/Source/{2.0 => }/Interface/BoundaryIntegrators/Electric/src/KElectrostaticBoundaryIntegratorPolicy.cc (100%) rename KEMField/Source/{2.0 => }/Interface/ChargeDensitySolvers/Electric/CMakeLists.txt (100%) rename KEMField/Source/{2.0 => }/Interface/ChargeDensitySolvers/Electric/include/KCachedChargeDensitySolver.hh (100%) rename KEMField/Source/{2.0 => }/Interface/ChargeDensitySolvers/Electric/include/KChargeDensitySolver.hh (100%) rename KEMField/Source/{2.0 => }/Interface/ChargeDensitySolvers/Electric/include/KExplicitSuperpositionCachedChargeDensitySolver.hh (100%) rename KEMField/Source/{2.0 => }/Interface/ChargeDensitySolvers/Electric/include/KExplicitSuperpositionSolutionComponent.hh (100%) rename KEMField/Source/{2.0 => }/Interface/ChargeDensitySolvers/Electric/include/KGaussianEliminationChargeDensitySolver.hh (100%) rename KEMField/Source/{2.0 => }/Interface/ChargeDensitySolvers/Electric/include/KKrylovChargeDensitySolver.hh (100%) rename KEMField/Source/{2.0 => }/Interface/ChargeDensitySolvers/Electric/include/KKrylovChargeDensitySolverOld.hh (100%) rename KEMField/Source/{2.0 => }/Interface/ChargeDensitySolvers/Electric/include/KKrylovPreconditionerGenerator.hh (100%) rename KEMField/Source/{2.0 => }/Interface/ChargeDensitySolvers/Electric/include/KRobinHoodChargeDensitySolver.hh (100%) rename KEMField/Source/{2.0 => }/Interface/ChargeDensitySolvers/Electric/src/KCachedChargeDensitySolver.cc (100%) rename KEMField/Source/{2.0 => }/Interface/ChargeDensitySolvers/Electric/src/KChargeDensitySolver.cc (100%) rename KEMField/Source/{2.0 => }/Interface/ChargeDensitySolvers/Electric/src/KExplicitSuperpositionCachedChargeDensitySolver.cc (100%) rename KEMField/Source/{2.0 => }/Interface/ChargeDensitySolvers/Electric/src/KGaussianEliminationChargeDensitySolver.cc (100%) rename KEMField/Source/{2.0 => }/Interface/ChargeDensitySolvers/Electric/src/KKrylovChargeDensitySolver.cc (100%) rename KEMField/Source/{2.0 => }/Interface/ChargeDensitySolvers/Electric/src/KKrylovChargeDensitySolverOld.cc (100%) rename KEMField/Source/{2.0 => }/Interface/ChargeDensitySolvers/Electric/src/KKrylovPreconditionerGenerator.cc (100%) rename KEMField/Source/{2.0 => }/Interface/ChargeDensitySolvers/Electric/src/KRobinHoodChargeDensitySolver.cc (100%) rename KEMField/Source/{2.0 => }/Interface/ChargeDensitySolvers/Electric/test/KChargeDensitySolver_test.cc (100%) rename KEMField/Source/{2.0 => }/Interface/FieldSolvers/Electric/CMakeLists.txt (89%) rename KEMField/Source/{2.0 => }/Interface/FieldSolvers/Electric/include/KElectricFastMultipoleFieldSolver.hh (100%) rename KEMField/Source/{2.0 => }/Interface/FieldSolvers/Electric/include/KElectricFieldSolver.hh (100%) rename KEMField/Source/{2.0 => }/Interface/FieldSolvers/Electric/include/KElectricZHFieldSolver.hh (100%) rename KEMField/Source/{2.0 => }/Interface/FieldSolvers/Electric/include/KIntegratingElectrostaticFieldSolver.hh (100%) rename KEMField/Source/{2.0 => }/Interface/FieldSolvers/Electric/src/KElectricFastMultipoleFieldSolver.cc (100%) rename KEMField/Source/{2.0 => }/Interface/FieldSolvers/Electric/src/KElectricZHFieldSolver.cc (100%) rename KEMField/Source/{2.0 => }/Interface/FieldSolvers/Electric/src/KIntegratingElectrostaticFieldSolver.cc (100%) rename KEMField/Source/{2.0 => }/Interface/FieldSolvers/Magnetic/CMakeLists.txt (100%) rename KEMField/Source/{2.0 => }/Interface/FieldSolvers/Magnetic/include/KIntegratingMagnetostaticFieldSolver.hh (100%) rename KEMField/Source/{2.0 => }/Interface/FieldSolvers/Magnetic/include/KMagneticFieldSolver.hh (100%) rename KEMField/Source/{2.0 => }/Interface/FieldSolvers/Magnetic/include/KZonalHarmonicMagnetostaticFieldSolver.hh (100%) rename KEMField/Source/{2.0 => }/Interface/FieldSolvers/Magnetic/src/KIntegratingMagnetostaticFieldSolver.cc (100%) rename KEMField/Source/{2.0 => }/Interface/FieldSolvers/Magnetic/src/KZonalHarmonicMagnetostaticFieldSolver.cc (100%) rename KEMField/Source/{2.0 => }/Interface/Fields/Electric/CMakeLists.txt (100%) rename KEMField/Source/{2.0 => }/Interface/Fields/Electric/include/KBoundaryElementInfoDisplay.hh (100%) rename KEMField/Source/{2.0 => }/Interface/Fields/Electric/include/KElectricField.hh (100%) rename KEMField/Source/{2.0 => }/Interface/Fields/Electric/include/KElectricQuadrupoleField.hh (100%) rename KEMField/Source/{2.0 => }/Interface/Fields/Electric/include/KElectrostaticBoundaryField.hh (100%) rename KEMField/Source/{2.0 => }/Interface/Fields/Electric/include/KElectrostaticBoundaryFieldTimer.hh (100%) rename KEMField/Source/{2.0 => }/Interface/Fields/Electric/include/KElectrostaticConstantField.hh (100%) rename KEMField/Source/{2.0 => }/Interface/Fields/Electric/include/KElectrostaticField.hh (100%) rename KEMField/Source/{2.0 => }/Interface/Fields/Electric/include/KInducedAzimuthalElectricField.hh (100%) rename KEMField/Source/{2.0 => }/Interface/Fields/Electric/include/KRampedElectric2Field.hh (100%) rename KEMField/Source/{2.0 => }/Interface/Fields/Electric/include/KRampedElectricField.hh (100%) rename KEMField/Source/{2.0 => }/Interface/Fields/Electric/src/KBoundaryElementInfoDisplay.cc (100%) rename KEMField/Source/{2.0 => }/Interface/Fields/Electric/src/KElectricQuadrupoleField.cc (100%) rename KEMField/Source/{2.0 => }/Interface/Fields/Electric/src/KElectrostaticBoundaryField.cc (100%) rename KEMField/Source/{2.0 => }/Interface/Fields/Electric/src/KElectrostaticBoundaryFieldTimer.cc (100%) rename KEMField/Source/{2.0 => }/Interface/Fields/Electric/src/KInducedAzimuthalElectricField.cc (100%) rename KEMField/Source/{2.0 => }/Interface/Fields/Electric/src/KRampedElectric2Field.cc (100%) rename KEMField/Source/{2.0 => }/Interface/Fields/Electric/src/KRampedElectricField.cc (100%) rename KEMField/Source/{2.0 => }/Interface/Fields/Magnetic/CMakeLists.txt (100%) rename KEMField/Source/{2.0 => }/Interface/Fields/Magnetic/include/KMagneticDipoleField.hh (100%) rename KEMField/Source/{2.0 => }/Interface/Fields/Magnetic/include/KMagneticField.hh (100%) rename KEMField/Source/{2.0 => }/Interface/Fields/Magnetic/include/KMagneticSuperpositionField.hh (100%) rename KEMField/Source/{2.0 => }/Interface/Fields/Magnetic/include/KMagnetostaticConstantField.hh (100%) rename KEMField/Source/{2.0 => }/Interface/Fields/Magnetic/include/KMagnetostaticField.hh (100%) rename KEMField/Source/{2.0 => }/Interface/Fields/Magnetic/include/KRampedMagneticField.hh (100%) rename KEMField/Source/{2.0 => }/Interface/Fields/Magnetic/include/KStaticElectromagnetField.hh (100%) rename KEMField/Source/{2.0 => }/Interface/Fields/Magnetic/src/KMagneticDipoleField.cc (100%) rename KEMField/Source/{2.0 => }/Interface/Fields/Magnetic/src/KMagneticSuperpositionField.cc (100%) rename KEMField/Source/{2.0 => }/Interface/Fields/Magnetic/src/KRampedMagneticField.cc (100%) rename KEMField/Source/{2.0 => }/Interface/Fields/Magnetic/src/KStaticElectromagnetField.cc (100%) rename KEMField/Source/{2.0 => }/LinearAlgebra/Core/CMakeLists.txt (100%) rename KEMField/Source/{2.0 => }/LinearAlgebra/Core/include/KMatrix.hh (100%) rename KEMField/Source/{2.0 => }/LinearAlgebra/Core/include/KSimpleMatrix.hh (100%) rename KEMField/Source/{2.0 => }/LinearAlgebra/Core/include/KSimpleSquareMatrix.hh (100%) rename KEMField/Source/{2.0 => }/LinearAlgebra/Core/include/KSimpleVector.hh (100%) rename KEMField/Source/{2.0 => }/LinearAlgebra/Core/include/KSquareMatrix.hh (100%) rename KEMField/Source/{2.0 => }/LinearAlgebra/Core/include/KVector.hh (100%) rename KEMField/Source/{2.0 => }/LinearAlgebra/Preconditioners/CMakeLists.txt (100%) rename KEMField/Source/{2.0 => }/LinearAlgebra/Preconditioners/include/KBlockJacobiPreconditioner.hh (100%) rename KEMField/Source/{2.0 => }/LinearAlgebra/Preconditioners/include/KIdentityPreconditioner.hh (100%) rename KEMField/Source/{2.0 => }/LinearAlgebra/Preconditioners/include/KImplicitKrylovPreconditioner.hh (100%) rename KEMField/Source/{2.0 => }/LinearAlgebra/Preconditioners/include/KJacobiPreconditioner.hh (100%) rename KEMField/Source/{2.0 => }/LinearAlgebra/Preconditioners/include/KMatrixPreconditioner.hh (100%) rename KEMField/Source/{2.0 => }/LinearAlgebra/Preconditioners/include/KPreconditioner.hh (100%) rename KEMField/Source/{2.0 => }/LinearAlgebra/Solvers/CMakeLists.txt (100%) rename KEMField/Source/{2.0 => }/LinearAlgebra/Solvers/include/KBiconjugateGradientStabilized.hh (100%) rename KEMField/Source/{2.0 => }/LinearAlgebra/Solvers/include/KBiconjugateGradientStabilizedState.hh (100%) rename KEMField/Source/{2.0 => }/LinearAlgebra/Solvers/include/KGaussSeidel.hh (100%) rename KEMField/Source/{2.0 => }/LinearAlgebra/Solvers/include/KGaussSeidel_MPI.hh (100%) rename KEMField/Source/{2.0 => }/LinearAlgebra/Solvers/include/KGaussSeidel_SingleThread.hh (100%) rename KEMField/Source/{2.0 => }/LinearAlgebra/Solvers/include/KGaussianElimination.hh (100%) rename KEMField/Source/{2.0 => }/LinearAlgebra/Solvers/include/KGeneralizedMinimalResidual.hh (100%) rename KEMField/Source/{2.0 => }/LinearAlgebra/Solvers/include/KGeneralizedMinimalResidualState.hh (100%) rename KEMField/Source/{2.0 => }/LinearAlgebra/Solvers/include/KGeneralizedMinimalResidual_MPI.hh (100%) rename KEMField/Source/{2.0 => }/LinearAlgebra/Solvers/include/KIterativeKrylovRestartCondition.hh (100%) rename KEMField/Source/{2.0 => }/LinearAlgebra/Solvers/include/KIterativeKrylovSolver.hh (100%) rename KEMField/Source/{2.0 => }/LinearAlgebra/Solvers/include/KIterativeSolver.hh (100%) rename KEMField/Source/{2.0 => }/LinearAlgebra/Solvers/include/KKrylovSolverConfiguration.hh (100%) rename KEMField/Source/{2.0 => }/LinearAlgebra/Solvers/include/KKrylovSolverFactory.hh (100%) rename KEMField/Source/{2.0 => }/LinearAlgebra/Solvers/include/KMultiElementRobinHood.hh (100%) rename KEMField/Source/{2.0 => }/LinearAlgebra/Solvers/include/KMultiElementRobinHood_SingleThread.hh (100%) rename KEMField/Source/{2.0 => }/LinearAlgebra/Solvers/include/KPreconditionedBiconjugateGradientStabilized.hh (100%) rename KEMField/Source/{2.0 => }/LinearAlgebra/Solvers/include/KPreconditionedGeneralizedMinimalResidual.hh (100%) rename KEMField/Source/{2.0 => }/LinearAlgebra/Solvers/include/KPreconditionedGeneralizedMinimalResidualState.hh (100%) rename KEMField/Source/{2.0 => }/LinearAlgebra/Solvers/include/KPreconditionedGeneralizedMinimalResidual_MPI.hh (100%) rename KEMField/Source/{2.0 => }/LinearAlgebra/Solvers/include/KPreconditionedIterativeKrylovSolver.hh (100%) rename KEMField/Source/{2.0 => }/LinearAlgebra/Solvers/include/KProjectionSolver.hh (100%) rename KEMField/Source/{2.0 => }/LinearAlgebra/Solvers/include/KRobinHood.hh (100%) rename KEMField/Source/{2.0 => }/LinearAlgebra/Solvers/include/KRobinHood_MPI.hh (100%) rename KEMField/Source/{2.0 => }/LinearAlgebra/Solvers/include/KRobinHood_SingleThread.hh (100%) rename KEMField/Source/{2.0 => }/LinearAlgebra/Solvers/include/KSVDSolver.hh (100%) rename KEMField/Source/{2.0 => }/LinearAlgebra/Solvers/include/KSimpleIterativeKrylovSolver.hh (100%) rename KEMField/Source/{2.0 => }/LinearAlgebra/Solvers/include/KSuccessiveSubspaceCorrection.hh (100%) rename KEMField/Source/{2.0 => }/LinearAlgebra/Solvers/include/KSuccessiveSubspaceCorrection_SingleThread.hh (100%) rename KEMField/Source/{2.0 => }/LinearAlgebra/Solvers/include/KSuperpositionSolver.hh (100%) rename KEMField/Source/{2.0 => }/LinearAlgebra/Solvers/src/KKrylovSolverConfiguration.cc (100%) rename KEMField/Source/{2.0 => }/LinearAlgebra/Visitors/CMakeLists.txt (100%) rename KEMField/Source/{2.0 => }/LinearAlgebra/Visitors/include/KIterationTerminator.hh (100%) rename KEMField/Source/{2.0 => }/LinearAlgebra/Visitors/include/KIterationTracker.hh (100%) rename KEMField/Source/{2.0 => }/LinearAlgebra/Visitors/include/KIterativeKrylovStateReader.hh (100%) rename KEMField/Source/{2.0 => }/LinearAlgebra/Visitors/include/KIterativeKrylovStateWriter.hh (100%) rename KEMField/Source/{2.0 => }/LinearAlgebra/Visitors/include/KIterativeSolverTimer.hh (100%) rename KEMField/Source/{2.0 => }/LinearAlgebra/Visitors/include/KIterativeStateReader.hh (100%) rename KEMField/Source/{2.0 => }/LinearAlgebra/Visitors/include/KIterativeStateWriter.hh (100%) rename KEMField/Source/{2.0 => }/LinearAlgebra/Visitors/include/KPreconditionedIterativeKrylovStateReader.hh (100%) rename KEMField/Source/{2.0 => }/LinearAlgebra/Visitors/include/KPreconditionedIterativeKrylovStateWriter.hh (100%) rename KEMField/Source/{2.0 => }/LinearAlgebra/Visitors/include/KResidualVector.hh (100%) rename KEMField/Source/{2.0 => }/LinearAlgebra/Visitors/include/KTimeTerminator.hh (100%) rename KEMField/Source/{2.0 => }/Math/Array/CMakeLists.txt (100%) rename KEMField/Source/{2.0 => }/Math/Array/include/KFMArrayFillingOperator.hh (100%) rename KEMField/Source/{2.0 => }/Math/Array/include/KFMArrayMath.hh (100%) rename KEMField/Source/{2.0 => }/Math/Array/include/KFMArrayOperator.hh (100%) rename KEMField/Source/{2.0 => }/Math/Array/include/KFMArrayScalarMultiplier.hh (100%) rename KEMField/Source/{2.0 => }/Math/Array/include/KFMArrayWrapper.hh (100%) rename KEMField/Source/{2.0 => }/Math/Array/include/KFMBinaryArrayOperator.hh (100%) rename KEMField/Source/{2.0 => }/Math/Array/include/KFMMessaging.hh (100%) rename KEMField/Source/{2.0 => }/Math/Array/include/KFMPointwiseArrayAdder.hh (100%) rename KEMField/Source/{2.0 => }/Math/Array/include/KFMPointwiseArrayMultiplier.hh (100%) rename KEMField/Source/{2.0 => }/Math/Array/include/KFMPointwiseArrayReversedConjugateMultiplier.hh (100%) rename KEMField/Source/{2.0 => }/Math/Array/include/KFMPointwiseArrayScaledAdder.hh (100%) rename KEMField/Source/{2.0 => }/Math/Array/include/KFMUnaryArrayOperator.hh (100%) rename KEMField/Source/{2.0 => }/Math/CMakeLists.txt (100%) rename KEMField/Source/{2.0 => }/Math/Utilities/CMakeLists.txt (100%) rename KEMField/Source/{2.0 => }/Math/Utilities/include/KFMBitReversalPermutation.hh (100%) rename KEMField/Source/{2.0 => }/Math/Utilities/include/KFMFastFourierTransform.hh (100%) rename KEMField/Source/{2.0 => }/Math/Utilities/include/KFMFastFourierTransformUtilities.hh (100%) rename KEMField/Source/{2.0 => }/Math/Utilities/include/KFMGaussLegendreQuadratureTableCalculator.hh (100%) rename KEMField/Source/{2.0 => }/Math/Utilities/include/KFMLinearAlgebraDefinitions.hh (100%) rename KEMField/Source/{2.0 => }/Math/Utilities/include/KFMLinearSystemSolver.hh (100%) rename KEMField/Source/{2.0 => }/Math/Utilities/include/KFMMath.hh (100%) rename KEMField/Source/{2.0 => }/Math/Utilities/include/KFMMatrixOperations.hh (100%) rename KEMField/Source/{2.0 => }/Math/Utilities/include/KFMMatrixVectorOperations.hh (100%) rename KEMField/Source/{2.0 => }/Math/Utilities/include/KFMMultidimensionalFastFourierTransform.hh (100%) rename KEMField/Source/{2.0 => }/Math/Utilities/include/KFMMultidimensionalFastFourierTransformFFTW.hh (100%) rename KEMField/Source/{2.0 => }/Math/Utilities/include/KFMNumericalConstants.hh (100%) rename KEMField/Source/{2.0 => }/Math/Utilities/include/KFMSquareRootUtilities.hh (100%) rename KEMField/Source/{2.0 => }/Math/Utilities/include/KFMVectorOperations.hh (100%) rename KEMField/Source/{2.0 => }/Math/Utilities/src/KFMBitReversalPermutation.cc (100%) rename KEMField/Source/{2.0 => }/Math/Utilities/src/KFMFastFourierTransform.cc (100%) rename KEMField/Source/{2.0 => }/Math/Utilities/src/KFMFastFourierTransformUtilities.cc (100%) rename KEMField/Source/{2.0 => }/Math/Utilities/src/KFMGaussLegendreQuadratureTableCalculator.cc (100%) rename KEMField/Source/{2.0 => }/Math/Utilities/src/KFMLinearSystemSolver.cc (100%) rename KEMField/Source/{2.0 => }/Math/Utilities/src/KFMMath.cc (100%) rename KEMField/Source/{2.0 => }/Math/Utilities/src/KFMMatrixOperations.cc (100%) rename KEMField/Source/{2.0 => }/Math/Utilities/src/KFMMatrixVectorOperations.cc (100%) rename KEMField/Source/{2.0 => }/Math/Utilities/src/KFMSquareRootUtilities.cc (100%) rename KEMField/Source/{2.0 => }/Math/Utilities/src/KFMVectorOperations.cc (100%) rename KEMField/Source/{2.0 => }/Math/VectorMath/CMakeLists.txt (100%) rename KEMField/Source/{2.0 => }/Math/VectorMath/include/KVMCompactCurve.hh (100%) rename KEMField/Source/{2.0 => }/Math/VectorMath/include/KVMCompactSurface.hh (100%) rename KEMField/Source/{2.0 => }/Math/VectorMath/include/KVMCompactVolume.hh (100%) rename KEMField/Source/{2.0 => }/Math/VectorMath/include/KVMField.hh (100%) rename KEMField/Source/{2.0 => }/Math/VectorMath/include/KVMFieldWrapper.hh (100%) rename KEMField/Source/{2.0 => }/Math/VectorMath/include/KVMFixedArray.hh (100%) rename KEMField/Source/{2.0 => }/Math/VectorMath/include/KVMFluxIntegral.hh (100%) rename KEMField/Source/{2.0 => }/Math/VectorMath/include/KVMLineIntegral.hh (100%) rename KEMField/Source/{2.0 => }/Math/VectorMath/include/KVMLineSegment.hh (100%) rename KEMField/Source/{2.0 => }/Math/VectorMath/include/KVMMap.hh (100%) rename KEMField/Source/{2.0 => }/Math/VectorMath/include/KVMNumericalIntegrator.hh (100%) rename KEMField/Source/{2.0 => }/Math/VectorMath/include/KVMPathIntegral.hh (100%) rename KEMField/Source/{2.0 => }/Math/VectorMath/include/KVMRectangularSurface.hh (100%) rename KEMField/Source/{2.0 => }/Math/VectorMath/include/KVMSpaceLineSegment.hh (100%) rename KEMField/Source/{2.0 => }/Math/VectorMath/include/KVMSpaceRectangle.hh (100%) rename KEMField/Source/{2.0 => }/Math/VectorMath/include/KVMSpaceTriangle.hh (100%) rename KEMField/Source/{2.0 => }/Math/VectorMath/include/KVMSurfaceIntegral.hh (100%) rename KEMField/Source/{2.0 => }/Math/VectorMath/include/KVMTriangularSurface.hh (100%) rename KEMField/Source/{2.0 => }/Math/VectorMath/src/KVMCompactCurve.cc (100%) rename KEMField/Source/{2.0 => }/Math/VectorMath/src/KVMCompactSurface.cc (100%) rename KEMField/Source/{2.0 => }/Math/VectorMath/src/KVMCompactVolume.cc (100%) rename KEMField/Source/{2.0 => }/Math/VectorMath/src/KVMFluxIntegral.cc (100%) rename KEMField/Source/{2.0 => }/Math/VectorMath/src/KVMLineIntegral.cc (100%) rename KEMField/Source/{2.0 => }/Math/VectorMath/src/KVMLineSegment.cc (100%) rename KEMField/Source/{2.0 => }/Math/VectorMath/src/KVMRectangularSurface.cc (100%) rename KEMField/Source/{2.0 => }/Math/VectorMath/src/KVMSpaceLineSegment.cc (100%) rename KEMField/Source/{2.0 => }/Math/VectorMath/src/KVMSpaceRectangle.cc (100%) rename KEMField/Source/{2.0 => }/Math/VectorMath/src/KVMSpaceTriangle.cc (100%) rename KEMField/Source/{2.0 => }/Math/VectorMath/src/KVMTriangularSurface.cc (100%) rename KEMField/Source/{2.0 => }/Math/include/KEMCoordinateSystem.hh (100%) rename KEMField/Source/{2.0 => }/Math/include/KEMStreamableThreeVector.hh (100%) rename KEMField/Source/{2.0 => }/Math/include/KEMThreeMatrix.hh (100%) rename KEMField/Source/{2.0 => }/Math/include/KEMThreeVector.hh (100%) rename KEMField/Source/{2.0 => }/Math/include/KEMTransformation.hh (100%) rename KEMField/Source/{2.0 => }/Math/include/KEllipticIntegrals.hh (100%) rename KEMField/Source/{2.0 => }/Math/include/KGaussLegendreQuadrature.hh (100%) rename KEMField/Source/{2.0 => }/Math/include/KGaussianQuadrature.hh (100%) rename KEMField/Source/{2.0 => }/Math/include/KShanksTransformation.hh (100%) rename KEMField/Source/{2.0 => }/Math/src/KEMCoordinateSystem.cc (100%) rename KEMField/Source/{2.0 => }/Math/src/KEMThreeMatrix.cc (100%) rename KEMField/Source/{2.0 => }/Math/src/KEMThreeVector.cc (100%) rename KEMField/Source/{2.0 => }/Math/src/KEllipticIntegrals.cc (100%) rename KEMField/Source/{2.0 => }/Math/src/KGaussLegendreQuadrature.cc (100%) rename KEMField/Source/{2.0 => }/Math/src/KGaussianQuadrature.cc (100%) rename KEMField/Source/{2.0 => }/Plugins/Bindings/CMakeLists.txt (93%) rename KEMField/Source/{2.0 => }/Plugins/Bindings/ChargeDensitySolvers/Electric/include/KCachedChargeDensitySolverBuilder.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/Bindings/ChargeDensitySolvers/Electric/include/KElectrostaticBoundaryIntegratorAttributeProcessor.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/Bindings/ChargeDensitySolvers/Electric/include/KExplicitSuperpositionCachedChargeDensitySolverBuilder.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/Bindings/ChargeDensitySolvers/Electric/include/KExplicitSuperpositionSolutionComponentBuilder.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/Bindings/ChargeDensitySolvers/Electric/include/KFMElectrostaticParametersBuilder.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/Bindings/ChargeDensitySolvers/Electric/include/KFastMultipoleMatrixGeneratorBuilder.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/Bindings/ChargeDensitySolvers/Electric/include/KGaussianEliminationChargeDensitySolverBuilder.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/Bindings/ChargeDensitySolvers/Electric/include/KKrylovChargeDensitySolverBuilder.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/Bindings/ChargeDensitySolvers/Electric/include/KKrylovChargeDensitySolverOldBuilder.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/Bindings/ChargeDensitySolvers/Electric/include/KKrylovPreconditionerGeneratorBuilder.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/Bindings/ChargeDensitySolvers/Electric/include/KKrylovSolverConfigurationReader.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/Bindings/ChargeDensitySolvers/Electric/include/KRobinHoodChargeDensitySolverBuilder.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/Bindings/ChargeDensitySolvers/Electric/src/KCachedChargeDensitySolverBuilder.cc (100%) rename KEMField/Source/{2.0 => }/Plugins/Bindings/ChargeDensitySolvers/Electric/src/KExplicitSuperpositionCachedChargeDensitySolverBuilder.cc (100%) rename KEMField/Source/{2.0 => }/Plugins/Bindings/ChargeDensitySolvers/Electric/src/KExplicitSuperpositionSolutionComponentBuilder.cc (100%) rename KEMField/Source/{2.0 => }/Plugins/Bindings/ChargeDensitySolvers/Electric/src/KFMElectrostaticParametersBuilder.cc (100%) rename KEMField/Source/{2.0 => }/Plugins/Bindings/ChargeDensitySolvers/Electric/src/KFastMultipoleMatrixGeneratorBuilder.cc (100%) rename KEMField/Source/{2.0 => }/Plugins/Bindings/ChargeDensitySolvers/Electric/src/KGaussianEliminationChargeDensitySolverBuilder.cc (100%) rename KEMField/Source/{2.0 => }/Plugins/Bindings/ChargeDensitySolvers/Electric/src/KKrylovChargeDensitySolverBuilder.cc (100%) rename KEMField/Source/{2.0 => }/Plugins/Bindings/ChargeDensitySolvers/Electric/src/KKrylovChargeDensitySolverOldBuilder.cc (100%) rename KEMField/Source/{2.0 => }/Plugins/Bindings/ChargeDensitySolvers/Electric/src/KKrylovPreconditionerGeneratorBuilder.cc (100%) rename KEMField/Source/{2.0 => }/Plugins/Bindings/ChargeDensitySolvers/Electric/src/KRobinHoodChargeDensitySolverBuilder.cc (100%) rename KEMField/Source/{2.0 => }/Plugins/Bindings/FieldSolvers/Electric/include/KElectricFastMultipoleFieldSolverBuilder.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/Bindings/FieldSolvers/Electric/include/KElectricZHFieldSolverBuilder.hh (100%) create mode 100644 KEMField/Source/Plugins/Bindings/FieldSolvers/Electric/include/KFMVTKElectrostaticTreeViewerBuilder.hh rename KEMField/Source/{2.0 => }/Plugins/Bindings/FieldSolvers/Electric/include/KIntegratingElectrostaticFieldSolverBuilder.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/Bindings/FieldSolvers/Electric/src/KElectricFastMultipoleFieldSolverBuilder.cc (100%) rename KEMField/Source/{2.0 => }/Plugins/Bindings/FieldSolvers/Electric/src/KElectricZHFieldSolverBuilder.cc (100%) create mode 100644 KEMField/Source/Plugins/Bindings/FieldSolvers/Electric/src/KFMVTKElectrostaticTreeViewerBuilder.cc rename KEMField/Source/{2.0 => }/Plugins/Bindings/FieldSolvers/Electric/src/KIntegratingElectrostaticFieldSolverBuilder.cc (100%) rename KEMField/Source/{2.0 => }/Plugins/Bindings/FieldSolvers/Magnetic/include/KIntegratingMagnetostaticFieldSolverBuilder.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/Bindings/FieldSolvers/Magnetic/include/KZonalHarmonicMagnetostaticFieldSolverBuilder.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/Bindings/FieldSolvers/Magnetic/src/KIntegratingMagnetostaticFieldSolverBuilder.cc (100%) rename KEMField/Source/{2.0 => }/Plugins/Bindings/FieldSolvers/Magnetic/src/KZonalHarmonicMagnetostaticFieldSolverBuilder.cc (100%) rename KEMField/Source/{2.0 => }/Plugins/Bindings/Fields/Electric/include/KBoundaryElementInfoDisplayBuilder.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/Bindings/Fields/Electric/include/KElectricQuadrupoleFieldBuilder.hh (100%) create mode 100644 KEMField/Source/Plugins/Bindings/Fields/Electric/include/KElectrostaticBoundaryFieldBuilder.hh rename KEMField/Source/{2.0 => }/Plugins/Bindings/Fields/Electric/include/KElectrostaticBoundaryFieldTimerBuilder.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/Bindings/Fields/Electric/include/KElectrostaticConstantFieldBuilder.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/Bindings/Fields/Electric/include/KElectrostaticPotentialmapBuilder.hh (98%) rename KEMField/Source/{2.0 => }/Plugins/Bindings/Fields/Electric/include/KInducedAzimuthalElectricFieldBuilder.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/Bindings/Fields/Electric/include/KRampedElectric2FieldBuilder.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/Bindings/Fields/Electric/include/KRampedElectricFieldBuilder.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/Bindings/Fields/Electric/include/KVTKViewerVisitorBuilder.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/Bindings/Fields/Electric/src/KBoundaryElementInfoDisplayBuilder.cc (100%) rename KEMField/Source/{2.0 => }/Plugins/Bindings/Fields/Electric/src/KElectricQuadrupoleFieldBuilder.cc (100%) rename KEMField/Source/{2.0 => }/Plugins/Bindings/Fields/Electric/src/KElectrostaticBoundaryFieldBuilder.cc (100%) rename KEMField/Source/{2.0 => }/Plugins/Bindings/Fields/Electric/src/KElectrostaticBoundaryFieldTimerBuilder.cc (100%) rename KEMField/Source/{2.0 => }/Plugins/Bindings/Fields/Electric/src/KElectrostaticConstantFieldBuilder.cc (100%) rename KEMField/Source/{2.0 => }/Plugins/Bindings/Fields/Electric/src/KElectrostaticPotentialmapBuilder.cc (98%) rename KEMField/Source/{2.0 => }/Plugins/Bindings/Fields/Electric/src/KInducedAzimuthalElectricFieldBuilder.cc (100%) rename KEMField/Source/{2.0 => }/Plugins/Bindings/Fields/Electric/src/KRampedElectric2FieldBuilder.cc (100%) rename KEMField/Source/{2.0 => }/Plugins/Bindings/Fields/Electric/src/KRampedElectricFieldBuilder.cc (100%) rename KEMField/Source/{2.0 => }/Plugins/Bindings/Fields/Electric/src/KVTKViewerVisitorBuilder.cc (100%) rename KEMField/Source/{2.0 => }/Plugins/Bindings/Fields/Magnetic/include/KMagneticDipoleFieldBuilder.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/Bindings/Fields/Magnetic/include/KMagneticSuperpositionFieldBuilder.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/Bindings/Fields/Magnetic/include/KMagnetostaticConstantFieldBuilder.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/Bindings/Fields/Magnetic/include/KMagnetostaticFieldmapBuilder.hh (86%) rename KEMField/Source/{2.0 => }/Plugins/Bindings/Fields/Magnetic/include/KRampedMagneticFieldBuilder.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/Bindings/Fields/Magnetic/include/KStaticElectromagnetFieldBuilder.hh (98%) rename KEMField/Source/{2.0 => }/Plugins/Bindings/Fields/Magnetic/src/KMagneticDipoleFieldBuilder.cc (100%) rename KEMField/Source/{2.0 => }/Plugins/Bindings/Fields/Magnetic/src/KMagneticSuperpositionFieldBuilder.cc (100%) rename KEMField/Source/{2.0 => }/Plugins/Bindings/Fields/Magnetic/src/KMagnetostaticConstantFieldBuilder.cc (100%) create mode 100644 KEMField/Source/Plugins/Bindings/Fields/Magnetic/src/KMagnetostaticFieldmapBuilder.cc rename KEMField/Source/{2.0 => }/Plugins/Bindings/Fields/Magnetic/src/KRampedMagneticFieldBuilder.cc (100%) rename KEMField/Source/{2.0 => }/Plugins/Bindings/Fields/Magnetic/src/KStaticElectromagnetFieldBuilder.cc (100%) rename KEMField/Source/{2.0 => }/Plugins/Bindings/Utilities/include/KEMBindingsMessage.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/Bindings/Utilities/include/KEMToolbox.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/Bindings/Utilities/include/KEMToolboxBuilder.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/Bindings/Utilities/include/KEMToolboxHelper.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/Bindings/Utilities/include/KSmartPointerRelease.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/Bindings/Utilities/src/KEMBindingsMessage.cc (100%) rename KEMField/Source/{2.0 => }/Plugins/Bindings/Utilities/src/KEMToolbox.cc (100%) rename KEMField/Source/{2.0 => }/Plugins/Bindings/Utilities/src/KEMToolboxBuilder.cc (100%) rename KEMField/Source/{2.0 => }/Plugins/KGeoBag/CMakeLists.txt (100%) rename KEMField/Source/{2.0 => }/Plugins/KGeoBag/include/KEMVectorConverters.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/KGeoBag/include/KElectrostaticBoundaryFieldWithKGeoBag.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/KGeoBag/include/KGBEM.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/KGeoBag/include/KGBEMBuilder.hh (99%) rename KEMField/Source/{2.0 => }/Plugins/KGeoBag/include/KGBEMConverter.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/KGeoBag/include/KGElectromagnet.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/KGeoBag/include/KGElectromagnetBuilder.hh (83%) rename KEMField/Source/{2.0 => }/Plugins/KGeoBag/include/KGElectromagnetConverter.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/KGeoBag/include/KStaticElectromagnetFieldWithKGeoBag.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/KGeoBag/src/KElectrostaticBoundaryFieldWithKGeoBag.cc (100%) rename KEMField/Source/{2.0 => }/Plugins/KGeoBag/src/KGBEM.cc (100%) rename KEMField/Source/{2.0 => }/Plugins/KGeoBag/src/KGBEMBuilder.cc (100%) rename KEMField/Source/{2.0 => }/Plugins/KGeoBag/src/KGBEMConverter.cc (100%) rename KEMField/Source/{2.0 => }/Plugins/KGeoBag/src/KGElectromagnet.cc (100%) rename KEMField/Source/{2.0 => }/Plugins/KGeoBag/src/KGElectromagnetBuilder.cc (100%) rename KEMField/Source/{2.0 => }/Plugins/KGeoBag/src/KGElectromagnetConverter.cc (100%) rename KEMField/Source/{2.0 => }/Plugins/KGeoBag/src/KStaticElectromagnetFieldWithKGeoBag.cc (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/BoundaryIntegrals/Core/cl/kEMField_BoundaryIntegrals.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/BoundaryIntegrals/Core/include/KOpenCLBoundaryIntegralMatrix.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/BoundaryIntegrals/Core/include/KOpenCLBoundaryIntegralSolutionVector.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/BoundaryIntegrals/Core/include/KOpenCLBoundaryIntegralVector.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/BoundaryIntegrals/Core/include/KOpenCLBoundaryIntegrator.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/BoundaryIntegrals/Electrostatic/cl/kEMField_ElectrostaticBoundaryIntegrals.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/BoundaryIntegrals/Electrostatic/cl/kEMField_ElectrostaticBoundaryIntegrals_kernel.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/BoundaryIntegrals/Electrostatic/cl/kEMField_ElectrostaticConicSection.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/BoundaryIntegrals/Electrostatic/cl/kEMField_ElectrostaticLineSegment.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/BoundaryIntegrals/Electrostatic/cl/kEMField_ElectrostaticRectangle.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/BoundaryIntegrals/Electrostatic/cl/kEMField_ElectrostaticTriangle.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/BoundaryIntegrals/Electrostatic/include/KOpenCLElectrostaticBoundaryIntegrator.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/BoundaryIntegrals/Electrostatic/include/KOpenCLElectrostaticBoundaryIntegratorConfig.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/BoundaryIntegrals/Electrostatic/include/KOpenCLElectrostaticBoundaryIntegratorFactory.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/BoundaryIntegrals/Electrostatic/src/KOpenCLElectrostaticBoundaryIntegrator.cc (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/BoundaryIntegrals/Electrostatic/src/KOpenCLElectrostaticBoundaryIntegratorFactory.cc (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/BoundaryIntegrals/ElectrostaticNumeric/cl/kEMField_ElectrostaticCubatureRectangle_12Point.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/BoundaryIntegrals/ElectrostaticNumeric/cl/kEMField_ElectrostaticCubatureRectangle_33Point.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/BoundaryIntegrals/ElectrostaticNumeric/cl/kEMField_ElectrostaticCubatureRectangle_7Point.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/BoundaryIntegrals/ElectrostaticNumeric/cl/kEMField_ElectrostaticCubatureTriangle_12Point.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/BoundaryIntegrals/ElectrostaticNumeric/cl/kEMField_ElectrostaticCubatureTriangle_33Point.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/BoundaryIntegrals/ElectrostaticNumeric/cl/kEMField_ElectrostaticCubatureTriangle_7Point.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/BoundaryIntegrals/ElectrostaticNumeric/cl/kEMField_ElectrostaticCubature_CommonFunctions.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/BoundaryIntegrals/ElectrostaticNumeric/cl/kEMField_ElectrostaticNumericBoundaryIntegrals.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/BoundaryIntegrals/ElectrostaticNumeric/cl/kEMField_ElectrostaticNumericBoundaryIntegrals_kernel.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/BoundaryIntegrals/ElectrostaticNumeric/cl/kEMField_ElectrostaticQuadratureLineSegment.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/BoundaryIntegrals/ElectrostaticNumeric/include/KOpenCLElectrostaticNumericBoundaryIntegrator.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/BoundaryIntegrals/ElectrostaticNumeric/src/KOpenCLElectrostaticNumericBoundaryIntegrator.cc (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/BoundaryIntegrals/RWG/cl/kEMField_ElectrostaticRWGBoundaryIntegrals.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/BoundaryIntegrals/RWG/cl/kEMField_ElectrostaticRWGBoundaryIntegrals_kernel.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/BoundaryIntegrals/RWG/cl/kEMField_ElectrostaticRWGRectangle.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/BoundaryIntegrals/RWG/cl/kEMField_ElectrostaticRWGTriangle.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/BoundaryIntegrals/RWG/include/KOpenCLElectrostaticRWGBoundaryIntegrator.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/BoundaryIntegrals/RWG/src/KOpenCLElectrostaticRWGBoundaryIntegrator.cc (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/CMakeLists.txt (97%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/Core/cl/kEMField_ParallelReduction.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/Core/include/KOpenCLAction.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/Core/include/KOpenCLData.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/Core/include/KOpenCLHeaderWrapper.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/Core/include/KOpenCLInterface.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/Core/include/KOpenCLKernelBuilder.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/Core/src/GenerateOpenCLHeader.cc (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/Core/src/KOpenCLAction.cc (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/Core/src/KOpenCLData.cc (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/Core/src/KOpenCLInterface.cc (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/Core/src/KOpenCLKernelBuilder.cc (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElectrostaticBatchedLocalToLocalTransformation_kernel.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElectrostaticBatchedRemoteToLocalTransformation_kernel.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElectrostaticBatchedRemoteToRemoteReduce_kernel.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElectrostaticBatchedRemoteToRemoteTransformation_kernel.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElectrostaticBufferedRemoteToLocalCopyAndScale_kernel.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElectrostaticBufferedRemoteToLocalReduceAndScale_kernel.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElectrostaticLocalToLocalTransformation_kernel.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElectrostaticMultipoleDistribution_kernel.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElectrostaticMultipole_kernel.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElectrostaticRemoteToLocalCopyAndScale_kernel.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElectrostaticRemoteToLocalReduceAndScale_kernel.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElectrostaticRemoteToRemoteCopyAndScale_kernel.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElectrostaticRemoteToRemoteReduceAndScale_kernel.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElectrostaticRemoteToRemoteTransformation_kernel.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElectrostaticSparseShellMatrixVectorProduct_kernel.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElementCentroidFieldEvaluation.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElementCentroidPotentialEvaluation.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMLineSegmentMultipole.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMLineSegmentMultipoleNumerical.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMRaggedElementLookUp.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMRectangleMultipole.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMRectangleMultipoleNumerical.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMTriangleMultipole.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMTriangleMultipoleNumerical.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Electrostatics/include/KFMElectrostaticBatchedLocalToLocalConverter_OpenCL.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Electrostatics/include/KFMElectrostaticBatchedRemoteToLocalConverter_OpenCL.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Electrostatics/include/KFMElectrostaticBatchedRemoteToRemoteConverter_OpenCL.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Electrostatics/include/KFMElectrostaticBoundaryIntegratorEngine_OpenCL.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Electrostatics/include/KFMElectrostaticFastMultipoleFieldSolver_OpenCL.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Electrostatics/include/KFMElectrostaticFieldMapper_OpenCL.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Electrostatics/include/KFMElectrostaticLocalToLocalConverter_OpenCL.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Electrostatics/include/KFMElectrostaticMultipoleBatchCalculator_OpenCL.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Electrostatics/include/KFMElectrostaticMultipoleCalculator_OpenCL.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Electrostatics/include/KFMElectrostaticMultipoleDistributor_OpenCL.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Electrostatics/include/KFMElectrostaticRemoteToLocalConverter_OpenCL.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Electrostatics/include/KFMElectrostaticRemoteToRemoteConverter_OpenCL.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Electrostatics/include/KFMElectrostaticSparseBoundaryIntegralShellMatrix_MPI_OpenCL.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Electrostatics/include/KFMElectrostaticSparseBoundaryIntegralShellMatrix_OpenCL.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Electrostatics/include/KFMSparseElectrostaticBoundaryIntegratorEngine_OpenCL.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Electrostatics/src/KFMElectrostaticBatchedLocalToLocalConverter_OpenCL.cc (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Electrostatics/src/KFMElectrostaticBatchedRemoteToLocalConverter_OpenCL.cc (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Electrostatics/src/KFMElectrostaticBatchedRemoteToRemoteConverter_OpenCL.cc (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Electrostatics/src/KFMElectrostaticBoundaryIntegratorEngine_OpenCL.cc (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Electrostatics/src/KFMElectrostaticFastMultipoleFieldSolver_OpenCL.cc (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Electrostatics/src/KFMElectrostaticFieldMapper_OpenCL.cc (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Electrostatics/src/KFMElectrostaticLocalToLocalConverter_OpenCL.cc (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Electrostatics/src/KFMElectrostaticMultipoleBatchCalculator_OpenCL.cc (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Electrostatics/src/KFMElectrostaticMultipoleCalculator_OpenCL.cc (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Electrostatics/src/KFMElectrostaticMultipoleDistributor_OpenCL.cc (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Electrostatics/src/KFMElectrostaticRemoteToLocalConverter_OpenCL.cc (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Electrostatics/src/KFMElectrostaticRemoteToRemoteConverter_OpenCL.cc (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Electrostatics/src/KFMSparseElectrostaticBoundaryIntegratorEngine_OpenCL.cc (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMArrayMath.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMComplexMultiply.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMFastFourierTransformUtilities.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMFastFourierTransformUtilitiesLocal.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMFastFourierTransformUtilitiesPrivate.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMMultidimensionalFastFourierTransformLocal_kernel.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMMultidimensionalFastFourierTransformPrivate_kernel.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMMultidimensionalFastFourierTransform_kernel.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMMultipoleRotation.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMMultipoleTranslation.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMPointwiseComplexVectorAdd_kernel.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMPointwiseComplexVectorMultiply_kernel.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMRotationMatrix.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMSphericalMultipoleExpansionEvaluation.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMSphericalMultipoleExpansionEvaluation_Precomputed.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMSphericalMultipoleMath.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMVectorScale_kernel.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMZeroComplexArray_kernel.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Math/include/KFMBatchedMultidimensionalFastFourierTransform_OpenCL.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Tree/cl/kEMField_KFMBufferedReducedScalarMomentRemoteToLocalConverter_kernel.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Tree/cl/kEMField_KFMReducedScalarMomentRemoteToLocalConverter_kernel.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Tree/cl/kEMField_KFMScalarMomentApplyScaleFactor_kernel.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Tree/cl/kEMField_KFMScalarMomentArrayReduction_kernel.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Tree/cl/kEMField_KFMScalarMomentLocalToLocalConverter_kernel.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Tree/cl/kEMField_KFMScalarMomentRemoteToLocalConverter_kernel.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Tree/cl/kEMField_KFMScalarMomentRemoteToRemoteConverter_kernel.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Tree/cl/kEMField_KFMSparseScalarMomentAdd_kernel.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Tree/include/KFMReducedScalarMomentRemoteToLocalConverter_OpenCL.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Tree/include/KFMScalarMomentLocalToLocalConverter_OpenCL.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Tree/include/KFMScalarMomentRemoteToLocalConverter_OpenCL.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Tree/include/KFMScalarMomentRemoteToRemoteConverter_OpenCL.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FastMultipole/Tree/include/KFMSparseReducedScalarMomentRemoteToLocalConverter_OpenCL.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FieldSolvers/Integrating/cl/kEMField_ElectrostaticIntegratingFieldSolver_kernel.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/FieldSolvers/Integrating/include/KOpenCLElectrostaticIntegratingFieldSolver.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/IO/include/KOpenCLBufferStreamer.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/LinearAlgebra/cl/kEMField_DenseBlockSparseMatrixVectorProduct_kernel.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/LinearAlgebra/cl/kEMField_GaussSeidel_kernel.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/LinearAlgebra/cl/kEMField_LinearAlgebra.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/LinearAlgebra/cl/kEMField_LinearAlgebra_kernel.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/LinearAlgebra/cl/kEMField_RobinHood_kernel.cl (83%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/LinearAlgebra/include/KFMDenseBlockSparseMatrix_OpenCL.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/LinearAlgebra/include/KGaussSeidel_OpenCL.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/LinearAlgebra/include/KRobinHood_MPI_OpenCL.hh (98%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/LinearAlgebra/include/KRobinHood_OpenCL.hh (97%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/Math/cl/kEMField_GaussianCubature.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/Math/cl/kEMField_GaussianQuadrature.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/Math/cl/kEMField_VectorOperations.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/Surfaces/cl/kEMField_ConicSection.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/Surfaces/cl/kEMField_LineSegment.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/Surfaces/cl/kEMField_Rectangle.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/Surfaces/cl/kEMField_SolidAngle.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/Surfaces/cl/kEMField_Triangle.cl (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/Surfaces/include/KOpenCLSurfaceContainer.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/OpenCL/Surfaces/src/KOpenCLSurfaceContainer.cc (100%) rename KEMField/Source/{2.0 => }/Plugins/PETSc/CMakeLists.txt (100%) rename KEMField/Source/{2.0 => }/Plugins/PETSc/include/KPETScInterface.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/PETSc/include/KPETScSolver.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/PETSc/src/KPETScInterface.cc (100%) rename KEMField/Source/{2.0 => }/Plugins/Root/CMakeLists.txt (100%) rename KEMField/Source/{2.0 => }/Plugins/Root/include/KEMElectricFieldPointsRootFile.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/Root/include/KEMRootFieldCanvas.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/Root/include/KEMRootSVDSolver.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/Root/src/KEMElectricFieldPointsRootFile.cc (100%) rename KEMField/Source/{2.0 => }/Plugins/Root/src/KEMRootFieldCanvas.cc (100%) rename KEMField/Source/{2.0 => }/Plugins/Root/src/KEMRootSVDSolver.cc (100%) rename KEMField/Source/{2.0 => }/Plugins/VTK/CMakeLists.txt (95%) rename KEMField/Source/{2.0 => }/Plugins/VTK/include/KEMVTKElectromagnetViewer.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/VTK/include/KEMVTKFieldCanvas.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/VTK/include/KEMVTKViewer.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/VTK/include/KFMVTKElectrostaticTreeViewer.hh (96%) rename KEMField/Source/{2.0 => }/Plugins/VTK/include/KVTKIterationPlotter.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/VTK/include/KVTKResidualGraph.hh (100%) rename KEMField/Source/{2.0 => }/Plugins/VTK/src/KEMVTKElectromagnetViewer.cc (100%) rename KEMField/Source/{2.0 => }/Plugins/VTK/src/KEMVTKFieldCanvas.cc (100%) rename KEMField/Source/{2.0 => }/Plugins/VTK/src/KEMVTKViewer.cc (97%) rename KEMField/Source/{2.0 => }/Plugins/VTK/src/KFMVTKElectrostaticTreeViewer.cc (79%) rename KEMField/Source/{2.0 => }/Plugins/VTKPart2/CMakeLists.txt (89%) rename KEMField/Source/{2.0/Plugins/VTKPart2/include/KElectrostaticPotentialMap.hh => Plugins/VTKPart2/include/KElectrostaticPotentialmap.hh} (99%) rename KEMField/Source/{2.0/Plugins/VTKPart2/include/KMagnetostaticFieldMap.hh => Plugins/VTKPart2/include/KMagnetostaticFieldmap.hh} (99%) rename KEMField/Source/{2.0 => }/Plugins/VTKPart2/include/KVTKViewerAsBoundaryFieldVisitor.hh (100%) rename KEMField/Source/{2.0/Plugins/VTKPart2/src/KElectrostaticPotentialMap.cc => Plugins/VTKPart2/src/KElectrostaticPotentialmap.cc} (98%) rename KEMField/Source/{2.0/Plugins/VTKPart2/src/KMagnetostaticFieldMap.cc => Plugins/VTKPart2/src/KMagnetostaticFieldmap.cc} (98%) rename KEMField/Source/{2.0 => }/Plugins/VTKPart2/src/KVTKViewerAsBoundaryFieldVisitor.cc (100%) rename KEMField/Source/{2.0 => }/Surfaces/CMakeLists.txt (100%) rename KEMField/Source/{2.0 => }/Surfaces/include/KBasis.hh (100%) rename KEMField/Source/{2.0 => }/Surfaces/include/KBoundary.hh (100%) rename KEMField/Source/{2.0 => }/Surfaces/include/KConicSection.hh (100%) rename KEMField/Source/{2.0 => }/Surfaces/include/KElectromagneticBasis.hh (100%) rename KEMField/Source/{2.0 => }/Surfaces/include/KElectrostaticBasis.hh (100%) rename KEMField/Source/{2.0 => }/Surfaces/include/KLineSegment.hh (100%) rename KEMField/Source/{2.0 => }/Surfaces/include/KMagnetostaticBasis.hh (100%) rename KEMField/Source/{2.0 => }/Surfaces/include/KOrderedSurfaceContainer.hh (100%) rename KEMField/Source/{2.0 => }/Surfaces/include/KRectangle.hh (100%) rename KEMField/Source/{2.0 => }/Surfaces/include/KRing.hh (100%) rename KEMField/Source/{2.0 => }/Surfaces/include/KShape.hh (100%) rename KEMField/Source/{2.0 => }/Surfaces/include/KSolidAngle.hh (100%) rename KEMField/Source/{2.0 => }/Surfaces/include/KSortedSurfaceContainer.hh (100%) rename KEMField/Source/{2.0 => }/Surfaces/include/KSurface.hh (100%) rename KEMField/Source/{2.0 => }/Surfaces/include/KSurfaceAction.hh (100%) rename KEMField/Source/{2.0 => }/Surfaces/include/KSurfaceContainer.hh (100%) rename KEMField/Source/{2.0 => }/Surfaces/include/KSurfaceID.hh (100%) rename KEMField/Source/{2.0 => }/Surfaces/include/KSurfaceOrderingPredicate.hh (100%) rename KEMField/Source/{2.0 => }/Surfaces/include/KSurfacePrimitive.hh (100%) rename KEMField/Source/{2.0 => }/Surfaces/include/KSurfaceTypes.hh (100%) rename KEMField/Source/{2.0 => }/Surfaces/include/KSurfaceVisitors.hh (100%) rename KEMField/Source/{2.0 => }/Surfaces/include/KSymmetryGroup.hh (100%) rename KEMField/Source/{2.0 => }/Surfaces/include/KTriangle.hh (100%) rename KEMField/Source/{2.0 => }/Surfaces/src/KConicSection.cc (100%) rename KEMField/Source/{2.0 => }/Surfaces/src/KLineSegment.cc (100%) rename KEMField/Source/{2.0 => }/Surfaces/src/KOrderedSurfaceContainer.cc (100%) rename KEMField/Source/{2.0 => }/Surfaces/src/KRectangle.cc (100%) rename KEMField/Source/{2.0 => }/Surfaces/src/KRing.cc (100%) rename KEMField/Source/{2.0 => }/Surfaces/src/KSolidAngle.cc (100%) rename KEMField/Source/{2.0 => }/Surfaces/src/KSortedSurfaceContainer.cc (100%) rename KEMField/Source/{2.0 => }/Surfaces/src/KSurface.cc (100%) rename KEMField/Source/{2.0 => }/Surfaces/src/KSurfaceContainer.cc (100%) rename KEMField/Source/{2.0 => }/Surfaces/src/KTriangle.cc (100%) rename KEMField/Source/{2.0 => }/Tests/CMakeLists.txt (94%) rename KEMField/Source/{2.0 => }/Tests/TestAnisotropicPoisson.cc (100%) rename KEMField/Source/{2.0 => }/Tests/TestBinaryTruncation.cc (100%) rename KEMField/Source/{2.0 => }/Tests/TestCubatureSpeedStandAlone.cc (98%) rename KEMField/Source/{2.0 => }/Tests/TestCubeCapacitance.cc (99%) create mode 100644 KEMField/Source/Tests/TestDielectrics.cc rename KEMField/Source/{2.0 => }/Tests/TestDiskCapacitance.cc (100%) rename KEMField/Source/{2.0 => }/Tests/TestEMFileInterface.cc (100%) rename KEMField/Source/{2.0 => }/Tests/TestElectromagnetViewer.cc (100%) rename KEMField/Source/{2.0 => }/Tests/TestElectromagnets.cc (100%) rename KEMField/Source/{2.0 => }/Tests/TestGeometry.cc (100%) rename KEMField/Source/{2.0 => }/Tests/TestIntegratorDistRatioLineSegmentROOT.cc (100%) rename KEMField/Source/{2.0 => }/Tests/TestIntegratorDistRatioRectangleROOT.cc (100%) rename KEMField/Source/{2.0 => }/Tests/TestIntegratorDistRatioTriangleROOT.cc (100%) rename KEMField/Source/{2.0 => }/Tests/TestIntegratorFunctionality.cc (100%) rename KEMField/Source/{2.0 => }/Tests/TestIntegratorFunctionalityOpenCL.cc (100%) rename KEMField/Source/{2.0 => }/Tests/TestIntegratorLineSegmentROOTOpenCL.cc (100%) rename KEMField/Source/{2.0 => }/Tests/TestIntegratorRWG.cc (100%) rename KEMField/Source/{2.0 => }/Tests/TestIntegratorRWGAccuracy.cc (100%) rename KEMField/Source/{2.0 => }/Tests/TestIntegratorRectangleROOTOpenCL.cc (100%) rename KEMField/Source/{2.0 => }/Tests/TestIntegratorSpeed.cc (100%) rename KEMField/Source/{2.0 => }/Tests/TestIntegratorSpeedWithKbdInput.cc (100%) rename KEMField/Source/{2.0 => }/Tests/TestIntegratorTriangleROOTOpenCL.cc (100%) rename KEMField/Source/{2.0 => }/Tests/TestInverseDistance.cc (100%) rename KEMField/Source/{2.0 => }/Tests/TestKMessageInterface.cc (100%) rename KEMField/Source/{2.0 => }/Tests/TestKSP1.cc (100%) rename KEMField/Source/{2.0 => }/Tests/TestKSP2.cc (100%) rename KEMField/Source/{2.0 => }/Tests/TestOpenCL.cc (100%) rename KEMField/Source/{2.0 => }/Tests/TestOpenCLPlugin.cc (100%) rename KEMField/Source/{2.0 => }/Tests/TestPETSc.cc (100%) rename KEMField/Source/{2.0 => }/Tests/TestPETSc1.cc (100%) rename KEMField/Source/{2.0 => }/Tests/TestPETSc2.cc (100%) rename KEMField/Source/{2.0 => }/Tests/TestSVDSolver.cc (100%) rename KEMField/Source/{2.0 => }/Tests/TestSphereCapacitance.cc (100%) rename KEMField/Source/{2.0 => }/Tests/TestSuperposition.cc (99%) rename KEMField/Source/{2.0 => }/Tests/TestSymmetryGroups.cc (100%) rename KEMField/Source/{2.0 => }/Tests/TestTriangles.cc (100%) rename KEMField/Source/{2.0 => }/Tests/TestTypelists.cc (100%) rename KEMField/Source/{2.0 => }/Tests/TestVectorTypes.cc (100%) rename KEMField/Source/{2.0 => }/Tests/TestVisitor.cc (100%) rename KEMField/Source/{2.0 => }/Tests/TestZonalHarmonics.cc (100%) rename KEMField/Source/{2.0 => }/Tests/include/KElectrostaticBoundaryIntegratorOptions.hh (100%) rename KEMField/Source/{2.0/Tests => Tests/include}/TestCubatureTriangleIntegrator.hh (100%) rename KEMField/Source/{2.0/Tests => Tests/include}/TestRWGTriangleIntegrator.hh (100%) rename KEMField/Source/{2.0 => }/Visualization/CMakeLists.txt (100%) rename KEMField/Source/{2.0 => }/Visualization/include/KEMFieldCanvas.hh (100%) rename KEMField/Source/{2.0 => }/Visualization/src/KEMFieldCanvas.cc (100%) rename KEMField/Source/{2.0 => }/XML/CMakeLists.txt (100%) rename KEMField/Source/{2.0 => }/XML/Complete/ElectricFieldExplicitSuperposition.xml (100%) rename KEMField/Source/{2.0 => }/XML/Complete/ElectricFields.xml (100%) rename KEMField/Source/{2.0 => }/XML/Complete/MagneticFields.xml (100%) create mode 100644 KGeoBag/Source/Bindings/Shapes/Complex/Include/KGComplexAnnulusBuilder.hh create mode 100644 KGeoBag/Source/Shapes/Complex/Include/KGComplexAnnulus.hh create mode 100644 KGeoBag/Source/Shapes/Complex/Include/KGComplexAnnulusSurface.hh create mode 100644 KGeoBag/Source/Shapes/Complex/Source/KGComplexAnnulus.cc create mode 100644 KGeoBag/Source/Shapes/Complex/Source/KGComplexAnnulusBuilder.cc create mode 100644 Kassiopeia/Applications/Examples/Source/CrossSectionBrCalculator.cxx create mode 100644 Kassiopeia/Applications/Examples/Source/CrossSectionBthetaCalculator.cxx create mode 100644 Kassiopeia/Applications/Examples/Source/CrossSectionMagneticFieldCalculator.cxx create mode 100644 Kassiopeia/Applications/Examples/Source/MultiFileAnalysis.cxx create mode 100644 Kassiopeia/Bindings/Interactions/Include/KSIntSurfaceSpinFlipBuilder.h create mode 100644 Kassiopeia/Bindings/Interactions/Include/KSIntSurfaceUCNBuilder.h create mode 100644 Kassiopeia/Bindings/Interactions/Source/KSIntSurfaceSpinFlipBuilder.cxx create mode 100644 Kassiopeia/Bindings/Interactions/Source/KSIntSurfaceUCNBuilder.cxx create mode 100644 Kassiopeia/Bindings/Modifiers/Include/KSModSplitOnTurnBuilder.h create mode 100644 Kassiopeia/Bindings/Modifiers/Source/KSModSplitOnTurnBuilder.cxx create mode 100644 Kassiopeia/Interactions/Include/KSIntSurfaceSpinFlip.h create mode 100644 Kassiopeia/Interactions/Include/KSIntSurfaceUCN.h create mode 100644 Kassiopeia/Interactions/Source/KSIntSurfaceSpinFlip.cxx create mode 100644 Kassiopeia/Interactions/Source/KSIntSurfaceUCN.cxx create mode 100644 Kassiopeia/Modifiers/Include/KSModSplitOnTurn.h create mode 100644 Kassiopeia/Modifiers/Source/KSModSplitOnTurn.cxx create mode 100644 Kassiopeia/Python/CMakeLists.txt create mode 100644 Kassiopeia/Python/KassiopeiaReader.py create mode 100644 Kassiopeia/Writers/Source/KSWriteHDF5.cxx create mode 100644 Kommon/Boost/Utility/KPathUtils.h diff --git a/.gitignore b/.gitignore index 991d1e971..971a06926 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ /*Build* /*install* /*Install* +/IndependentKassiopeia/ *~ *.bak *.tmp @@ -35,4 +36,3 @@ Kasper.config Kasper.creator Kasper.files Kasper.includes - diff --git a/CMakeLists.txt b/CMakeLists.txt index 75de7dea4..df14b79e5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,13 @@ -cmake_minimum_required( VERSION 2.8.6 ) +set( CMAKE_MINIMUM_VERSION "2.8.6" ) +cmake_minimum_required( VERSION ${CMAKE_MINIMUM_VERSION} ) +# project version +set( KASPER_VERSION_MAJOR 3 ) +set( KASPER_VERSION_MINOR 5 ) +set( KASPER_VERSION_PATCH 0 ) +set( KASPER_VERSION "${KASPER_VERSION_MAJOR}.${KASPER_VERSION_MINOR}.${KASPER_VERSION_PATCH}" ) + +#project( Kasper VERSION ${KASPER_VERSION} ) project( Kasper ) set( CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/Kommon/cmake ) @@ -42,9 +50,9 @@ option( BUILD_KEMFIELD ${BUILD_KEMFIELD_DESC} ON ) set( BUILD_KASSIOPEIA_DESC "Build Kassiopeia [particle tracking simulation system]" ) option( BUILD_KASSIOPEIA ${BUILD_KASSIOPEIA_DESC} ON ) -#set( CMAKE_C_FLAGS ${CMAKE_C_FLAGS_INIT} ) -#set( CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS_INIT} ) -#set( CMAKE_EXE_LINKER_FLAG ${CMAKE_EXE_LINKER_FLAGS_INIT} ) +set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Werror" ) +set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror" ) +#set( CMAKE_EXE_LINKER_FLAG "${CMAKE_EXE_LINKER_FLAGS}" ) if (CMAKE_BUILD_TYPE MATCHES Rel) option( COMPILER_TUNE_OPTIONS "Enable additional tuning options [compiles for local CPU, use with care!]" OFF ) @@ -56,12 +64,12 @@ if (CMAKE_BUILD_TYPE MATCHES Rel) endif() endif() -option( COMPILER_ENABLE_PROFILING "Enable profiling( gprof-based, adds -pg flag to GCC calls )" OFF ) -if( COMPILER_ENABLE_PROFILING ) - set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -pg" ) - set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -pg" ) - set( CMAKE_EXE_LINKER_FLAGS" ${CMAKE_EXE_LINKER_FLAGS} -g -pg" ) -endif() +#option( COMPILER_ENABLE_PROFILING "Enable profiling( gprof-based, adds -pg flag to GCC calls )" OFF ) +#if( COMPILER_ENABLE_PROFILING ) +# set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -pg" ) +# set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -pg" ) +# set( CMAKE_EXE_LINKER_FLAGS" ${CMAKE_EXE_LINKER_FLAGS} -g -pg" ) +#endif() if (CMAKE_COMPILER_IS_GNUCXX) option( GCC_FORCE_LINKING "Fix linker errors with some GCC versions by adding the --no-as-needed flag" ON ) @@ -75,7 +83,7 @@ if (CMAKE_COMPILER_IS_GNUCXX) set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftrack-macro-expansion=1" ) endif( GCC_REDUCE_MEMORY ) - option( GCC_ENABLE_PIPES "Use pipes to speed up compiling with GCC by adding the -pipe flag" OFF ) + option( GCC_ENABLE_PIPES "Use pipes to speed up compiling with GCC by adding the -pipe flag" ON ) if( GCC_ENABLE_PIPES ) set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pipe" ) set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pipe" ) @@ -86,11 +94,19 @@ mark_as_advanced( CLEAR CMAKE_VERBOSE_MAKEFILE ) # Global dependency options -option( KASPER_USE_BOOST "Build Boost dependent modules" OFF ) +option( KASPER_USE_BOOST "Build Boost dependent modules" ON ) option( KASPER_USE_ROOT "Build ROOT dependent modules" ON ) option( KASPER_USE_GSL "Build GSL dependent modules" OFF ) option( KASPER_USE_VTK "Build VTK dependent modules" OFF ) -option( KASPER_USE_TBB "Build TBB dependent modules" OFF ) + +# Advanced options mainly for testing +option( KASPER_EXPERIMENTAL "Enable some experimental features" OFF ) +if( KASPER_EXPERIMENTAL ) + option( KASPER_USE_TBB "Build TBB dependent modules" OFF ) + if( KASPER_USE_TBB ) + message( "WARNING: Enabling TBB can produce inconsistent or wrong results in KaFit. It is strongly recommended to leave this option disabled until further investigation." ) + endif() +endif( KASPER_EXPERIMENTAL ) # Make sure all dependencies are being built # Every module must be listed before its dependencies and activate ONLY its @@ -106,6 +122,7 @@ endif() if( BUILD_KGEOBAG ) set( BUILD_KOMMON ON CACHE BOOL "${BUILD_KOMMON_DESC} (Required)" FORCE ) + set( KASPER_USE_GSL ON CACHE BOOL "(Required)" FORCE ) endif() @@ -114,6 +131,8 @@ endif() if( BUILD_KOMMON ) add_subdirectory( Kommon ) + + set( KASPER_USE_BOOST ON CACHE BOOL "(Required)" FORCE ) endif() if( BUILD_KGEOBAG ) @@ -128,10 +147,6 @@ if( BUILD_KASSIOPEIA ) add_subdirectory( Kassiopeia ) endif() -if( BUILD_KTEMPLATE ) - add_subdirectory( KTemplate ) -endif() - #add_subdirectory( Documentation ) install( EXPORT KasperTargets DESTINATION ${CMAKE_INSTALL_DIR} ) diff --git a/KEMField/CMakeLists.txt b/KEMField/CMakeLists.txt index c7fab67f4..868cf5ad4 100644 --- a/KEMField/CMakeLists.txt +++ b/KEMField/CMakeLists.txt @@ -1,18 +1,20 @@ -cmake_minimum_required( VERSION 2.8.6 ) +cmake_minimum_required( VERSION ${CMAKE_MINIMUM_VERSION} ) +# KEMField version +set(MODULE_VERSION_MAJOR 3) +set(MODULE_VERSION_MINOR 0) +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) if(POLICY CMP0053) cmake_policy(SET CMP0053 OLD) endif() -# Module version -set(MODULE_VERSION_MAJOR 2) -set(MODULE_VERSION_MINOR 1) -set(MODULE_VERSION_PATCH 0) -set(MODULE_VERSION "${MODULE_VERSION_MAJOR}.${MODULE_VERSION_MINOR}.${MODULE_VERSION_PATCH}") - # paths kasper_module_paths( KEMField ) @@ -49,7 +51,8 @@ add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/data) # NOTE: If files in a subdirectory INCLUDE HEADERS from other subdirectories, # this subdirectory has to come AFTER those other directories. # Otherwise you will encounter strange linker or even compiler errors. -set (SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/Source/2.0) +set (SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/Source) + add_subdirectory(${SOURCE}/Core) add_subdirectory(${SOURCE}/Exceptions) add_subdirectory(${SOURCE}/IO/HashGenerator) diff --git a/KEMField/Source/2.0/Plugins/Bindings/Fields/Electric/include/KElectrostaticBoundaryFieldBuilder.hh b/KEMField/Source/2.0/Plugins/Bindings/Fields/Electric/include/KElectrostaticBoundaryFieldBuilder.hh deleted file mode 100644 index 967770120..000000000 --- a/KEMField/Source/2.0/Plugins/Bindings/Fields/Electric/include/KElectrostaticBoundaryFieldBuilder.hh +++ /dev/null @@ -1,186 +0,0 @@ -/* - * KElectrostaticBoundaryFieldBuilder.hh - * - * Created on: 17 Jun 2015 - * Author: wolfgang - */ - -#ifndef KEMFIELD_SOURCE_2_0_PLUGINS_BINDINGS_FIELDS_ELECTRIC_INCLUDE_KELECTROSTATICBOUNDARYFIELDBUILDER_HH_ -#define KEMFIELD_SOURCE_2_0_PLUGINS_BINDINGS_FIELDS_ELECTRIC_INCLUDE_KELECTROSTATICBOUNDARYFIELDBUILDER_HH_ - -#include "KEMBindingsMessage.hh" -#include "KSmartPointerRelease.hh" -#include "KComplexElement.hh" -#include "KElectrostaticBoundaryFieldWithKGeoBag.hh" -#include "KSmartPointerRelease.hh" - -namespace katrin { - -typedef KComplexElement< KEMField::KElectrostaticBoundaryFieldWithKGeoBag> -KElectrostaticBoundaryFieldBuilder; - -template< > -inline bool KElectrostaticBoundaryFieldBuilder::AddAttribute( KContainer* aContainer ) -{ - if( aContainer->GetName() == "name" ) - { - std::string name; - aContainer->CopyTo(name); - fObject->SetName(name); - SetName(name); - } - else if( aContainer->GetName() == "directory" ) - { - aContainer->CopyTo( fObject, &KEMField::KElectrostaticBoundaryFieldWithKGeoBag::SetDirectory ); - } - else if( aContainer->GetName() == "file" ) - { - aContainer->CopyTo( fObject, &KEMField::KElectrostaticBoundaryFieldWithKGeoBag::SetFile ); - } - else if( aContainer->GetName() == "system" ) - { - KGeoBag::KGSpace* tSpace = KGeoBag::KGInterface::GetInstance()->RetrieveSpace( aContainer->AsReference< string >() ); - - if( tSpace == NULL ) - { - BINDINGMSG( eWarning ) << "no spaces found for specifier <" << aContainer->AsReference< string >() << ">" << eom; - return false; - } - - fObject->SetSystem( tSpace ); - } - else if( aContainer->GetName() == "surfaces" ) - { - std::vector< KGeoBag::KGSurface* > tSurfaces = KGeoBag::KGInterface::GetInstance()->RetrieveSurfaces( aContainer->AsReference< string >() ); - std::vector< KGeoBag::KGSurface* >::const_iterator tSurfaceIt; - KGeoBag::KGSurface* tSurface; - - if( tSurfaces.size() == 0 ) - { - BINDINGMSG( eWarning ) << "no surfaces found for specifier <" << aContainer->AsReference< string >() << ">" << eom; - return false; - } - - for( tSurfaceIt = tSurfaces.begin(); tSurfaceIt != tSurfaces.end(); tSurfaceIt++ ) - { - tSurface = *tSurfaceIt; - fObject->AddSurface( tSurface ); - } - } - else if( aContainer->GetName() == "spaces" ) - { - std::vector< KGeoBag::KGSpace* > tSpaces = KGeoBag::KGInterface::GetInstance()->RetrieveSpaces( aContainer->AsReference< string >() ); - std::vector< KGeoBag::KGSpace* >::const_iterator tSpaceIt; - KGeoBag::KGSpace* tSpace; - - if( tSpaces.size() == 0 ) - { - BINDINGMSG( eWarning ) << "no spaces found for specifier <" << aContainer->AsReference< string >() << ">" << eom; - return false; - } - - for( tSpaceIt = tSpaces.begin(); tSpaceIt != tSpaces.end(); tSpaceIt++ ) - { - tSpace = *tSpaceIt; - fObject->AddSpace( tSpace ); - } - } - else if( aContainer->GetName() == "symmetry" ) - { - if( aContainer->AsReference< string >() == "none" ) - { - fObject->SetSymmetry( KEMField::KElectrostaticBoundaryFieldWithKGeoBag::NoSymmetry ); - return true; - } - if( aContainer->AsReference< string >() == "axial" ) - { - fObject->SetSymmetry( KEMField::KElectrostaticBoundaryFieldWithKGeoBag::AxialSymmetry ); - return true; - } - if( aContainer->AsReference< string >() == "discrete_axial" ) - { - fObject->SetSymmetry( KEMField::KElectrostaticBoundaryFieldWithKGeoBag::DiscreteAxialSymmetry ); - return true; - } - BINDINGMSG( eWarning ) << "symmetry must be , , or " << eom; - return false; - } - else if( aContainer->GetName() == "hash_masked_bits" ) - { - aContainer->CopyTo( fObject, &KEMField::KElectrostaticBoundaryFieldWithKGeoBag::SetHashMaskedBits ); - } - else if( aContainer->GetName() == "hash_threshold" ) - { - aContainer->CopyTo( fObject, &KEMField::KElectrostaticBoundaryFieldWithKGeoBag::SetHashThreshold ); - } - else if( aContainer->GetName() == "minimum_element_area" ) - { - aContainer->CopyTo( fObject, &KEMField::KElectrostaticBoundaryFieldWithKGeoBag::SetMinimumElementArea); - } - else if( aContainer->GetName() == "maximum_element_aspect_ratio" ) - { - aContainer->CopyTo( fObject, &KEMField::KElectrostaticBoundaryFieldWithKGeoBag::SetMaximumElementAspectRatio); - } - else return false; - return true; -} - -template< > -inline bool KElectrostaticBoundaryFieldBuilder::AddElement( KContainer* anElement ) -{ - if(anElement->Is()) - { - if(!(fObject->GetChargeDensitySolver()) ){ - KEMField::KSmartPointer solver = - ReleaseToSmartPtr(anElement); - fObject->SetChargeDensitySolver(solver); - } - else{ - BINDINGMSG(eError) << "Cannot set more than one charge density solver for field " << GetName() << "!"<< eom; - } - } - else if(anElement->Is()) - { - if(!(fObject->GetFieldSolver()) ){ - KEMField::KSmartPointer solver = - ReleaseToSmartPtr(anElement); - fObject->SetFieldSolver(solver); - } - else{ - BINDINGMSG(eError) << "Cannot set more than one field solver for field " << GetName() << "!"<< eom; - } - } - else if(anElement->Is()) - { - KEMField::KSmartPointer visitor = - ReleaseToSmartPtr(anElement); - fObject->AddVisitor(visitor); - } - else return false; - return true; -} - -template< > -inline bool KElectrostaticBoundaryFieldBuilder::End() { - if(!fObject->GetChargeDensitySolver() && !fObject->GetFieldSolver()) - { - BINDINGMSG( eError ) << " No charge density solver and no field solver" - " set in field " << GetName() << "!" << eom; - } - else if(!fObject->GetChargeDensitySolver()) - { - BINDINGMSG( eError ) << " No charge density solver" - " set in field " << GetName() << "!" << eom; - } - else if(!fObject->GetFieldSolver()) - { - BINDINGMSG( eError ) << " No field solver" - " set in field " << GetName() << "!" << eom; - } - else return true; - return false; -} - -} // katrin - -#endif /* KEMFIELD_SOURCE_2_0_PLUGINS_BINDINGS_FIELDS_ELECTRIC_INCLUDE_KELECTROSTATICBOUNDARYFIELDBUILDER_HH_ */ diff --git a/KEMField/Source/2.0/Plugins/Bindings/Fields/Magnetic/src/KMagnetostaticFieldmapBuilder.cc b/KEMField/Source/2.0/Plugins/Bindings/Fields/Magnetic/src/KMagnetostaticFieldmapBuilder.cc deleted file mode 100644 index 09420aa79..000000000 --- a/KEMField/Source/2.0/Plugins/Bindings/Fields/Magnetic/src/KMagnetostaticFieldmapBuilder.cc +++ /dev/null @@ -1,62 +0,0 @@ -/* - * KMagnetostaticFieldMapBuilder.cc - * - * Created on: 27 May 2016 - * Author: wolfgang - */ - -#include "KMagnetostaticFieldmapBuilder.hh" -#include "KMagnetostaticConstantFieldBuilder.hh" -#include "KMagneticDipoleFieldBuilder.hh" -#include "KMagnetostaticBoundaryFieldBuilder.hh" -#include "KEMToolboxBuilder.hh" - -using namespace KEMField; -namespace katrin { - -template< > -KMagnetostaticFieldmapBuilder::~KComplexElement() -{ -} - -STATICINT sKMagnetostaticFieldmapStructure = - KMagnetostaticFieldmapBuilder::Attribute< string >( "name" ) + - KMagnetostaticFieldmapBuilder::Attribute< string >( "directory" ) + - KMagnetostaticFieldmapBuilder::Attribute< string >( "file" ) + - KMagnetostaticFieldmapBuilder::Attribute< string >( "interpolation" ); - -STATICINT sKMagnetostaticFieldmap = - KEMToolboxBuilder::ComplexElement< KMagnetostaticFieldmap >( "magnetic_fieldmap" ); - -//////////////////////////////////////////////////////////////////// - -template< > -KMagnetostaticFieldmapCalculatorBuilder::~KComplexElement() -{ -} - -STATICINT sKMagnetostaticFieldmapCalculatorStructure = - KMagnetostaticFieldmapCalculatorStructure::Attribute< string >( "name" ) + - KMagnetostaticFieldmapCalculatorStructure::Attribute< string >( "directory" ) + - KMagnetostaticFieldmapCalculatorStructure::Attribute< string >( "file" ) + - KMagnetostaticFieldmapCalculatorStructure::Attribute< KEMStreamableThreeVector >( "center" ) + - KMagnetostaticFieldmapCalculatorStructure::Attribute< KEMStreamableThreeVector >( "length" ) + - KMagnetostaticFieldmapCalculatorStructure::Attribute< bool >( "mirror_x" ) + - KMagnetostaticFieldmapCalculatorStructure::Attribute< bool >( "mirror_y" ) + - KMagnetostaticFieldmapCalculatorStructure::Attribute< bool >( "mirror_z" ) + - KMagnetostaticFieldmapCalculatorStructure::Attribute< double >( "spacing" ) + - KMagnetostaticFieldmapCalculatorStructure::Attribute< string >( "spaces" ) + - KMagnetostaticFieldmapCalculatorStructure::Attribute< string >( "field") + - // support of deprecated old xml: - KMagnetostaticFieldmapCalculatorStructure:: - ComplexElement< KMagnetoostaticConstantField >( "field_magnetic_constant" ) + - KMagnetostaticFieldmapCalculatorStructure:: - ComplexElement< KMagneticDipoleFieldBuilder >( "field_magnetic_dipole" ) + - KMagnetostaticFieldmapCalculatorStructure:: - ComplexElement< KMagnetostaticBoundaryFieldWithKGeoBag >( "field_electromagnet" ); - -STATICINT sKMagnetostaticFieldmapCalculator = - KEMToolboxBuilder::ComplexElement< KMagnetostaticFieldmapCalculator >( "magnetic_fieldmap_calculator" ); - - -} /* namespace katrin */ diff --git a/KEMField/Source/2.0/Applications/ApplicationFiles/.gitignore b/KEMField/Source/Applications/ApplicationFiles/.gitignore similarity index 100% rename from KEMField/Source/2.0/Applications/ApplicationFiles/.gitignore rename to KEMField/Source/Applications/ApplicationFiles/.gitignore diff --git a/KEMField/Source/2.0/Applications/AspectRatioFromKbdROOT.cc b/KEMField/Source/Applications/AspectRatioFromKbdROOT.cc similarity index 100% rename from KEMField/Source/2.0/Applications/AspectRatioFromKbdROOT.cc rename to KEMField/Source/Applications/AspectRatioFromKbdROOT.cc diff --git a/KEMField/Source/2.0/Applications/CMakeLists.txt b/KEMField/Source/Applications/CMakeLists.txt similarity index 83% rename from KEMField/Source/2.0/Applications/CMakeLists.txt rename to KEMField/Source/Applications/CMakeLists.txt index 734e68edd..954740310 100644 --- a/KEMField/Source/2.0/Applications/CMakeLists.txt +++ b/KEMField/Source/Applications/CMakeLists.txt @@ -92,6 +92,14 @@ add_executable (InspectEMFile ${CMAKE_CURRENT_SOURCE_DIR}/InspectEMFile.cc) target_link_libraries (InspectEMFile ${APPLICATIONS_LIBS} ) +add_executable (WriteKbdToAscii + ${CMAKE_CURRENT_SOURCE_DIR}/WriteKbdToAscii.cc) +target_link_libraries (WriteKbdToAscii ${APPLICATIONS_LIBS} ) + +add_executable (WriteAsciiToPCD + ${CMAKE_CURRENT_SOURCE_DIR}/WriteAsciiToPCD.cc) +target_link_libraries (WriteAsciiToPCD ${APPLICATIONS_LIBS} ) + kasper_install_executables ( ComputeChargeDensities ComputeChargeDensitiesFromElcd33File @@ -100,6 +108,8 @@ kasper_install_executables ( TransferEMElement HashEMGeometry InspectEMFile + WriteKbdToAscii + WriteAsciiToPCD ) if (@PROJECT_NAME@_USE_ROOT) @@ -115,7 +125,7 @@ if (@PROJECT_NAME@_USE_ROOT) add_executable (DistanceRatioFromKbdROOT ${CMAKE_CURRENT_SOURCE_DIR}/DistanceRatioFromKbdROOT.cc) target_link_libraries (DistanceRatioFromKbdROOT ${APPLICATIONS_LIBS} ) - + kasper_install_executables ( AspectRatioFromKbdROOT CompareFieldsAndPotentialsROOT @@ -143,3 +153,21 @@ install (DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/ApplicationFiles ) endif (@PROJECT_NAME@_USE_VTK) + +#PCL Stuff +#cmake_minimum_required(VERSION 2.8 FATAL_ERROR) + +#project(greedy_projection) + +#find_package(PCL 1.2 REQUIRED) + +#include_directories(${PCL_INCLUDE_DIRS}) +#link_directories(${PCL_LIBRARY_DIRS}) +#add_definitions(${PCL_DEFINITIONS}) + +#add_executable (greedy_projection ${CMAKE_CURRENT_SOURCE_DIR}/greedy_projection.cpp) +#target_link_libraries (greedy_projection ${PCL_LIBRARIES}) + +#kasper_install_executables ( +# greedy_projection +# ) diff --git a/KEMField/Source/2.0/Applications/CompareFieldsAndPotentialsROOT.cc b/KEMField/Source/Applications/CompareFieldsAndPotentialsROOT.cc similarity index 100% rename from KEMField/Source/2.0/Applications/CompareFieldsAndPotentialsROOT.cc rename to KEMField/Source/Applications/CompareFieldsAndPotentialsROOT.cc diff --git a/KEMField/Source/2.0/Applications/ComputeChargeDensities.cc b/KEMField/Source/Applications/ComputeChargeDensities.cc similarity index 100% rename from KEMField/Source/2.0/Applications/ComputeChargeDensities.cc rename to KEMField/Source/Applications/ComputeChargeDensities.cc diff --git a/KEMField/Source/2.0/Applications/ComputeChargeDensitiesFromElcd33File.cc b/KEMField/Source/Applications/ComputeChargeDensitiesFromElcd33File.cc similarity index 100% rename from KEMField/Source/2.0/Applications/ComputeChargeDensitiesFromElcd33File.cc rename to KEMField/Source/Applications/ComputeChargeDensitiesFromElcd33File.cc diff --git a/KEMField/Source/2.0/Applications/ComputeSphericalCapacitor.cc b/KEMField/Source/Applications/ComputeSphericalCapacitor.cc similarity index 100% rename from KEMField/Source/2.0/Applications/ComputeSphericalCapacitor.cc rename to KEMField/Source/Applications/ComputeSphericalCapacitor.cc diff --git a/KEMField/Source/2.0/Applications/DistanceRatioFromKbdROOT.cc b/KEMField/Source/Applications/DistanceRatioFromKbdROOT.cc similarity index 100% rename from KEMField/Source/2.0/Applications/DistanceRatioFromKbdROOT.cc rename to KEMField/Source/Applications/DistanceRatioFromKbdROOT.cc diff --git a/KEMField/Source/2.0/Applications/HashEMGeometry.cc b/KEMField/Source/Applications/HashEMGeometry.cc similarity index 100% rename from KEMField/Source/2.0/Applications/HashEMGeometry.cc rename to KEMField/Source/Applications/HashEMGeometry.cc diff --git a/KEMField/Source/2.0/Applications/InspectEMFile.cc b/KEMField/Source/Applications/InspectEMFile.cc similarity index 100% rename from KEMField/Source/2.0/Applications/InspectEMFile.cc rename to KEMField/Source/Applications/InspectEMFile.cc diff --git a/KEMField/Source/2.0/Applications/KdbConverter.cc b/KEMField/Source/Applications/KdbConverter.cc similarity index 100% rename from KEMField/Source/2.0/Applications/KdbConverter.cc rename to KEMField/Source/Applications/KdbConverter.cc diff --git a/KEMField/Source/2.0/Applications/TransferEMElement.cc b/KEMField/Source/Applications/TransferEMElement.cc similarity index 100% rename from KEMField/Source/2.0/Applications/TransferEMElement.cc rename to KEMField/Source/Applications/TransferEMElement.cc diff --git a/KEMField/Source/2.0/Applications/VisualizeEMGeometry.cc b/KEMField/Source/Applications/VisualizeEMGeometry.cc similarity index 90% rename from KEMField/Source/2.0/Applications/VisualizeEMGeometry.cc rename to KEMField/Source/Applications/VisualizeEMGeometry.cc index 0ba64db6e..3f789b736 100644 --- a/KEMField/Source/2.0/Applications/VisualizeEMGeometry.cc +++ b/KEMField/Source/Applications/VisualizeEMGeometry.cc @@ -32,14 +32,14 @@ int main(int argc, char* argv[]) "Usage: VisualizeEMGeometry \n" "\n" "This program takes a KEMField geometry file and produces a ParaView file of the\n" - "geometry.\n" + "geometry ('.vtp').\n" "\n" "\tAvailable options:\n" "\t -h, --help (shows this message and exits)\n" - "\t -n, --name (name of surface container)\n" + "\t -n, --name (required; name of surface container, e.g from InspectEMFile)\n" "\t -d, --display (bool; display geometry on screen)\n"; - if (argc == 1) + if (argc <= 2) // --name is a required argument { std::cout<Read(inFileName,surfaceContainer,name); KEMVTKViewer viewer(surfaceContainer); - viewer.GenerateGeometryFile(outFileName); + + viewer.GenerateGeometryFile(outFileName + std::string(".vtp")); if (display) viewer.ViewGeometry(); diff --git a/KEMField/Source/Applications/WriteAsciiToPCD.cc b/KEMField/Source/Applications/WriteAsciiToPCD.cc new file mode 100644 index 000000000..5b0c8fa87 --- /dev/null +++ b/KEMField/Source/Applications/WriteAsciiToPCD.cc @@ -0,0 +1,181 @@ +// WriteAsciiToMSH +// This program converts the ASCII output triangles.txt of WriteKbdToAscii into an MSH file. +// Author: Zachary Bogorad +// Date: 07.02.2016 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +int main(int argc, char* argv[]) +{ + + std::string usage = + "\n" + "Usage: WriteAsciiToPCD \n" + "\n" + "This program translates ASCII triangles.txt files from WriteKbdToAscii into PCD files.\n" + "\n" + "\tAvailable options:\n" + "\t -h, --help (shows this message and exits)\n" + "\t -f, --file (specify the input triangles.txt file)\n" + "\n"; + + static struct option longOptions[] = { + {"help", no_argument, 0, 'h'}, + {"file", required_argument, 0, 'f'} + }; + + static const char *optString = "ha:b:n:m:s:"; + + std::string inFile = ""; + + while(1) + { + char optId = getopt_long(argc, argv, optString, longOptions, NULL); + if(optId == -1){ + break; + } + switch(optId) { + case('h'): // help + std::cout< xlist; + std::vector ylist; + std::vector zlist; + std::vector xnlist; + std::vector ynlist; + std::vector znlist; + + while ( getline (fileReader,line) ) + { + //Input format is L1 | L2 | P0.x | P0.y | P0.z | N1.x | N1.y | N1.z | N2.x | N2.y | N2.z | (charge density value) + std::string temp = line; + char* token = strtok (&temp[0], "\t"); + if(token!=NULL && token[0]!='p'){ + //Skip lengths + token = strtok (NULL, "\t"); + token = strtok (NULL, "\t"); + + // Get coordinates + xlist.push_back(std::stod(token)); + token = strtok (NULL, "\t"); + ylist.push_back(std::stod(token)); + token = strtok (NULL, "\t"); + zlist.push_back(std::stod(token)); + token = strtok (NULL, "\t"); + + //Get edge vectors + double xn1 = std::stod(token); + token = strtok (NULL, "\t"); + double yn1 = std::stod(token); + token = strtok (NULL, "\t"); + double zn1 = std::stod(token); + token = strtok (NULL, "\t"); + + double xn2 = std::stod(token); + token = strtok (NULL, "\t"); + double yn2 = std::stod(token); + token = strtok (NULL, "\t"); + double zn2 = std::stod(token); + token = strtok (NULL, "\t"); + + // Calculate normal vector + double xn = yn1*zn2 - yn2*zn1; + xnlist.push_back(xn); + double yn = zn1*xn2 - zn2*xn1; + ynlist.push_back(yn); + double zn = xn1*yn2 - xn2*yn1; + znlist.push_back(zn); + + //Skip charge + token = strtok (NULL, "\t"); + + } + // while (token != NULL) + // { + // //std::cout << "Token: " << token << "\n"; + // if(token!=NULL && token[0]!='p'){ + // double value = std::stod(token); + // //std::cout << "Value: " << value << "\n"; + // } + // else{ + // //std::cout << "Not a number.\n"; + // } + // token = strtok (NULL, "\t"); + // } + } + fileReader.close(); + + // Write the header + + fileWriter << "VERSION .7\n"; + //fileWriter << "FIELDS x y z normal_x normal_y normal_z\n"; + fileWriter << "FIELDS x y z\n"; + // fileWriter << "SIZE 8 8 8 8 8 8\n"; + fileWriter << "SIZE 8 8 8\n"; + // fileWriter << "TYPE F F F F F F\n"; + fileWriter << "TYPE F F F\n"; + // fileWriter << "COUNT 1 1 1 1 1 1\n"; + fileWriter << "COUNT 1 1 1\n"; + fileWriter << "WIDTH " << xlist.size() << "\n"; + fileWriter << "HEIGHT 1\n"; + //fileWriter << "VIEWPOINT 0 0 0 1 0 0 0\n"; //optional + fileWriter << "POINTS " << xlist.size() << "\n"; + fileWriter << "DATA ascii\n"; + + for (unsigned int i = 0; i < xlist.size(); i++ ){ + // fileWriter << xlist[i] << " " << ylist[i] << " " << zlist[i] << " " << xnlist[i] << " " << ynlist[i] << " " << znlist[i] << "\n"; + fileWriter << xlist[i] << " " << ylist[i] << " " << zlist[i] << "\n"; + } + + fileWriter.close(); + + return 0; + +} diff --git a/KEMField/Source/2.0/Applications/WriteKbdToAscii.cc b/KEMField/Source/Applications/WriteKbdToAscii.cc similarity index 98% rename from KEMField/Source/2.0/Applications/WriteKbdToAscii.cc rename to KEMField/Source/Applications/WriteKbdToAscii.cc index a6c72fbb8..520182d6f 100644 --- a/KEMField/Source/2.0/Applications/WriteKbdToAscii.cc +++ b/KEMField/Source/Applications/WriteKbdToAscii.cc @@ -166,7 +166,7 @@ int main(int argc, char* argv[]) "\n" "Usage: WriteKbdToAscii \n" "\n" - "This program takes two KEMField files and compares the charge density values. These files must contain the same geometry.\n" + "This program translates .kbd files into three ASCII files.\n" "\n" "\tAvailable options:\n" "\t -h, --help (shows this message and exits)\n" diff --git a/KEMField/Source/Applications/greedy_projection.cpp b/KEMField/Source/Applications/greedy_projection.cpp new file mode 100644 index 000000000..8c7b8768f --- /dev/null +++ b/KEMField/Source/Applications/greedy_projection.cpp @@ -0,0 +1,209 @@ +#include +#include +#include +#include +#include + +int +main (int argc, char** argv) +{ + // Load input file into a PointCloud with an appropriate type + pcl::PointCloud::Ptr cloud (new pcl::PointCloud); + pcl::PCLPointCloud2 cloud_blob; + pcl::io::loadPCDFile ("/home/zach/Work/pcl-pcl-1.8.0/test/bun0.pcd", cloud_blob); + pcl::fromPCLPointCloud2 (cloud_blob, *cloud); + //* the data should be available in cloud + + // Normal estimation* + pcl::NormalEstimation n; + pcl::PointCloud::Ptr normals (new pcl::PointCloud); + pcl::search::KdTree::Ptr tree (new pcl::search::KdTree); + tree->setInputCloud (cloud); + n.setInputCloud (cloud); + n.setSearchMethod (tree); + n.setKSearch (20); + n.compute (*normals); + //* normals should not contain the point normals + surface curvatures + + // Concatenate the XYZ and normal fields* + pcl::PointCloud::Ptr cloud_with_normals (new pcl::PointCloud); + pcl::concatenateFields (*cloud, *normals, *cloud_with_normals); + //* cloud_with_normals = cloud + normals + + // Create search tree* + pcl::search::KdTree::Ptr tree2 (new pcl::search::KdTree); + tree2->setInputCloud (cloud_with_normals); + + // Initialize objects + pcl::GreedyProjectionTriangulation gp3; + pcl::PolygonMesh triangles; + + // Set the maximum distance between connected points (maximum edge length) + gp3.setSearchRadius (0.025); + + // Set typical values for the parameters + gp3.setMu (2.5); + gp3.setMaximumNearestNeighbors (100); + gp3.setMaximumSurfaceAngle(M_PI/4); // 45 degrees + gp3.setMinimumAngle(M_PI/18); // 10 degrees + gp3.setMaximumAngle(2*M_PI/3); // 120 degrees + gp3.setNormalConsistency(false); + + // Get result + gp3.setInputCloud (cloud_with_normals); + gp3.setSearchMethod (tree2); + gp3.reconstruct (triangles); + + // Additional vertex information + std::vector parts = gp3.getPartIDs(); + std::vector states = gp3.getPointStates(); + + // Finish + return (0); +} + +// #include +// #include +// #include +// #include +// +// #include +// #include +// #include +// #include +// #include +// +// #include +// +// int +// main (int argc, char** argv) +// { +// +// std::string usage = +// "\n" +// "Usage: WriteAsciiToMSH \n" +// "\n" +// "This program creates a triangular mesh from an MSH file.\n" +// "\n" +// "\tAvailable options:\n" +// "\t -h, --help (shows this message and exits)\n" +// "\t -f, --file (specify the input triangles.txt file)\n" +// "\n"; +// +// static struct option longOptions[] = { +// {"help", no_argument, 0, 'h'}, +// {"file", required_argument, 0, 'f'} +// }; +// +// static const char *optString = "ha:b:n:m:s:"; +// +// std::string inFile = ""; +// +// while(1) +// { +// char optId = getopt_long(argc, argv, optString, longOptions, NULL); +// if(optId == -1){ +// break; +// } +// switch(optId) { +// case('h'): // help +// std::cout< with an appropriate type +// pcl::PointCloud::Ptr cloud (new pcl::PointCloud); +// pcl::PCLPointCloud2 cloud_blob; +// pcl::io::loadPCDFile (inFile, cloud_blob); +// pcl::fromPCLPointCloud2 (cloud_blob, *cloud); +// //* the data should be available in cloud +// +// // Normal estimation* +// pcl::NormalEstimation n; +// pcl::PointCloud::Ptr normals (new pcl::PointCloud); +// pcl::search::KdTree::Ptr tree (new pcl::search::KdTree); +// tree->setInputCloud (cloud); +// n.setInputCloud (cloud); +// n.setSearchMethod (tree); +// n.setKSearch (20); +// n.compute (*normals); +// //* normals should not contain the point normals + surface curvatures +// +// // Concatenate the XYZ and normal fields* +// pcl::PointCloud::Ptr cloud_with_normals (new pcl::PointCloud); +// pcl::concatenateFields (*cloud, *normals, *cloud_with_normals); +// //* cloud_with_normals = cloud + normals +// +// //Simplified version using pre-determined normals +// +// // pcl::PointCloud::Ptr cloud_with_normals (new pcl::PointCloud); +// // pcl::PCLPointCloud2 cloud_blob; +// // pcl::io::loadPCDFile (inFile, cloud_blob); +// // pcl::fromPCLPointCloud2 (cloud_blob, *cloud_with_normals); +// +// //Everything else is the same whether normals are given or estimated +// +// // Create search tree* +// pcl::search::KdTree::Ptr tree2 (new pcl::search::KdTree); +// tree2->setInputCloud (cloud_with_normals); +// +// // Initialize objects +// pcl::GreedyProjectionTriangulation gp3; +// pcl::PolygonMesh triangles; +// +// // Set the maximum distance between connected points (maximum edge length) +// gp3.setSearchRadius (0.025); +// +// // Set typical values for the parameters +// gp3.setMu (2.5); +// gp3.setMaximumNearestNeighbors (100); +// gp3.setMaximumSurfaceAngle(M_PI/4); // 45 degrees +// gp3.setMinimumAngle(M_PI/18); // 10 degrees +// gp3.setMaximumAngle(2*M_PI/3); // 120 degrees +// gp3.setNormalConsistency(false); +// +// // Get result +// gp3.setInputCloud (cloud_with_normals); +// gp3.setSearchMethod (tree2); +// gp3.reconstruct (triangles); //crash occurs here +// +// // Additional vertex information +// std::vector parts = gp3.getPartIDs(); +// std::vector states = gp3.getPointStates(); +// +// pcl::io::saveVTKFile ("mesh.vtk", triangles); +// +// // Finish +// return (0); +// } diff --git a/KEMField/Source/2.0/BoundaryIntegrals/Core/CMakeLists.txt b/KEMField/Source/BoundaryIntegrals/Core/CMakeLists.txt similarity index 100% rename from KEMField/Source/2.0/BoundaryIntegrals/Core/CMakeLists.txt rename to KEMField/Source/BoundaryIntegrals/Core/CMakeLists.txt diff --git a/KEMField/Source/2.0/BoundaryIntegrals/Core/include/KBoundaryIntegralMatrix.hh b/KEMField/Source/BoundaryIntegrals/Core/include/KBoundaryIntegralMatrix.hh similarity index 100% rename from KEMField/Source/2.0/BoundaryIntegrals/Core/include/KBoundaryIntegralMatrix.hh rename to KEMField/Source/BoundaryIntegrals/Core/include/KBoundaryIntegralMatrix.hh diff --git a/KEMField/Source/2.0/BoundaryIntegrals/Core/include/KBoundaryIntegralSolutionVector.hh b/KEMField/Source/BoundaryIntegrals/Core/include/KBoundaryIntegralSolutionVector.hh similarity index 100% rename from KEMField/Source/2.0/BoundaryIntegrals/Core/include/KBoundaryIntegralSolutionVector.hh rename to KEMField/Source/BoundaryIntegrals/Core/include/KBoundaryIntegralSolutionVector.hh diff --git a/KEMField/Source/2.0/BoundaryIntegrals/Core/include/KBoundaryIntegralVector.hh b/KEMField/Source/BoundaryIntegrals/Core/include/KBoundaryIntegralVector.hh similarity index 100% rename from KEMField/Source/2.0/BoundaryIntegrals/Core/include/KBoundaryIntegralVector.hh rename to KEMField/Source/BoundaryIntegrals/Core/include/KBoundaryIntegralVector.hh diff --git a/KEMField/Source/2.0/BoundaryIntegrals/Core/include/KBoundaryMatrixGenerator.hh b/KEMField/Source/BoundaryIntegrals/Core/include/KBoundaryMatrixGenerator.hh similarity index 100% rename from KEMField/Source/2.0/BoundaryIntegrals/Core/include/KBoundaryMatrixGenerator.hh rename to KEMField/Source/BoundaryIntegrals/Core/include/KBoundaryMatrixGenerator.hh diff --git a/KEMField/Source/2.0/BoundaryIntegrals/Electrostatic/Analytic/include/KElectrostaticAnalyticConicSectionIntegrator.hh b/KEMField/Source/BoundaryIntegrals/Electrostatic/Analytic/include/KElectrostaticAnalyticConicSectionIntegrator.hh similarity index 100% rename from KEMField/Source/2.0/BoundaryIntegrals/Electrostatic/Analytic/include/KElectrostaticAnalyticConicSectionIntegrator.hh rename to KEMField/Source/BoundaryIntegrals/Electrostatic/Analytic/include/KElectrostaticAnalyticConicSectionIntegrator.hh diff --git a/KEMField/Source/2.0/BoundaryIntegrals/Electrostatic/Analytic/include/KElectrostaticAnalyticLineSegmentIntegrator.hh b/KEMField/Source/BoundaryIntegrals/Electrostatic/Analytic/include/KElectrostaticAnalyticLineSegmentIntegrator.hh similarity index 100% rename from KEMField/Source/2.0/BoundaryIntegrals/Electrostatic/Analytic/include/KElectrostaticAnalyticLineSegmentIntegrator.hh rename to KEMField/Source/BoundaryIntegrals/Electrostatic/Analytic/include/KElectrostaticAnalyticLineSegmentIntegrator.hh diff --git a/KEMField/Source/2.0/BoundaryIntegrals/Electrostatic/Analytic/include/KElectrostaticAnalyticRectangleIntegrator.hh b/KEMField/Source/BoundaryIntegrals/Electrostatic/Analytic/include/KElectrostaticAnalyticRectangleIntegrator.hh similarity index 100% rename from KEMField/Source/2.0/BoundaryIntegrals/Electrostatic/Analytic/include/KElectrostaticAnalyticRectangleIntegrator.hh rename to KEMField/Source/BoundaryIntegrals/Electrostatic/Analytic/include/KElectrostaticAnalyticRectangleIntegrator.hh diff --git a/KEMField/Source/2.0/BoundaryIntegrals/Electrostatic/Analytic/include/KElectrostaticAnalyticRingIntegrator.hh b/KEMField/Source/BoundaryIntegrals/Electrostatic/Analytic/include/KElectrostaticAnalyticRingIntegrator.hh similarity index 100% rename from KEMField/Source/2.0/BoundaryIntegrals/Electrostatic/Analytic/include/KElectrostaticAnalyticRingIntegrator.hh rename to KEMField/Source/BoundaryIntegrals/Electrostatic/Analytic/include/KElectrostaticAnalyticRingIntegrator.hh diff --git a/KEMField/Source/2.0/BoundaryIntegrals/Electrostatic/Analytic/include/KElectrostaticAnalyticTriangleIntegrator.hh b/KEMField/Source/BoundaryIntegrals/Electrostatic/Analytic/include/KElectrostaticAnalyticTriangleIntegrator.hh similarity index 100% rename from KEMField/Source/2.0/BoundaryIntegrals/Electrostatic/Analytic/include/KElectrostaticAnalyticTriangleIntegrator.hh rename to KEMField/Source/BoundaryIntegrals/Electrostatic/Analytic/include/KElectrostaticAnalyticTriangleIntegrator.hh diff --git a/KEMField/Source/2.0/BoundaryIntegrals/Electrostatic/Analytic/src/KElectrostaticAnalyticConicSectionIntegrator.cc b/KEMField/Source/BoundaryIntegrals/Electrostatic/Analytic/src/KElectrostaticAnalyticConicSectionIntegrator.cc similarity index 100% rename from KEMField/Source/2.0/BoundaryIntegrals/Electrostatic/Analytic/src/KElectrostaticAnalyticConicSectionIntegrator.cc rename to KEMField/Source/BoundaryIntegrals/Electrostatic/Analytic/src/KElectrostaticAnalyticConicSectionIntegrator.cc diff --git a/KEMField/Source/2.0/BoundaryIntegrals/Electrostatic/Analytic/src/KElectrostaticAnalyticLineSegmentIntegrator.cc b/KEMField/Source/BoundaryIntegrals/Electrostatic/Analytic/src/KElectrostaticAnalyticLineSegmentIntegrator.cc similarity index 100% rename from KEMField/Source/2.0/BoundaryIntegrals/Electrostatic/Analytic/src/KElectrostaticAnalyticLineSegmentIntegrator.cc rename to KEMField/Source/BoundaryIntegrals/Electrostatic/Analytic/src/KElectrostaticAnalyticLineSegmentIntegrator.cc diff --git a/KEMField/Source/2.0/BoundaryIntegrals/Electrostatic/Analytic/src/KElectrostaticAnalyticRectangleIntegrator.cc b/KEMField/Source/BoundaryIntegrals/Electrostatic/Analytic/src/KElectrostaticAnalyticRectangleIntegrator.cc similarity index 100% rename from KEMField/Source/2.0/BoundaryIntegrals/Electrostatic/Analytic/src/KElectrostaticAnalyticRectangleIntegrator.cc rename to KEMField/Source/BoundaryIntegrals/Electrostatic/Analytic/src/KElectrostaticAnalyticRectangleIntegrator.cc diff --git a/KEMField/Source/2.0/BoundaryIntegrals/Electrostatic/Analytic/src/KElectrostaticAnalyticRingIntegrator.cc b/KEMField/Source/BoundaryIntegrals/Electrostatic/Analytic/src/KElectrostaticAnalyticRingIntegrator.cc similarity index 100% rename from KEMField/Source/2.0/BoundaryIntegrals/Electrostatic/Analytic/src/KElectrostaticAnalyticRingIntegrator.cc rename to KEMField/Source/BoundaryIntegrals/Electrostatic/Analytic/src/KElectrostaticAnalyticRingIntegrator.cc diff --git a/KEMField/Source/2.0/BoundaryIntegrals/Electrostatic/Analytic/src/KElectrostaticAnalyticTriangleIntegrator.cc b/KEMField/Source/BoundaryIntegrals/Electrostatic/Analytic/src/KElectrostaticAnalyticTriangleIntegrator.cc similarity index 100% rename from KEMField/Source/2.0/BoundaryIntegrals/Electrostatic/Analytic/src/KElectrostaticAnalyticTriangleIntegrator.cc rename to KEMField/Source/BoundaryIntegrals/Electrostatic/Analytic/src/KElectrostaticAnalyticTriangleIntegrator.cc diff --git a/KEMField/Source/2.0/BoundaryIntegrals/Electrostatic/CMakeLists.txt b/KEMField/Source/BoundaryIntegrals/Electrostatic/CMakeLists.txt similarity index 100% rename from KEMField/Source/2.0/BoundaryIntegrals/Electrostatic/CMakeLists.txt rename to KEMField/Source/BoundaryIntegrals/Electrostatic/CMakeLists.txt diff --git a/KEMField/Source/2.0/BoundaryIntegrals/Electrostatic/Core/include/KElectrostaticBoundaryIntegrator.hh b/KEMField/Source/BoundaryIntegrals/Electrostatic/Core/include/KElectrostaticBoundaryIntegrator.hh similarity index 100% rename from KEMField/Source/2.0/BoundaryIntegrals/Electrostatic/Core/include/KElectrostaticBoundaryIntegrator.hh rename to KEMField/Source/BoundaryIntegrals/Electrostatic/Core/include/KElectrostaticBoundaryIntegrator.hh diff --git a/KEMField/Source/2.0/BoundaryIntegrals/Electrostatic/Core/include/KElectrostaticBoundaryIntegratorFactory.hh b/KEMField/Source/BoundaryIntegrals/Electrostatic/Core/include/KElectrostaticBoundaryIntegratorFactory.hh similarity index 100% rename from KEMField/Source/2.0/BoundaryIntegrals/Electrostatic/Core/include/KElectrostaticBoundaryIntegratorFactory.hh rename to KEMField/Source/BoundaryIntegrals/Electrostatic/Core/include/KElectrostaticBoundaryIntegratorFactory.hh diff --git a/KEMField/Source/2.0/BoundaryIntegrals/Electrostatic/Core/include/KElectrostaticElementIntegrator.hh b/KEMField/Source/BoundaryIntegrals/Electrostatic/Core/include/KElectrostaticElementIntegrator.hh similarity index 100% rename from KEMField/Source/2.0/BoundaryIntegrals/Electrostatic/Core/include/KElectrostaticElementIntegrator.hh rename to KEMField/Source/BoundaryIntegrals/Electrostatic/Core/include/KElectrostaticElementIntegrator.hh diff --git a/KEMField/Source/2.0/BoundaryIntegrals/Electrostatic/Core/src/KElectrostaticBoundaryIntegrator.cc b/KEMField/Source/BoundaryIntegrals/Electrostatic/Core/src/KElectrostaticBoundaryIntegrator.cc similarity index 100% rename from KEMField/Source/2.0/BoundaryIntegrals/Electrostatic/Core/src/KElectrostaticBoundaryIntegrator.cc rename to KEMField/Source/BoundaryIntegrals/Electrostatic/Core/src/KElectrostaticBoundaryIntegrator.cc diff --git a/KEMField/Source/2.0/BoundaryIntegrals/Electrostatic/Core/src/KElectrostaticBoundaryIntegratorFactory.cc b/KEMField/Source/BoundaryIntegrals/Electrostatic/Core/src/KElectrostaticBoundaryIntegratorFactory.cc similarity index 100% rename from KEMField/Source/2.0/BoundaryIntegrals/Electrostatic/Core/src/KElectrostaticBoundaryIntegratorFactory.cc rename to KEMField/Source/BoundaryIntegrals/Electrostatic/Core/src/KElectrostaticBoundaryIntegratorFactory.cc diff --git a/KEMField/Source/2.0/BoundaryIntegrals/Electrostatic/Numeric/include/KElectrostaticCubatureRectangleIntegrator.hh b/KEMField/Source/BoundaryIntegrals/Electrostatic/Numeric/include/KElectrostaticCubatureRectangleIntegrator.hh similarity index 100% rename from KEMField/Source/2.0/BoundaryIntegrals/Electrostatic/Numeric/include/KElectrostaticCubatureRectangleIntegrator.hh rename to KEMField/Source/BoundaryIntegrals/Electrostatic/Numeric/include/KElectrostaticCubatureRectangleIntegrator.hh diff --git a/KEMField/Source/2.0/BoundaryIntegrals/Electrostatic/Numeric/include/KElectrostaticCubatureTriangleIntegrator.hh b/KEMField/Source/BoundaryIntegrals/Electrostatic/Numeric/include/KElectrostaticCubatureTriangleIntegrator.hh similarity index 100% rename from KEMField/Source/2.0/BoundaryIntegrals/Electrostatic/Numeric/include/KElectrostaticCubatureTriangleIntegrator.hh rename to KEMField/Source/BoundaryIntegrals/Electrostatic/Numeric/include/KElectrostaticCubatureTriangleIntegrator.hh diff --git a/KEMField/Source/2.0/BoundaryIntegrals/Electrostatic/Numeric/include/KElectrostaticQuadratureLineSegmentIntegrator.hh b/KEMField/Source/BoundaryIntegrals/Electrostatic/Numeric/include/KElectrostaticQuadratureLineSegmentIntegrator.hh similarity index 100% rename from KEMField/Source/2.0/BoundaryIntegrals/Electrostatic/Numeric/include/KElectrostaticQuadratureLineSegmentIntegrator.hh rename to KEMField/Source/BoundaryIntegrals/Electrostatic/Numeric/include/KElectrostaticQuadratureLineSegmentIntegrator.hh diff --git a/KEMField/Source/2.0/BoundaryIntegrals/Electrostatic/Numeric/src/KElectrostaticCubatureRectangleIntegrator.cc b/KEMField/Source/BoundaryIntegrals/Electrostatic/Numeric/src/KElectrostaticCubatureRectangleIntegrator.cc similarity index 100% rename from KEMField/Source/2.0/BoundaryIntegrals/Electrostatic/Numeric/src/KElectrostaticCubatureRectangleIntegrator.cc rename to KEMField/Source/BoundaryIntegrals/Electrostatic/Numeric/src/KElectrostaticCubatureRectangleIntegrator.cc diff --git a/KEMField/Source/2.0/BoundaryIntegrals/Electrostatic/Numeric/src/KElectrostaticCubatureTriangleIntegrator.cc b/KEMField/Source/BoundaryIntegrals/Electrostatic/Numeric/src/KElectrostaticCubatureTriangleIntegrator.cc similarity index 100% rename from KEMField/Source/2.0/BoundaryIntegrals/Electrostatic/Numeric/src/KElectrostaticCubatureTriangleIntegrator.cc rename to KEMField/Source/BoundaryIntegrals/Electrostatic/Numeric/src/KElectrostaticCubatureTriangleIntegrator.cc diff --git a/KEMField/Source/2.0/BoundaryIntegrals/Electrostatic/Numeric/src/KElectrostaticQuadratureLineSegmentIntegrator.cc b/KEMField/Source/BoundaryIntegrals/Electrostatic/Numeric/src/KElectrostaticQuadratureLineSegmentIntegrator.cc similarity index 100% rename from KEMField/Source/2.0/BoundaryIntegrals/Electrostatic/Numeric/src/KElectrostaticQuadratureLineSegmentIntegrator.cc rename to KEMField/Source/BoundaryIntegrals/Electrostatic/Numeric/src/KElectrostaticQuadratureLineSegmentIntegrator.cc diff --git a/KEMField/Source/2.0/BoundaryIntegrals/Electrostatic/RWG/include/KElectrostaticRWGRectangleIntegrator.hh b/KEMField/Source/BoundaryIntegrals/Electrostatic/RWG/include/KElectrostaticRWGRectangleIntegrator.hh similarity index 100% rename from KEMField/Source/2.0/BoundaryIntegrals/Electrostatic/RWG/include/KElectrostaticRWGRectangleIntegrator.hh rename to KEMField/Source/BoundaryIntegrals/Electrostatic/RWG/include/KElectrostaticRWGRectangleIntegrator.hh diff --git a/KEMField/Source/2.0/BoundaryIntegrals/Electrostatic/RWG/include/KElectrostaticRWGTriangleIntegrator.hh b/KEMField/Source/BoundaryIntegrals/Electrostatic/RWG/include/KElectrostaticRWGTriangleIntegrator.hh similarity index 100% rename from KEMField/Source/2.0/BoundaryIntegrals/Electrostatic/RWG/include/KElectrostaticRWGTriangleIntegrator.hh rename to KEMField/Source/BoundaryIntegrals/Electrostatic/RWG/include/KElectrostaticRWGTriangleIntegrator.hh diff --git a/KEMField/Source/2.0/BoundaryIntegrals/Electrostatic/RWG/include/KRWGFunctions.hh b/KEMField/Source/BoundaryIntegrals/Electrostatic/RWG/include/KRWGFunctions.hh similarity index 100% rename from KEMField/Source/2.0/BoundaryIntegrals/Electrostatic/RWG/include/KRWGFunctions.hh rename to KEMField/Source/BoundaryIntegrals/Electrostatic/RWG/include/KRWGFunctions.hh diff --git a/KEMField/Source/2.0/BoundaryIntegrals/Electrostatic/RWG/include/KTFaceRFBasis.hh b/KEMField/Source/BoundaryIntegrals/Electrostatic/RWG/include/KTFaceRFBasis.hh similarity index 100% rename from KEMField/Source/2.0/BoundaryIntegrals/Electrostatic/RWG/include/KTFaceRFBasis.hh rename to KEMField/Source/BoundaryIntegrals/Electrostatic/RWG/include/KTFaceRFBasis.hh diff --git a/KEMField/Source/2.0/BoundaryIntegrals/Electrostatic/RWG/src/KElectrostaticRWGRectangleIntegrator.cc b/KEMField/Source/BoundaryIntegrals/Electrostatic/RWG/src/KElectrostaticRWGRectangleIntegrator.cc similarity index 100% rename from KEMField/Source/2.0/BoundaryIntegrals/Electrostatic/RWG/src/KElectrostaticRWGRectangleIntegrator.cc rename to KEMField/Source/BoundaryIntegrals/Electrostatic/RWG/src/KElectrostaticRWGRectangleIntegrator.cc diff --git a/KEMField/Source/2.0/BoundaryIntegrals/Electrostatic/RWG/src/KElectrostaticRWGTriangleIntegrator.cc b/KEMField/Source/BoundaryIntegrals/Electrostatic/RWG/src/KElectrostaticRWGTriangleIntegrator.cc similarity index 100% rename from KEMField/Source/2.0/BoundaryIntegrals/Electrostatic/RWG/src/KElectrostaticRWGTriangleIntegrator.cc rename to KEMField/Source/BoundaryIntegrals/Electrostatic/RWG/src/KElectrostaticRWGTriangleIntegrator.cc diff --git a/KEMField/Source/2.0/BoundaryIntegrals/Electrostatic/RWG/src/KTFaceRFBasis.cc b/KEMField/Source/BoundaryIntegrals/Electrostatic/RWG/src/KTFaceRFBasis.cc similarity index 100% rename from KEMField/Source/2.0/BoundaryIntegrals/Electrostatic/RWG/src/KTFaceRFBasis.cc rename to KEMField/Source/BoundaryIntegrals/Electrostatic/RWG/src/KTFaceRFBasis.cc diff --git a/KEMField/Source/2.0/BoundaryIntegrals/Electrostatic/RWG/src/KTRWGFunctions.cc b/KEMField/Source/BoundaryIntegrals/Electrostatic/RWG/src/KTRWGFunctions.cc similarity index 100% rename from KEMField/Source/2.0/BoundaryIntegrals/Electrostatic/RWG/src/KTRWGFunctions.cc rename to KEMField/Source/BoundaryIntegrals/Electrostatic/RWG/src/KTRWGFunctions.cc diff --git a/KEMField/Source/2.0/BoundaryIntegrals/Electrostatic/Reference/include/KElectrostatic256NodeQuadratureLineSegmentIntegrator.hh b/KEMField/Source/BoundaryIntegrals/Electrostatic/Reference/include/KElectrostatic256NodeQuadratureLineSegmentIntegrator.hh similarity index 100% rename from KEMField/Source/2.0/BoundaryIntegrals/Electrostatic/Reference/include/KElectrostatic256NodeQuadratureLineSegmentIntegrator.hh rename to KEMField/Source/BoundaryIntegrals/Electrostatic/Reference/include/KElectrostatic256NodeQuadratureLineSegmentIntegrator.hh diff --git a/KEMField/Source/2.0/BoundaryIntegrals/Electrostatic/Reference/include/KElectrostaticBiQuadratureRectangleIntegrator.hh b/KEMField/Source/BoundaryIntegrals/Electrostatic/Reference/include/KElectrostaticBiQuadratureRectangleIntegrator.hh similarity index 100% rename from KEMField/Source/2.0/BoundaryIntegrals/Electrostatic/Reference/include/KElectrostaticBiQuadratureRectangleIntegrator.hh rename to KEMField/Source/BoundaryIntegrals/Electrostatic/Reference/include/KElectrostaticBiQuadratureRectangleIntegrator.hh diff --git a/KEMField/Source/2.0/BoundaryIntegrals/Electrostatic/Reference/include/KElectrostaticBiQuadratureTriangleIntegrator.hh b/KEMField/Source/BoundaryIntegrals/Electrostatic/Reference/include/KElectrostaticBiQuadratureTriangleIntegrator.hh similarity index 100% rename from KEMField/Source/2.0/BoundaryIntegrals/Electrostatic/Reference/include/KElectrostaticBiQuadratureTriangleIntegrator.hh rename to KEMField/Source/BoundaryIntegrals/Electrostatic/Reference/include/KElectrostaticBiQuadratureTriangleIntegrator.hh diff --git a/KEMField/Source/2.0/BoundaryIntegrals/Electrostatic/Reference/src/KElectrostatic256NodeQuadratureLineSegmentIntegrator.cc b/KEMField/Source/BoundaryIntegrals/Electrostatic/Reference/src/KElectrostatic256NodeQuadratureLineSegmentIntegrator.cc similarity index 100% rename from KEMField/Source/2.0/BoundaryIntegrals/Electrostatic/Reference/src/KElectrostatic256NodeQuadratureLineSegmentIntegrator.cc rename to KEMField/Source/BoundaryIntegrals/Electrostatic/Reference/src/KElectrostatic256NodeQuadratureLineSegmentIntegrator.cc diff --git a/KEMField/Source/2.0/BoundaryIntegrals/Electrostatic/Reference/src/KElectrostaticBiQuadratureRectangleIntegrator.cc b/KEMField/Source/BoundaryIntegrals/Electrostatic/Reference/src/KElectrostaticBiQuadratureRectangleIntegrator.cc similarity index 100% rename from KEMField/Source/2.0/BoundaryIntegrals/Electrostatic/Reference/src/KElectrostaticBiQuadratureRectangleIntegrator.cc rename to KEMField/Source/BoundaryIntegrals/Electrostatic/Reference/src/KElectrostaticBiQuadratureRectangleIntegrator.cc diff --git a/KEMField/Source/2.0/BoundaryIntegrals/Electrostatic/Reference/src/KElectrostaticBiQuadratureTriangleIntegrator.cc b/KEMField/Source/BoundaryIntegrals/Electrostatic/Reference/src/KElectrostaticBiQuadratureTriangleIntegrator.cc similarity index 100% rename from KEMField/Source/2.0/BoundaryIntegrals/Electrostatic/Reference/src/KElectrostaticBiQuadratureTriangleIntegrator.cc rename to KEMField/Source/BoundaryIntegrals/Electrostatic/Reference/src/KElectrostaticBiQuadratureTriangleIntegrator.cc diff --git a/KEMField/Source/2.0/BoundaryIntegrals/Magnetostatic/CMakeLists.txt b/KEMField/Source/BoundaryIntegrals/Magnetostatic/CMakeLists.txt similarity index 100% rename from KEMField/Source/2.0/BoundaryIntegrals/Magnetostatic/CMakeLists.txt rename to KEMField/Source/BoundaryIntegrals/Magnetostatic/CMakeLists.txt diff --git a/KEMField/Source/2.0/BoundaryIntegrals/Magnetostatic/include/KMagnetostaticBoundaryIntegrator.hh b/KEMField/Source/BoundaryIntegrals/Magnetostatic/include/KMagnetostaticBoundaryIntegrator.hh similarity index 100% rename from KEMField/Source/2.0/BoundaryIntegrals/Magnetostatic/include/KMagnetostaticBoundaryIntegrator.hh rename to KEMField/Source/BoundaryIntegrals/Magnetostatic/include/KMagnetostaticBoundaryIntegrator.hh diff --git a/KEMField/Source/2.0/BoundaryIntegrals/Magnetostatic/include/KMagnetostaticLineSegmentIntegrator.hh b/KEMField/Source/BoundaryIntegrals/Magnetostatic/include/KMagnetostaticLineSegmentIntegrator.hh similarity index 100% rename from KEMField/Source/2.0/BoundaryIntegrals/Magnetostatic/include/KMagnetostaticLineSegmentIntegrator.hh rename to KEMField/Source/BoundaryIntegrals/Magnetostatic/include/KMagnetostaticLineSegmentIntegrator.hh diff --git a/KEMField/Source/2.0/BoundaryIntegrals/Magnetostatic/include/KMagnetostaticRingIntegrator.hh b/KEMField/Source/BoundaryIntegrals/Magnetostatic/include/KMagnetostaticRingIntegrator.hh similarity index 100% rename from KEMField/Source/2.0/BoundaryIntegrals/Magnetostatic/include/KMagnetostaticRingIntegrator.hh rename to KEMField/Source/BoundaryIntegrals/Magnetostatic/include/KMagnetostaticRingIntegrator.hh diff --git a/KEMField/Source/2.0/BoundaryIntegrals/Magnetostatic/src/KMagnetostaticBoundaryIntegrator.cc b/KEMField/Source/BoundaryIntegrals/Magnetostatic/src/KMagnetostaticBoundaryIntegrator.cc similarity index 100% rename from KEMField/Source/2.0/BoundaryIntegrals/Magnetostatic/src/KMagnetostaticBoundaryIntegrator.cc rename to KEMField/Source/BoundaryIntegrals/Magnetostatic/src/KMagnetostaticBoundaryIntegrator.cc diff --git a/KEMField/Source/2.0/BoundaryIntegrals/Magnetostatic/src/KMagnetostaticLineSegmentIntegrator.cc b/KEMField/Source/BoundaryIntegrals/Magnetostatic/src/KMagnetostaticLineSegmentIntegrator.cc similarity index 100% rename from KEMField/Source/2.0/BoundaryIntegrals/Magnetostatic/src/KMagnetostaticLineSegmentIntegrator.cc rename to KEMField/Source/BoundaryIntegrals/Magnetostatic/src/KMagnetostaticLineSegmentIntegrator.cc diff --git a/KEMField/Source/2.0/BoundaryIntegrals/Magnetostatic/src/KMagnetostaticRingIntegrator.cc b/KEMField/Source/BoundaryIntegrals/Magnetostatic/src/KMagnetostaticRingIntegrator.cc similarity index 100% rename from KEMField/Source/2.0/BoundaryIntegrals/Magnetostatic/src/KMagnetostaticRingIntegrator.cc rename to KEMField/Source/BoundaryIntegrals/Magnetostatic/src/KMagnetostaticRingIntegrator.cc diff --git a/KEMField/Source/2.0/Core/CMakeLists.txt b/KEMField/Source/Core/CMakeLists.txt similarity index 100% rename from KEMField/Source/2.0/Core/CMakeLists.txt rename to KEMField/Source/Core/CMakeLists.txt diff --git a/KEMField/Source/2.0/Core/include/KComplexStreamer.hh b/KEMField/Source/Core/include/KComplexStreamer.hh similarity index 100% rename from KEMField/Source/2.0/Core/include/KComplexStreamer.hh rename to KEMField/Source/Core/include/KComplexStreamer.hh diff --git a/KEMField/Source/2.0/Core/include/KDataComparator.hh b/KEMField/Source/Core/include/KDataComparator.hh similarity index 100% rename from KEMField/Source/2.0/Core/include/KDataComparator.hh rename to KEMField/Source/Core/include/KDataComparator.hh diff --git a/KEMField/Source/2.0/Core/include/KDataDisplay.hh b/KEMField/Source/Core/include/KDataDisplay.hh similarity index 100% rename from KEMField/Source/2.0/Core/include/KDataDisplay.hh rename to KEMField/Source/Core/include/KDataDisplay.hh diff --git a/KEMField/Source/2.0/Core/include/KEMConstants.hh b/KEMField/Source/Core/include/KEMConstants.hh similarity index 100% rename from KEMField/Source/2.0/Core/include/KEMConstants.hh rename to KEMField/Source/Core/include/KEMConstants.hh diff --git a/KEMField/Source/2.0/Core/include/KEMCout.hh b/KEMField/Source/Core/include/KEMCout.hh similarity index 100% rename from KEMField/Source/2.0/Core/include/KEMCout.hh rename to KEMField/Source/Core/include/KEMCout.hh diff --git a/KEMField/Source/2.0/Core/include/KEMStringUtils.hh b/KEMField/Source/Core/include/KEMStringUtils.hh similarity index 100% rename from KEMField/Source/2.0/Core/include/KEMStringUtils.hh rename to KEMField/Source/Core/include/KEMStringUtils.hh diff --git a/KEMField/Source/2.0/Core/include/KEMTicker.hh b/KEMField/Source/Core/include/KEMTicker.hh similarity index 100% rename from KEMField/Source/2.0/Core/include/KEMTicker.hh rename to KEMField/Source/Core/include/KEMTicker.hh diff --git a/KEMField/Source/2.0/Core/include/KFundamentalTypeCounter.hh b/KEMField/Source/Core/include/KFundamentalTypeCounter.hh similarity index 100% rename from KEMField/Source/2.0/Core/include/KFundamentalTypeCounter.hh rename to KEMField/Source/Core/include/KFundamentalTypeCounter.hh diff --git a/KEMField/Source/2.0/Core/include/KFundamentalTypes.hh b/KEMField/Source/Core/include/KFundamentalTypes.hh similarity index 100% rename from KEMField/Source/2.0/Core/include/KFundamentalTypes.hh rename to KEMField/Source/Core/include/KFundamentalTypes.hh diff --git a/KEMField/Source/2.0/Core/include/KMPIEnvironment.hh b/KEMField/Source/Core/include/KMPIEnvironment.hh similarity index 100% rename from KEMField/Source/2.0/Core/include/KMPIEnvironment.hh rename to KEMField/Source/Core/include/KMPIEnvironment.hh diff --git a/KEMField/Source/2.0/Core/include/KMPIInterface.hh b/KEMField/Source/Core/include/KMPIInterface.hh similarity index 100% rename from KEMField/Source/2.0/Core/include/KMPIInterface.hh rename to KEMField/Source/Core/include/KMPIInterface.hh diff --git a/KEMField/Source/2.0/Core/include/KMessageInterface.hh b/KEMField/Source/Core/include/KMessageInterface.hh similarity index 100% rename from KEMField/Source/2.0/Core/include/KMessageInterface.hh rename to KEMField/Source/Core/include/KMessageInterface.hh diff --git a/KEMField/Source/2.0/Core/include/KSmartPointer.hh b/KEMField/Source/Core/include/KSmartPointer.hh similarity index 100% rename from KEMField/Source/2.0/Core/include/KSmartPointer.hh rename to KEMField/Source/Core/include/KSmartPointer.hh diff --git a/KEMField/Source/2.0/Core/include/KTimer.hh b/KEMField/Source/Core/include/KTimer.hh similarity index 100% rename from KEMField/Source/2.0/Core/include/KTimer.hh rename to KEMField/Source/Core/include/KTimer.hh diff --git a/KEMField/Source/2.0/Core/include/KTypeManipulation.hh b/KEMField/Source/Core/include/KTypeManipulation.hh similarity index 100% rename from KEMField/Source/2.0/Core/include/KTypeManipulation.hh rename to KEMField/Source/Core/include/KTypeManipulation.hh diff --git a/KEMField/Source/2.0/Core/include/KTypelist.hh b/KEMField/Source/Core/include/KTypelist.hh similarity index 100% rename from KEMField/Source/2.0/Core/include/KTypelist.hh rename to KEMField/Source/Core/include/KTypelist.hh diff --git a/KEMField/Source/2.0/Core/include/KTypelistVisitor.hh b/KEMField/Source/Core/include/KTypelistVisitor.hh similarity index 100% rename from KEMField/Source/2.0/Core/include/KTypelistVisitor.hh rename to KEMField/Source/Core/include/KTypelistVisitor.hh diff --git a/KEMField/Source/2.0/Core/src/KEMConstants.cc b/KEMField/Source/Core/src/KEMConstants.cc similarity index 100% rename from KEMField/Source/2.0/Core/src/KEMConstants.cc rename to KEMField/Source/Core/src/KEMConstants.cc diff --git a/KEMField/Source/2.0/Core/src/KEMCout.cc b/KEMField/Source/Core/src/KEMCout.cc similarity index 100% rename from KEMField/Source/2.0/Core/src/KEMCout.cc rename to KEMField/Source/Core/src/KEMCout.cc diff --git a/KEMField/Source/2.0/Core/src/KEMStringUtils.cc b/KEMField/Source/Core/src/KEMStringUtils.cc similarity index 100% rename from KEMField/Source/2.0/Core/src/KEMStringUtils.cc rename to KEMField/Source/Core/src/KEMStringUtils.cc diff --git a/KEMField/Source/2.0/Core/src/KEMTicker.cc b/KEMField/Source/Core/src/KEMTicker.cc similarity index 100% rename from KEMField/Source/2.0/Core/src/KEMTicker.cc rename to KEMField/Source/Core/src/KEMTicker.cc diff --git a/KEMField/Source/2.0/Core/src/KFundamentalTypes.cc b/KEMField/Source/Core/src/KFundamentalTypes.cc similarity index 100% rename from KEMField/Source/2.0/Core/src/KFundamentalTypes.cc rename to KEMField/Source/Core/src/KFundamentalTypes.cc diff --git a/KEMField/Source/2.0/Core/src/KMPIInterface.cc b/KEMField/Source/Core/src/KMPIInterface.cc similarity index 100% rename from KEMField/Source/2.0/Core/src/KMPIInterface.cc rename to KEMField/Source/Core/src/KMPIInterface.cc diff --git a/KEMField/Source/2.0/Core/src/KMessageInterface.cc b/KEMField/Source/Core/src/KMessageInterface.cc similarity index 100% rename from KEMField/Source/2.0/Core/src/KMessageInterface.cc rename to KEMField/Source/Core/src/KMessageInterface.cc diff --git a/KEMField/Source/2.0/Core/src/KTimer.cc b/KEMField/Source/Core/src/KTimer.cc similarity index 100% rename from KEMField/Source/2.0/Core/src/KTimer.cc rename to KEMField/Source/Core/src/KTimer.cc diff --git a/KEMField/Source/2.0/Core/test/KSmartPointer_test.cc b/KEMField/Source/Core/test/KSmartPointer_test.cc similarity index 100% rename from KEMField/Source/2.0/Core/test/KSmartPointer_test.cc rename to KEMField/Source/Core/test/KSmartPointer_test.cc diff --git a/KEMField/Source/2.0/Exceptions/CMakeLists.txt b/KEMField/Source/Exceptions/CMakeLists.txt similarity index 100% rename from KEMField/Source/2.0/Exceptions/CMakeLists.txt rename to KEMField/Source/Exceptions/CMakeLists.txt diff --git a/KEMField/Source/2.0/Exceptions/include/KEMSimpleException.hh b/KEMField/Source/Exceptions/include/KEMSimpleException.hh similarity index 100% rename from KEMField/Source/2.0/Exceptions/include/KEMSimpleException.hh rename to KEMField/Source/Exceptions/include/KEMSimpleException.hh diff --git a/KEMField/Source/2.0/Exceptions/include/KKeyNotFoundException.hh b/KEMField/Source/Exceptions/include/KKeyNotFoundException.hh similarity index 100% rename from KEMField/Source/2.0/Exceptions/include/KKeyNotFoundException.hh rename to KEMField/Source/Exceptions/include/KKeyNotFoundException.hh diff --git a/KEMField/Source/2.0/Exceptions/src/KEMSimpleException.cc b/KEMField/Source/Exceptions/src/KEMSimpleException.cc similarity index 100% rename from KEMField/Source/2.0/Exceptions/src/KEMSimpleException.cc rename to KEMField/Source/Exceptions/src/KEMSimpleException.cc diff --git a/KEMField/Source/2.0/Exceptions/src/KKeyNotFoundException.cc b/KEMField/Source/Exceptions/src/KKeyNotFoundException.cc similarity index 100% rename from KEMField/Source/2.0/Exceptions/src/KKeyNotFoundException.cc rename to KEMField/Source/Exceptions/src/KKeyNotFoundException.cc diff --git a/KEMField/Source/2.0/ExternalFields/Electromagnets/CMakeLists.txt b/KEMField/Source/ExternalFields/Electromagnets/CMakeLists.txt similarity index 100% rename from KEMField/Source/2.0/ExternalFields/Electromagnets/CMakeLists.txt rename to KEMField/Source/ExternalFields/Electromagnets/CMakeLists.txt diff --git a/KEMField/Source/2.0/ExternalFields/Electromagnets/include/KCoil.hh b/KEMField/Source/ExternalFields/Electromagnets/include/KCoil.hh similarity index 100% rename from KEMField/Source/2.0/ExternalFields/Electromagnets/include/KCoil.hh rename to KEMField/Source/ExternalFields/Electromagnets/include/KCoil.hh diff --git a/KEMField/Source/2.0/ExternalFields/Electromagnets/include/KCoilIntegrator.hh b/KEMField/Source/ExternalFields/Electromagnets/include/KCoilIntegrator.hh similarity index 100% rename from KEMField/Source/2.0/ExternalFields/Electromagnets/include/KCoilIntegrator.hh rename to KEMField/Source/ExternalFields/Electromagnets/include/KCoilIntegrator.hh diff --git a/KEMField/Source/2.0/ExternalFields/Electromagnets/include/KCurrentLoop.hh b/KEMField/Source/ExternalFields/Electromagnets/include/KCurrentLoop.hh similarity index 100% rename from KEMField/Source/2.0/ExternalFields/Electromagnets/include/KCurrentLoop.hh rename to KEMField/Source/ExternalFields/Electromagnets/include/KCurrentLoop.hh diff --git a/KEMField/Source/2.0/ExternalFields/Electromagnets/include/KCurrentLoopIntegrator.hh b/KEMField/Source/ExternalFields/Electromagnets/include/KCurrentLoopIntegrator.hh similarity index 100% rename from KEMField/Source/2.0/ExternalFields/Electromagnets/include/KCurrentLoopIntegrator.hh rename to KEMField/Source/ExternalFields/Electromagnets/include/KCurrentLoopIntegrator.hh diff --git a/KEMField/Source/2.0/ExternalFields/Electromagnets/include/KElectromagnet.hh b/KEMField/Source/ExternalFields/Electromagnets/include/KElectromagnet.hh similarity index 100% rename from KEMField/Source/2.0/ExternalFields/Electromagnets/include/KElectromagnet.hh rename to KEMField/Source/ExternalFields/Electromagnets/include/KElectromagnet.hh diff --git a/KEMField/Source/2.0/ExternalFields/Electromagnets/include/KElectromagnetContainer.hh b/KEMField/Source/ExternalFields/Electromagnets/include/KElectromagnetContainer.hh similarity index 100% rename from KEMField/Source/2.0/ExternalFields/Electromagnets/include/KElectromagnetContainer.hh rename to KEMField/Source/ExternalFields/Electromagnets/include/KElectromagnetContainer.hh diff --git a/KEMField/Source/2.0/ExternalFields/Electromagnets/include/KElectromagnetIntegratingFieldSolver.hh b/KEMField/Source/ExternalFields/Electromagnets/include/KElectromagnetIntegratingFieldSolver.hh similarity index 100% rename from KEMField/Source/2.0/ExternalFields/Electromagnets/include/KElectromagnetIntegratingFieldSolver.hh rename to KEMField/Source/ExternalFields/Electromagnets/include/KElectromagnetIntegratingFieldSolver.hh diff --git a/KEMField/Source/2.0/ExternalFields/Electromagnets/include/KElectromagnetIntegrator.hh b/KEMField/Source/ExternalFields/Electromagnets/include/KElectromagnetIntegrator.hh similarity index 100% rename from KEMField/Source/2.0/ExternalFields/Electromagnets/include/KElectromagnetIntegrator.hh rename to KEMField/Source/ExternalFields/Electromagnets/include/KElectromagnetIntegrator.hh diff --git a/KEMField/Source/2.0/ExternalFields/Electromagnets/include/KElectromagnetTypes.hh b/KEMField/Source/ExternalFields/Electromagnets/include/KElectromagnetTypes.hh similarity index 100% rename from KEMField/Source/2.0/ExternalFields/Electromagnets/include/KElectromagnetTypes.hh rename to KEMField/Source/ExternalFields/Electromagnets/include/KElectromagnetTypes.hh diff --git a/KEMField/Source/2.0/ExternalFields/Electromagnets/include/KElectromagnetVisitor.hh b/KEMField/Source/ExternalFields/Electromagnets/include/KElectromagnetVisitor.hh similarity index 100% rename from KEMField/Source/2.0/ExternalFields/Electromagnets/include/KElectromagnetVisitor.hh rename to KEMField/Source/ExternalFields/Electromagnets/include/KElectromagnetVisitor.hh diff --git a/KEMField/Source/2.0/ExternalFields/Electromagnets/include/KLineCurrent.hh b/KEMField/Source/ExternalFields/Electromagnets/include/KLineCurrent.hh similarity index 100% rename from KEMField/Source/2.0/ExternalFields/Electromagnets/include/KLineCurrent.hh rename to KEMField/Source/ExternalFields/Electromagnets/include/KLineCurrent.hh diff --git a/KEMField/Source/2.0/ExternalFields/Electromagnets/include/KLineCurrentIntegrator.hh b/KEMField/Source/ExternalFields/Electromagnets/include/KLineCurrentIntegrator.hh similarity index 100% rename from KEMField/Source/2.0/ExternalFields/Electromagnets/include/KLineCurrentIntegrator.hh rename to KEMField/Source/ExternalFields/Electromagnets/include/KLineCurrentIntegrator.hh diff --git a/KEMField/Source/2.0/ExternalFields/Electromagnets/include/KSolenoid.hh b/KEMField/Source/ExternalFields/Electromagnets/include/KSolenoid.hh similarity index 100% rename from KEMField/Source/2.0/ExternalFields/Electromagnets/include/KSolenoid.hh rename to KEMField/Source/ExternalFields/Electromagnets/include/KSolenoid.hh diff --git a/KEMField/Source/2.0/ExternalFields/Electromagnets/include/KSolenoidIntegrator.hh b/KEMField/Source/ExternalFields/Electromagnets/include/KSolenoidIntegrator.hh similarity index 100% rename from KEMField/Source/2.0/ExternalFields/Electromagnets/include/KSolenoidIntegrator.hh rename to KEMField/Source/ExternalFields/Electromagnets/include/KSolenoidIntegrator.hh diff --git a/KEMField/Source/2.0/ExternalFields/Electromagnets/src/KCoil.cc b/KEMField/Source/ExternalFields/Electromagnets/src/KCoil.cc similarity index 100% rename from KEMField/Source/2.0/ExternalFields/Electromagnets/src/KCoil.cc rename to KEMField/Source/ExternalFields/Electromagnets/src/KCoil.cc diff --git a/KEMField/Source/2.0/ExternalFields/Electromagnets/src/KCoilIntegrator.cc b/KEMField/Source/ExternalFields/Electromagnets/src/KCoilIntegrator.cc similarity index 100% rename from KEMField/Source/2.0/ExternalFields/Electromagnets/src/KCoilIntegrator.cc rename to KEMField/Source/ExternalFields/Electromagnets/src/KCoilIntegrator.cc diff --git a/KEMField/Source/2.0/ExternalFields/Electromagnets/src/KCurrentLoop.cc b/KEMField/Source/ExternalFields/Electromagnets/src/KCurrentLoop.cc similarity index 100% rename from KEMField/Source/2.0/ExternalFields/Electromagnets/src/KCurrentLoop.cc rename to KEMField/Source/ExternalFields/Electromagnets/src/KCurrentLoop.cc diff --git a/KEMField/Source/2.0/ExternalFields/Electromagnets/src/KCurrentLoopIntegrator.cc b/KEMField/Source/ExternalFields/Electromagnets/src/KCurrentLoopIntegrator.cc similarity index 100% rename from KEMField/Source/2.0/ExternalFields/Electromagnets/src/KCurrentLoopIntegrator.cc rename to KEMField/Source/ExternalFields/Electromagnets/src/KCurrentLoopIntegrator.cc diff --git a/KEMField/Source/2.0/ExternalFields/Electromagnets/src/KElectromagnetIntegratingFieldSolver.cc b/KEMField/Source/ExternalFields/Electromagnets/src/KElectromagnetIntegratingFieldSolver.cc similarity index 100% rename from KEMField/Source/2.0/ExternalFields/Electromagnets/src/KElectromagnetIntegratingFieldSolver.cc rename to KEMField/Source/ExternalFields/Electromagnets/src/KElectromagnetIntegratingFieldSolver.cc diff --git a/KEMField/Source/2.0/ExternalFields/Electromagnets/src/KLineCurrent.cc b/KEMField/Source/ExternalFields/Electromagnets/src/KLineCurrent.cc similarity index 100% rename from KEMField/Source/2.0/ExternalFields/Electromagnets/src/KLineCurrent.cc rename to KEMField/Source/ExternalFields/Electromagnets/src/KLineCurrent.cc diff --git a/KEMField/Source/2.0/ExternalFields/Electromagnets/src/KLineCurrentIntegrator.cc b/KEMField/Source/ExternalFields/Electromagnets/src/KLineCurrentIntegrator.cc similarity index 100% rename from KEMField/Source/2.0/ExternalFields/Electromagnets/src/KLineCurrentIntegrator.cc rename to KEMField/Source/ExternalFields/Electromagnets/src/KLineCurrentIntegrator.cc diff --git a/KEMField/Source/2.0/ExternalFields/Electromagnets/src/KSolenoid.cc b/KEMField/Source/ExternalFields/Electromagnets/src/KSolenoid.cc similarity index 100% rename from KEMField/Source/2.0/ExternalFields/Electromagnets/src/KSolenoid.cc rename to KEMField/Source/ExternalFields/Electromagnets/src/KSolenoid.cc diff --git a/KEMField/Source/2.0/ExternalFields/Electromagnets/src/KSolenoidIntegrator.cc b/KEMField/Source/ExternalFields/Electromagnets/src/KSolenoidIntegrator.cc similarity index 100% rename from KEMField/Source/2.0/ExternalFields/Electromagnets/src/KSolenoidIntegrator.cc rename to KEMField/Source/ExternalFields/Electromagnets/src/KSolenoidIntegrator.cc diff --git a/KEMField/Source/2.0/FastMultipole/Applications/AccuracyComparisonFastMultipole.cc b/KEMField/Source/FastMultipole/Applications/AccuracyComparisonFastMultipole.cc similarity index 100% rename from KEMField/Source/2.0/FastMultipole/Applications/AccuracyComparisonFastMultipole.cc rename to KEMField/Source/FastMultipole/Applications/AccuracyComparisonFastMultipole.cc diff --git a/KEMField/Source/2.0/FastMultipole/Applications/CMakeLists.txt b/KEMField/Source/FastMultipole/Applications/CMakeLists.txt similarity index 95% rename from KEMField/Source/2.0/FastMultipole/Applications/CMakeLists.txt rename to KEMField/Source/FastMultipole/Applications/CMakeLists.txt index dbf4b4398..50b7bf4c6 100644 --- a/KEMField/Source/2.0/FastMultipole/Applications/CMakeLists.txt +++ b/KEMField/Source/FastMultipole/Applications/CMakeLists.txt @@ -97,7 +97,7 @@ if (@PROJECT_NAME@_ENABLE_FM_APP) ) - if (KEMField_USE_KGEOBAG) + if(@PROJECT_NAME@_USE_KGEOBAG) # add_executable (ComputeSphericalCapacitorFastMultipole # ${CMAKE_CURRENT_SOURCE_DIR}/ComputeSphericalCapacitorFastMultipole.cc) @@ -112,11 +112,10 @@ if (@PROJECT_NAME@_ENABLE_FM_APP) AccuracyComparisonFastMultipole ) - endif (KEMField_USE_KGEOBAG) - + endif (@PROJECT_NAME@_USE_KGEOBAG) - if (KEMField_USE_ROOT) + if (@PROJECT_NAME@_USE_ROOT) add_executable (ConvertFieldMapToROOT ${CMAKE_CURRENT_SOURCE_DIR}/ConvertFieldMapToROOT.cc) target_link_libraries (ConvertFieldMapToROOT ${FAST_MULTIPOLE_APP_LIBS} ${KasperCommon_LIBRARIES}) @@ -125,9 +124,9 @@ if (@PROJECT_NAME@_ENABLE_FM_APP) ConvertFieldMapToROOT ) - endif (KEMField_USE_ROOT) + endif (@PROJECT_NAME@_USE_ROOT) - if (KEMField_USE_VTK) + if (@PROJECT_NAME@_USE_VTK) add_executable (ConvertFieldMapToVTK ${CMAKE_CURRENT_SOURCE_DIR}/ConvertFieldMapToVTK.cc) @@ -143,7 +142,7 @@ if (@PROJECT_NAME@_ENABLE_FM_APP) VisualizeElectrostaticMultipoleTree ) - endif (KEMField_USE_VTK) + endif (@PROJECT_NAME@_USE_VTK) install (DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/FastMultipoleApplicationFiles DESTINATION ${@PROJECT_NAME@_CONFIG_INSTALL_DIR} diff --git a/KEMField/Source/2.0/FastMultipole/Applications/CompareChargeDensities.cc b/KEMField/Source/FastMultipole/Applications/CompareChargeDensities.cc similarity index 100% rename from KEMField/Source/2.0/FastMultipole/Applications/CompareChargeDensities.cc rename to KEMField/Source/FastMultipole/Applications/CompareChargeDensities.cc diff --git a/KEMField/Source/2.0/FastMultipole/Applications/ComputeResidualNormFastMultipole.cc b/KEMField/Source/FastMultipole/Applications/ComputeResidualNormFastMultipole.cc similarity index 100% rename from KEMField/Source/2.0/FastMultipole/Applications/ComputeResidualNormFastMultipole.cc rename to KEMField/Source/FastMultipole/Applications/ComputeResidualNormFastMultipole.cc diff --git a/KEMField/Source/2.0/FastMultipole/Applications/ConvertFieldMapToROOT.cc b/KEMField/Source/FastMultipole/Applications/ConvertFieldMapToROOT.cc similarity index 100% rename from KEMField/Source/2.0/FastMultipole/Applications/ConvertFieldMapToROOT.cc rename to KEMField/Source/FastMultipole/Applications/ConvertFieldMapToROOT.cc diff --git a/KEMField/Source/2.0/FastMultipole/Applications/ConvertFieldMapToVTK.cc b/KEMField/Source/FastMultipole/Applications/ConvertFieldMapToVTK.cc similarity index 100% rename from KEMField/Source/2.0/FastMultipole/Applications/ConvertFieldMapToVTK.cc rename to KEMField/Source/FastMultipole/Applications/ConvertFieldMapToVTK.cc diff --git a/KEMField/Source/2.0/FastMultipole/Applications/FastMultipoleApplicationFiles/AccuracyComparisonFastMultipole_ConfigurationExample.xml b/KEMField/Source/FastMultipole/Applications/FastMultipoleApplicationFiles/AccuracyComparisonFastMultipole_ConfigurationExample.xml similarity index 100% rename from KEMField/Source/2.0/FastMultipole/Applications/FastMultipoleApplicationFiles/AccuracyComparisonFastMultipole_ConfigurationExample.xml rename to KEMField/Source/FastMultipole/Applications/FastMultipoleApplicationFiles/AccuracyComparisonFastMultipole_ConfigurationExample.xml diff --git a/KEMField/Source/2.0/FastMultipole/Applications/FastMultipoleApplicationFiles/ComputeSphericalCapacitorFastMultipole_ConfigurationExample.xml b/KEMField/Source/FastMultipole/Applications/FastMultipoleApplicationFiles/ComputeSphericalCapacitorFastMultipole_ConfigurationExample.xml similarity index 100% rename from KEMField/Source/2.0/FastMultipole/Applications/FastMultipoleApplicationFiles/ComputeSphericalCapacitorFastMultipole_ConfigurationExample.xml rename to KEMField/Source/FastMultipole/Applications/FastMultipoleApplicationFiles/ComputeSphericalCapacitorFastMultipole_ConfigurationExample.xml diff --git a/KEMField/Source/2.0/FastMultipole/Applications/FastMultipoleApplicationFiles/TestFastMultipoleFieldSolverConfigurationExample.xml b/KEMField/Source/FastMultipole/Applications/FastMultipoleApplicationFiles/TestFastMultipoleFieldSolverConfigurationExample.xml similarity index 100% rename from KEMField/Source/2.0/FastMultipole/Applications/FastMultipoleApplicationFiles/TestFastMultipoleFieldSolverConfigurationExample.xml rename to KEMField/Source/FastMultipole/Applications/FastMultipoleApplicationFiles/TestFastMultipoleFieldSolverConfigurationExample.xml diff --git a/KEMField/Source/2.0/FastMultipole/Applications/PlotSparseMatrixStructure.cc b/KEMField/Source/FastMultipole/Applications/PlotSparseMatrixStructure.cc similarity index 100% rename from KEMField/Source/2.0/FastMultipole/Applications/PlotSparseMatrixStructure.cc rename to KEMField/Source/FastMultipole/Applications/PlotSparseMatrixStructure.cc diff --git a/KEMField/Source/2.0/FastMultipole/Applications/TestFastMultipoleDualTree.cc b/KEMField/Source/FastMultipole/Applications/TestFastMultipoleDualTree.cc similarity index 100% rename from KEMField/Source/2.0/FastMultipole/Applications/TestFastMultipoleDualTree.cc rename to KEMField/Source/FastMultipole/Applications/TestFastMultipoleDualTree.cc diff --git a/KEMField/Source/2.0/FastMultipole/Applications/TestFastMultipoleGeometryAnalysis.cc b/KEMField/Source/FastMultipole/Applications/TestFastMultipoleGeometryAnalysis.cc similarity index 100% rename from KEMField/Source/2.0/FastMultipole/Applications/TestFastMultipoleGeometryAnalysis.cc rename to KEMField/Source/FastMultipole/Applications/TestFastMultipoleGeometryAnalysis.cc diff --git a/KEMField/Source/2.0/FastMultipole/Applications/VisualizeElectrostaticMultipoleTree.cc b/KEMField/Source/FastMultipole/Applications/VisualizeElectrostaticMultipoleTree.cc similarity index 74% rename from KEMField/Source/2.0/FastMultipole/Applications/VisualizeElectrostaticMultipoleTree.cc rename to KEMField/Source/FastMultipole/Applications/VisualizeElectrostaticMultipoleTree.cc index 9094b00a2..e99346fac 100644 --- a/KEMField/Source/2.0/FastMultipole/Applications/VisualizeElectrostaticMultipoleTree.cc +++ b/KEMField/Source/FastMultipole/Applications/VisualizeElectrostaticMultipoleTree.cc @@ -25,14 +25,15 @@ int main(int argc, char* argv[]) "\n" "Usage: VisualizeElectrostaticMultipoleTree \n" "\n" - "This program takes a KEMField geometry file and produces a ParaView file of the\n" - "geometry.\n" + "This program takes a KEMField geometry file and produces two ParaView files of the\n" + "geometry ('.vtp') and the multipole tree ('.vtu').\n" "\n" "\tAvailable options:\n" "\t -h, --help (shows this message and exits)\n" - "\t -n, --name (name of tree )\n"; + "\t -n, --name (required; name of tree, e.g from InspectEMFile)\n" + "\t -d, --display (bool; display geometry on screen)\n"; - if(argc == 1) + if (argc <= 2) // --name is a required argument { std::cout< +KFMVTKElectrostaticTreeViewerBuilder; + +template< > +inline bool KFMVTKElectrostaticTreeViewerBuilder::Begin() +{ + fObject = new KEMField::KFMVTKElectrostaticTreeViewerData; + return true; +} + +template< > +inline bool KFMVTKElectrostaticTreeViewerBuilder::AddAttribute( KContainer* aContainer ) +{ + if( aContainer->GetName() == "file" ) + { + aContainer->CopyTo( fObject->fFileName ); + return true; + } + if( aContainer->GetName() == "save" ) + { + aContainer->CopyTo( fObject->fSaveGeometry ); + return true; + } + return false; +} + +template< > +inline bool KFMVTKElectrostaticTreeViewerBuilder::End() +{ + KEMField::KFMElectrostaticTree *tTree = dynamic_cast(fParentElement); + + KEMField::KFMVTKElectrostaticTreeViewer *tViewer = new KEMField::KFMVTKElectrostaticTreeViewer(*tTree); + + if (fObject->fSaveGeometry) + { + tViewer->GenerateGeometryFile(fObject->fFileName); + } + + delete tViewer; + return true; +} + +} /* namespace katrin */ + +#endif /* KEMFIELD_SOURCE_2_0_PLUGINS_BINDINGS_FIELDSOLVERS_ELECTRIC_INCLUDE_KFMVTKELECTROSTATICTREEVIEWERBUILDER_HH_ */ diff --git a/KEMField/Source/2.0/Plugins/Bindings/FieldSolvers/Electric/include/KIntegratingElectrostaticFieldSolverBuilder.hh b/KEMField/Source/Plugins/Bindings/FieldSolvers/Electric/include/KIntegratingElectrostaticFieldSolverBuilder.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/Bindings/FieldSolvers/Electric/include/KIntegratingElectrostaticFieldSolverBuilder.hh rename to KEMField/Source/Plugins/Bindings/FieldSolvers/Electric/include/KIntegratingElectrostaticFieldSolverBuilder.hh diff --git a/KEMField/Source/2.0/Plugins/Bindings/FieldSolvers/Electric/src/KElectricFastMultipoleFieldSolverBuilder.cc b/KEMField/Source/Plugins/Bindings/FieldSolvers/Electric/src/KElectricFastMultipoleFieldSolverBuilder.cc similarity index 100% rename from KEMField/Source/2.0/Plugins/Bindings/FieldSolvers/Electric/src/KElectricFastMultipoleFieldSolverBuilder.cc rename to KEMField/Source/Plugins/Bindings/FieldSolvers/Electric/src/KElectricFastMultipoleFieldSolverBuilder.cc diff --git a/KEMField/Source/2.0/Plugins/Bindings/FieldSolvers/Electric/src/KElectricZHFieldSolverBuilder.cc b/KEMField/Source/Plugins/Bindings/FieldSolvers/Electric/src/KElectricZHFieldSolverBuilder.cc similarity index 100% rename from KEMField/Source/2.0/Plugins/Bindings/FieldSolvers/Electric/src/KElectricZHFieldSolverBuilder.cc rename to KEMField/Source/Plugins/Bindings/FieldSolvers/Electric/src/KElectricZHFieldSolverBuilder.cc diff --git a/KEMField/Source/Plugins/Bindings/FieldSolvers/Electric/src/KFMVTKElectrostaticTreeViewerBuilder.cc b/KEMField/Source/Plugins/Bindings/FieldSolvers/Electric/src/KFMVTKElectrostaticTreeViewerBuilder.cc new file mode 100644 index 000000000..2f8f88a23 --- /dev/null +++ b/KEMField/Source/Plugins/Bindings/FieldSolvers/Electric/src/KFMVTKElectrostaticTreeViewerBuilder.cc @@ -0,0 +1,27 @@ +/* + * KVTKViewerVisitorBuilder.cc + * + * Created on: + * Author: + */ + +#include "KFMVTKElectrostaticTreeViewerBuilder.hh" +#include "KElectricFastMultipoleFieldSolverBuilder.hh" + +namespace katrin { + +template< > +KFMVTKElectrostaticTreeViewerBuilder::~KComplexElement() +{ +} + +STATICINT sKFMVTKElectrostaticTreeViewerBuilderStructure = + KFMVTKElectrostaticTreeViewerBuilder::Attribute< std::string >( "file" ) + + //KFMVTKElectrostaticTreeViewerBuilder::Attribute< bool >( "view" ) + + KFMVTKElectrostaticTreeViewerBuilder::Attribute< bool >( "save" ); + +STATICINT sKElectricFastMultipoleFieldSolver = + KElectricFastMultipoleFieldSolverBuilder::ComplexElement< KEMField::KFMVTKElectrostaticTreeViewerData > + ( "viewer" ); + +} /* namespace katrin */ diff --git a/KEMField/Source/2.0/Plugins/Bindings/FieldSolvers/Electric/src/KIntegratingElectrostaticFieldSolverBuilder.cc b/KEMField/Source/Plugins/Bindings/FieldSolvers/Electric/src/KIntegratingElectrostaticFieldSolverBuilder.cc similarity index 100% rename from KEMField/Source/2.0/Plugins/Bindings/FieldSolvers/Electric/src/KIntegratingElectrostaticFieldSolverBuilder.cc rename to KEMField/Source/Plugins/Bindings/FieldSolvers/Electric/src/KIntegratingElectrostaticFieldSolverBuilder.cc diff --git a/KEMField/Source/2.0/Plugins/Bindings/FieldSolvers/Magnetic/include/KIntegratingMagnetostaticFieldSolverBuilder.hh b/KEMField/Source/Plugins/Bindings/FieldSolvers/Magnetic/include/KIntegratingMagnetostaticFieldSolverBuilder.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/Bindings/FieldSolvers/Magnetic/include/KIntegratingMagnetostaticFieldSolverBuilder.hh rename to KEMField/Source/Plugins/Bindings/FieldSolvers/Magnetic/include/KIntegratingMagnetostaticFieldSolverBuilder.hh diff --git a/KEMField/Source/2.0/Plugins/Bindings/FieldSolvers/Magnetic/include/KZonalHarmonicMagnetostaticFieldSolverBuilder.hh b/KEMField/Source/Plugins/Bindings/FieldSolvers/Magnetic/include/KZonalHarmonicMagnetostaticFieldSolverBuilder.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/Bindings/FieldSolvers/Magnetic/include/KZonalHarmonicMagnetostaticFieldSolverBuilder.hh rename to KEMField/Source/Plugins/Bindings/FieldSolvers/Magnetic/include/KZonalHarmonicMagnetostaticFieldSolverBuilder.hh diff --git a/KEMField/Source/2.0/Plugins/Bindings/FieldSolvers/Magnetic/src/KIntegratingMagnetostaticFieldSolverBuilder.cc b/KEMField/Source/Plugins/Bindings/FieldSolvers/Magnetic/src/KIntegratingMagnetostaticFieldSolverBuilder.cc similarity index 100% rename from KEMField/Source/2.0/Plugins/Bindings/FieldSolvers/Magnetic/src/KIntegratingMagnetostaticFieldSolverBuilder.cc rename to KEMField/Source/Plugins/Bindings/FieldSolvers/Magnetic/src/KIntegratingMagnetostaticFieldSolverBuilder.cc diff --git a/KEMField/Source/2.0/Plugins/Bindings/FieldSolvers/Magnetic/src/KZonalHarmonicMagnetostaticFieldSolverBuilder.cc b/KEMField/Source/Plugins/Bindings/FieldSolvers/Magnetic/src/KZonalHarmonicMagnetostaticFieldSolverBuilder.cc similarity index 100% rename from KEMField/Source/2.0/Plugins/Bindings/FieldSolvers/Magnetic/src/KZonalHarmonicMagnetostaticFieldSolverBuilder.cc rename to KEMField/Source/Plugins/Bindings/FieldSolvers/Magnetic/src/KZonalHarmonicMagnetostaticFieldSolverBuilder.cc diff --git a/KEMField/Source/2.0/Plugins/Bindings/Fields/Electric/include/KBoundaryElementInfoDisplayBuilder.hh b/KEMField/Source/Plugins/Bindings/Fields/Electric/include/KBoundaryElementInfoDisplayBuilder.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/Bindings/Fields/Electric/include/KBoundaryElementInfoDisplayBuilder.hh rename to KEMField/Source/Plugins/Bindings/Fields/Electric/include/KBoundaryElementInfoDisplayBuilder.hh diff --git a/KEMField/Source/2.0/Plugins/Bindings/Fields/Electric/include/KElectricQuadrupoleFieldBuilder.hh b/KEMField/Source/Plugins/Bindings/Fields/Electric/include/KElectricQuadrupoleFieldBuilder.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/Bindings/Fields/Electric/include/KElectricQuadrupoleFieldBuilder.hh rename to KEMField/Source/Plugins/Bindings/Fields/Electric/include/KElectricQuadrupoleFieldBuilder.hh diff --git a/KEMField/Source/Plugins/Bindings/Fields/Electric/include/KElectrostaticBoundaryFieldBuilder.hh b/KEMField/Source/Plugins/Bindings/Fields/Electric/include/KElectrostaticBoundaryFieldBuilder.hh new file mode 100644 index 000000000..cc1b19a03 --- /dev/null +++ b/KEMField/Source/Plugins/Bindings/Fields/Electric/include/KElectrostaticBoundaryFieldBuilder.hh @@ -0,0 +1,186 @@ +/* + * KElectrostaticBoundaryFieldBuilder.hh + * + * Created on: 17 Jun 2015 + * Author: wolfgang + */ + +#ifndef KEMFIELD_SOURCE_2_0_PLUGINS_BINDINGS_FIELDS_ELECTRIC_INCLUDE_KELECTROSTATICBOUNDARYFIELDBUILDER_HH_ +#define KEMFIELD_SOURCE_2_0_PLUGINS_BINDINGS_FIELDS_ELECTRIC_INCLUDE_KELECTROSTATICBOUNDARYFIELDBUILDER_HH_ + +#include "KEMBindingsMessage.hh" +#include "KSmartPointerRelease.hh" +#include "KComplexElement.hh" +#include "KElectrostaticBoundaryFieldWithKGeoBag.hh" +#include "KSmartPointerRelease.hh" + +namespace katrin { + +typedef KComplexElement< KEMField::KElectrostaticBoundaryFieldWithKGeoBag> +KElectrostaticBoundaryFieldBuilder; + +template< > +inline bool KElectrostaticBoundaryFieldBuilder::AddAttribute( KContainer* aContainer ) +{ + if( aContainer->GetName() == "name" ) + { + std::string name; + aContainer->CopyTo(name); + fObject->SetName(name); + SetName(name); + } + else if( aContainer->GetName() == "directory" ) + { + aContainer->CopyTo( fObject, &KEMField::KElectrostaticBoundaryFieldWithKGeoBag::SetDirectory ); + } + else if( aContainer->GetName() == "file" ) + { + aContainer->CopyTo( fObject, &KEMField::KElectrostaticBoundaryFieldWithKGeoBag::SetFile ); + } + else if( aContainer->GetName() == "system" ) + { + KGeoBag::KGSpace* tSpace = KGeoBag::KGInterface::GetInstance()->RetrieveSpace( aContainer->AsReference< string >() ); + + if( tSpace == NULL ) + { + BINDINGMSG( eWarning ) << "no spaces found for specifier <" << aContainer->AsReference< string >() << ">" << eom; + return false; + } + + fObject->SetSystem( tSpace ); + } + else if( aContainer->GetName() == "surfaces" ) + { + std::vector< KGeoBag::KGSurface* > tSurfaces = KGeoBag::KGInterface::GetInstance()->RetrieveSurfaces( aContainer->AsReference< string >() ); + std::vector< KGeoBag::KGSurface* >::const_iterator tSurfaceIt; + KGeoBag::KGSurface* tSurface; + + if( tSurfaces.size() == 0 ) + { + BINDINGMSG( eWarning ) << "no surfaces found for specifier <" << aContainer->AsReference< string >() << ">" << eom; + return true; + } + + for( tSurfaceIt = tSurfaces.begin(); tSurfaceIt != tSurfaces.end(); tSurfaceIt++ ) + { + tSurface = *tSurfaceIt; + fObject->AddSurface( tSurface ); + } + } + else if( aContainer->GetName() == "spaces" ) + { + std::vector< KGeoBag::KGSpace* > tSpaces = KGeoBag::KGInterface::GetInstance()->RetrieveSpaces( aContainer->AsReference< string >() ); + std::vector< KGeoBag::KGSpace* >::const_iterator tSpaceIt; + KGeoBag::KGSpace* tSpace; + + if( tSpaces.size() == 0 ) + { + BINDINGMSG( eWarning ) << "no spaces found for specifier <" << aContainer->AsReference< string >() << ">" << eom; + return true; + } + + for( tSpaceIt = tSpaces.begin(); tSpaceIt != tSpaces.end(); tSpaceIt++ ) + { + tSpace = *tSpaceIt; + fObject->AddSpace( tSpace ); + } + } + else if( aContainer->GetName() == "symmetry" ) + { + if( aContainer->AsReference< string >() == "none" ) + { + fObject->SetSymmetry( KEMField::KElectrostaticBoundaryFieldWithKGeoBag::NoSymmetry ); + return true; + } + if( aContainer->AsReference< string >() == "axial" ) + { + fObject->SetSymmetry( KEMField::KElectrostaticBoundaryFieldWithKGeoBag::AxialSymmetry ); + return true; + } + if( aContainer->AsReference< string >() == "discrete_axial" ) + { + fObject->SetSymmetry( KEMField::KElectrostaticBoundaryFieldWithKGeoBag::DiscreteAxialSymmetry ); + return true; + } + BINDINGMSG( eWarning ) << "symmetry must be , , or " << eom; + return false; + } + else if( aContainer->GetName() == "hash_masked_bits" ) + { + aContainer->CopyTo( fObject, &KEMField::KElectrostaticBoundaryFieldWithKGeoBag::SetHashMaskedBits ); + } + else if( aContainer->GetName() == "hash_threshold" ) + { + aContainer->CopyTo( fObject, &KEMField::KElectrostaticBoundaryFieldWithKGeoBag::SetHashThreshold ); + } + else if( aContainer->GetName() == "minimum_element_area" ) + { + aContainer->CopyTo( fObject, &KEMField::KElectrostaticBoundaryFieldWithKGeoBag::SetMinimumElementArea); + } + else if( aContainer->GetName() == "maximum_element_aspect_ratio" ) + { + aContainer->CopyTo( fObject, &KEMField::KElectrostaticBoundaryFieldWithKGeoBag::SetMaximumElementAspectRatio); + } + else return false; + return true; +} + +template< > +inline bool KElectrostaticBoundaryFieldBuilder::AddElement( KContainer* anElement ) +{ + if(anElement->Is()) + { + if(!(fObject->GetChargeDensitySolver()) ){ + KEMField::KSmartPointer solver = + ReleaseToSmartPtr(anElement); + fObject->SetChargeDensitySolver(solver); + } + else{ + BINDINGMSG(eError) << "Cannot set more than one charge density solver for field " << GetName() << "!"<< eom; + } + } + else if(anElement->Is()) + { + if(!(fObject->GetFieldSolver()) ){ + KEMField::KSmartPointer solver = + ReleaseToSmartPtr(anElement); + fObject->SetFieldSolver(solver); + } + else{ + BINDINGMSG(eError) << "Cannot set more than one field solver for field " << GetName() << "!"<< eom; + } + } + else if(anElement->Is()) + { + KEMField::KSmartPointer visitor = + ReleaseToSmartPtr(anElement); + fObject->AddVisitor(visitor); + } + else return false; + return true; +} + +template< > +inline bool KElectrostaticBoundaryFieldBuilder::End() { + if(!fObject->GetChargeDensitySolver() && !fObject->GetFieldSolver()) + { + BINDINGMSG( eError ) << " No charge density solver and no field solver" + " set in field " << GetName() << "!" << eom; + } + else if(!fObject->GetChargeDensitySolver()) + { + BINDINGMSG( eError ) << " No charge density solver" + " set in field " << GetName() << "!" << eom; + } + else if(!fObject->GetFieldSolver()) + { + BINDINGMSG( eError ) << " No field solver" + " set in field " << GetName() << "!" << eom; + } + else return true; + return false; +} + +} // katrin + +#endif /* KEMFIELD_SOURCE_2_0_PLUGINS_BINDINGS_FIELDS_ELECTRIC_INCLUDE_KELECTROSTATICBOUNDARYFIELDBUILDER_HH_ */ diff --git a/KEMField/Source/2.0/Plugins/Bindings/Fields/Electric/include/KElectrostaticBoundaryFieldTimerBuilder.hh b/KEMField/Source/Plugins/Bindings/Fields/Electric/include/KElectrostaticBoundaryFieldTimerBuilder.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/Bindings/Fields/Electric/include/KElectrostaticBoundaryFieldTimerBuilder.hh rename to KEMField/Source/Plugins/Bindings/Fields/Electric/include/KElectrostaticBoundaryFieldTimerBuilder.hh diff --git a/KEMField/Source/2.0/Plugins/Bindings/Fields/Electric/include/KElectrostaticConstantFieldBuilder.hh b/KEMField/Source/Plugins/Bindings/Fields/Electric/include/KElectrostaticConstantFieldBuilder.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/Bindings/Fields/Electric/include/KElectrostaticConstantFieldBuilder.hh rename to KEMField/Source/Plugins/Bindings/Fields/Electric/include/KElectrostaticConstantFieldBuilder.hh diff --git a/KEMField/Source/2.0/Plugins/Bindings/Fields/Electric/include/KElectrostaticPotentialmapBuilder.hh b/KEMField/Source/Plugins/Bindings/Fields/Electric/include/KElectrostaticPotentialmapBuilder.hh similarity index 98% rename from KEMField/Source/2.0/Plugins/Bindings/Fields/Electric/include/KElectrostaticPotentialmapBuilder.hh rename to KEMField/Source/Plugins/Bindings/Fields/Electric/include/KElectrostaticPotentialmapBuilder.hh index ba4ed7635..14f1e4364 100644 --- a/KEMField/Source/2.0/Plugins/Bindings/Fields/Electric/include/KElectrostaticPotentialmapBuilder.hh +++ b/KEMField/Source/Plugins/Bindings/Fields/Electric/include/KElectrostaticPotentialmapBuilder.hh @@ -1,5 +1,5 @@ /* - * KElectricPotentialMapBuilder.hh + * KElectricPotentialmapBuilder.hh * * Created on: 27 May 2016 * Author: wolfgang @@ -15,7 +15,7 @@ #include "KToolbox.h" #ifdef KEMFIELD_USE_VTK -#include "KElectrostaticPotentialMap.hh" +#include "KElectrostaticPotentialmap.hh" namespace katrin { diff --git a/KEMField/Source/2.0/Plugins/Bindings/Fields/Electric/include/KInducedAzimuthalElectricFieldBuilder.hh b/KEMField/Source/Plugins/Bindings/Fields/Electric/include/KInducedAzimuthalElectricFieldBuilder.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/Bindings/Fields/Electric/include/KInducedAzimuthalElectricFieldBuilder.hh rename to KEMField/Source/Plugins/Bindings/Fields/Electric/include/KInducedAzimuthalElectricFieldBuilder.hh diff --git a/KEMField/Source/2.0/Plugins/Bindings/Fields/Electric/include/KRampedElectric2FieldBuilder.hh b/KEMField/Source/Plugins/Bindings/Fields/Electric/include/KRampedElectric2FieldBuilder.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/Bindings/Fields/Electric/include/KRampedElectric2FieldBuilder.hh rename to KEMField/Source/Plugins/Bindings/Fields/Electric/include/KRampedElectric2FieldBuilder.hh diff --git a/KEMField/Source/2.0/Plugins/Bindings/Fields/Electric/include/KRampedElectricFieldBuilder.hh b/KEMField/Source/Plugins/Bindings/Fields/Electric/include/KRampedElectricFieldBuilder.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/Bindings/Fields/Electric/include/KRampedElectricFieldBuilder.hh rename to KEMField/Source/Plugins/Bindings/Fields/Electric/include/KRampedElectricFieldBuilder.hh diff --git a/KEMField/Source/2.0/Plugins/Bindings/Fields/Electric/include/KVTKViewerVisitorBuilder.hh b/KEMField/Source/Plugins/Bindings/Fields/Electric/include/KVTKViewerVisitorBuilder.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/Bindings/Fields/Electric/include/KVTKViewerVisitorBuilder.hh rename to KEMField/Source/Plugins/Bindings/Fields/Electric/include/KVTKViewerVisitorBuilder.hh diff --git a/KEMField/Source/2.0/Plugins/Bindings/Fields/Electric/src/KBoundaryElementInfoDisplayBuilder.cc b/KEMField/Source/Plugins/Bindings/Fields/Electric/src/KBoundaryElementInfoDisplayBuilder.cc similarity index 100% rename from KEMField/Source/2.0/Plugins/Bindings/Fields/Electric/src/KBoundaryElementInfoDisplayBuilder.cc rename to KEMField/Source/Plugins/Bindings/Fields/Electric/src/KBoundaryElementInfoDisplayBuilder.cc diff --git a/KEMField/Source/2.0/Plugins/Bindings/Fields/Electric/src/KElectricQuadrupoleFieldBuilder.cc b/KEMField/Source/Plugins/Bindings/Fields/Electric/src/KElectricQuadrupoleFieldBuilder.cc similarity index 100% rename from KEMField/Source/2.0/Plugins/Bindings/Fields/Electric/src/KElectricQuadrupoleFieldBuilder.cc rename to KEMField/Source/Plugins/Bindings/Fields/Electric/src/KElectricQuadrupoleFieldBuilder.cc diff --git a/KEMField/Source/2.0/Plugins/Bindings/Fields/Electric/src/KElectrostaticBoundaryFieldBuilder.cc b/KEMField/Source/Plugins/Bindings/Fields/Electric/src/KElectrostaticBoundaryFieldBuilder.cc similarity index 100% rename from KEMField/Source/2.0/Plugins/Bindings/Fields/Electric/src/KElectrostaticBoundaryFieldBuilder.cc rename to KEMField/Source/Plugins/Bindings/Fields/Electric/src/KElectrostaticBoundaryFieldBuilder.cc diff --git a/KEMField/Source/2.0/Plugins/Bindings/Fields/Electric/src/KElectrostaticBoundaryFieldTimerBuilder.cc b/KEMField/Source/Plugins/Bindings/Fields/Electric/src/KElectrostaticBoundaryFieldTimerBuilder.cc similarity index 100% rename from KEMField/Source/2.0/Plugins/Bindings/Fields/Electric/src/KElectrostaticBoundaryFieldTimerBuilder.cc rename to KEMField/Source/Plugins/Bindings/Fields/Electric/src/KElectrostaticBoundaryFieldTimerBuilder.cc diff --git a/KEMField/Source/2.0/Plugins/Bindings/Fields/Electric/src/KElectrostaticConstantFieldBuilder.cc b/KEMField/Source/Plugins/Bindings/Fields/Electric/src/KElectrostaticConstantFieldBuilder.cc similarity index 100% rename from KEMField/Source/2.0/Plugins/Bindings/Fields/Electric/src/KElectrostaticConstantFieldBuilder.cc rename to KEMField/Source/Plugins/Bindings/Fields/Electric/src/KElectrostaticConstantFieldBuilder.cc diff --git a/KEMField/Source/2.0/Plugins/Bindings/Fields/Electric/src/KElectrostaticPotentialmapBuilder.cc b/KEMField/Source/Plugins/Bindings/Fields/Electric/src/KElectrostaticPotentialmapBuilder.cc similarity index 98% rename from KEMField/Source/2.0/Plugins/Bindings/Fields/Electric/src/KElectrostaticPotentialmapBuilder.cc rename to KEMField/Source/Plugins/Bindings/Fields/Electric/src/KElectrostaticPotentialmapBuilder.cc index 22f6ebbfd..33b459975 100644 --- a/KEMField/Source/2.0/Plugins/Bindings/Fields/Electric/src/KElectrostaticPotentialmapBuilder.cc +++ b/KEMField/Source/Plugins/Bindings/Fields/Electric/src/KElectrostaticPotentialmapBuilder.cc @@ -1,5 +1,5 @@ /* - * KElectricPotentialMapBuilder.cc + * KElectricPotentialmapBuilder.cc * * Created on: 27 May 2016 * Author: wolfgang diff --git a/KEMField/Source/2.0/Plugins/Bindings/Fields/Electric/src/KInducedAzimuthalElectricFieldBuilder.cc b/KEMField/Source/Plugins/Bindings/Fields/Electric/src/KInducedAzimuthalElectricFieldBuilder.cc similarity index 100% rename from KEMField/Source/2.0/Plugins/Bindings/Fields/Electric/src/KInducedAzimuthalElectricFieldBuilder.cc rename to KEMField/Source/Plugins/Bindings/Fields/Electric/src/KInducedAzimuthalElectricFieldBuilder.cc diff --git a/KEMField/Source/2.0/Plugins/Bindings/Fields/Electric/src/KRampedElectric2FieldBuilder.cc b/KEMField/Source/Plugins/Bindings/Fields/Electric/src/KRampedElectric2FieldBuilder.cc similarity index 100% rename from KEMField/Source/2.0/Plugins/Bindings/Fields/Electric/src/KRampedElectric2FieldBuilder.cc rename to KEMField/Source/Plugins/Bindings/Fields/Electric/src/KRampedElectric2FieldBuilder.cc diff --git a/KEMField/Source/2.0/Plugins/Bindings/Fields/Electric/src/KRampedElectricFieldBuilder.cc b/KEMField/Source/Plugins/Bindings/Fields/Electric/src/KRampedElectricFieldBuilder.cc similarity index 100% rename from KEMField/Source/2.0/Plugins/Bindings/Fields/Electric/src/KRampedElectricFieldBuilder.cc rename to KEMField/Source/Plugins/Bindings/Fields/Electric/src/KRampedElectricFieldBuilder.cc diff --git a/KEMField/Source/2.0/Plugins/Bindings/Fields/Electric/src/KVTKViewerVisitorBuilder.cc b/KEMField/Source/Plugins/Bindings/Fields/Electric/src/KVTKViewerVisitorBuilder.cc similarity index 100% rename from KEMField/Source/2.0/Plugins/Bindings/Fields/Electric/src/KVTKViewerVisitorBuilder.cc rename to KEMField/Source/Plugins/Bindings/Fields/Electric/src/KVTKViewerVisitorBuilder.cc diff --git a/KEMField/Source/2.0/Plugins/Bindings/Fields/Magnetic/include/KMagneticDipoleFieldBuilder.hh b/KEMField/Source/Plugins/Bindings/Fields/Magnetic/include/KMagneticDipoleFieldBuilder.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/Bindings/Fields/Magnetic/include/KMagneticDipoleFieldBuilder.hh rename to KEMField/Source/Plugins/Bindings/Fields/Magnetic/include/KMagneticDipoleFieldBuilder.hh diff --git a/KEMField/Source/2.0/Plugins/Bindings/Fields/Magnetic/include/KMagneticSuperpositionFieldBuilder.hh b/KEMField/Source/Plugins/Bindings/Fields/Magnetic/include/KMagneticSuperpositionFieldBuilder.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/Bindings/Fields/Magnetic/include/KMagneticSuperpositionFieldBuilder.hh rename to KEMField/Source/Plugins/Bindings/Fields/Magnetic/include/KMagneticSuperpositionFieldBuilder.hh diff --git a/KEMField/Source/2.0/Plugins/Bindings/Fields/Magnetic/include/KMagnetostaticConstantFieldBuilder.hh b/KEMField/Source/Plugins/Bindings/Fields/Magnetic/include/KMagnetostaticConstantFieldBuilder.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/Bindings/Fields/Magnetic/include/KMagnetostaticConstantFieldBuilder.hh rename to KEMField/Source/Plugins/Bindings/Fields/Magnetic/include/KMagnetostaticConstantFieldBuilder.hh diff --git a/KEMField/Source/2.0/Plugins/Bindings/Fields/Magnetic/include/KMagnetostaticFieldmapBuilder.hh b/KEMField/Source/Plugins/Bindings/Fields/Magnetic/include/KMagnetostaticFieldmapBuilder.hh similarity index 86% rename from KEMField/Source/2.0/Plugins/Bindings/Fields/Magnetic/include/KMagnetostaticFieldmapBuilder.hh rename to KEMField/Source/Plugins/Bindings/Fields/Magnetic/include/KMagnetostaticFieldmapBuilder.hh index 1bd7284e1..59a007768 100644 --- a/KEMField/Source/2.0/Plugins/Bindings/Fields/Magnetic/include/KMagnetostaticFieldmapBuilder.hh +++ b/KEMField/Source/Plugins/Bindings/Fields/Magnetic/include/KMagnetostaticFieldmapBuilder.hh @@ -1,5 +1,5 @@ /* - * KMagneticFieldMapBuilder.hh + * KMagnetostaticFieldmapBuilder.hh * * Created on: 27 May 2016 * Author: wolfgang @@ -15,15 +15,15 @@ #include "KToolbox.h" #ifdef KEMFIELD_USE_VTK -#include "KMagnetostaticFieldMap.hh" +#include "KMagnetostaticFieldmap.hh" namespace katrin { typedef KComplexElement< KEMField::KMagnetostaticFieldmap > -KMagnetostaticFieldMapBuilder; +KMagnetostaticFieldmapBuilder; template< > -inline bool KMagnetostaticFieldMapBuilder::AddAttribute( KContainer* aContainer ) +inline bool KMagnetostaticFieldmapBuilder::AddAttribute( KContainer* aContainer ) { if( aContainer->GetName() == "name" ) { @@ -54,10 +54,10 @@ inline bool KMagnetostaticFieldMapBuilder::AddAttribute( KContainer* aContainer //////////////////////////////////////////////////////////////////// typedef KComplexElement< KEMField::KMagnetostaticFieldmapCalculator > -KMagnetostaticFieldMapCalculatorBuilder; +KMagnetostaticFieldmapCalculatorBuilder; template< > -inline bool KMagnetostaticFieldMapCalculatorBuilder::AddAttribute( KContainer* aContainer ) +inline bool KMagnetostaticFieldmapCalculatorBuilder::AddAttribute( KContainer* aContainer ) { if (aContainer->GetName() == "name" ) { @@ -143,7 +143,7 @@ inline bool KMagnetostaticFieldMapCalculatorBuilder::AddAttribute( KContainer* a } template< > -inline bool KMagnetostaticFieldMapCalculatorBuilder::AddElement( KContainer* aContainer ) +inline bool KMagnetostaticFieldmapCalculatorBuilder::AddElement( KContainer* aContainer ) { if(aContainer->Is()) { @@ -155,7 +155,7 @@ inline bool KMagnetostaticFieldMapCalculatorBuilder::AddElement( KContainer* aCo } template< > -inline bool KMagnetostaticFieldMapCalculatorBuilder::End(){ +inline bool KMagnetostaticFieldmapCalculatorBuilder::End(){ fObject->Initialize(); return true; } @@ -172,10 +172,18 @@ namespace KEMField { class KMagnetostaticFieldmap : public KMagnetostaticField { - virtual KEMThreeVector FieldCore(const KPosition& /*P*/) const { + virtual KEMThreeVector MagneticPotentialCore(const KPosition& /*P*/) const { + double nan = std::numeric_limits::quiet_NaN(); + return KEMThreeVector(nan,nan,nan); + } + virtual KEMThreeVector MagneticFieldCore(const KPosition& /*P*/) const { double nan = std::numeric_limits::quiet_NaN(); return KEMThreeVector(nan,nan,nan); } + virtual KGradient MagneticGradientCore(const KPosition& /*P*/) const { + double nan = std::numeric_limits::quiet_NaN(); + return KGradient(nan,nan,nan,nan,nan,nan,nan,nan,nan); + } }; class KMagnetostaticFieldmapCalculator{}; } diff --git a/KEMField/Source/2.0/Plugins/Bindings/Fields/Magnetic/include/KRampedMagneticFieldBuilder.hh b/KEMField/Source/Plugins/Bindings/Fields/Magnetic/include/KRampedMagneticFieldBuilder.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/Bindings/Fields/Magnetic/include/KRampedMagneticFieldBuilder.hh rename to KEMField/Source/Plugins/Bindings/Fields/Magnetic/include/KRampedMagneticFieldBuilder.hh diff --git a/KEMField/Source/2.0/Plugins/Bindings/Fields/Magnetic/include/KStaticElectromagnetFieldBuilder.hh b/KEMField/Source/Plugins/Bindings/Fields/Magnetic/include/KStaticElectromagnetFieldBuilder.hh similarity index 98% rename from KEMField/Source/2.0/Plugins/Bindings/Fields/Magnetic/include/KStaticElectromagnetFieldBuilder.hh rename to KEMField/Source/Plugins/Bindings/Fields/Magnetic/include/KStaticElectromagnetFieldBuilder.hh index dfc85acc4..6c356646d 100644 --- a/KEMField/Source/2.0/Plugins/Bindings/Fields/Magnetic/include/KStaticElectromagnetFieldBuilder.hh +++ b/KEMField/Source/Plugins/Bindings/Fields/Magnetic/include/KStaticElectromagnetFieldBuilder.hh @@ -49,7 +49,7 @@ typedef KComplexElement< KEMField::KStaticElectromagnetFieldWithKGeoBag > KStati if( tSurfaces.size() == 0 ) { BINDINGMSG( eWarning ) << "no surfaces found for specifier <" << aContainer->AsReference< std::string >() << ">" << eom; - return false; + return true; } for( tSurfaceIt = tSurfaces.begin(); tSurfaceIt != tSurfaces.end(); tSurfaceIt++ ) @@ -69,7 +69,7 @@ typedef KComplexElement< KEMField::KStaticElectromagnetFieldWithKGeoBag > KStati if( tSpaces.size() == 0 ) { BINDINGMSG( eWarning ) << "no spaces found for specifier <" << aContainer->AsReference< std::string >() << ">" << eom; - return false; + return true; } for( tSpaceIt = tSpaces.begin(); tSpaceIt != tSpaces.end(); tSpaceIt++ ) diff --git a/KEMField/Source/2.0/Plugins/Bindings/Fields/Magnetic/src/KMagneticDipoleFieldBuilder.cc b/KEMField/Source/Plugins/Bindings/Fields/Magnetic/src/KMagneticDipoleFieldBuilder.cc similarity index 100% rename from KEMField/Source/2.0/Plugins/Bindings/Fields/Magnetic/src/KMagneticDipoleFieldBuilder.cc rename to KEMField/Source/Plugins/Bindings/Fields/Magnetic/src/KMagneticDipoleFieldBuilder.cc diff --git a/KEMField/Source/2.0/Plugins/Bindings/Fields/Magnetic/src/KMagneticSuperpositionFieldBuilder.cc b/KEMField/Source/Plugins/Bindings/Fields/Magnetic/src/KMagneticSuperpositionFieldBuilder.cc similarity index 100% rename from KEMField/Source/2.0/Plugins/Bindings/Fields/Magnetic/src/KMagneticSuperpositionFieldBuilder.cc rename to KEMField/Source/Plugins/Bindings/Fields/Magnetic/src/KMagneticSuperpositionFieldBuilder.cc diff --git a/KEMField/Source/2.0/Plugins/Bindings/Fields/Magnetic/src/KMagnetostaticConstantFieldBuilder.cc b/KEMField/Source/Plugins/Bindings/Fields/Magnetic/src/KMagnetostaticConstantFieldBuilder.cc similarity index 100% rename from KEMField/Source/2.0/Plugins/Bindings/Fields/Magnetic/src/KMagnetostaticConstantFieldBuilder.cc rename to KEMField/Source/Plugins/Bindings/Fields/Magnetic/src/KMagnetostaticConstantFieldBuilder.cc diff --git a/KEMField/Source/Plugins/Bindings/Fields/Magnetic/src/KMagnetostaticFieldmapBuilder.cc b/KEMField/Source/Plugins/Bindings/Fields/Magnetic/src/KMagnetostaticFieldmapBuilder.cc new file mode 100644 index 000000000..edfe5367a --- /dev/null +++ b/KEMField/Source/Plugins/Bindings/Fields/Magnetic/src/KMagnetostaticFieldmapBuilder.cc @@ -0,0 +1,62 @@ +/* + * KMagnetostaticFieldmapBuilder.cc + * + * Created on: 27 May 2016 + * Author: wolfgang + */ + +#include "KMagnetostaticFieldmapBuilder.hh" +#include "KMagnetostaticConstantFieldBuilder.hh" +#include "KMagneticDipoleFieldBuilder.hh" +#include "KStaticElectromagnetFieldBuilder.hh" +#include "KEMToolboxBuilder.hh" + +using namespace KEMField; +namespace katrin { + +template< > +KMagnetostaticFieldmapBuilder::~KComplexElement() +{ +} + +STATICINT sKMagnetostaticFieldmapStructure = + KMagnetostaticFieldmapBuilder::Attribute< string >( "name" ) + + KMagnetostaticFieldmapBuilder::Attribute< string >( "directory" ) + + KMagnetostaticFieldmapBuilder::Attribute< string >( "file" ) + + KMagnetostaticFieldmapBuilder::Attribute< string >( "interpolation" ); + +STATICINT sKMagnetostaticFieldmap = + KEMToolboxBuilder::ComplexElement< KMagnetostaticFieldmap >( "magnetic_fieldmap" ); + +//////////////////////////////////////////////////////////////////// + +template< > +KMagnetostaticFieldmapCalculatorBuilder::~KComplexElement() +{ +} + +STATICINT sKMagnetostaticFieldmapCalculatorStructure = + KMagnetostaticFieldmapCalculatorBuilder::Attribute< string >( "name" ) + + KMagnetostaticFieldmapCalculatorBuilder::Attribute< string >( "directory" ) + + KMagnetostaticFieldmapCalculatorBuilder::Attribute< string >( "file" ) + + KMagnetostaticFieldmapCalculatorBuilder::Attribute< KEMStreamableThreeVector >( "center" ) + + KMagnetostaticFieldmapCalculatorBuilder::Attribute< KEMStreamableThreeVector >( "length" ) + + KMagnetostaticFieldmapCalculatorBuilder::Attribute< bool >( "mirror_x" ) + + KMagnetostaticFieldmapCalculatorBuilder::Attribute< bool >( "mirror_y" ) + + KMagnetostaticFieldmapCalculatorBuilder::Attribute< bool >( "mirror_z" ) + + KMagnetostaticFieldmapCalculatorBuilder::Attribute< double >( "spacing" ) + + KMagnetostaticFieldmapCalculatorBuilder::Attribute< string >( "spaces" ) + + KMagnetostaticFieldmapCalculatorBuilder::Attribute< string >( "field") + + // support of deprecated old xml: + KMagnetostaticFieldmapCalculatorBuilder:: + ComplexElement< KMagnetostaticConstantField >( "field_magnetic_constant" ) + + KMagnetostaticFieldmapCalculatorBuilder:: + ComplexElement< KMagneticDipoleFieldBuilder >( "field_magnetic_dipole" ) + + KMagnetostaticFieldmapCalculatorBuilder:: + ComplexElement< KStaticElectromagnetField >( "field_electromagnet" ); + +STATICINT sKMagnetostaticFieldmapCalculator = + KEMToolboxBuilder::ComplexElement< KMagnetostaticFieldmapCalculator >( "magnetic_fieldmap_calculator" ); + + +} /* namespace katrin */ diff --git a/KEMField/Source/2.0/Plugins/Bindings/Fields/Magnetic/src/KRampedMagneticFieldBuilder.cc b/KEMField/Source/Plugins/Bindings/Fields/Magnetic/src/KRampedMagneticFieldBuilder.cc similarity index 100% rename from KEMField/Source/2.0/Plugins/Bindings/Fields/Magnetic/src/KRampedMagneticFieldBuilder.cc rename to KEMField/Source/Plugins/Bindings/Fields/Magnetic/src/KRampedMagneticFieldBuilder.cc diff --git a/KEMField/Source/2.0/Plugins/Bindings/Fields/Magnetic/src/KStaticElectromagnetFieldBuilder.cc b/KEMField/Source/Plugins/Bindings/Fields/Magnetic/src/KStaticElectromagnetFieldBuilder.cc similarity index 100% rename from KEMField/Source/2.0/Plugins/Bindings/Fields/Magnetic/src/KStaticElectromagnetFieldBuilder.cc rename to KEMField/Source/Plugins/Bindings/Fields/Magnetic/src/KStaticElectromagnetFieldBuilder.cc diff --git a/KEMField/Source/2.0/Plugins/Bindings/Utilities/include/KEMBindingsMessage.hh b/KEMField/Source/Plugins/Bindings/Utilities/include/KEMBindingsMessage.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/Bindings/Utilities/include/KEMBindingsMessage.hh rename to KEMField/Source/Plugins/Bindings/Utilities/include/KEMBindingsMessage.hh diff --git a/KEMField/Source/2.0/Plugins/Bindings/Utilities/include/KEMToolbox.hh b/KEMField/Source/Plugins/Bindings/Utilities/include/KEMToolbox.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/Bindings/Utilities/include/KEMToolbox.hh rename to KEMField/Source/Plugins/Bindings/Utilities/include/KEMToolbox.hh diff --git a/KEMField/Source/2.0/Plugins/Bindings/Utilities/include/KEMToolboxBuilder.hh b/KEMField/Source/Plugins/Bindings/Utilities/include/KEMToolboxBuilder.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/Bindings/Utilities/include/KEMToolboxBuilder.hh rename to KEMField/Source/Plugins/Bindings/Utilities/include/KEMToolboxBuilder.hh diff --git a/KEMField/Source/2.0/Plugins/Bindings/Utilities/include/KEMToolboxHelper.hh b/KEMField/Source/Plugins/Bindings/Utilities/include/KEMToolboxHelper.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/Bindings/Utilities/include/KEMToolboxHelper.hh rename to KEMField/Source/Plugins/Bindings/Utilities/include/KEMToolboxHelper.hh diff --git a/KEMField/Source/2.0/Plugins/Bindings/Utilities/include/KSmartPointerRelease.hh b/KEMField/Source/Plugins/Bindings/Utilities/include/KSmartPointerRelease.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/Bindings/Utilities/include/KSmartPointerRelease.hh rename to KEMField/Source/Plugins/Bindings/Utilities/include/KSmartPointerRelease.hh diff --git a/KEMField/Source/2.0/Plugins/Bindings/Utilities/src/KEMBindingsMessage.cc b/KEMField/Source/Plugins/Bindings/Utilities/src/KEMBindingsMessage.cc similarity index 100% rename from KEMField/Source/2.0/Plugins/Bindings/Utilities/src/KEMBindingsMessage.cc rename to KEMField/Source/Plugins/Bindings/Utilities/src/KEMBindingsMessage.cc diff --git a/KEMField/Source/2.0/Plugins/Bindings/Utilities/src/KEMToolbox.cc b/KEMField/Source/Plugins/Bindings/Utilities/src/KEMToolbox.cc similarity index 100% rename from KEMField/Source/2.0/Plugins/Bindings/Utilities/src/KEMToolbox.cc rename to KEMField/Source/Plugins/Bindings/Utilities/src/KEMToolbox.cc diff --git a/KEMField/Source/2.0/Plugins/Bindings/Utilities/src/KEMToolboxBuilder.cc b/KEMField/Source/Plugins/Bindings/Utilities/src/KEMToolboxBuilder.cc similarity index 100% rename from KEMField/Source/2.0/Plugins/Bindings/Utilities/src/KEMToolboxBuilder.cc rename to KEMField/Source/Plugins/Bindings/Utilities/src/KEMToolboxBuilder.cc diff --git a/KEMField/Source/2.0/Plugins/KGeoBag/CMakeLists.txt b/KEMField/Source/Plugins/KGeoBag/CMakeLists.txt similarity index 100% rename from KEMField/Source/2.0/Plugins/KGeoBag/CMakeLists.txt rename to KEMField/Source/Plugins/KGeoBag/CMakeLists.txt diff --git a/KEMField/Source/2.0/Plugins/KGeoBag/include/KEMVectorConverters.hh b/KEMField/Source/Plugins/KGeoBag/include/KEMVectorConverters.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/KGeoBag/include/KEMVectorConverters.hh rename to KEMField/Source/Plugins/KGeoBag/include/KEMVectorConverters.hh diff --git a/KEMField/Source/2.0/Plugins/KGeoBag/include/KElectrostaticBoundaryFieldWithKGeoBag.hh b/KEMField/Source/Plugins/KGeoBag/include/KElectrostaticBoundaryFieldWithKGeoBag.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/KGeoBag/include/KElectrostaticBoundaryFieldWithKGeoBag.hh rename to KEMField/Source/Plugins/KGeoBag/include/KElectrostaticBoundaryFieldWithKGeoBag.hh diff --git a/KEMField/Source/2.0/Plugins/KGeoBag/include/KGBEM.hh b/KEMField/Source/Plugins/KGeoBag/include/KGBEM.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/KGeoBag/include/KGBEM.hh rename to KEMField/Source/Plugins/KGeoBag/include/KGBEM.hh diff --git a/KEMField/Source/2.0/Plugins/KGeoBag/include/KGBEMBuilder.hh b/KEMField/Source/Plugins/KGeoBag/include/KGBEMBuilder.hh similarity index 99% rename from KEMField/Source/2.0/Plugins/KGeoBag/include/KGBEMBuilder.hh rename to KEMField/Source/Plugins/KGeoBag/include/KGBEMBuilder.hh index 56b39ebea..87911661f 100644 --- a/KEMField/Source/2.0/Plugins/KGeoBag/include/KGBEMBuilder.hh +++ b/KEMField/Source/Plugins/KGeoBag/include/KGBEMBuilder.hh @@ -140,7 +140,7 @@ namespace katrin if( tSurfaces.size() == 0 ) { coremsg( eWarning ) << "no surfaces found for specifier <" << aContainer->AsReference< string >() << ">" << eom; - return false; + return true; } for( tSurfaceIt = tSurfaces.begin(); tSurfaceIt != tSurfaces.end(); tSurfaceIt++ ) @@ -162,7 +162,7 @@ namespace katrin if( tSpaces.size() == 0 ) { coremsg( eWarning ) << "no spaces found for specifier <" << aContainer->AsReference< string >() << ">" << eom; - return false; + return true; } for( tSpaceIt = tSpaces.begin(); tSpaceIt != tSpaces.end(); tSpaceIt++ ) diff --git a/KEMField/Source/2.0/Plugins/KGeoBag/include/KGBEMConverter.hh b/KEMField/Source/Plugins/KGeoBag/include/KGBEMConverter.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/KGeoBag/include/KGBEMConverter.hh rename to KEMField/Source/Plugins/KGeoBag/include/KGBEMConverter.hh diff --git a/KEMField/Source/2.0/Plugins/KGeoBag/include/KGElectromagnet.hh b/KEMField/Source/Plugins/KGeoBag/include/KGElectromagnet.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/KGeoBag/include/KGElectromagnet.hh rename to KEMField/Source/Plugins/KGeoBag/include/KGElectromagnet.hh diff --git a/KEMField/Source/2.0/Plugins/KGeoBag/include/KGElectromagnetBuilder.hh b/KEMField/Source/Plugins/KGeoBag/include/KGElectromagnetBuilder.hh similarity index 83% rename from KEMField/Source/2.0/Plugins/KGeoBag/include/KGElectromagnetBuilder.hh rename to KEMField/Source/Plugins/KGeoBag/include/KGElectromagnetBuilder.hh index 5b4af9645..c194f693a 100644 --- a/KEMField/Source/2.0/Plugins/KGeoBag/include/KGElectromagnetBuilder.hh +++ b/KEMField/Source/Plugins/KGeoBag/include/KGElectromagnetBuilder.hh @@ -59,17 +59,17 @@ namespace katrin } if( aContainer->GetName() == "direction" ) { - string tDirection = aContainer->AsReference(); - if ( tDirection == string("clockwise") || tDirection == string("normal") ) - { - fObject->SetDirection( 1.0 ); - return true; - } - if ( tDirection == string("counter_clockwise") || tDirection == string("reversed")) - { - fObject->SetDirection( -1.0 ); - return true; - } + string tDirection = aContainer->AsReference(); + if ( tDirection == string("clockwise") || tDirection == string("normal") ) + { + fObject->SetDirection( 1.0 ); + return true; + } + if ( tDirection == string("counter_clockwise") || tDirection == string("reversed")) + { + fObject->SetDirection( -1.0 ); + return true; + } coremsg( eWarning ) << "Dont know the direction <"<< tDirection<<">" << eom; return false; } @@ -82,7 +82,7 @@ namespace katrin if( tSurfaces.size() == 0 ) { coremsg( eWarning ) << "no surfaces found for specifier <" << aContainer->AsReference< string >() << ">" << eom; - return false; + return true; } for( tSurfaceIt = tSurfaces.begin(); tSurfaceIt != tSurfaces.end(); tSurfaceIt++ ) @@ -101,7 +101,7 @@ namespace katrin if( tSpaces.size() == 0 ) { coremsg( eWarning ) << "no spaces found for specifier <" << aContainer->AsReference< string >() << ">" << eom; - return false; + return true; } for( tSpaceIt = tSpaces.begin(); tSpaceIt != tSpaces.end(); tSpaceIt++ ) @@ -117,8 +117,8 @@ namespace katrin template< > inline bool KGElectromagnetBuilder::End() { - fObject->SetCurrent( fObject->GetLineCurrent() * fObject->GetScalingFactor() * fObject->GetDirection() ); - return true; + fObject->SetCurrent( fObject->GetLineCurrent() * fObject->GetScalingFactor() * fObject->GetDirection() ); + return true; } } diff --git a/KEMField/Source/2.0/Plugins/KGeoBag/include/KGElectromagnetConverter.hh b/KEMField/Source/Plugins/KGeoBag/include/KGElectromagnetConverter.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/KGeoBag/include/KGElectromagnetConverter.hh rename to KEMField/Source/Plugins/KGeoBag/include/KGElectromagnetConverter.hh diff --git a/KEMField/Source/2.0/Plugins/KGeoBag/include/KStaticElectromagnetFieldWithKGeoBag.hh b/KEMField/Source/Plugins/KGeoBag/include/KStaticElectromagnetFieldWithKGeoBag.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/KGeoBag/include/KStaticElectromagnetFieldWithKGeoBag.hh rename to KEMField/Source/Plugins/KGeoBag/include/KStaticElectromagnetFieldWithKGeoBag.hh diff --git a/KEMField/Source/2.0/Plugins/KGeoBag/src/KElectrostaticBoundaryFieldWithKGeoBag.cc b/KEMField/Source/Plugins/KGeoBag/src/KElectrostaticBoundaryFieldWithKGeoBag.cc similarity index 100% rename from KEMField/Source/2.0/Plugins/KGeoBag/src/KElectrostaticBoundaryFieldWithKGeoBag.cc rename to KEMField/Source/Plugins/KGeoBag/src/KElectrostaticBoundaryFieldWithKGeoBag.cc diff --git a/KEMField/Source/2.0/Plugins/KGeoBag/src/KGBEM.cc b/KEMField/Source/Plugins/KGeoBag/src/KGBEM.cc similarity index 100% rename from KEMField/Source/2.0/Plugins/KGeoBag/src/KGBEM.cc rename to KEMField/Source/Plugins/KGeoBag/src/KGBEM.cc diff --git a/KEMField/Source/2.0/Plugins/KGeoBag/src/KGBEMBuilder.cc b/KEMField/Source/Plugins/KGeoBag/src/KGBEMBuilder.cc similarity index 100% rename from KEMField/Source/2.0/Plugins/KGeoBag/src/KGBEMBuilder.cc rename to KEMField/Source/Plugins/KGeoBag/src/KGBEMBuilder.cc diff --git a/KEMField/Source/2.0/Plugins/KGeoBag/src/KGBEMConverter.cc b/KEMField/Source/Plugins/KGeoBag/src/KGBEMConverter.cc similarity index 100% rename from KEMField/Source/2.0/Plugins/KGeoBag/src/KGBEMConverter.cc rename to KEMField/Source/Plugins/KGeoBag/src/KGBEMConverter.cc diff --git a/KEMField/Source/2.0/Plugins/KGeoBag/src/KGElectromagnet.cc b/KEMField/Source/Plugins/KGeoBag/src/KGElectromagnet.cc similarity index 100% rename from KEMField/Source/2.0/Plugins/KGeoBag/src/KGElectromagnet.cc rename to KEMField/Source/Plugins/KGeoBag/src/KGElectromagnet.cc diff --git a/KEMField/Source/2.0/Plugins/KGeoBag/src/KGElectromagnetBuilder.cc b/KEMField/Source/Plugins/KGeoBag/src/KGElectromagnetBuilder.cc similarity index 100% rename from KEMField/Source/2.0/Plugins/KGeoBag/src/KGElectromagnetBuilder.cc rename to KEMField/Source/Plugins/KGeoBag/src/KGElectromagnetBuilder.cc diff --git a/KEMField/Source/2.0/Plugins/KGeoBag/src/KGElectromagnetConverter.cc b/KEMField/Source/Plugins/KGeoBag/src/KGElectromagnetConverter.cc similarity index 100% rename from KEMField/Source/2.0/Plugins/KGeoBag/src/KGElectromagnetConverter.cc rename to KEMField/Source/Plugins/KGeoBag/src/KGElectromagnetConverter.cc diff --git a/KEMField/Source/2.0/Plugins/KGeoBag/src/KStaticElectromagnetFieldWithKGeoBag.cc b/KEMField/Source/Plugins/KGeoBag/src/KStaticElectromagnetFieldWithKGeoBag.cc similarity index 100% rename from KEMField/Source/2.0/Plugins/KGeoBag/src/KStaticElectromagnetFieldWithKGeoBag.cc rename to KEMField/Source/Plugins/KGeoBag/src/KStaticElectromagnetFieldWithKGeoBag.cc diff --git a/KEMField/Source/2.0/Plugins/OpenCL/BoundaryIntegrals/Core/cl/kEMField_BoundaryIntegrals.cl b/KEMField/Source/Plugins/OpenCL/BoundaryIntegrals/Core/cl/kEMField_BoundaryIntegrals.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/BoundaryIntegrals/Core/cl/kEMField_BoundaryIntegrals.cl rename to KEMField/Source/Plugins/OpenCL/BoundaryIntegrals/Core/cl/kEMField_BoundaryIntegrals.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/BoundaryIntegrals/Core/include/KOpenCLBoundaryIntegralMatrix.hh b/KEMField/Source/Plugins/OpenCL/BoundaryIntegrals/Core/include/KOpenCLBoundaryIntegralMatrix.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/BoundaryIntegrals/Core/include/KOpenCLBoundaryIntegralMatrix.hh rename to KEMField/Source/Plugins/OpenCL/BoundaryIntegrals/Core/include/KOpenCLBoundaryIntegralMatrix.hh diff --git a/KEMField/Source/2.0/Plugins/OpenCL/BoundaryIntegrals/Core/include/KOpenCLBoundaryIntegralSolutionVector.hh b/KEMField/Source/Plugins/OpenCL/BoundaryIntegrals/Core/include/KOpenCLBoundaryIntegralSolutionVector.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/BoundaryIntegrals/Core/include/KOpenCLBoundaryIntegralSolutionVector.hh rename to KEMField/Source/Plugins/OpenCL/BoundaryIntegrals/Core/include/KOpenCLBoundaryIntegralSolutionVector.hh diff --git a/KEMField/Source/2.0/Plugins/OpenCL/BoundaryIntegrals/Core/include/KOpenCLBoundaryIntegralVector.hh b/KEMField/Source/Plugins/OpenCL/BoundaryIntegrals/Core/include/KOpenCLBoundaryIntegralVector.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/BoundaryIntegrals/Core/include/KOpenCLBoundaryIntegralVector.hh rename to KEMField/Source/Plugins/OpenCL/BoundaryIntegrals/Core/include/KOpenCLBoundaryIntegralVector.hh diff --git a/KEMField/Source/2.0/Plugins/OpenCL/BoundaryIntegrals/Core/include/KOpenCLBoundaryIntegrator.hh b/KEMField/Source/Plugins/OpenCL/BoundaryIntegrals/Core/include/KOpenCLBoundaryIntegrator.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/BoundaryIntegrals/Core/include/KOpenCLBoundaryIntegrator.hh rename to KEMField/Source/Plugins/OpenCL/BoundaryIntegrals/Core/include/KOpenCLBoundaryIntegrator.hh diff --git a/KEMField/Source/2.0/Plugins/OpenCL/BoundaryIntegrals/Electrostatic/cl/kEMField_ElectrostaticBoundaryIntegrals.cl b/KEMField/Source/Plugins/OpenCL/BoundaryIntegrals/Electrostatic/cl/kEMField_ElectrostaticBoundaryIntegrals.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/BoundaryIntegrals/Electrostatic/cl/kEMField_ElectrostaticBoundaryIntegrals.cl rename to KEMField/Source/Plugins/OpenCL/BoundaryIntegrals/Electrostatic/cl/kEMField_ElectrostaticBoundaryIntegrals.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/BoundaryIntegrals/Electrostatic/cl/kEMField_ElectrostaticBoundaryIntegrals_kernel.cl b/KEMField/Source/Plugins/OpenCL/BoundaryIntegrals/Electrostatic/cl/kEMField_ElectrostaticBoundaryIntegrals_kernel.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/BoundaryIntegrals/Electrostatic/cl/kEMField_ElectrostaticBoundaryIntegrals_kernel.cl rename to KEMField/Source/Plugins/OpenCL/BoundaryIntegrals/Electrostatic/cl/kEMField_ElectrostaticBoundaryIntegrals_kernel.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/BoundaryIntegrals/Electrostatic/cl/kEMField_ElectrostaticConicSection.cl b/KEMField/Source/Plugins/OpenCL/BoundaryIntegrals/Electrostatic/cl/kEMField_ElectrostaticConicSection.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/BoundaryIntegrals/Electrostatic/cl/kEMField_ElectrostaticConicSection.cl rename to KEMField/Source/Plugins/OpenCL/BoundaryIntegrals/Electrostatic/cl/kEMField_ElectrostaticConicSection.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/BoundaryIntegrals/Electrostatic/cl/kEMField_ElectrostaticLineSegment.cl b/KEMField/Source/Plugins/OpenCL/BoundaryIntegrals/Electrostatic/cl/kEMField_ElectrostaticLineSegment.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/BoundaryIntegrals/Electrostatic/cl/kEMField_ElectrostaticLineSegment.cl rename to KEMField/Source/Plugins/OpenCL/BoundaryIntegrals/Electrostatic/cl/kEMField_ElectrostaticLineSegment.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/BoundaryIntegrals/Electrostatic/cl/kEMField_ElectrostaticRectangle.cl b/KEMField/Source/Plugins/OpenCL/BoundaryIntegrals/Electrostatic/cl/kEMField_ElectrostaticRectangle.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/BoundaryIntegrals/Electrostatic/cl/kEMField_ElectrostaticRectangle.cl rename to KEMField/Source/Plugins/OpenCL/BoundaryIntegrals/Electrostatic/cl/kEMField_ElectrostaticRectangle.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/BoundaryIntegrals/Electrostatic/cl/kEMField_ElectrostaticTriangle.cl b/KEMField/Source/Plugins/OpenCL/BoundaryIntegrals/Electrostatic/cl/kEMField_ElectrostaticTriangle.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/BoundaryIntegrals/Electrostatic/cl/kEMField_ElectrostaticTriangle.cl rename to KEMField/Source/Plugins/OpenCL/BoundaryIntegrals/Electrostatic/cl/kEMField_ElectrostaticTriangle.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/BoundaryIntegrals/Electrostatic/include/KOpenCLElectrostaticBoundaryIntegrator.hh b/KEMField/Source/Plugins/OpenCL/BoundaryIntegrals/Electrostatic/include/KOpenCLElectrostaticBoundaryIntegrator.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/BoundaryIntegrals/Electrostatic/include/KOpenCLElectrostaticBoundaryIntegrator.hh rename to KEMField/Source/Plugins/OpenCL/BoundaryIntegrals/Electrostatic/include/KOpenCLElectrostaticBoundaryIntegrator.hh diff --git a/KEMField/Source/2.0/Plugins/OpenCL/BoundaryIntegrals/Electrostatic/include/KOpenCLElectrostaticBoundaryIntegratorConfig.hh b/KEMField/Source/Plugins/OpenCL/BoundaryIntegrals/Electrostatic/include/KOpenCLElectrostaticBoundaryIntegratorConfig.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/BoundaryIntegrals/Electrostatic/include/KOpenCLElectrostaticBoundaryIntegratorConfig.hh rename to KEMField/Source/Plugins/OpenCL/BoundaryIntegrals/Electrostatic/include/KOpenCLElectrostaticBoundaryIntegratorConfig.hh diff --git a/KEMField/Source/2.0/Plugins/OpenCL/BoundaryIntegrals/Electrostatic/include/KOpenCLElectrostaticBoundaryIntegratorFactory.hh b/KEMField/Source/Plugins/OpenCL/BoundaryIntegrals/Electrostatic/include/KOpenCLElectrostaticBoundaryIntegratorFactory.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/BoundaryIntegrals/Electrostatic/include/KOpenCLElectrostaticBoundaryIntegratorFactory.hh rename to KEMField/Source/Plugins/OpenCL/BoundaryIntegrals/Electrostatic/include/KOpenCLElectrostaticBoundaryIntegratorFactory.hh diff --git a/KEMField/Source/2.0/Plugins/OpenCL/BoundaryIntegrals/Electrostatic/src/KOpenCLElectrostaticBoundaryIntegrator.cc b/KEMField/Source/Plugins/OpenCL/BoundaryIntegrals/Electrostatic/src/KOpenCLElectrostaticBoundaryIntegrator.cc similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/BoundaryIntegrals/Electrostatic/src/KOpenCLElectrostaticBoundaryIntegrator.cc rename to KEMField/Source/Plugins/OpenCL/BoundaryIntegrals/Electrostatic/src/KOpenCLElectrostaticBoundaryIntegrator.cc diff --git a/KEMField/Source/2.0/Plugins/OpenCL/BoundaryIntegrals/Electrostatic/src/KOpenCLElectrostaticBoundaryIntegratorFactory.cc b/KEMField/Source/Plugins/OpenCL/BoundaryIntegrals/Electrostatic/src/KOpenCLElectrostaticBoundaryIntegratorFactory.cc similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/BoundaryIntegrals/Electrostatic/src/KOpenCLElectrostaticBoundaryIntegratorFactory.cc rename to KEMField/Source/Plugins/OpenCL/BoundaryIntegrals/Electrostatic/src/KOpenCLElectrostaticBoundaryIntegratorFactory.cc diff --git a/KEMField/Source/2.0/Plugins/OpenCL/BoundaryIntegrals/ElectrostaticNumeric/cl/kEMField_ElectrostaticCubatureRectangle_12Point.cl b/KEMField/Source/Plugins/OpenCL/BoundaryIntegrals/ElectrostaticNumeric/cl/kEMField_ElectrostaticCubatureRectangle_12Point.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/BoundaryIntegrals/ElectrostaticNumeric/cl/kEMField_ElectrostaticCubatureRectangle_12Point.cl rename to KEMField/Source/Plugins/OpenCL/BoundaryIntegrals/ElectrostaticNumeric/cl/kEMField_ElectrostaticCubatureRectangle_12Point.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/BoundaryIntegrals/ElectrostaticNumeric/cl/kEMField_ElectrostaticCubatureRectangle_33Point.cl b/KEMField/Source/Plugins/OpenCL/BoundaryIntegrals/ElectrostaticNumeric/cl/kEMField_ElectrostaticCubatureRectangle_33Point.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/BoundaryIntegrals/ElectrostaticNumeric/cl/kEMField_ElectrostaticCubatureRectangle_33Point.cl rename to KEMField/Source/Plugins/OpenCL/BoundaryIntegrals/ElectrostaticNumeric/cl/kEMField_ElectrostaticCubatureRectangle_33Point.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/BoundaryIntegrals/ElectrostaticNumeric/cl/kEMField_ElectrostaticCubatureRectangle_7Point.cl b/KEMField/Source/Plugins/OpenCL/BoundaryIntegrals/ElectrostaticNumeric/cl/kEMField_ElectrostaticCubatureRectangle_7Point.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/BoundaryIntegrals/ElectrostaticNumeric/cl/kEMField_ElectrostaticCubatureRectangle_7Point.cl rename to KEMField/Source/Plugins/OpenCL/BoundaryIntegrals/ElectrostaticNumeric/cl/kEMField_ElectrostaticCubatureRectangle_7Point.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/BoundaryIntegrals/ElectrostaticNumeric/cl/kEMField_ElectrostaticCubatureTriangle_12Point.cl b/KEMField/Source/Plugins/OpenCL/BoundaryIntegrals/ElectrostaticNumeric/cl/kEMField_ElectrostaticCubatureTriangle_12Point.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/BoundaryIntegrals/ElectrostaticNumeric/cl/kEMField_ElectrostaticCubatureTriangle_12Point.cl rename to KEMField/Source/Plugins/OpenCL/BoundaryIntegrals/ElectrostaticNumeric/cl/kEMField_ElectrostaticCubatureTriangle_12Point.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/BoundaryIntegrals/ElectrostaticNumeric/cl/kEMField_ElectrostaticCubatureTriangle_33Point.cl b/KEMField/Source/Plugins/OpenCL/BoundaryIntegrals/ElectrostaticNumeric/cl/kEMField_ElectrostaticCubatureTriangle_33Point.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/BoundaryIntegrals/ElectrostaticNumeric/cl/kEMField_ElectrostaticCubatureTriangle_33Point.cl rename to KEMField/Source/Plugins/OpenCL/BoundaryIntegrals/ElectrostaticNumeric/cl/kEMField_ElectrostaticCubatureTriangle_33Point.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/BoundaryIntegrals/ElectrostaticNumeric/cl/kEMField_ElectrostaticCubatureTriangle_7Point.cl b/KEMField/Source/Plugins/OpenCL/BoundaryIntegrals/ElectrostaticNumeric/cl/kEMField_ElectrostaticCubatureTriangle_7Point.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/BoundaryIntegrals/ElectrostaticNumeric/cl/kEMField_ElectrostaticCubatureTriangle_7Point.cl rename to KEMField/Source/Plugins/OpenCL/BoundaryIntegrals/ElectrostaticNumeric/cl/kEMField_ElectrostaticCubatureTriangle_7Point.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/BoundaryIntegrals/ElectrostaticNumeric/cl/kEMField_ElectrostaticCubature_CommonFunctions.cl b/KEMField/Source/Plugins/OpenCL/BoundaryIntegrals/ElectrostaticNumeric/cl/kEMField_ElectrostaticCubature_CommonFunctions.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/BoundaryIntegrals/ElectrostaticNumeric/cl/kEMField_ElectrostaticCubature_CommonFunctions.cl rename to KEMField/Source/Plugins/OpenCL/BoundaryIntegrals/ElectrostaticNumeric/cl/kEMField_ElectrostaticCubature_CommonFunctions.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/BoundaryIntegrals/ElectrostaticNumeric/cl/kEMField_ElectrostaticNumericBoundaryIntegrals.cl b/KEMField/Source/Plugins/OpenCL/BoundaryIntegrals/ElectrostaticNumeric/cl/kEMField_ElectrostaticNumericBoundaryIntegrals.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/BoundaryIntegrals/ElectrostaticNumeric/cl/kEMField_ElectrostaticNumericBoundaryIntegrals.cl rename to KEMField/Source/Plugins/OpenCL/BoundaryIntegrals/ElectrostaticNumeric/cl/kEMField_ElectrostaticNumericBoundaryIntegrals.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/BoundaryIntegrals/ElectrostaticNumeric/cl/kEMField_ElectrostaticNumericBoundaryIntegrals_kernel.cl b/KEMField/Source/Plugins/OpenCL/BoundaryIntegrals/ElectrostaticNumeric/cl/kEMField_ElectrostaticNumericBoundaryIntegrals_kernel.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/BoundaryIntegrals/ElectrostaticNumeric/cl/kEMField_ElectrostaticNumericBoundaryIntegrals_kernel.cl rename to KEMField/Source/Plugins/OpenCL/BoundaryIntegrals/ElectrostaticNumeric/cl/kEMField_ElectrostaticNumericBoundaryIntegrals_kernel.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/BoundaryIntegrals/ElectrostaticNumeric/cl/kEMField_ElectrostaticQuadratureLineSegment.cl b/KEMField/Source/Plugins/OpenCL/BoundaryIntegrals/ElectrostaticNumeric/cl/kEMField_ElectrostaticQuadratureLineSegment.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/BoundaryIntegrals/ElectrostaticNumeric/cl/kEMField_ElectrostaticQuadratureLineSegment.cl rename to KEMField/Source/Plugins/OpenCL/BoundaryIntegrals/ElectrostaticNumeric/cl/kEMField_ElectrostaticQuadratureLineSegment.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/BoundaryIntegrals/ElectrostaticNumeric/include/KOpenCLElectrostaticNumericBoundaryIntegrator.hh b/KEMField/Source/Plugins/OpenCL/BoundaryIntegrals/ElectrostaticNumeric/include/KOpenCLElectrostaticNumericBoundaryIntegrator.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/BoundaryIntegrals/ElectrostaticNumeric/include/KOpenCLElectrostaticNumericBoundaryIntegrator.hh rename to KEMField/Source/Plugins/OpenCL/BoundaryIntegrals/ElectrostaticNumeric/include/KOpenCLElectrostaticNumericBoundaryIntegrator.hh diff --git a/KEMField/Source/2.0/Plugins/OpenCL/BoundaryIntegrals/ElectrostaticNumeric/src/KOpenCLElectrostaticNumericBoundaryIntegrator.cc b/KEMField/Source/Plugins/OpenCL/BoundaryIntegrals/ElectrostaticNumeric/src/KOpenCLElectrostaticNumericBoundaryIntegrator.cc similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/BoundaryIntegrals/ElectrostaticNumeric/src/KOpenCLElectrostaticNumericBoundaryIntegrator.cc rename to KEMField/Source/Plugins/OpenCL/BoundaryIntegrals/ElectrostaticNumeric/src/KOpenCLElectrostaticNumericBoundaryIntegrator.cc diff --git a/KEMField/Source/2.0/Plugins/OpenCL/BoundaryIntegrals/RWG/cl/kEMField_ElectrostaticRWGBoundaryIntegrals.cl b/KEMField/Source/Plugins/OpenCL/BoundaryIntegrals/RWG/cl/kEMField_ElectrostaticRWGBoundaryIntegrals.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/BoundaryIntegrals/RWG/cl/kEMField_ElectrostaticRWGBoundaryIntegrals.cl rename to KEMField/Source/Plugins/OpenCL/BoundaryIntegrals/RWG/cl/kEMField_ElectrostaticRWGBoundaryIntegrals.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/BoundaryIntegrals/RWG/cl/kEMField_ElectrostaticRWGBoundaryIntegrals_kernel.cl b/KEMField/Source/Plugins/OpenCL/BoundaryIntegrals/RWG/cl/kEMField_ElectrostaticRWGBoundaryIntegrals_kernel.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/BoundaryIntegrals/RWG/cl/kEMField_ElectrostaticRWGBoundaryIntegrals_kernel.cl rename to KEMField/Source/Plugins/OpenCL/BoundaryIntegrals/RWG/cl/kEMField_ElectrostaticRWGBoundaryIntegrals_kernel.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/BoundaryIntegrals/RWG/cl/kEMField_ElectrostaticRWGRectangle.cl b/KEMField/Source/Plugins/OpenCL/BoundaryIntegrals/RWG/cl/kEMField_ElectrostaticRWGRectangle.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/BoundaryIntegrals/RWG/cl/kEMField_ElectrostaticRWGRectangle.cl rename to KEMField/Source/Plugins/OpenCL/BoundaryIntegrals/RWG/cl/kEMField_ElectrostaticRWGRectangle.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/BoundaryIntegrals/RWG/cl/kEMField_ElectrostaticRWGTriangle.cl b/KEMField/Source/Plugins/OpenCL/BoundaryIntegrals/RWG/cl/kEMField_ElectrostaticRWGTriangle.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/BoundaryIntegrals/RWG/cl/kEMField_ElectrostaticRWGTriangle.cl rename to KEMField/Source/Plugins/OpenCL/BoundaryIntegrals/RWG/cl/kEMField_ElectrostaticRWGTriangle.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/BoundaryIntegrals/RWG/include/KOpenCLElectrostaticRWGBoundaryIntegrator.hh b/KEMField/Source/Plugins/OpenCL/BoundaryIntegrals/RWG/include/KOpenCLElectrostaticRWGBoundaryIntegrator.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/BoundaryIntegrals/RWG/include/KOpenCLElectrostaticRWGBoundaryIntegrator.hh rename to KEMField/Source/Plugins/OpenCL/BoundaryIntegrals/RWG/include/KOpenCLElectrostaticRWGBoundaryIntegrator.hh diff --git a/KEMField/Source/2.0/Plugins/OpenCL/BoundaryIntegrals/RWG/src/KOpenCLElectrostaticRWGBoundaryIntegrator.cc b/KEMField/Source/Plugins/OpenCL/BoundaryIntegrals/RWG/src/KOpenCLElectrostaticRWGBoundaryIntegrator.cc similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/BoundaryIntegrals/RWG/src/KOpenCLElectrostaticRWGBoundaryIntegrator.cc rename to KEMField/Source/Plugins/OpenCL/BoundaryIntegrals/RWG/src/KOpenCLElectrostaticRWGBoundaryIntegrator.cc diff --git a/KEMField/Source/2.0/Plugins/OpenCL/CMakeLists.txt b/KEMField/Source/Plugins/OpenCL/CMakeLists.txt similarity index 97% rename from KEMField/Source/2.0/Plugins/OpenCL/CMakeLists.txt rename to KEMField/Source/Plugins/OpenCL/CMakeLists.txt index 92095a71d..78032b84f 100644 --- a/KEMField/Source/2.0/Plugins/OpenCL/CMakeLists.txt +++ b/KEMField/Source/Plugins/OpenCL/CMakeLists.txt @@ -63,6 +63,15 @@ else (@PROJECT_NAME@_OPENCL_FASTRWG) add_cflag(KEMFIELD_FASTRWG_VALUE=0) endif (@PROJECT_NAME@_OPENCL_FASTRWG) +cmake_dependent_option (@PROJECT_NAME@_OPENCL_FASTDIELECTRICS "Enable the fast computation of Neumann boundary elements through the function RH_BoundaryRatioExceeded" OFF @PROJECT_NAME@_USE_OPENCL OFF) +mark_as_advanced(FORCE @PROJECT_NAME@_OPENCL_FASTDIELECTRICS) +if (@PROJECT_NAME@_OPENCL_FASTDIELECTRICS) + add_cflag(KEMFIELD_FASTDIELECTRICS_VALUE=1) +else (@PROJECT_NAME@_OPENCL_FASTDIELECTRICS) + add_cflag(KEMFIELD_FASTDIELECTRICS_VALUE=0) +endif (@PROJECT_NAME@_OPENCL_FASTDIELECTRICS) + + option (@PROJECT_NAME@_USE_OPENCL "Use OpenCL via C++ wrapper API." OFF) if (@PROJECT_NAME@_USE_OPENCL) diff --git a/KEMField/Source/2.0/Plugins/OpenCL/Core/cl/kEMField_ParallelReduction.cl b/KEMField/Source/Plugins/OpenCL/Core/cl/kEMField_ParallelReduction.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/Core/cl/kEMField_ParallelReduction.cl rename to KEMField/Source/Plugins/OpenCL/Core/cl/kEMField_ParallelReduction.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/Core/include/KOpenCLAction.hh b/KEMField/Source/Plugins/OpenCL/Core/include/KOpenCLAction.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/Core/include/KOpenCLAction.hh rename to KEMField/Source/Plugins/OpenCL/Core/include/KOpenCLAction.hh diff --git a/KEMField/Source/2.0/Plugins/OpenCL/Core/include/KOpenCLData.hh b/KEMField/Source/Plugins/OpenCL/Core/include/KOpenCLData.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/Core/include/KOpenCLData.hh rename to KEMField/Source/Plugins/OpenCL/Core/include/KOpenCLData.hh diff --git a/KEMField/Source/2.0/Plugins/OpenCL/Core/include/KOpenCLHeaderWrapper.hh b/KEMField/Source/Plugins/OpenCL/Core/include/KOpenCLHeaderWrapper.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/Core/include/KOpenCLHeaderWrapper.hh rename to KEMField/Source/Plugins/OpenCL/Core/include/KOpenCLHeaderWrapper.hh diff --git a/KEMField/Source/2.0/Plugins/OpenCL/Core/include/KOpenCLInterface.hh b/KEMField/Source/Plugins/OpenCL/Core/include/KOpenCLInterface.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/Core/include/KOpenCLInterface.hh rename to KEMField/Source/Plugins/OpenCL/Core/include/KOpenCLInterface.hh diff --git a/KEMField/Source/2.0/Plugins/OpenCL/Core/include/KOpenCLKernelBuilder.hh b/KEMField/Source/Plugins/OpenCL/Core/include/KOpenCLKernelBuilder.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/Core/include/KOpenCLKernelBuilder.hh rename to KEMField/Source/Plugins/OpenCL/Core/include/KOpenCLKernelBuilder.hh diff --git a/KEMField/Source/2.0/Plugins/OpenCL/Core/src/GenerateOpenCLHeader.cc b/KEMField/Source/Plugins/OpenCL/Core/src/GenerateOpenCLHeader.cc similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/Core/src/GenerateOpenCLHeader.cc rename to KEMField/Source/Plugins/OpenCL/Core/src/GenerateOpenCLHeader.cc diff --git a/KEMField/Source/2.0/Plugins/OpenCL/Core/src/KOpenCLAction.cc b/KEMField/Source/Plugins/OpenCL/Core/src/KOpenCLAction.cc similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/Core/src/KOpenCLAction.cc rename to KEMField/Source/Plugins/OpenCL/Core/src/KOpenCLAction.cc diff --git a/KEMField/Source/2.0/Plugins/OpenCL/Core/src/KOpenCLData.cc b/KEMField/Source/Plugins/OpenCL/Core/src/KOpenCLData.cc similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/Core/src/KOpenCLData.cc rename to KEMField/Source/Plugins/OpenCL/Core/src/KOpenCLData.cc diff --git a/KEMField/Source/2.0/Plugins/OpenCL/Core/src/KOpenCLInterface.cc b/KEMField/Source/Plugins/OpenCL/Core/src/KOpenCLInterface.cc similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/Core/src/KOpenCLInterface.cc rename to KEMField/Source/Plugins/OpenCL/Core/src/KOpenCLInterface.cc diff --git a/KEMField/Source/2.0/Plugins/OpenCL/Core/src/KOpenCLKernelBuilder.cc b/KEMField/Source/Plugins/OpenCL/Core/src/KOpenCLKernelBuilder.cc similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/Core/src/KOpenCLKernelBuilder.cc rename to KEMField/Source/Plugins/OpenCL/Core/src/KOpenCLKernelBuilder.cc diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElectrostaticBatchedLocalToLocalTransformation_kernel.cl b/KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElectrostaticBatchedLocalToLocalTransformation_kernel.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElectrostaticBatchedLocalToLocalTransformation_kernel.cl rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElectrostaticBatchedLocalToLocalTransformation_kernel.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElectrostaticBatchedRemoteToLocalTransformation_kernel.cl b/KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElectrostaticBatchedRemoteToLocalTransformation_kernel.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElectrostaticBatchedRemoteToLocalTransformation_kernel.cl rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElectrostaticBatchedRemoteToLocalTransformation_kernel.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElectrostaticBatchedRemoteToRemoteReduce_kernel.cl b/KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElectrostaticBatchedRemoteToRemoteReduce_kernel.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElectrostaticBatchedRemoteToRemoteReduce_kernel.cl rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElectrostaticBatchedRemoteToRemoteReduce_kernel.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElectrostaticBatchedRemoteToRemoteTransformation_kernel.cl b/KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElectrostaticBatchedRemoteToRemoteTransformation_kernel.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElectrostaticBatchedRemoteToRemoteTransformation_kernel.cl rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElectrostaticBatchedRemoteToRemoteTransformation_kernel.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElectrostaticBufferedRemoteToLocalCopyAndScale_kernel.cl b/KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElectrostaticBufferedRemoteToLocalCopyAndScale_kernel.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElectrostaticBufferedRemoteToLocalCopyAndScale_kernel.cl rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElectrostaticBufferedRemoteToLocalCopyAndScale_kernel.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElectrostaticBufferedRemoteToLocalReduceAndScale_kernel.cl b/KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElectrostaticBufferedRemoteToLocalReduceAndScale_kernel.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElectrostaticBufferedRemoteToLocalReduceAndScale_kernel.cl rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElectrostaticBufferedRemoteToLocalReduceAndScale_kernel.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElectrostaticLocalToLocalTransformation_kernel.cl b/KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElectrostaticLocalToLocalTransformation_kernel.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElectrostaticLocalToLocalTransformation_kernel.cl rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElectrostaticLocalToLocalTransformation_kernel.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElectrostaticMultipoleDistribution_kernel.cl b/KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElectrostaticMultipoleDistribution_kernel.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElectrostaticMultipoleDistribution_kernel.cl rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElectrostaticMultipoleDistribution_kernel.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElectrostaticMultipole_kernel.cl b/KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElectrostaticMultipole_kernel.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElectrostaticMultipole_kernel.cl rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElectrostaticMultipole_kernel.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElectrostaticRemoteToLocalCopyAndScale_kernel.cl b/KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElectrostaticRemoteToLocalCopyAndScale_kernel.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElectrostaticRemoteToLocalCopyAndScale_kernel.cl rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElectrostaticRemoteToLocalCopyAndScale_kernel.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElectrostaticRemoteToLocalReduceAndScale_kernel.cl b/KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElectrostaticRemoteToLocalReduceAndScale_kernel.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElectrostaticRemoteToLocalReduceAndScale_kernel.cl rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElectrostaticRemoteToLocalReduceAndScale_kernel.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElectrostaticRemoteToRemoteCopyAndScale_kernel.cl b/KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElectrostaticRemoteToRemoteCopyAndScale_kernel.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElectrostaticRemoteToRemoteCopyAndScale_kernel.cl rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElectrostaticRemoteToRemoteCopyAndScale_kernel.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElectrostaticRemoteToRemoteReduceAndScale_kernel.cl b/KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElectrostaticRemoteToRemoteReduceAndScale_kernel.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElectrostaticRemoteToRemoteReduceAndScale_kernel.cl rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElectrostaticRemoteToRemoteReduceAndScale_kernel.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElectrostaticRemoteToRemoteTransformation_kernel.cl b/KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElectrostaticRemoteToRemoteTransformation_kernel.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElectrostaticRemoteToRemoteTransformation_kernel.cl rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElectrostaticRemoteToRemoteTransformation_kernel.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElectrostaticSparseShellMatrixVectorProduct_kernel.cl b/KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElectrostaticSparseShellMatrixVectorProduct_kernel.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElectrostaticSparseShellMatrixVectorProduct_kernel.cl rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElectrostaticSparseShellMatrixVectorProduct_kernel.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElementCentroidFieldEvaluation.cl b/KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElementCentroidFieldEvaluation.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElementCentroidFieldEvaluation.cl rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElementCentroidFieldEvaluation.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElementCentroidPotentialEvaluation.cl b/KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElementCentroidPotentialEvaluation.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElementCentroidPotentialEvaluation.cl rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMElementCentroidPotentialEvaluation.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMLineSegmentMultipole.cl b/KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMLineSegmentMultipole.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMLineSegmentMultipole.cl rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMLineSegmentMultipole.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMLineSegmentMultipoleNumerical.cl b/KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMLineSegmentMultipoleNumerical.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMLineSegmentMultipoleNumerical.cl rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMLineSegmentMultipoleNumerical.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMRaggedElementLookUp.cl b/KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMRaggedElementLookUp.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMRaggedElementLookUp.cl rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMRaggedElementLookUp.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMRectangleMultipole.cl b/KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMRectangleMultipole.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMRectangleMultipole.cl rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMRectangleMultipole.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMRectangleMultipoleNumerical.cl b/KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMRectangleMultipoleNumerical.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMRectangleMultipoleNumerical.cl rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMRectangleMultipoleNumerical.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMTriangleMultipole.cl b/KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMTriangleMultipole.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMTriangleMultipole.cl rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMTriangleMultipole.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMTriangleMultipoleNumerical.cl b/KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMTriangleMultipoleNumerical.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMTriangleMultipoleNumerical.cl rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/cl/kEMField_KFMTriangleMultipoleNumerical.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/include/KFMElectrostaticBatchedLocalToLocalConverter_OpenCL.hh b/KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/include/KFMElectrostaticBatchedLocalToLocalConverter_OpenCL.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/include/KFMElectrostaticBatchedLocalToLocalConverter_OpenCL.hh rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/include/KFMElectrostaticBatchedLocalToLocalConverter_OpenCL.hh diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/include/KFMElectrostaticBatchedRemoteToLocalConverter_OpenCL.hh b/KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/include/KFMElectrostaticBatchedRemoteToLocalConverter_OpenCL.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/include/KFMElectrostaticBatchedRemoteToLocalConverter_OpenCL.hh rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/include/KFMElectrostaticBatchedRemoteToLocalConverter_OpenCL.hh diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/include/KFMElectrostaticBatchedRemoteToRemoteConverter_OpenCL.hh b/KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/include/KFMElectrostaticBatchedRemoteToRemoteConverter_OpenCL.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/include/KFMElectrostaticBatchedRemoteToRemoteConverter_OpenCL.hh rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/include/KFMElectrostaticBatchedRemoteToRemoteConverter_OpenCL.hh diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/include/KFMElectrostaticBoundaryIntegratorEngine_OpenCL.hh b/KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/include/KFMElectrostaticBoundaryIntegratorEngine_OpenCL.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/include/KFMElectrostaticBoundaryIntegratorEngine_OpenCL.hh rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/include/KFMElectrostaticBoundaryIntegratorEngine_OpenCL.hh diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/include/KFMElectrostaticFastMultipoleFieldSolver_OpenCL.hh b/KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/include/KFMElectrostaticFastMultipoleFieldSolver_OpenCL.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/include/KFMElectrostaticFastMultipoleFieldSolver_OpenCL.hh rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/include/KFMElectrostaticFastMultipoleFieldSolver_OpenCL.hh diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/include/KFMElectrostaticFieldMapper_OpenCL.hh b/KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/include/KFMElectrostaticFieldMapper_OpenCL.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/include/KFMElectrostaticFieldMapper_OpenCL.hh rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/include/KFMElectrostaticFieldMapper_OpenCL.hh diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/include/KFMElectrostaticLocalToLocalConverter_OpenCL.hh b/KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/include/KFMElectrostaticLocalToLocalConverter_OpenCL.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/include/KFMElectrostaticLocalToLocalConverter_OpenCL.hh rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/include/KFMElectrostaticLocalToLocalConverter_OpenCL.hh diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/include/KFMElectrostaticMultipoleBatchCalculator_OpenCL.hh b/KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/include/KFMElectrostaticMultipoleBatchCalculator_OpenCL.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/include/KFMElectrostaticMultipoleBatchCalculator_OpenCL.hh rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/include/KFMElectrostaticMultipoleBatchCalculator_OpenCL.hh diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/include/KFMElectrostaticMultipoleCalculator_OpenCL.hh b/KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/include/KFMElectrostaticMultipoleCalculator_OpenCL.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/include/KFMElectrostaticMultipoleCalculator_OpenCL.hh rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/include/KFMElectrostaticMultipoleCalculator_OpenCL.hh diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/include/KFMElectrostaticMultipoleDistributor_OpenCL.hh b/KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/include/KFMElectrostaticMultipoleDistributor_OpenCL.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/include/KFMElectrostaticMultipoleDistributor_OpenCL.hh rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/include/KFMElectrostaticMultipoleDistributor_OpenCL.hh diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/include/KFMElectrostaticRemoteToLocalConverter_OpenCL.hh b/KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/include/KFMElectrostaticRemoteToLocalConverter_OpenCL.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/include/KFMElectrostaticRemoteToLocalConverter_OpenCL.hh rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/include/KFMElectrostaticRemoteToLocalConverter_OpenCL.hh diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/include/KFMElectrostaticRemoteToRemoteConverter_OpenCL.hh b/KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/include/KFMElectrostaticRemoteToRemoteConverter_OpenCL.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/include/KFMElectrostaticRemoteToRemoteConverter_OpenCL.hh rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/include/KFMElectrostaticRemoteToRemoteConverter_OpenCL.hh diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/include/KFMElectrostaticSparseBoundaryIntegralShellMatrix_MPI_OpenCL.hh b/KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/include/KFMElectrostaticSparseBoundaryIntegralShellMatrix_MPI_OpenCL.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/include/KFMElectrostaticSparseBoundaryIntegralShellMatrix_MPI_OpenCL.hh rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/include/KFMElectrostaticSparseBoundaryIntegralShellMatrix_MPI_OpenCL.hh diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/include/KFMElectrostaticSparseBoundaryIntegralShellMatrix_OpenCL.hh b/KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/include/KFMElectrostaticSparseBoundaryIntegralShellMatrix_OpenCL.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/include/KFMElectrostaticSparseBoundaryIntegralShellMatrix_OpenCL.hh rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/include/KFMElectrostaticSparseBoundaryIntegralShellMatrix_OpenCL.hh diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/include/KFMSparseElectrostaticBoundaryIntegratorEngine_OpenCL.hh b/KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/include/KFMSparseElectrostaticBoundaryIntegratorEngine_OpenCL.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/include/KFMSparseElectrostaticBoundaryIntegratorEngine_OpenCL.hh rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/include/KFMSparseElectrostaticBoundaryIntegratorEngine_OpenCL.hh diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/src/KFMElectrostaticBatchedLocalToLocalConverter_OpenCL.cc b/KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/src/KFMElectrostaticBatchedLocalToLocalConverter_OpenCL.cc similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/src/KFMElectrostaticBatchedLocalToLocalConverter_OpenCL.cc rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/src/KFMElectrostaticBatchedLocalToLocalConverter_OpenCL.cc diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/src/KFMElectrostaticBatchedRemoteToLocalConverter_OpenCL.cc b/KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/src/KFMElectrostaticBatchedRemoteToLocalConverter_OpenCL.cc similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/src/KFMElectrostaticBatchedRemoteToLocalConverter_OpenCL.cc rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/src/KFMElectrostaticBatchedRemoteToLocalConverter_OpenCL.cc diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/src/KFMElectrostaticBatchedRemoteToRemoteConverter_OpenCL.cc b/KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/src/KFMElectrostaticBatchedRemoteToRemoteConverter_OpenCL.cc similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/src/KFMElectrostaticBatchedRemoteToRemoteConverter_OpenCL.cc rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/src/KFMElectrostaticBatchedRemoteToRemoteConverter_OpenCL.cc diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/src/KFMElectrostaticBoundaryIntegratorEngine_OpenCL.cc b/KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/src/KFMElectrostaticBoundaryIntegratorEngine_OpenCL.cc similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/src/KFMElectrostaticBoundaryIntegratorEngine_OpenCL.cc rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/src/KFMElectrostaticBoundaryIntegratorEngine_OpenCL.cc diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/src/KFMElectrostaticFastMultipoleFieldSolver_OpenCL.cc b/KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/src/KFMElectrostaticFastMultipoleFieldSolver_OpenCL.cc similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/src/KFMElectrostaticFastMultipoleFieldSolver_OpenCL.cc rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/src/KFMElectrostaticFastMultipoleFieldSolver_OpenCL.cc diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/src/KFMElectrostaticFieldMapper_OpenCL.cc b/KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/src/KFMElectrostaticFieldMapper_OpenCL.cc similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/src/KFMElectrostaticFieldMapper_OpenCL.cc rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/src/KFMElectrostaticFieldMapper_OpenCL.cc diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/src/KFMElectrostaticLocalToLocalConverter_OpenCL.cc b/KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/src/KFMElectrostaticLocalToLocalConverter_OpenCL.cc similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/src/KFMElectrostaticLocalToLocalConverter_OpenCL.cc rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/src/KFMElectrostaticLocalToLocalConverter_OpenCL.cc diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/src/KFMElectrostaticMultipoleBatchCalculator_OpenCL.cc b/KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/src/KFMElectrostaticMultipoleBatchCalculator_OpenCL.cc similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/src/KFMElectrostaticMultipoleBatchCalculator_OpenCL.cc rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/src/KFMElectrostaticMultipoleBatchCalculator_OpenCL.cc diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/src/KFMElectrostaticMultipoleCalculator_OpenCL.cc b/KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/src/KFMElectrostaticMultipoleCalculator_OpenCL.cc similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/src/KFMElectrostaticMultipoleCalculator_OpenCL.cc rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/src/KFMElectrostaticMultipoleCalculator_OpenCL.cc diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/src/KFMElectrostaticMultipoleDistributor_OpenCL.cc b/KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/src/KFMElectrostaticMultipoleDistributor_OpenCL.cc similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/src/KFMElectrostaticMultipoleDistributor_OpenCL.cc rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/src/KFMElectrostaticMultipoleDistributor_OpenCL.cc diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/src/KFMElectrostaticRemoteToLocalConverter_OpenCL.cc b/KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/src/KFMElectrostaticRemoteToLocalConverter_OpenCL.cc similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/src/KFMElectrostaticRemoteToLocalConverter_OpenCL.cc rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/src/KFMElectrostaticRemoteToLocalConverter_OpenCL.cc diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/src/KFMElectrostaticRemoteToRemoteConverter_OpenCL.cc b/KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/src/KFMElectrostaticRemoteToRemoteConverter_OpenCL.cc similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/src/KFMElectrostaticRemoteToRemoteConverter_OpenCL.cc rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/src/KFMElectrostaticRemoteToRemoteConverter_OpenCL.cc diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/src/KFMSparseElectrostaticBoundaryIntegratorEngine_OpenCL.cc b/KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/src/KFMSparseElectrostaticBoundaryIntegratorEngine_OpenCL.cc similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Electrostatics/src/KFMSparseElectrostaticBoundaryIntegratorEngine_OpenCL.cc rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Electrostatics/src/KFMSparseElectrostaticBoundaryIntegratorEngine_OpenCL.cc diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMArrayMath.cl b/KEMField/Source/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMArrayMath.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMArrayMath.cl rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMArrayMath.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMComplexMultiply.cl b/KEMField/Source/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMComplexMultiply.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMComplexMultiply.cl rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMComplexMultiply.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMFastFourierTransformUtilities.cl b/KEMField/Source/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMFastFourierTransformUtilities.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMFastFourierTransformUtilities.cl rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMFastFourierTransformUtilities.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMFastFourierTransformUtilitiesLocal.cl b/KEMField/Source/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMFastFourierTransformUtilitiesLocal.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMFastFourierTransformUtilitiesLocal.cl rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMFastFourierTransformUtilitiesLocal.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMFastFourierTransformUtilitiesPrivate.cl b/KEMField/Source/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMFastFourierTransformUtilitiesPrivate.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMFastFourierTransformUtilitiesPrivate.cl rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMFastFourierTransformUtilitiesPrivate.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMMultidimensionalFastFourierTransformLocal_kernel.cl b/KEMField/Source/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMMultidimensionalFastFourierTransformLocal_kernel.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMMultidimensionalFastFourierTransformLocal_kernel.cl rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMMultidimensionalFastFourierTransformLocal_kernel.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMMultidimensionalFastFourierTransformPrivate_kernel.cl b/KEMField/Source/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMMultidimensionalFastFourierTransformPrivate_kernel.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMMultidimensionalFastFourierTransformPrivate_kernel.cl rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMMultidimensionalFastFourierTransformPrivate_kernel.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMMultidimensionalFastFourierTransform_kernel.cl b/KEMField/Source/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMMultidimensionalFastFourierTransform_kernel.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMMultidimensionalFastFourierTransform_kernel.cl rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMMultidimensionalFastFourierTransform_kernel.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMMultipoleRotation.cl b/KEMField/Source/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMMultipoleRotation.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMMultipoleRotation.cl rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMMultipoleRotation.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMMultipoleTranslation.cl b/KEMField/Source/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMMultipoleTranslation.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMMultipoleTranslation.cl rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMMultipoleTranslation.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMPointwiseComplexVectorAdd_kernel.cl b/KEMField/Source/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMPointwiseComplexVectorAdd_kernel.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMPointwiseComplexVectorAdd_kernel.cl rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMPointwiseComplexVectorAdd_kernel.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMPointwiseComplexVectorMultiply_kernel.cl b/KEMField/Source/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMPointwiseComplexVectorMultiply_kernel.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMPointwiseComplexVectorMultiply_kernel.cl rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMPointwiseComplexVectorMultiply_kernel.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMRotationMatrix.cl b/KEMField/Source/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMRotationMatrix.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMRotationMatrix.cl rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMRotationMatrix.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMSphericalMultipoleExpansionEvaluation.cl b/KEMField/Source/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMSphericalMultipoleExpansionEvaluation.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMSphericalMultipoleExpansionEvaluation.cl rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMSphericalMultipoleExpansionEvaluation.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMSphericalMultipoleExpansionEvaluation_Precomputed.cl b/KEMField/Source/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMSphericalMultipoleExpansionEvaluation_Precomputed.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMSphericalMultipoleExpansionEvaluation_Precomputed.cl rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMSphericalMultipoleExpansionEvaluation_Precomputed.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMSphericalMultipoleMath.cl b/KEMField/Source/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMSphericalMultipoleMath.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMSphericalMultipoleMath.cl rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMSphericalMultipoleMath.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMVectorScale_kernel.cl b/KEMField/Source/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMVectorScale_kernel.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMVectorScale_kernel.cl rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMVectorScale_kernel.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMZeroComplexArray_kernel.cl b/KEMField/Source/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMZeroComplexArray_kernel.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMZeroComplexArray_kernel.cl rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Math/cl/kEMField_KFMZeroComplexArray_kernel.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Math/include/KFMBatchedMultidimensionalFastFourierTransform_OpenCL.hh b/KEMField/Source/Plugins/OpenCL/FastMultipole/Math/include/KFMBatchedMultidimensionalFastFourierTransform_OpenCL.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Math/include/KFMBatchedMultidimensionalFastFourierTransform_OpenCL.hh rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Math/include/KFMBatchedMultidimensionalFastFourierTransform_OpenCL.hh diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Tree/cl/kEMField_KFMBufferedReducedScalarMomentRemoteToLocalConverter_kernel.cl b/KEMField/Source/Plugins/OpenCL/FastMultipole/Tree/cl/kEMField_KFMBufferedReducedScalarMomentRemoteToLocalConverter_kernel.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Tree/cl/kEMField_KFMBufferedReducedScalarMomentRemoteToLocalConverter_kernel.cl rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Tree/cl/kEMField_KFMBufferedReducedScalarMomentRemoteToLocalConverter_kernel.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Tree/cl/kEMField_KFMReducedScalarMomentRemoteToLocalConverter_kernel.cl b/KEMField/Source/Plugins/OpenCL/FastMultipole/Tree/cl/kEMField_KFMReducedScalarMomentRemoteToLocalConverter_kernel.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Tree/cl/kEMField_KFMReducedScalarMomentRemoteToLocalConverter_kernel.cl rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Tree/cl/kEMField_KFMReducedScalarMomentRemoteToLocalConverter_kernel.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Tree/cl/kEMField_KFMScalarMomentApplyScaleFactor_kernel.cl b/KEMField/Source/Plugins/OpenCL/FastMultipole/Tree/cl/kEMField_KFMScalarMomentApplyScaleFactor_kernel.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Tree/cl/kEMField_KFMScalarMomentApplyScaleFactor_kernel.cl rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Tree/cl/kEMField_KFMScalarMomentApplyScaleFactor_kernel.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Tree/cl/kEMField_KFMScalarMomentArrayReduction_kernel.cl b/KEMField/Source/Plugins/OpenCL/FastMultipole/Tree/cl/kEMField_KFMScalarMomentArrayReduction_kernel.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Tree/cl/kEMField_KFMScalarMomentArrayReduction_kernel.cl rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Tree/cl/kEMField_KFMScalarMomentArrayReduction_kernel.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Tree/cl/kEMField_KFMScalarMomentLocalToLocalConverter_kernel.cl b/KEMField/Source/Plugins/OpenCL/FastMultipole/Tree/cl/kEMField_KFMScalarMomentLocalToLocalConverter_kernel.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Tree/cl/kEMField_KFMScalarMomentLocalToLocalConverter_kernel.cl rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Tree/cl/kEMField_KFMScalarMomentLocalToLocalConverter_kernel.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Tree/cl/kEMField_KFMScalarMomentRemoteToLocalConverter_kernel.cl b/KEMField/Source/Plugins/OpenCL/FastMultipole/Tree/cl/kEMField_KFMScalarMomentRemoteToLocalConverter_kernel.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Tree/cl/kEMField_KFMScalarMomentRemoteToLocalConverter_kernel.cl rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Tree/cl/kEMField_KFMScalarMomentRemoteToLocalConverter_kernel.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Tree/cl/kEMField_KFMScalarMomentRemoteToRemoteConverter_kernel.cl b/KEMField/Source/Plugins/OpenCL/FastMultipole/Tree/cl/kEMField_KFMScalarMomentRemoteToRemoteConverter_kernel.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Tree/cl/kEMField_KFMScalarMomentRemoteToRemoteConverter_kernel.cl rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Tree/cl/kEMField_KFMScalarMomentRemoteToRemoteConverter_kernel.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Tree/cl/kEMField_KFMSparseScalarMomentAdd_kernel.cl b/KEMField/Source/Plugins/OpenCL/FastMultipole/Tree/cl/kEMField_KFMSparseScalarMomentAdd_kernel.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Tree/cl/kEMField_KFMSparseScalarMomentAdd_kernel.cl rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Tree/cl/kEMField_KFMSparseScalarMomentAdd_kernel.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Tree/include/KFMReducedScalarMomentRemoteToLocalConverter_OpenCL.hh b/KEMField/Source/Plugins/OpenCL/FastMultipole/Tree/include/KFMReducedScalarMomentRemoteToLocalConverter_OpenCL.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Tree/include/KFMReducedScalarMomentRemoteToLocalConverter_OpenCL.hh rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Tree/include/KFMReducedScalarMomentRemoteToLocalConverter_OpenCL.hh diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Tree/include/KFMScalarMomentLocalToLocalConverter_OpenCL.hh b/KEMField/Source/Plugins/OpenCL/FastMultipole/Tree/include/KFMScalarMomentLocalToLocalConverter_OpenCL.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Tree/include/KFMScalarMomentLocalToLocalConverter_OpenCL.hh rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Tree/include/KFMScalarMomentLocalToLocalConverter_OpenCL.hh diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Tree/include/KFMScalarMomentRemoteToLocalConverter_OpenCL.hh b/KEMField/Source/Plugins/OpenCL/FastMultipole/Tree/include/KFMScalarMomentRemoteToLocalConverter_OpenCL.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Tree/include/KFMScalarMomentRemoteToLocalConverter_OpenCL.hh rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Tree/include/KFMScalarMomentRemoteToLocalConverter_OpenCL.hh diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Tree/include/KFMScalarMomentRemoteToRemoteConverter_OpenCL.hh b/KEMField/Source/Plugins/OpenCL/FastMultipole/Tree/include/KFMScalarMomentRemoteToRemoteConverter_OpenCL.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Tree/include/KFMScalarMomentRemoteToRemoteConverter_OpenCL.hh rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Tree/include/KFMScalarMomentRemoteToRemoteConverter_OpenCL.hh diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Tree/include/KFMSparseReducedScalarMomentRemoteToLocalConverter_OpenCL.hh b/KEMField/Source/Plugins/OpenCL/FastMultipole/Tree/include/KFMSparseReducedScalarMomentRemoteToLocalConverter_OpenCL.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FastMultipole/Tree/include/KFMSparseReducedScalarMomentRemoteToLocalConverter_OpenCL.hh rename to KEMField/Source/Plugins/OpenCL/FastMultipole/Tree/include/KFMSparseReducedScalarMomentRemoteToLocalConverter_OpenCL.hh diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FieldSolvers/Integrating/cl/kEMField_ElectrostaticIntegratingFieldSolver_kernel.cl b/KEMField/Source/Plugins/OpenCL/FieldSolvers/Integrating/cl/kEMField_ElectrostaticIntegratingFieldSolver_kernel.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FieldSolvers/Integrating/cl/kEMField_ElectrostaticIntegratingFieldSolver_kernel.cl rename to KEMField/Source/Plugins/OpenCL/FieldSolvers/Integrating/cl/kEMField_ElectrostaticIntegratingFieldSolver_kernel.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/FieldSolvers/Integrating/include/KOpenCLElectrostaticIntegratingFieldSolver.hh b/KEMField/Source/Plugins/OpenCL/FieldSolvers/Integrating/include/KOpenCLElectrostaticIntegratingFieldSolver.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/FieldSolvers/Integrating/include/KOpenCLElectrostaticIntegratingFieldSolver.hh rename to KEMField/Source/Plugins/OpenCL/FieldSolvers/Integrating/include/KOpenCLElectrostaticIntegratingFieldSolver.hh diff --git a/KEMField/Source/2.0/Plugins/OpenCL/IO/include/KOpenCLBufferStreamer.hh b/KEMField/Source/Plugins/OpenCL/IO/include/KOpenCLBufferStreamer.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/IO/include/KOpenCLBufferStreamer.hh rename to KEMField/Source/Plugins/OpenCL/IO/include/KOpenCLBufferStreamer.hh diff --git a/KEMField/Source/2.0/Plugins/OpenCL/LinearAlgebra/cl/kEMField_DenseBlockSparseMatrixVectorProduct_kernel.cl b/KEMField/Source/Plugins/OpenCL/LinearAlgebra/cl/kEMField_DenseBlockSparseMatrixVectorProduct_kernel.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/LinearAlgebra/cl/kEMField_DenseBlockSparseMatrixVectorProduct_kernel.cl rename to KEMField/Source/Plugins/OpenCL/LinearAlgebra/cl/kEMField_DenseBlockSparseMatrixVectorProduct_kernel.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/LinearAlgebra/cl/kEMField_GaussSeidel_kernel.cl b/KEMField/Source/Plugins/OpenCL/LinearAlgebra/cl/kEMField_GaussSeidel_kernel.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/LinearAlgebra/cl/kEMField_GaussSeidel_kernel.cl rename to KEMField/Source/Plugins/OpenCL/LinearAlgebra/cl/kEMField_GaussSeidel_kernel.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/LinearAlgebra/cl/kEMField_LinearAlgebra.cl b/KEMField/Source/Plugins/OpenCL/LinearAlgebra/cl/kEMField_LinearAlgebra.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/LinearAlgebra/cl/kEMField_LinearAlgebra.cl rename to KEMField/Source/Plugins/OpenCL/LinearAlgebra/cl/kEMField_LinearAlgebra.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/LinearAlgebra/cl/kEMField_LinearAlgebra_kernel.cl b/KEMField/Source/Plugins/OpenCL/LinearAlgebra/cl/kEMField_LinearAlgebra_kernel.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/LinearAlgebra/cl/kEMField_LinearAlgebra_kernel.cl rename to KEMField/Source/Plugins/OpenCL/LinearAlgebra/cl/kEMField_LinearAlgebra_kernel.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/LinearAlgebra/cl/kEMField_RobinHood_kernel.cl b/KEMField/Source/Plugins/OpenCL/LinearAlgebra/cl/kEMField_RobinHood_kernel.cl similarity index 83% rename from KEMField/Source/2.0/Plugins/OpenCL/LinearAlgebra/cl/kEMField_RobinHood_kernel.cl rename to KEMField/Source/Plugins/OpenCL/LinearAlgebra/cl/kEMField_RobinHood_kernel.cl index 4aa962852..ea6634af3 100644 --- a/KEMField/Source/2.0/Plugins/OpenCL/LinearAlgebra/cl/kEMField_RobinHood_kernel.cl +++ b/KEMField/Source/Plugins/OpenCL/LinearAlgebra/cl/kEMField_RobinHood_kernel.cl @@ -13,33 +13,35 @@ int RH_BoundaryRatioExceeded(int iElement, { int return_val = 0; -//#ifdef NEUMANNBOUNDARY -// int iBoundary = BI_GetBoundaryForElement(iElement,boundaryInfo); -// - // is the element a dielectric? -// if (BI_GetBoundaryType(iBoundary,boundaryInfo) == NEUMANNBOUNDARY) -// { - // yes. Is the ratio of times its boundary has been called to the total - // number of calls more than the ratio of dielectric elements to total - // elements? -// -// if (counter[BI_GetNumBoundaries(boundaryInfo)]==0) -// return return_val; -// -// CL_TYPE ratio_called = 0.; -// CL_TYPE ratio_geometric = 0.; -// -// ratio_called = (convert_float(counter[iBoundary])/ -// convert_float(counter[BI_GetNumBoundaries(boundaryInfo)])); -// -// ratio_geometric =(convert_float(BI_GetBoundarySize(iBoundary,boundaryInfo))/ -// convert_float(BI_GetNumElements(boundaryInfo))); -// -// // this all must be negated if the residual is being checked! -// if (ratio_called>ratio_geometric && counter[BI_GetNumBoundaries(boundaryInfo)]%counter[BI_GetNumBoundaries(boundaryInfo)+1]!=0) -// return_val = 1; -// } -//#endif +#if KEMFIELD_OCLFASTDIELECTRICS==1 +#ifdef NEUMANNBOUNDARY + int iBoundary = BI_GetBoundaryForElement(iElement,boundaryInfo); + +// is the element a dielectric? + if (BI_GetBoundaryType(iBoundary,boundaryInfo) == NEUMANNBOUNDARY) + { +// yes. Is the ratio of times its boundary has been called to the total +// number of calls more than the ratio of dielectric elements to total +// elements? + + if (counter[BI_GetNumBoundaries(boundaryInfo)]==0) + return return_val; + + CL_TYPE ratio_called = 0.; + CL_TYPE ratio_geometric = 0.; + + ratio_called = (convert_float(counter[iBoundary])/ + convert_float(counter[BI_GetNumBoundaries(boundaryInfo)])); + + ratio_geometric =(convert_float(BI_GetBoundarySize(iBoundary,boundaryInfo))/ + convert_float(BI_GetNumElements(boundaryInfo))); + + // this all must be negated if the residual is being checked! + if (ratio_called>ratio_geometric && counter[BI_GetNumBoundaries(boundaryInfo)]%counter[BI_GetNumBoundaries(boundaryInfo)+1]!=0) + return_val = 1; + } +#endif +#endif /* KEMFIELD_OCLDIELECTRICS */ return return_val; } @@ -84,9 +86,11 @@ __kernel void FindResidual(__global CL_TYPE* b_diff, if (b_iterative[iElement]<1.e10) { - // if (RH_BoundaryRatioExceeded(iElement,boundaryInfo,counter)) - // b_diff[iElement] = 0.; - // else +#if KEMFIELD_OCLFASTDIELECTRICS==1 + if (RH_BoundaryRatioExceeded(iElement,boundaryInfo,counter)) + b_diff[iElement] = 0.; + else +#endif /* KEMFIELD_OCLFASTDIELECTRICS */ b_diff[iElement] = U_Target - b_iterative[iElement]; } else diff --git a/KEMField/Source/2.0/Plugins/OpenCL/LinearAlgebra/include/KFMDenseBlockSparseMatrix_OpenCL.hh b/KEMField/Source/Plugins/OpenCL/LinearAlgebra/include/KFMDenseBlockSparseMatrix_OpenCL.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/LinearAlgebra/include/KFMDenseBlockSparseMatrix_OpenCL.hh rename to KEMField/Source/Plugins/OpenCL/LinearAlgebra/include/KFMDenseBlockSparseMatrix_OpenCL.hh diff --git a/KEMField/Source/2.0/Plugins/OpenCL/LinearAlgebra/include/KGaussSeidel_OpenCL.hh b/KEMField/Source/Plugins/OpenCL/LinearAlgebra/include/KGaussSeidel_OpenCL.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/LinearAlgebra/include/KGaussSeidel_OpenCL.hh rename to KEMField/Source/Plugins/OpenCL/LinearAlgebra/include/KGaussSeidel_OpenCL.hh diff --git a/KEMField/Source/2.0/Plugins/OpenCL/LinearAlgebra/include/KRobinHood_MPI_OpenCL.hh b/KEMField/Source/Plugins/OpenCL/LinearAlgebra/include/KRobinHood_MPI_OpenCL.hh similarity index 98% rename from KEMField/Source/2.0/Plugins/OpenCL/LinearAlgebra/include/KRobinHood_MPI_OpenCL.hh rename to KEMField/Source/Plugins/OpenCL/LinearAlgebra/include/KRobinHood_MPI_OpenCL.hh index 052b9a503..7241c0810 100644 --- a/KEMField/Source/2.0/Plugins/OpenCL/LinearAlgebra/include/KRobinHood_MPI_OpenCL.hh +++ b/KEMField/Source/Plugins/OpenCL/LinearAlgebra/include/KRobinHood_MPI_OpenCL.hh @@ -23,6 +23,8 @@ namespace KEMField void ConstructOpenCLKernels() const; void AssignBuffers() const; + std::string GetOpenCLFlags() const { return fOpenCLFlags; } + void Initialize(); void FindResidual(); void FindResidualNorm(double& residualNorm); @@ -90,6 +92,8 @@ namespace KEMField mutable bool fReadResidual; + mutable std::string fOpenCLFlags; + MPI_Status fStatus; MPI_Datatype fMPI_Res_type; MPI_Op fMPI_Max; @@ -136,6 +140,10 @@ namespace KEMField KRobinHood_MPI_OpenCL::KRobinHood_MPI_OpenCL(const Matrix& A, Vector& X, const Vector& B) : KOpenCLAction(dynamic_cast(A).GetData()), fA(A), fX(X), fB(B), fBInfinityNorm(1.e30), fInitializeVectorApproximationKernel(NULL), fFindResidualKernel(NULL), fFindResidualNormKernel(NULL), fCompleteResidualNormalizationKernel(NULL), fIdentifyLargestResidualElementKernel(NULL), fCompleteLargestResidualIdentificationKernel(NULL), fComputeCorrectionKernel(NULL), fUpdateSolutionApproximationKernel(NULL), fUpdateVectorApproximationKernel(NULL), fBufferResidual(NULL), fBufferB_iterative(NULL), fBufferCorrection(NULL), fBufferPartialMaxResidualIndex(NULL), fBufferMaxResidualIndex(NULL), fBufferPartialResidualNorm(NULL), fBufferResidualNorm(NULL), fBufferNWarps(NULL), fBufferCounter(NULL), fCLResidual(NULL), fCLB_iterative(NULL), fCLCorrection(NULL), fCLPartialMaxResidualIndex(NULL), fCLMaxResidualIndex(NULL), fCLMaxResidual(NULL), fCLPartialResidualNorm(NULL), fCLResidualNorm(NULL), fCLNWarps(NULL), fCLCounter(NULL), fReadResidual(false) { InitializeMPIStructs(Type2Type()); + std::stringstream options; + options << " -DKEMFIELD_OCLFASTDIELECTRICS=" << KEMFIELD_FASTDIELECTRICS_VALUE; + fOpenCLFlags = options.str(); + KOpenCLAction::Initialize(); } @@ -182,13 +190,16 @@ namespace KEMField // 2); // } + std::stringstream options; + options << (dynamic_cast(fA)).GetOpenCLFlags().c_str() << GetOpenCLFlags(); + // Build program for these specific devices try { // use only target device! CL_VECTOR_TYPE devices; devices.push_back( KOpenCLInterface::GetInstance()->GetDevice() ); - program.build(devices,dynamic_cast(fA).GetOpenCLFlags().c_str()); + program.build(devices, options.str().c_str()); } catch (cl::Error error) { diff --git a/KEMField/Source/2.0/Plugins/OpenCL/LinearAlgebra/include/KRobinHood_OpenCL.hh b/KEMField/Source/Plugins/OpenCL/LinearAlgebra/include/KRobinHood_OpenCL.hh similarity index 97% rename from KEMField/Source/2.0/Plugins/OpenCL/LinearAlgebra/include/KRobinHood_OpenCL.hh rename to KEMField/Source/Plugins/OpenCL/LinearAlgebra/include/KRobinHood_OpenCL.hh index 083dff36c..1985b29bf 100644 --- a/KEMField/Source/2.0/Plugins/OpenCL/LinearAlgebra/include/KRobinHood_OpenCL.hh +++ b/KEMField/Source/Plugins/OpenCL/LinearAlgebra/include/KRobinHood_OpenCL.hh @@ -23,6 +23,8 @@ namespace KEMField void ConstructOpenCLKernels() const; void AssignBuffers() const; + std::string GetOpenCLFlags() const { return fOpenCLFlags; } + void Initialize(); void FindResidual(); void FindResidualNorm(double& residualNorm); @@ -85,12 +87,18 @@ namespace KEMField mutable cl_int *fCLCounter; mutable bool fReadResidual; + + mutable std::string fOpenCLFlags; }; template KRobinHood_OpenCL::KRobinHood_OpenCL(const Matrix& A, Vector& x, const Vector& b) : KOpenCLAction((dynamic_cast(A)).GetData()), fA(A), fX(x), fB(b), fInitializeVectorApproximationKernel(NULL), fFindResidualKernel(NULL), fFindResidualNormKernel(NULL), fCompleteResidualNormalizationKernel(NULL), fIdentifyLargestResidualElementKernel(NULL), fCompleteLargestResidualIdentificationKernel(NULL), fComputeCorrectionKernel(NULL), fUpdateSolutionApproximationKernel(NULL), fUpdateVectorApproximationKernel(NULL), fBufferResidual(NULL), fBufferB_iterative(NULL), fBufferCorrection(NULL), fBufferPartialMaxResidualIndex(NULL), fBufferMaxResidualIndex(NULL), fBufferPartialResidualNorm(NULL), fBufferResidualNorm(NULL), fBufferNWarps(NULL), fBufferCounter(NULL), fCLResidual(NULL), fCLB_iterative(NULL), fCLCorrection(NULL), fCLPartialMaxResidualIndex(NULL), fCLMaxResidualIndex(NULL), fCLPartialResidualNorm(NULL), fCLResidualNorm(NULL), fCLNWarps(NULL), fCLCounter(NULL), fReadResidual(false) { - KOpenCLAction::Initialize(); + std::stringstream options; + options << " -DKEMFIELD_OCLFASTDIELECTRICS=" << KEMFIELD_FASTDIELECTRICS_VALUE; /* variable defined via cmake */ + fOpenCLFlags = options.str(); + + KOpenCLAction::Initialize(); } template @@ -136,13 +144,16 @@ namespace KEMField // 2); // } + std::stringstream options; + options << (dynamic_cast(fA)).GetOpenCLFlags().c_str() << GetOpenCLFlags(); + // Build program for these specific devices try { // use only target device! CL_VECTOR_TYPE devices; devices.push_back( KOpenCLInterface::GetInstance()->GetDevice() ); - program.build(devices,(dynamic_cast(fA)).GetOpenCLFlags().c_str()); + program.build(devices,options.str().c_str()); } catch (cl::Error error) { diff --git a/KEMField/Source/2.0/Plugins/OpenCL/Math/cl/kEMField_GaussianCubature.cl b/KEMField/Source/Plugins/OpenCL/Math/cl/kEMField_GaussianCubature.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/Math/cl/kEMField_GaussianCubature.cl rename to KEMField/Source/Plugins/OpenCL/Math/cl/kEMField_GaussianCubature.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/Math/cl/kEMField_GaussianQuadrature.cl b/KEMField/Source/Plugins/OpenCL/Math/cl/kEMField_GaussianQuadrature.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/Math/cl/kEMField_GaussianQuadrature.cl rename to KEMField/Source/Plugins/OpenCL/Math/cl/kEMField_GaussianQuadrature.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/Math/cl/kEMField_VectorOperations.cl b/KEMField/Source/Plugins/OpenCL/Math/cl/kEMField_VectorOperations.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/Math/cl/kEMField_VectorOperations.cl rename to KEMField/Source/Plugins/OpenCL/Math/cl/kEMField_VectorOperations.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/Surfaces/cl/kEMField_ConicSection.cl b/KEMField/Source/Plugins/OpenCL/Surfaces/cl/kEMField_ConicSection.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/Surfaces/cl/kEMField_ConicSection.cl rename to KEMField/Source/Plugins/OpenCL/Surfaces/cl/kEMField_ConicSection.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/Surfaces/cl/kEMField_LineSegment.cl b/KEMField/Source/Plugins/OpenCL/Surfaces/cl/kEMField_LineSegment.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/Surfaces/cl/kEMField_LineSegment.cl rename to KEMField/Source/Plugins/OpenCL/Surfaces/cl/kEMField_LineSegment.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/Surfaces/cl/kEMField_Rectangle.cl b/KEMField/Source/Plugins/OpenCL/Surfaces/cl/kEMField_Rectangle.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/Surfaces/cl/kEMField_Rectangle.cl rename to KEMField/Source/Plugins/OpenCL/Surfaces/cl/kEMField_Rectangle.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/Surfaces/cl/kEMField_SolidAngle.cl b/KEMField/Source/Plugins/OpenCL/Surfaces/cl/kEMField_SolidAngle.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/Surfaces/cl/kEMField_SolidAngle.cl rename to KEMField/Source/Plugins/OpenCL/Surfaces/cl/kEMField_SolidAngle.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/Surfaces/cl/kEMField_Triangle.cl b/KEMField/Source/Plugins/OpenCL/Surfaces/cl/kEMField_Triangle.cl similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/Surfaces/cl/kEMField_Triangle.cl rename to KEMField/Source/Plugins/OpenCL/Surfaces/cl/kEMField_Triangle.cl diff --git a/KEMField/Source/2.0/Plugins/OpenCL/Surfaces/include/KOpenCLSurfaceContainer.hh b/KEMField/Source/Plugins/OpenCL/Surfaces/include/KOpenCLSurfaceContainer.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/Surfaces/include/KOpenCLSurfaceContainer.hh rename to KEMField/Source/Plugins/OpenCL/Surfaces/include/KOpenCLSurfaceContainer.hh diff --git a/KEMField/Source/2.0/Plugins/OpenCL/Surfaces/src/KOpenCLSurfaceContainer.cc b/KEMField/Source/Plugins/OpenCL/Surfaces/src/KOpenCLSurfaceContainer.cc similarity index 100% rename from KEMField/Source/2.0/Plugins/OpenCL/Surfaces/src/KOpenCLSurfaceContainer.cc rename to KEMField/Source/Plugins/OpenCL/Surfaces/src/KOpenCLSurfaceContainer.cc diff --git a/KEMField/Source/2.0/Plugins/PETSc/CMakeLists.txt b/KEMField/Source/Plugins/PETSc/CMakeLists.txt similarity index 100% rename from KEMField/Source/2.0/Plugins/PETSc/CMakeLists.txt rename to KEMField/Source/Plugins/PETSc/CMakeLists.txt diff --git a/KEMField/Source/2.0/Plugins/PETSc/include/KPETScInterface.hh b/KEMField/Source/Plugins/PETSc/include/KPETScInterface.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/PETSc/include/KPETScInterface.hh rename to KEMField/Source/Plugins/PETSc/include/KPETScInterface.hh diff --git a/KEMField/Source/2.0/Plugins/PETSc/include/KPETScSolver.hh b/KEMField/Source/Plugins/PETSc/include/KPETScSolver.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/PETSc/include/KPETScSolver.hh rename to KEMField/Source/Plugins/PETSc/include/KPETScSolver.hh diff --git a/KEMField/Source/2.0/Plugins/PETSc/src/KPETScInterface.cc b/KEMField/Source/Plugins/PETSc/src/KPETScInterface.cc similarity index 100% rename from KEMField/Source/2.0/Plugins/PETSc/src/KPETScInterface.cc rename to KEMField/Source/Plugins/PETSc/src/KPETScInterface.cc diff --git a/KEMField/Source/2.0/Plugins/Root/CMakeLists.txt b/KEMField/Source/Plugins/Root/CMakeLists.txt similarity index 100% rename from KEMField/Source/2.0/Plugins/Root/CMakeLists.txt rename to KEMField/Source/Plugins/Root/CMakeLists.txt diff --git a/KEMField/Source/2.0/Plugins/Root/include/KEMElectricFieldPointsRootFile.hh b/KEMField/Source/Plugins/Root/include/KEMElectricFieldPointsRootFile.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/Root/include/KEMElectricFieldPointsRootFile.hh rename to KEMField/Source/Plugins/Root/include/KEMElectricFieldPointsRootFile.hh diff --git a/KEMField/Source/2.0/Plugins/Root/include/KEMRootFieldCanvas.hh b/KEMField/Source/Plugins/Root/include/KEMRootFieldCanvas.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/Root/include/KEMRootFieldCanvas.hh rename to KEMField/Source/Plugins/Root/include/KEMRootFieldCanvas.hh diff --git a/KEMField/Source/2.0/Plugins/Root/include/KEMRootSVDSolver.hh b/KEMField/Source/Plugins/Root/include/KEMRootSVDSolver.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/Root/include/KEMRootSVDSolver.hh rename to KEMField/Source/Plugins/Root/include/KEMRootSVDSolver.hh diff --git a/KEMField/Source/2.0/Plugins/Root/src/KEMElectricFieldPointsRootFile.cc b/KEMField/Source/Plugins/Root/src/KEMElectricFieldPointsRootFile.cc similarity index 100% rename from KEMField/Source/2.0/Plugins/Root/src/KEMElectricFieldPointsRootFile.cc rename to KEMField/Source/Plugins/Root/src/KEMElectricFieldPointsRootFile.cc diff --git a/KEMField/Source/2.0/Plugins/Root/src/KEMRootFieldCanvas.cc b/KEMField/Source/Plugins/Root/src/KEMRootFieldCanvas.cc similarity index 100% rename from KEMField/Source/2.0/Plugins/Root/src/KEMRootFieldCanvas.cc rename to KEMField/Source/Plugins/Root/src/KEMRootFieldCanvas.cc diff --git a/KEMField/Source/2.0/Plugins/Root/src/KEMRootSVDSolver.cc b/KEMField/Source/Plugins/Root/src/KEMRootSVDSolver.cc similarity index 100% rename from KEMField/Source/2.0/Plugins/Root/src/KEMRootSVDSolver.cc rename to KEMField/Source/Plugins/Root/src/KEMRootSVDSolver.cc diff --git a/KEMField/Source/2.0/Plugins/VTK/CMakeLists.txt b/KEMField/Source/Plugins/VTK/CMakeLists.txt similarity index 95% rename from KEMField/Source/2.0/Plugins/VTK/CMakeLists.txt rename to KEMField/Source/Plugins/VTK/CMakeLists.txt index bea6dd44e..d4629863f 100644 --- a/KEMField/Source/2.0/Plugins/VTK/CMakeLists.txt +++ b/KEMField/Source/Plugins/VTK/CMakeLists.txt @@ -27,10 +27,11 @@ if (@PROJECT_NAME@_USE_VTK) SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/src/KEMVTKViewer.cc ${CMAKE_CURRENT_SOURCE_DIR}/src/KEMVTKFieldCanvas.cc + ${CMAKE_CURRENT_SOURCE_DIR}/src/KFMVTKElectrostaticTreeViewer.cc APPEND PROPERTY COMPILE_DEFINITIONS VTK6 ) endif () - + set( VTKPLUGIN_LINK_LIBRARIES KEMSurfaces KEMVisualization @@ -39,7 +40,7 @@ if (@PROJECT_NAME@_USE_VTK) ${GSL_LIBRARIES} ${OPENCL_LIBRARIES} ${VTK_LIBRARIES} - ) + ) add_library (KEMVTKPlugin SHARED ${VTKPLUGIN_SOURCEFILES}) target_link_libraries (KEMVTKPlugin ${VTKPLUGIN_LINK_LIBRARIES}) diff --git a/KEMField/Source/2.0/Plugins/VTK/include/KEMVTKElectromagnetViewer.hh b/KEMField/Source/Plugins/VTK/include/KEMVTKElectromagnetViewer.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/VTK/include/KEMVTKElectromagnetViewer.hh rename to KEMField/Source/Plugins/VTK/include/KEMVTKElectromagnetViewer.hh diff --git a/KEMField/Source/2.0/Plugins/VTK/include/KEMVTKFieldCanvas.hh b/KEMField/Source/Plugins/VTK/include/KEMVTKFieldCanvas.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/VTK/include/KEMVTKFieldCanvas.hh rename to KEMField/Source/Plugins/VTK/include/KEMVTKFieldCanvas.hh diff --git a/KEMField/Source/2.0/Plugins/VTK/include/KEMVTKViewer.hh b/KEMField/Source/Plugins/VTK/include/KEMVTKViewer.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/VTK/include/KEMVTKViewer.hh rename to KEMField/Source/Plugins/VTK/include/KEMVTKViewer.hh diff --git a/KEMField/Source/2.0/Plugins/VTK/include/KFMVTKElectrostaticTreeViewer.hh b/KEMField/Source/Plugins/VTK/include/KFMVTKElectrostaticTreeViewer.hh similarity index 96% rename from KEMField/Source/2.0/Plugins/VTK/include/KFMVTKElectrostaticTreeViewer.hh rename to KEMField/Source/Plugins/VTK/include/KFMVTKElectrostaticTreeViewer.hh index e60332d01..c697e6d47 100644 --- a/KEMField/Source/2.0/Plugins/VTK/include/KFMVTKElectrostaticTreeViewer.hh +++ b/KEMField/Source/Plugins/VTK/include/KFMVTKElectrostaticTreeViewer.hh @@ -68,6 +68,9 @@ namespace KEMField void ApplyAction(KFMElectrostaticNode* node); void GenerateGeometryFile(std::string fileName = "FastMultipoleTreeData.vtp"); + void GenerateGridFile(std::string fileName = "FastMultipoleTreeData.vtu"); + + void ViewGeometry(); private: diff --git a/KEMField/Source/2.0/Plugins/VTK/include/KVTKIterationPlotter.hh b/KEMField/Source/Plugins/VTK/include/KVTKIterationPlotter.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/VTK/include/KVTKIterationPlotter.hh rename to KEMField/Source/Plugins/VTK/include/KVTKIterationPlotter.hh diff --git a/KEMField/Source/2.0/Plugins/VTK/include/KVTKResidualGraph.hh b/KEMField/Source/Plugins/VTK/include/KVTKResidualGraph.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/VTK/include/KVTKResidualGraph.hh rename to KEMField/Source/Plugins/VTK/include/KVTKResidualGraph.hh diff --git a/KEMField/Source/2.0/Plugins/VTK/src/KEMVTKElectromagnetViewer.cc b/KEMField/Source/Plugins/VTK/src/KEMVTKElectromagnetViewer.cc similarity index 100% rename from KEMField/Source/2.0/Plugins/VTK/src/KEMVTKElectromagnetViewer.cc rename to KEMField/Source/Plugins/VTK/src/KEMVTKElectromagnetViewer.cc diff --git a/KEMField/Source/2.0/Plugins/VTK/src/KEMVTKFieldCanvas.cc b/KEMField/Source/Plugins/VTK/src/KEMVTKFieldCanvas.cc similarity index 100% rename from KEMField/Source/2.0/Plugins/VTK/src/KEMVTKFieldCanvas.cc rename to KEMField/Source/Plugins/VTK/src/KEMVTKFieldCanvas.cc diff --git a/KEMField/Source/2.0/Plugins/VTK/src/KEMVTKViewer.cc b/KEMField/Source/Plugins/VTK/src/KEMVTKViewer.cc similarity index 97% rename from KEMField/Source/2.0/Plugins/VTK/src/KEMVTKViewer.cc rename to KEMField/Source/Plugins/VTK/src/KEMVTKViewer.cc index 9548d8b0a..e4898d237 100644 --- a/KEMField/Source/2.0/Plugins/VTK/src/KEMVTKViewer.cc +++ b/KEMField/Source/Plugins/VTK/src/KEMVTKViewer.cc @@ -40,11 +40,10 @@ namespace KEMField fLineSegmentPolyApprox = 3; fArcPolyApprox = 128; - for (KSurfaceContainer::iterator it=aSurfaceContainer.begin(); - it!=aSurfaceContainer.end();it++) + for (KSurfaceContainer::iterator it=aSurfaceContainer.begin(); it!=aSurfaceContainer.end();it++) { - SetSurfacePrimitive(*it); - ActOnSurfaceType((*it)->GetID(),*this); + SetSurfacePrimitive(*it); + ActOnSurfaceType((*it)->GetID(),*this); } } diff --git a/KEMField/Source/2.0/Plugins/VTK/src/KFMVTKElectrostaticTreeViewer.cc b/KEMField/Source/Plugins/VTK/src/KFMVTKElectrostaticTreeViewer.cc similarity index 79% rename from KEMField/Source/2.0/Plugins/VTK/src/KFMVTKElectrostaticTreeViewer.cc rename to KEMField/Source/Plugins/VTK/src/KFMVTKElectrostaticTreeViewer.cc index eeea7c267..c41fc7bb5 100644 --- a/KEMField/Source/2.0/Plugins/VTK/src/KFMVTKElectrostaticTreeViewer.cc +++ b/KEMField/Source/Plugins/VTK/src/KFMVTKElectrostaticTreeViewer.cc @@ -41,6 +41,14 @@ namespace KEMField //Add the points and hexahedron to an unstructured grid fGrid = vtkSmartPointer::New(); + fGrid->GetCellData()->AddArray(fTreeLevel); + fGrid->GetCellData()->AddArray(fOwnedElements); + fGrid->GetCellData()->AddArray(fDirectCalls); + fGrid->GetCellData()->AddArray(fZeroOrderMultipole); + fGrid->GetCellData()->AddArray(fZeroOrderLocalCoeff); + fGrid->GetCellData()->AddArray(fPotential); + fGrid->GetCellData()->AddArray(fElectricFieldMagnitude); + fGrid->GetCellData()->AddArray(fElectricField); //TODO uncomment and implement below // //average size of owned elements @@ -223,30 +231,76 @@ namespace KEMField #endif writer->SetFileName(fileName.c_str()); writer->Write(); + } - - std::string ugname = "FastMultipoleTreeData.vtu"; - - fGrid->GetCellData()->AddArray(fTreeLevel); - fGrid->GetCellData()->AddArray(fOwnedElements); - fGrid->GetCellData()->AddArray(fDirectCalls); - fGrid->GetCellData()->AddArray(fZeroOrderMultipole); - fGrid->GetCellData()->AddArray(fZeroOrderLocalCoeff); - fGrid->GetCellData()->AddArray(fPotential); - fGrid->GetCellData()->AddArray(fElectricFieldMagnitude); - fGrid->GetCellData()->AddArray(fElectricField); - - + void KFMVTKElectrostaticTreeViewer::GenerateGridFile(std::string fileName) + { // Write file - vtkSmartPointer ugwriter = + vtkSmartPointer writer = vtkSmartPointer::New(); - ugwriter->SetFileName(ugname.c_str()); #if VTK_MAJOR_VERSION <= 5 - ugwriter->SetInput(fGrid); + writer->SetInput(fGrid); #else - ugwriter->SetInputData(fGrid); + writer->SetInputData(fGrid); #endif - ugwriter->Write(); + writer->SetFileName(fileName.c_str()); + writer->Write(); + } + + void KFMVTKElectrostaticTreeViewer::ViewGeometry() + { + vtkSmartPointer polydata = vtkSmartPointer::New(); + polydata->SetPoints(fPoints); + polydata->SetPolys(fCells); + polydata->GetCellData()->AddArray(fTreeLevel); + polydata->GetCellData()->AddArray(fOwnedElements); + polydata->GetCellData()->AddArray(fDirectCalls); + polydata->GetCellData()->AddArray(fZeroOrderMultipole); + polydata->GetCellData()->AddArray(fZeroOrderLocalCoeff); + polydata->GetCellData()->AddArray(fPotential); + polydata->GetCellData()->AddArray(fElectricFieldMagnitude); + polydata->GetCellData()->AddArray(fElectricField); + + vtkSmartPointer trifilter = + vtkSmartPointer::New(); +#ifdef VTK6 + trifilter->SetInputData(polydata); +#else + trifilter->SetInput(polydata); +#endif + + vtkSmartPointer stripper = + vtkSmartPointer::New(); + stripper->SetInputConnection(trifilter->GetOutputPort()); + + // Create an actor and mapper + vtkSmartPointer mapper = + vtkSmartPointer::New(); +#ifdef VTK6 + mapper->SetInputConnection(stripper->GetOutputPort()); +#else + mapper->SetInput(stripper->GetOutput()); +#endif + + vtkSmartPointer actor = + vtkSmartPointer::New(); + actor->SetMapper(mapper); + actor->GetProperty()->SetRepresentationToWireframe(); + + // Create a renderer, render window, and interactor + vtkSmartPointer renderer = + vtkSmartPointer::New(); + vtkSmartPointer renderWindow = + vtkSmartPointer::New(); + renderWindow->SetSize(750,750); + renderWindow->AddRenderer(renderer); + vtkSmartPointer renderWindowInteractor = + vtkSmartPointer::New(); + renderWindowInteractor->SetRenderWindow(renderWindow); + + renderer->AddActor(actor); + renderWindow->Render(); + renderWindowInteractor->Start(); } } diff --git a/KEMField/Source/2.0/Plugins/VTKPart2/CMakeLists.txt b/KEMField/Source/Plugins/VTKPart2/CMakeLists.txt similarity index 89% rename from KEMField/Source/2.0/Plugins/VTKPart2/CMakeLists.txt rename to KEMField/Source/Plugins/VTKPart2/CMakeLists.txt index 2ffcd4a68..93bba7983 100644 --- a/KEMField/Source/2.0/Plugins/VTKPart2/CMakeLists.txt +++ b/KEMField/Source/Plugins/VTKPart2/CMakeLists.txt @@ -16,8 +16,8 @@ set( VTK-PART2_HEADERFILES if( @PROJECT_NAME@_USE_VTK AND @PROJECT_NAME@_USE_KGEOBAG) list( APPEND VTK-PART2_HEADERFILES - ${CMAKE_CURRENT_SOURCE_DIR}/include/KElectrostaticPotentialMap.hh - ${CMAKE_CURRENT_SOURCE_DIR}/include/KMagnetostaticFieldMap.hh + ${CMAKE_CURRENT_SOURCE_DIR}/include/KElectrostaticPotentialmap.hh + ${CMAKE_CURRENT_SOURCE_DIR}/include/KMagnetostaticFieldmap.hh ) endif( @PROJECT_NAME@_USE_VTK AND @PROJECT_NAME@_USE_KGEOBAG) @@ -29,8 +29,8 @@ set( VTK-PART2_SOURCEFILES if( @PROJECT_NAME@_USE_VTK AND @PROJECT_NAME@_USE_KGEOBAG) list( APPEND VTK-PART2_SOURCEFILES - ${CMAKE_CURRENT_SOURCE_DIR}/src/KElectrostaticPotentialMap.cc - ${CMAKE_CURRENT_SOURCE_DIR}/src/KMagnetostaticFieldMap.cc + ${CMAKE_CURRENT_SOURCE_DIR}/src/KElectrostaticPotentialmap.cc + ${CMAKE_CURRENT_SOURCE_DIR}/src/KMagnetostaticFieldmap.cc ) endif( @PROJECT_NAME@_USE_VTK AND @PROJECT_NAME@_USE_KGEOBAG) diff --git a/KEMField/Source/2.0/Plugins/VTKPart2/include/KElectrostaticPotentialMap.hh b/KEMField/Source/Plugins/VTKPart2/include/KElectrostaticPotentialmap.hh similarity index 99% rename from KEMField/Source/2.0/Plugins/VTKPart2/include/KElectrostaticPotentialMap.hh rename to KEMField/Source/Plugins/VTKPart2/include/KElectrostaticPotentialmap.hh index 445d37a6a..736934d1a 100644 --- a/KEMField/Source/2.0/Plugins/VTKPart2/include/KElectrostaticPotentialMap.hh +++ b/KEMField/Source/Plugins/VTKPart2/include/KElectrostaticPotentialmap.hh @@ -1,5 +1,5 @@ /* - * KElectrostaticPotentialMap.hh + * KElectrostaticPotentialmap.hh * * Last edited on: 26 Apr 2016 by Wolfgang Gosda * Author: Jan Behrens diff --git a/KEMField/Source/2.0/Plugins/VTKPart2/include/KMagnetostaticFieldMap.hh b/KEMField/Source/Plugins/VTKPart2/include/KMagnetostaticFieldmap.hh similarity index 99% rename from KEMField/Source/2.0/Plugins/VTKPart2/include/KMagnetostaticFieldMap.hh rename to KEMField/Source/Plugins/VTKPart2/include/KMagnetostaticFieldmap.hh index b57dc9c43..ed3c776ce 100644 --- a/KEMField/Source/2.0/Plugins/VTKPart2/include/KMagnetostaticFieldMap.hh +++ b/KEMField/Source/Plugins/VTKPart2/include/KMagnetostaticFieldmap.hh @@ -1,5 +1,5 @@ /* - * KMagnetostaticFieldMap.hh + * KMagnetostaticFieldmap.hh * * Last edited on: 26 Apr 2016 by Wolfgang Gosda * Author: Jan Behrens diff --git a/KEMField/Source/2.0/Plugins/VTKPart2/include/KVTKViewerAsBoundaryFieldVisitor.hh b/KEMField/Source/Plugins/VTKPart2/include/KVTKViewerAsBoundaryFieldVisitor.hh similarity index 100% rename from KEMField/Source/2.0/Plugins/VTKPart2/include/KVTKViewerAsBoundaryFieldVisitor.hh rename to KEMField/Source/Plugins/VTKPart2/include/KVTKViewerAsBoundaryFieldVisitor.hh diff --git a/KEMField/Source/2.0/Plugins/VTKPart2/src/KElectrostaticPotentialMap.cc b/KEMField/Source/Plugins/VTKPart2/src/KElectrostaticPotentialmap.cc similarity index 98% rename from KEMField/Source/2.0/Plugins/VTKPart2/src/KElectrostaticPotentialMap.cc rename to KEMField/Source/Plugins/VTKPart2/src/KElectrostaticPotentialmap.cc index 023ec01fa..698674855 100644 --- a/KEMField/Source/2.0/Plugins/VTKPart2/src/KElectrostaticPotentialMap.cc +++ b/KEMField/Source/Plugins/VTKPart2/src/KElectrostaticPotentialmap.cc @@ -1,11 +1,11 @@ /* - * KElectrostaticPotentialMap.cc + * KElectrostaticPotentialmap.cc * * Created on: 26 Apr 2016 * Author: wolfgang */ -#include "KElectrostaticPotentialMap.hh" +#include "KElectrostaticPotentialmap.hh" #include "KFile.h" #include "KEMFileInterface.hh" @@ -424,7 +424,7 @@ void KElectrostaticPotentialmapCalculator::Prepare() { if (! fElectricField) { - throw KEMSimpleException("KElectrostaticPotentialMap: no electric field has been defined."); + throw KEMSimpleException("KElectrostaticPotentialmap: no electric field has been defined."); return; } @@ -454,7 +454,7 @@ void KElectrostaticPotentialmapCalculator::Prepare() KEMThreeVector tGridDims = KEMThreeVector( 1 + fLength[0]/fSpacing, 1 + fLength[1]/fSpacing, 1 + fLength[2]/fSpacing ); KEMThreeVector tGridOrigin = fCenter - 0.5*fLength; - if ((floor(tGridDims[0]) <= 0) || (floor(tGridDims[1]) <= 0) || (floor(tGridDims[2]) <= 0)) + if ((ceil(tGridDims[0]) <= 0) || (ceil(tGridDims[1]) <= 0) || (ceil(tGridDims[2]) <= 0)) { throw KEMSimpleException( "KElectrostaticPotentialmapCalculator: invalid grid dimensions: " + std::to_string(tGridDims.X()) + " m, " @@ -464,7 +464,7 @@ void KElectrostaticPotentialmapCalculator::Prepare() } fGrid = vtkSmartPointer::New(); - fGrid->SetDimensions( (int)floor(tGridDims[0]), (int)floor(tGridDims[1]), (int)floor(tGridDims[2]) ); + fGrid->SetDimensions( (int)ceil(tGridDims[0]), (int)ceil(tGridDims[1]), (int)ceil(tGridDims[2]) ); fGrid->SetOrigin( tGridOrigin[0], tGridOrigin[1], tGridOrigin[2] ); fGrid->SetSpacing( fSpacing, fSpacing, fSpacing ); diff --git a/KEMField/Source/2.0/Plugins/VTKPart2/src/KMagnetostaticFieldMap.cc b/KEMField/Source/Plugins/VTKPart2/src/KMagnetostaticFieldmap.cc similarity index 98% rename from KEMField/Source/2.0/Plugins/VTKPart2/src/KMagnetostaticFieldMap.cc rename to KEMField/Source/Plugins/VTKPart2/src/KMagnetostaticFieldmap.cc index 5e53195c8..a351af45a 100644 --- a/KEMField/Source/2.0/Plugins/VTKPart2/src/KMagnetostaticFieldMap.cc +++ b/KEMField/Source/Plugins/VTKPart2/src/KMagnetostaticFieldmap.cc @@ -1,11 +1,11 @@ /* - * KMagnetostaticFieldMap.cc + * KMagnetostaticFieldmap.cc * * Created on: 26 Apr 2016 * Author: wolfgang */ -#include "KMagnetostaticFieldMap.hh" +#include "KMagnetostaticFieldmap.hh" #include "KFile.h" #include "KEMFileInterface.hh" @@ -444,7 +444,7 @@ void KMagnetostaticFieldmapCalculator::Prepare() KEMThreeVector tGridDims = KEMThreeVector( 1 + fLength[0]/fSpacing, 1 + fLength[1]/fSpacing, 1 + fLength[2]/fSpacing ); KEMThreeVector tGridOrigin = fCenter - 0.5*fLength; - if ((floor(tGridDims[0]) <= 0) || (floor(tGridDims[1]) <= 0) || (floor(tGridDims[2]) <= 0)) + if ((ceil(tGridDims[0]) <= 0) || (ceil(tGridDims[1]) <= 0) || (ceil(tGridDims[2]) <= 0)) { throw KEMSimpleException( "KMagnetostaticFieldmapCalculator: invalid grid dimensions: " + std::to_string(tGridDims.X()) + " m, " @@ -454,7 +454,7 @@ void KMagnetostaticFieldmapCalculator::Prepare() } fGrid = vtkSmartPointer::New(); - fGrid->SetDimensions( (int)floor(tGridDims[0]), (int)floor(tGridDims[1]), (int)floor(tGridDims[2]) ); + fGrid->SetDimensions( (int)ceil(tGridDims[0]), (int)ceil(tGridDims[1]), (int)ceil(tGridDims[2]) ); fGrid->SetOrigin( tGridOrigin[0], tGridOrigin[1], tGridOrigin[2] ); fGrid->SetSpacing( fSpacing, fSpacing, fSpacing ); diff --git a/KEMField/Source/2.0/Plugins/VTKPart2/src/KVTKViewerAsBoundaryFieldVisitor.cc b/KEMField/Source/Plugins/VTKPart2/src/KVTKViewerAsBoundaryFieldVisitor.cc similarity index 100% rename from KEMField/Source/2.0/Plugins/VTKPart2/src/KVTKViewerAsBoundaryFieldVisitor.cc rename to KEMField/Source/Plugins/VTKPart2/src/KVTKViewerAsBoundaryFieldVisitor.cc diff --git a/KEMField/Source/2.0/Surfaces/CMakeLists.txt b/KEMField/Source/Surfaces/CMakeLists.txt similarity index 100% rename from KEMField/Source/2.0/Surfaces/CMakeLists.txt rename to KEMField/Source/Surfaces/CMakeLists.txt diff --git a/KEMField/Source/2.0/Surfaces/include/KBasis.hh b/KEMField/Source/Surfaces/include/KBasis.hh similarity index 100% rename from KEMField/Source/2.0/Surfaces/include/KBasis.hh rename to KEMField/Source/Surfaces/include/KBasis.hh diff --git a/KEMField/Source/2.0/Surfaces/include/KBoundary.hh b/KEMField/Source/Surfaces/include/KBoundary.hh similarity index 100% rename from KEMField/Source/2.0/Surfaces/include/KBoundary.hh rename to KEMField/Source/Surfaces/include/KBoundary.hh diff --git a/KEMField/Source/2.0/Surfaces/include/KConicSection.hh b/KEMField/Source/Surfaces/include/KConicSection.hh similarity index 100% rename from KEMField/Source/2.0/Surfaces/include/KConicSection.hh rename to KEMField/Source/Surfaces/include/KConicSection.hh diff --git a/KEMField/Source/2.0/Surfaces/include/KElectromagneticBasis.hh b/KEMField/Source/Surfaces/include/KElectromagneticBasis.hh similarity index 100% rename from KEMField/Source/2.0/Surfaces/include/KElectromagneticBasis.hh rename to KEMField/Source/Surfaces/include/KElectromagneticBasis.hh diff --git a/KEMField/Source/2.0/Surfaces/include/KElectrostaticBasis.hh b/KEMField/Source/Surfaces/include/KElectrostaticBasis.hh similarity index 100% rename from KEMField/Source/2.0/Surfaces/include/KElectrostaticBasis.hh rename to KEMField/Source/Surfaces/include/KElectrostaticBasis.hh diff --git a/KEMField/Source/2.0/Surfaces/include/KLineSegment.hh b/KEMField/Source/Surfaces/include/KLineSegment.hh similarity index 100% rename from KEMField/Source/2.0/Surfaces/include/KLineSegment.hh rename to KEMField/Source/Surfaces/include/KLineSegment.hh diff --git a/KEMField/Source/2.0/Surfaces/include/KMagnetostaticBasis.hh b/KEMField/Source/Surfaces/include/KMagnetostaticBasis.hh similarity index 100% rename from KEMField/Source/2.0/Surfaces/include/KMagnetostaticBasis.hh rename to KEMField/Source/Surfaces/include/KMagnetostaticBasis.hh diff --git a/KEMField/Source/2.0/Surfaces/include/KOrderedSurfaceContainer.hh b/KEMField/Source/Surfaces/include/KOrderedSurfaceContainer.hh similarity index 100% rename from KEMField/Source/2.0/Surfaces/include/KOrderedSurfaceContainer.hh rename to KEMField/Source/Surfaces/include/KOrderedSurfaceContainer.hh diff --git a/KEMField/Source/2.0/Surfaces/include/KRectangle.hh b/KEMField/Source/Surfaces/include/KRectangle.hh similarity index 100% rename from KEMField/Source/2.0/Surfaces/include/KRectangle.hh rename to KEMField/Source/Surfaces/include/KRectangle.hh diff --git a/KEMField/Source/2.0/Surfaces/include/KRing.hh b/KEMField/Source/Surfaces/include/KRing.hh similarity index 100% rename from KEMField/Source/2.0/Surfaces/include/KRing.hh rename to KEMField/Source/Surfaces/include/KRing.hh diff --git a/KEMField/Source/2.0/Surfaces/include/KShape.hh b/KEMField/Source/Surfaces/include/KShape.hh similarity index 100% rename from KEMField/Source/2.0/Surfaces/include/KShape.hh rename to KEMField/Source/Surfaces/include/KShape.hh diff --git a/KEMField/Source/2.0/Surfaces/include/KSolidAngle.hh b/KEMField/Source/Surfaces/include/KSolidAngle.hh similarity index 100% rename from KEMField/Source/2.0/Surfaces/include/KSolidAngle.hh rename to KEMField/Source/Surfaces/include/KSolidAngle.hh diff --git a/KEMField/Source/2.0/Surfaces/include/KSortedSurfaceContainer.hh b/KEMField/Source/Surfaces/include/KSortedSurfaceContainer.hh similarity index 100% rename from KEMField/Source/2.0/Surfaces/include/KSortedSurfaceContainer.hh rename to KEMField/Source/Surfaces/include/KSortedSurfaceContainer.hh diff --git a/KEMField/Source/2.0/Surfaces/include/KSurface.hh b/KEMField/Source/Surfaces/include/KSurface.hh similarity index 100% rename from KEMField/Source/2.0/Surfaces/include/KSurface.hh rename to KEMField/Source/Surfaces/include/KSurface.hh diff --git a/KEMField/Source/2.0/Surfaces/include/KSurfaceAction.hh b/KEMField/Source/Surfaces/include/KSurfaceAction.hh similarity index 100% rename from KEMField/Source/2.0/Surfaces/include/KSurfaceAction.hh rename to KEMField/Source/Surfaces/include/KSurfaceAction.hh diff --git a/KEMField/Source/2.0/Surfaces/include/KSurfaceContainer.hh b/KEMField/Source/Surfaces/include/KSurfaceContainer.hh similarity index 100% rename from KEMField/Source/2.0/Surfaces/include/KSurfaceContainer.hh rename to KEMField/Source/Surfaces/include/KSurfaceContainer.hh diff --git a/KEMField/Source/2.0/Surfaces/include/KSurfaceID.hh b/KEMField/Source/Surfaces/include/KSurfaceID.hh similarity index 100% rename from KEMField/Source/2.0/Surfaces/include/KSurfaceID.hh rename to KEMField/Source/Surfaces/include/KSurfaceID.hh diff --git a/KEMField/Source/2.0/Surfaces/include/KSurfaceOrderingPredicate.hh b/KEMField/Source/Surfaces/include/KSurfaceOrderingPredicate.hh similarity index 100% rename from KEMField/Source/2.0/Surfaces/include/KSurfaceOrderingPredicate.hh rename to KEMField/Source/Surfaces/include/KSurfaceOrderingPredicate.hh diff --git a/KEMField/Source/2.0/Surfaces/include/KSurfacePrimitive.hh b/KEMField/Source/Surfaces/include/KSurfacePrimitive.hh similarity index 100% rename from KEMField/Source/2.0/Surfaces/include/KSurfacePrimitive.hh rename to KEMField/Source/Surfaces/include/KSurfacePrimitive.hh diff --git a/KEMField/Source/2.0/Surfaces/include/KSurfaceTypes.hh b/KEMField/Source/Surfaces/include/KSurfaceTypes.hh similarity index 100% rename from KEMField/Source/2.0/Surfaces/include/KSurfaceTypes.hh rename to KEMField/Source/Surfaces/include/KSurfaceTypes.hh diff --git a/KEMField/Source/2.0/Surfaces/include/KSurfaceVisitors.hh b/KEMField/Source/Surfaces/include/KSurfaceVisitors.hh similarity index 100% rename from KEMField/Source/2.0/Surfaces/include/KSurfaceVisitors.hh rename to KEMField/Source/Surfaces/include/KSurfaceVisitors.hh diff --git a/KEMField/Source/2.0/Surfaces/include/KSymmetryGroup.hh b/KEMField/Source/Surfaces/include/KSymmetryGroup.hh similarity index 100% rename from KEMField/Source/2.0/Surfaces/include/KSymmetryGroup.hh rename to KEMField/Source/Surfaces/include/KSymmetryGroup.hh diff --git a/KEMField/Source/2.0/Surfaces/include/KTriangle.hh b/KEMField/Source/Surfaces/include/KTriangle.hh similarity index 100% rename from KEMField/Source/2.0/Surfaces/include/KTriangle.hh rename to KEMField/Source/Surfaces/include/KTriangle.hh diff --git a/KEMField/Source/2.0/Surfaces/src/KConicSection.cc b/KEMField/Source/Surfaces/src/KConicSection.cc similarity index 100% rename from KEMField/Source/2.0/Surfaces/src/KConicSection.cc rename to KEMField/Source/Surfaces/src/KConicSection.cc diff --git a/KEMField/Source/2.0/Surfaces/src/KLineSegment.cc b/KEMField/Source/Surfaces/src/KLineSegment.cc similarity index 100% rename from KEMField/Source/2.0/Surfaces/src/KLineSegment.cc rename to KEMField/Source/Surfaces/src/KLineSegment.cc diff --git a/KEMField/Source/2.0/Surfaces/src/KOrderedSurfaceContainer.cc b/KEMField/Source/Surfaces/src/KOrderedSurfaceContainer.cc similarity index 100% rename from KEMField/Source/2.0/Surfaces/src/KOrderedSurfaceContainer.cc rename to KEMField/Source/Surfaces/src/KOrderedSurfaceContainer.cc diff --git a/KEMField/Source/2.0/Surfaces/src/KRectangle.cc b/KEMField/Source/Surfaces/src/KRectangle.cc similarity index 100% rename from KEMField/Source/2.0/Surfaces/src/KRectangle.cc rename to KEMField/Source/Surfaces/src/KRectangle.cc diff --git a/KEMField/Source/2.0/Surfaces/src/KRing.cc b/KEMField/Source/Surfaces/src/KRing.cc similarity index 100% rename from KEMField/Source/2.0/Surfaces/src/KRing.cc rename to KEMField/Source/Surfaces/src/KRing.cc diff --git a/KEMField/Source/2.0/Surfaces/src/KSolidAngle.cc b/KEMField/Source/Surfaces/src/KSolidAngle.cc similarity index 100% rename from KEMField/Source/2.0/Surfaces/src/KSolidAngle.cc rename to KEMField/Source/Surfaces/src/KSolidAngle.cc diff --git a/KEMField/Source/2.0/Surfaces/src/KSortedSurfaceContainer.cc b/KEMField/Source/Surfaces/src/KSortedSurfaceContainer.cc similarity index 100% rename from KEMField/Source/2.0/Surfaces/src/KSortedSurfaceContainer.cc rename to KEMField/Source/Surfaces/src/KSortedSurfaceContainer.cc diff --git a/KEMField/Source/2.0/Surfaces/src/KSurface.cc b/KEMField/Source/Surfaces/src/KSurface.cc similarity index 100% rename from KEMField/Source/2.0/Surfaces/src/KSurface.cc rename to KEMField/Source/Surfaces/src/KSurface.cc diff --git a/KEMField/Source/2.0/Surfaces/src/KSurfaceContainer.cc b/KEMField/Source/Surfaces/src/KSurfaceContainer.cc similarity index 100% rename from KEMField/Source/2.0/Surfaces/src/KSurfaceContainer.cc rename to KEMField/Source/Surfaces/src/KSurfaceContainer.cc diff --git a/KEMField/Source/2.0/Surfaces/src/KTriangle.cc b/KEMField/Source/Surfaces/src/KTriangle.cc similarity index 100% rename from KEMField/Source/2.0/Surfaces/src/KTriangle.cc rename to KEMField/Source/Surfaces/src/KTriangle.cc diff --git a/KEMField/Source/2.0/Tests/CMakeLists.txt b/KEMField/Source/Tests/CMakeLists.txt similarity index 94% rename from KEMField/Source/2.0/Tests/CMakeLists.txt rename to KEMField/Source/Tests/CMakeLists.txt index 5824c8508..c01e22cd9 100644 --- a/KEMField/Source/2.0/Tests/CMakeLists.txt +++ b/KEMField/Source/Tests/CMakeLists.txt @@ -12,6 +12,8 @@ if (@PROJECT_NAME@_ENABLE_TEST) set (TESTS_HEADERS include/KElectrostaticBoundaryIntegratorOptions.hh + include/TestCubatureTriangleIntegrator.hh + include/TestRWGTriangleIntegrator.hh ) kasper_internal_include_directories( include ) @@ -188,6 +190,10 @@ if (@PROJECT_NAME@_ENABLE_TEST) if (@PROJECT_NAME@_USE_ROOT) + add_executable (TestDielectrics + ${CMAKE_CURRENT_SOURCE_DIR}/TestDielectrics.cc) + target_link_libraries (TestDielectrics ${TESTS_LIBS} ) + add_executable (TestIntegratorDistRatioLineSegmentROOT ${CMAKE_CURRENT_SOURCE_DIR}/TestIntegratorDistRatioLineSegmentROOT.cc) target_link_libraries (TestIntegratorDistRatioLineSegmentROOT ${TESTS_LIBS} ) @@ -199,11 +205,17 @@ if (@PROJECT_NAME@_ENABLE_TEST) add_executable (TestIntegratorDistRatioTriangleROOT ${CMAKE_CURRENT_SOURCE_DIR}/TestIntegratorDistRatioTriangleROOT.cc) target_link_libraries (TestIntegratorDistRatioTriangleROOT ${TESTS_LIBS} ) + + add_executable (TestVectorTypes + ${CMAKE_CURRENT_SOURCE_DIR}/TestVectorTypes.cc) + target_link_libraries (TestVectorTypes ${TESTS_LIBS} ) kasper_install_executables ( + TestDielectrics TestIntegratorDistRatioLineSegmentROOT TestIntegratorDistRatioRectangleROOT TestIntegratorDistRatioTriangleROOT + TestVectorTypes ) endif (@PROJECT_NAME@_USE_ROOT) @@ -228,17 +240,17 @@ if (@PROJECT_NAME@_ENABLE_TEST) ### OpenCL + MPI ### #################### - if (@PROJECT_NAME@_USE_OPENCL AND @PROJECT_NAME@_USE_MPI) - - add_executable (TestOpenCL - ${CMAKE_CURRENT_SOURCE_DIR}/TestOpenCL.cc) - target_link_libraries (TestOpenCL ${OPENCL_LIBRARIES} ) +# if (@PROJECT_NAME@_USE_OPENCL AND @PROJECT_NAME@_USE_MPI) +# +# add_executable (TestOpenCL +# ${CMAKE_CURRENT_SOURCE_DIR}/TestOpenCL.cc) +# target_link_libraries (TestOpenCL ${OPENCL_LIBRARIES} ) - kasper_install_executables ( - TestOpenCL - ) +# kasper_install_executables ( +# TestOpenCL +# ) - endif (@PROJECT_NAME@_USE_OPENCL AND @PROJECT_NAME@_USE_MPI) +# endif (@PROJECT_NAME@_USE_OPENCL AND @PROJECT_NAME@_USE_MPI) ############## ### OpenCL ### @@ -307,10 +319,6 @@ if (@PROJECT_NAME@_ENABLE_TEST) # add_executable (TestSphericalImageCharge # ${CMAKE_CURRENT_SOURCE_DIR}/TestSphericalImageCharge.cc) # target_link_libraries (TestSphericalImageCharge ${TESTS_LIBS} ${Kommon_LIBRARIES}) - - add_executable (TestVectorTypes - ${CMAKE_CURRENT_SOURCE_DIR}/TestVectorTypes.cc) - target_link_libraries (TestVectorTypes ${TESTS_LIBS} ) kasper_install_executables ( TestCubeCapacitance @@ -318,7 +326,6 @@ if (@PROJECT_NAME@_ENABLE_TEST) TestSuperposition TestSymmetryGroups # TestSphericalImageCharge - TestVectorTypes ) endif (@PROJECT_NAME@_USE_KGEOBAG) diff --git a/KEMField/Source/2.0/Tests/TestAnisotropicPoisson.cc b/KEMField/Source/Tests/TestAnisotropicPoisson.cc similarity index 100% rename from KEMField/Source/2.0/Tests/TestAnisotropicPoisson.cc rename to KEMField/Source/Tests/TestAnisotropicPoisson.cc diff --git a/KEMField/Source/2.0/Tests/TestBinaryTruncation.cc b/KEMField/Source/Tests/TestBinaryTruncation.cc similarity index 100% rename from KEMField/Source/2.0/Tests/TestBinaryTruncation.cc rename to KEMField/Source/Tests/TestBinaryTruncation.cc diff --git a/KEMField/Source/2.0/Tests/TestCubatureSpeedStandAlone.cc b/KEMField/Source/Tests/TestCubatureSpeedStandAlone.cc similarity index 98% rename from KEMField/Source/2.0/Tests/TestCubatureSpeedStandAlone.cc rename to KEMField/Source/Tests/TestCubatureSpeedStandAlone.cc index acd02be1e..ad782dcef 100644 --- a/KEMField/Source/2.0/Tests/TestCubatureSpeedStandAlone.cc +++ b/KEMField/Source/Tests/TestCubatureSpeedStandAlone.cc @@ -8,8 +8,8 @@ // constants needed for stand-alone integrator functions below #define M_ONEOVER_4PI_EPS0 8987551787.9979107161559640186992 -#include "TestRWGTriangleIntegrator.hh" -#include "TestCubatureTriangleIntegrator.hh" +#include "include/TestRWGTriangleIntegrator.hh" +#include "include/TestCubatureTriangleIntegrator.hh" // number of triangles #define NUMTRI 1500000 diff --git a/KEMField/Source/2.0/Tests/TestCubeCapacitance.cc b/KEMField/Source/Tests/TestCubeCapacitance.cc similarity index 99% rename from KEMField/Source/2.0/Tests/TestCubeCapacitance.cc rename to KEMField/Source/Tests/TestCubeCapacitance.cc index 85b934d2e..13918a72b 100644 --- a/KEMField/Source/2.0/Tests/TestCubeCapacitance.cc +++ b/KEMField/Source/Tests/TestCubeCapacitance.cc @@ -40,9 +40,9 @@ #ifdef KEMFIELD_USE_MPI #include "KRobinHood_MPI.hh" -#define MPI_SINGLE_PROCESS if (KMPIInterface::GetInstance()->GetProcess()==0) +//#define MPI_SINGLE_PROCESS if (KMPIInterface::GetInstance()->GetProcess()==0) #else -#define MPI_SINGLE_PROCESS +//#define MPI_SINGLE_PROCESS #endif #ifdef KEMFIELD_USE_OPENCL diff --git a/KEMField/Source/Tests/TestDielectrics.cc b/KEMField/Source/Tests/TestDielectrics.cc new file mode 100644 index 000000000..d7effe579 --- /dev/null +++ b/KEMField/Source/Tests/TestDielectrics.cc @@ -0,0 +1,1353 @@ +// TestDielectrics.cc (adapted from KEMField 1.0) +// Daniel Hilk, 22.10.2017 + +// Geometric model: +// * Box filled with liquid and gaseous Xenon, eps_r(LXe) = 2, e_r(GXe) = 1. +// * Two electrodes (either plates or parallel wires). +// +// Output: +// * ROOT TFile containing four TGraphs (potential, electric field components E_z and E_r, electric displacement D_z) +// * All values will be computed along z-axis at x=y=0. + +// c++ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// kemfield +#include "KTypelist.hh" +#include "KSurfaceTypes.hh" +#include "KSurfaceContainer.hh" +#include "KEMConstants.hh" +#include "KSADataStreamer.hh" +#include "KBinaryDataStreamer.hh" +#include "KEMFileInterface.hh" +#include "KDataDisplay.hh" +#include "KElectrostaticBoundaryIntegratorFactory.hh" +#include "KChargeDensitySolver.hh" +#include "KElectrostaticBoundaryIntegratorPolicy.hh" + + +// linear algebra +#include "KBoundaryIntegralMatrix.hh" +#include "KBoundaryIntegralVector.hh" +#include "KBoundaryIntegralSolutionVector.hh" +#include "KGaussianElimination.hh" +#include "KRobinHood.hh" +#include "KMultiElementRobinHood.hh" +#include "KIterativeStateWriter.hh" +#include "KIterationTracker.hh" +#ifdef KEMFIELD_USE_OPENCL +#include "KRobinHood_OpenCL.hh" +#include "KOpenCLElectrostaticBoundaryIntegrator.hh" +#include "KOpenCLBoundaryIntegralMatrix.hh" +#include "KOpenCLBoundaryIntegralVector.hh" +#include "KOpenCLBoundaryIntegralSolutionVector.hh" +using KEMField::KRobinHood_OpenCL; +#endif + + +// field solver +#include "KElectrostaticIntegratingFieldSolver.hh" +#ifdef KEMFIELD_USE_OPENCL +#include "KOpenCLElectrostaticIntegratingFieldSolver.hh" +#endif + +// root +#include "Rtypes.h" +#include "TSystem.h" +#include "TFile.h" +#include "TCanvas.h" +#include "TGraph.h" +#include "TAxis.h" +#include "TMath.h" +#include "TVector3.h" + + +using namespace KEMField; +using namespace std; + + +// typedefs for dirichlet and neumann elements +typedef KSurface KEMBoundary; +typedef KSurface KEMRectangle; +typedef KSurface KEMWire; + + + +#define MULTIRH + + + + +bool StrToBool( std::string s ) +{ + bool b; + std::stringstream ss(s); //turn the string into a stream + ss >> b; //convert + return b; +} + + +/** + * This function takes an interval of length and discretizes it + * into # of segments, with the size distribution determined by + * . The resulting intervals are recorded into the array + * . + * + * is the lenth of that is mirrored. If is odd, + * then the largest segment is in the middle of the original interval, and the + * remaining lenth of is mirrored. + */ +void DiscretizeInterval(double interval, int nSegments, double power, std::vector& segments) +{ + if (nSegments == 1) + segments[0] = interval; + else + { + double inc1,inc2; + double mid = interval*.5; + if (nSegments%2==1) + { + segments[nSegments/2] = interval/nSegments; + mid -= interval/(2*nSegments); + } + + for (Int_t i=0;iSetA( fA ); + rectangle->SetB( fB ); + rectangle->SetP0( fP0 ); + rectangle->SetN1(fN1 ); + rectangle->SetN2( fN2 ); + + rectangle->SetBoundaryValue( fU ); + + fContainer.push_back( rectangle ); + + fGroup++; + return; + } + + const double scale = 1.; + const double power = 2.; + + // rescale the discretization parameters by GetDiscScale() + fNumDiscA*=scale; + fNumDiscB*=scale; + + // vectors a,b contain the lengths of the rectangles + std::vector a(fNumDiscA); + std::vector b(fNumDiscB); + + DiscretizeInterval(fA,fNumDiscA,power,a); + DiscretizeInterval(fB,fNumDiscB,power,b); + + // dA and db are the offsets for each fP0[3] cornerpoint + double dA = 0; + double dB = 0; + + for( int i=0; iSetN1(fN1 ); + rectangle->SetN2( fN2 ); + rectangle->SetBoundaryValue( fU ); + + // set length A + rectangle->SetA( a[i] ); + // set P0 + KPosition p0New((fP0[0] + dA*fN1[0] + dB*fN2[0]), (fP0[1] + dA*fN1[1] + dB*fN2[1]), (fP0[2] + dA*fN1[2] + dB*fN2[2])); + rectangle->SetP0(p0New); + + //std::cout << "x: " << p0New[0] << " y: " << p0New[1] << " z: " << p0New[2] << std::endl; + + // set length B + rectangle->SetB(b[j]); + dB+=b[j]; + + // add r to the surface container + fContainer.push_back( rectangle ); + } /*B direction*/ + dA+=a[i]; + } /*A direction*/ + + //std::cout << fContainer.size() << std::endl; + + fGroup++; + return; +} + + +/** + * Adds the wire to the surface container and discretizes + * the wire into smaller wires, where the approximation of + * constant charge density is more reasonable. + */ +void AddWire(KSurfaceContainer &fContainer, int &fGroup, int &fChDen, + KPosition fPA, KPosition fPB, double fD /*diameter*/ , double fU /*potential*/, int fNRot, int fNumDisc) +{ + (void)fNRot; + fChDen += fNumDisc; + + // do not discretize if discretization parameter is set to 0 + if( fNumDisc==0 ) { + KEMWire* wire = new KEMWire(); + + wire->SetP0( fPA ); + wire->SetP1( fPB ); + wire->SetDiameter( fD ); + wire->SetBoundaryValue( fU ); + fContainer.push_back( wire ); + + fGroup++; + return; + } + + double A[3] = {0,0,0}; // new wire parameters + double B[3] = {0,0,0}; + + const double scale = 1.; + const double power = 2.; + + int nIncrements = scale*fNumDisc; + + std::vector > inc(3,std::vector(nIncrements,0)); + + do { + DiscretizeInterval((fPB[0]-fPA[0]),nIncrements,power,inc[0]); + DiscretizeInterval((fPB[1]-fPA[1]),nIncrements,power,inc[1]); + DiscretizeInterval((fPB[2]-fPA[2]),nIncrements,power,inc[2]); + nIncrements--; + } while (sqrt(inc[0][0]*inc[0][0] + + inc[1][0]*inc[1][0] + + inc[2][0]*inc[2][0])SetDiameter( fD ); + wire->SetBoundaryValue( fU ); + + // loop over components + for( int j=0; j<3; j++ ) { + A[j] = B[j]; + B[j] += inc[j][i]; + + fPA[j] = A[j]; + fPB[j] = B[j]; + } + wire->SetP0( fPA ); + wire->SetP1( fPB ); + fContainer.push_back( wire ); + } + + for(int i=0; i<3; i++) + A[i] = fPB[i]; + + // Change: Added "-1" to calculate with the right number of wires. + for( int i=nIncrements-1; i>=nIncrements/2; i-- ){ + KEMWire* wire = new KEMWire(); + wire->SetDiameter( fD ); + wire->SetBoundaryValue( fU ); + + // loop over components + for( int j=0; j<3; j++ ){ + B[j] = A[j]; + A[j]-= inc[j][i]; + + fPA[j] = A[j]; + fPB[j] = B[j]; + } + wire->SetP0( fPA ); + wire->SetP1( fPB ); + fContainer.push_back( wire ); + } + + fGroup++; + return; +} + + +void AddBoundary(KSurfaceContainer &fContainer, int &fGroup, int &fChDen, double fA, double fB, + KEMThreeVector fP0, KEMThreeVector fN1, KEMThreeVector fN2, double fEpsRAbove, double fEpsRBelow, + double fNRot, int fNumDiscA, int fNumDiscB) +{ + (void)fNRot; + fChDen += (fNumDiscA * fNumDiscB); + + // do not discretize if discretization parameters are set to 0 + if( fNumDiscA==0 || fNumDiscB==0 ) { + KEMBoundary* rectangle = new KEMBoundary(); + + rectangle->SetA( fA ); + rectangle->SetB( fB ); + rectangle->SetP0( fP0 ); + rectangle->SetN1( fN1 ); + rectangle->SetN2( fN2 ); + rectangle->SetN3(); + + // switch N1 and N2 if necessary + if( rectangle->GetN3().Z() < 0 ) { + rectangle->SetN1( fN2 ); + rectangle->SetN2( fN1 ); + rectangle->SetN3(); + } + + //rectangle->SetNormalBoundaryFlux( fEpsRBelow / fEpsRAbove ); // TODO: Check!!!! + rectangle->SetNormalBoundaryFlux(0, fEpsRAbove ); + rectangle->SetNormalBoundaryFlux(1, fEpsRBelow ); + + fContainer.push_back( rectangle ); + + fGroup++; + return; + } + + const double scale = 1.; + const double power = 2.; + + // rescale the discretization parameters by GetDiscScale() + fNumDiscA*=scale; + fNumDiscB*=scale; + + // vectors a,b contain the lengths of the rectangles + std::vector a(fNumDiscA); + std::vector b(fNumDiscB); + + DiscretizeInterval(fA,fNumDiscA,power,a); + DiscretizeInterval(fB,fNumDiscB,power,b); + + // dA and db are the offsets for each fP0[3] cornerpoint + double dA = 0; + double dB = 0; + + for( int i=0; iSetN1(fN1 ); + rectangle->SetN2( fN2 ); + rectangle->SetN3(); + // switch N1 and N2 if necessary + if( rectangle->GetN3().Z() < 0 ) { + std::cout << "The normal vectors N1 and N2 have been exchanged for positive N3.\n"; + rectangle->SetN1( fN2 ); + rectangle->SetN2( fN1 ); + rectangle->SetN3(); + } + //rectangle->SetNormalBoundaryFlux( fEpsRBelow / fEpsRAbove ); // TODO: Check!!!! + rectangle->SetNormalBoundaryFlux(1, fEpsRAbove ); + rectangle->SetNormalBoundaryFlux(0, fEpsRBelow ); + + // set length A + rectangle->SetA( a[i] ); + // set P0 + KPosition p0New((fP0[0] + dA*fN1[0] + dB*fN2[0]), (fP0[1] + dA*fN1[1] + dB*fN2[1]), (fP0[2] + dA*fN1[2] + dB*fN2[2])); + rectangle->SetP0(p0New); + + // set length B + rectangle->SetB(b[j]); + dB+=b[j]; + + // add r to the surface container + fContainer.push_back( rectangle ); + } /*B direction*/ + dA+=a[i]; + } /*A direction*/ + + fGroup++; + return; +} + + +KEMThreeVector CalcTime(double fDuration) +{ + // Calculating a time, given in seconds, in hours, minutes and seconds. + // Result will be written into a vector. + KEMThreeVector fTime; + + int fSecondsTotal(fDuration); + + int fSecondsRest = fSecondsTotal % 60; + int fMinutesTotal = fSecondsTotal/60; + fTime.SetX(fSecondsRest); + + int fMinutesRest = fMinutesTotal % 60; + fTime.SetY(fMinutesRest); + + int fHoursTotal = fMinutesTotal/60; + fTime.SetZ(fHoursTotal); + + return fTime; +} + + +int main(int argc, char *argv[]) +{ + std::cout << "________________________________________________________________________________" << std::endl << std::endl; + std::cout << " ELECTRIC FIELD CALCULATION PROGRAM FOR TEST OF DIELECTRICS " << std::endl; + std::cout << "________________________________________________________________________________" << std::endl << std::endl; + +// ---------------------------------------------------------------------------- + + // Technical definitions: + std::string fModelName(""); + std::string fMainDir(""); + std::string ftextinput; + int fGroupIndex(0); + int fChDensities(0); + int k(0); + bool fFixedPoints(false); + (void) fFixedPoints; + KEMThreeVector gLocation(0., 0., -0.25); + int gSteps(5000); + double gStepsize(0.0001); + vector v; + vector c; + + if(argc >= 3) { + fFixedPoints = true; + ftextinput = argv[2]; + } else { + fFixedPoints = false; + } + + fMainDir = (std::string)gSystem->GetFromPipe("pwd") + "/"; + fModelName = "TestName" + (std::string)argv[1]; + int disc(10); + std::cout << fMainDir << std::endl; + + std::string fElectrodeDir(fMainDir + "KEM_" + fModelName + ".root"); + std::string fFieldOutput(fMainDir + "ESTATICS_" + fModelName + ".root"); + + +// ---------------------------------------------------------------------------- + + // Physical input parameters: + double fAnodeU(1500.); // Voltage of anode (top) + double fCathodeU(-500.); // Voltage of cathode (bottom) + double fBoxU(0.e0); + double fGXeEpsR(1.); + double fLXeEpsR(2.); + // double fGXeEpsR(1.00126e0); // Dielectric constant for upper part (gaseous Xenon) + // double fLXeEpsR(1.96e0); // Dielectric constant for lower part (liquid Xenon) + +// ---------------------------------------------------------------------------- + + // Geometrical setup: + bool fAnode(true); + bool fCathode(true); + + bool fBoundary(true); + + bool fUseWires(false); // if true, then use parallel wires as electrodes, otherwise use plates + bool fConnectWireEndPoints(false); // Connect open end points of parallel anode and cathode wires + + bool fBoxXY(false); + bool fBoxYZ(false); + bool fBoxZX(false); + +// ---------------------------------------------------------------------------- + + // Geometric input parameters: + int fWiresPerLayer(26); // please only even numbers! + double fWirePitchY(1.e-2); + double fWireDiameter(1.e-3); + // Additional space between main and short connection wire parts: + double fWireConnectDistX(5.e-3); + if (!fConnectWireEndPoints) fWireConnectDistX = 0.e0; + + // Calculate fWireLengthX from fWirePitchY, fWireDiameter + // and fWiresPerLayer, to ensure a quadratic area. + double fWireLengthX( (fWiresPerLayer*fWireDiameter) + ((fWiresPerLayer-1)*fWirePitchY) ); + + double fBoundaryHeightZ(0.e0); + double fLayerDistanceZ(20.e-3); + fLayerDistanceZ = fLayerDistanceZ/2.e0; + + // Use only half of fWireLengthX due to technical reasons: + fWireLengthX = fWireLengthX/2.e0; + + // Use only half of fWirePerLayer due to technical reasons: + fWiresPerLayer = fWiresPerLayer/2; + + double fBoxLengthX(400.e-3); + fBoxLengthX = fBoxLengthX/2.e0; + double fBoxWidthY(400.e-3); + fBoxWidthY = fBoxWidthY/2.e0; + double fBoxHeightZ(400.e-3); + fBoxHeightZ = fBoxHeightZ/2.e0; + + // For loop over y-axis to define wire electrodes: + double fRunAbsY(0.e0); + double fStepY((fWirePitchY+fWireDiameter)/2.e0); + + // Length and width of different rectangles in XY-layer: + double fXY269WidthY((((2*fWiresPerLayer)-1)*2.e0*fStepY)+fWireDiameter); + double fXY134578WidthY(fBoxWidthY-(fXY269WidthY/2.e0)); + double fXY489LengthX((2.e0*(fWireLengthX+fWireConnectDistX))+fWireDiameter); + double fXY123567LengthX(fBoxLengthX-(fXY489LengthX/2.e0)); + + // Length and width of different rectangles in YZ-layer: + double fYZ123HeightZ(fLayerDistanceZ); + double fYZ456HeightZ(fBoxHeightZ-fLayerDistanceZ); + double fYZ1346WidthY(fXY134578WidthY); + double fYZ25WidthY(fXY269WidthY); + + // Length and width of different rectangles in ZX-layer: + double fZX1346LengthX(fXY123567LengthX); + double fZX25LengthX(fXY489LengthX); + double fZX123HeightZ(fYZ123HeightZ); + double fZX456HeightZ(fYZ456HeightZ); + +// ---------------------------------------------------------------------------- + + // Start- and endpoints: + KEMThreeVector fWireAnodePA(fWireLengthX,fRunAbsY,fLayerDistanceZ); + KEMThreeVector fWireAnodePB(-fWireLengthX,fRunAbsY,fLayerDistanceZ); + KEMThreeVector fWireCathodePA(fWireLengthX,fRunAbsY,-fLayerDistanceZ); + KEMThreeVector fWireCathodePB(-fWireLengthX,fRunAbsY,-fLayerDistanceZ); + + // End points of connecting wires: + KEMThreeVector fWireConnectPA; + KEMThreeVector fWireConnectPB; + + // Normal vectors: + KEMThreeVector fNx(1.,0.,0.); + KEMThreeVector fNy(0.,1.,0.); + KEMThreeVector fNz(0.,0.,1.); + + // Common P0 vector for rectangles: + KEMThreeVector fP0(0.,0.,0.); + + // ---------------------------------------------------------------------------- + + // Discretization of wires: + int fWireDisc(70); + int fWireConnectDisc(5); + + // Discretization of one XY-layer: + int fRectDiscXY1357(disc); + int fRectDiscXY26(disc); + int fRectDiscXY48(disc); + int fRectDiscXY9(disc); + + // Discretization of the virtual boundary XY-layer: + int fBoundaryDiscXY1357(disc); + int fBoundaryDiscXY26(disc); + int fBoundaryDiscXY48(disc); + int fBoundaryDiscXY9(disc); + + // Discretization of YZ-layer: + int fRectDiscYZ13(disc); + int fRectDiscYZ46(disc); + int fRectDiscYZ2(disc); + int fRectDiscYZ5(disc); + + // Discretization of ZX-layer: + int fRectDiscZX13(disc); + int fRectDiscZX46(disc); + int fRectDiscZX2(disc); + int fRectDiscZX5(disc); + + // Discretization of electrode plates (XY-layer): + double fRectElectrodeDisc(disc); + +// ---------------------------------------------------------------------------- + + KSurfaceContainer surfaceContainer; + +// ---------------------------------------------------------------------------- + + + if( fUseWires ) { + + // The wires are parallel to the x-axis, the y-coordinate will be iterated. + + for( int i=1; i<=fWiresPerLayer; i++ ) { + + fRunAbsY += fStepY; + + if (fAnode) { + + // Positive y-direction, y > 0 + fWireAnodePA.SetY(fRunAbsY); fWireAnodePB.SetY(fRunAbsY); + AddWire(surfaceContainer, fGroupIndex, fChDensities, fWireAnodePA, fWireAnodePB, fWireDiameter, fAnodeU, 1, fWireDisc); + + // Connect wire endpoints (in total 4 wire elements) + if (fConnectWireEndPoints) { + + // Front, x > 0 + fWireConnectPA.SetComponents(fWireLengthX+fWireConnectDistX, fRunAbsY, fLayerDistanceZ); + fWireConnectPB.SetComponents(fWireLengthX+fWireConnectDistX, fRunAbsY-fStepY, fLayerDistanceZ); + AddWire(surfaceContainer, fGroupIndex, fChDensities, fWireConnectPA, fWireConnectPB, fWireDiameter, fAnodeU, 1, fWireConnectDisc); + if (i 0 + fWireConnectPA.SetComponents(fWireLengthX+fWireConnectDistX, -fRunAbsY, fLayerDistanceZ); + fWireConnectPB.SetComponents(fWireLengthX+fWireConnectDistX, -(fRunAbsY-fStepY), fLayerDistanceZ); + AddWire(surfaceContainer, fGroupIndex, fChDensities, fWireConnectPA, fWireConnectPB, fWireDiameter, fAnodeU, 1, fWireConnectDisc); + if (i 0 + fWireCathodePA.SetY(fRunAbsY); fWireCathodePB.SetY(fRunAbsY); + AddWire(surfaceContainer, fGroupIndex, fChDensities, fWireCathodePA, fWireCathodePB, fWireDiameter, fCathodeU, 1, fWireDisc); + + // Connect wire endpoints (in total 4 wire elements) + if (fConnectWireEndPoints) { + + // Front, x > 0 + fWireConnectPA.SetComponents(fWireLengthX+fWireConnectDistX, fRunAbsY, -fLayerDistanceZ); + fWireConnectPB.SetComponents(fWireLengthX+fWireConnectDistX, fRunAbsY-fStepY, -fLayerDistanceZ); + AddWire(surfaceContainer, fGroupIndex, fChDensities, fWireConnectPA, fWireConnectPB, fWireDiameter, fCathodeU, 1, fWireConnectDisc); + if (i 0 + fWireConnectPA.SetComponents(fWireLengthX+fWireConnectDistX, -fRunAbsY, -fLayerDistanceZ); + fWireConnectPB.SetComponents(fWireLengthX+fWireConnectDistX, -(fRunAbsY-fStepY), -fLayerDistanceZ); + AddWire(surfaceContainer, fGroupIndex, fChDensities, fWireConnectPA, fWireConnectPB, fWireDiameter, fCathodeU, 1, fWireConnectDisc); + if (i0 + // ------------------------------- + + /* No. 1 */ fP0.SetComponents(-fBoxLengthX,fYZ25WidthY/2.e0,fBoundaryHeightZ); + AddRect(surfaceContainer, fGroupIndex, fChDensities, fYZ1346WidthY, fYZ123HeightZ, fP0, fNy, fNz, fBoxU, 1, + fRectDiscYZ13, fRectDiscYZ13); + + /* No. 2 */ fP0.SetComponents(-fBoxLengthX,-fYZ25WidthY/2.e0,fBoundaryHeightZ); + AddRect(surfaceContainer, fGroupIndex, fChDensities, fYZ25WidthY, fYZ123HeightZ, fP0, fNy, fNz, fBoxU, 1, + fRectDiscYZ2, fRectDiscYZ2); + + /* No. 3 */ fP0.SetComponents(-fBoxLengthX,-fBoxWidthY,fBoundaryHeightZ); + AddRect(surfaceContainer, fGroupIndex, fChDensities, fYZ1346WidthY, fYZ123HeightZ, fP0, fNy, fNz, fBoxU, 1, + fRectDiscYZ13, fRectDiscYZ13); + + /* No. 4 */ fP0.SetComponents(-fBoxLengthX,-fBoxWidthY,fLayerDistanceZ); + AddRect(surfaceContainer, fGroupIndex, fChDensities, fYZ1346WidthY, fYZ456HeightZ, fP0, fNy, fNz, fBoxU, 1, + fRectDiscYZ46, fRectDiscYZ46); + + /* No. 5 */ fP0.SetComponents(-fBoxLengthX,-fYZ25WidthY/2.e0,fLayerDistanceZ); + AddRect(surfaceContainer, fGroupIndex, fChDensities, fYZ25WidthY, fYZ456HeightZ, fP0, fNy, fNz, fBoxU, 1, + fRectDiscYZ5, fRectDiscYZ5); + + /* No. 6 */ fP0.SetComponents(-fBoxLengthX,fYZ25WidthY/2.e0,fLayerDistanceZ); + AddRect(surfaceContainer, fGroupIndex, fChDensities, fYZ1346WidthY, fYZ456HeightZ, fP0, fNy, fNz, fBoxU, 1, + fRectDiscYZ46, fRectDiscYZ46); + + // ------------------------------ + // YZ-layer at x=fBoxLengthX, z>0 + // ------------------------------ + + /* No. 1 */ fP0.SetComponents(fBoxLengthX,fYZ25WidthY/2.e0,fBoundaryHeightZ); + AddRect(surfaceContainer, fGroupIndex, fChDensities, fYZ1346WidthY, fYZ123HeightZ, fP0, fNy, fNz, fBoxU, 1, + fRectDiscYZ13, fRectDiscYZ13); + + /* No. 2 */ fP0.SetComponents(fBoxLengthX,-fYZ25WidthY/2.e0,fBoundaryHeightZ); + AddRect(surfaceContainer, fGroupIndex, fChDensities, fYZ25WidthY, fYZ123HeightZ, fP0, fNy, fNz, fBoxU, 1, + fRectDiscYZ2, fRectDiscYZ2); + + /* No. 3 */ fP0.SetComponents(fBoxLengthX,-fBoxWidthY,fBoundaryHeightZ); + AddRect(surfaceContainer, fGroupIndex, fChDensities, fYZ1346WidthY, fYZ123HeightZ, fP0, fNy, fNz, fBoxU, 1, + fRectDiscYZ13, fRectDiscYZ13); + + /* No. 4 */ fP0.SetComponents(fBoxLengthX,-fBoxWidthY,fLayerDistanceZ); + AddRect(surfaceContainer, fGroupIndex, fChDensities, fYZ1346WidthY, fYZ456HeightZ, fP0, fNy, fNz, fBoxU, 1, + fRectDiscYZ46, fRectDiscYZ46); + + /* No. 5 */ fP0.SetComponents(fBoxLengthX,-fYZ25WidthY/2.e0,fLayerDistanceZ); + AddRect(surfaceContainer, fGroupIndex, fChDensities, fYZ25WidthY, fYZ456HeightZ, fP0, fNy, fNz, fBoxU, 1, + fRectDiscYZ5, fRectDiscYZ5); + + /* No. 6 */ fP0.SetComponents(fBoxLengthX,fYZ25WidthY/2.e0,fLayerDistanceZ); + AddRect(surfaceContainer, fGroupIndex, fChDensities, fYZ1346WidthY, fYZ456HeightZ, fP0, fNy, fNz, fBoxU, 1, + fRectDiscYZ46, fRectDiscYZ46); + + } + +// ---------------------------------------------------------------------------- + + if( fBoxZX ) { + // ------------------------------ + // ZX-layer at y=-fBoxWidthY, z<0 + // ------------------------------ + + /* No. 1 */ fP0.SetComponents(-fBoxLengthX,-fBoxWidthY,-fLayerDistanceZ); + AddRect(surfaceContainer, fGroupIndex, fChDensities, fZX123HeightZ, fZX1346LengthX, fP0, fNz, fNx, fBoxU, 1, + fRectDiscZX13, fRectDiscZX13); + + /* No. 2 */ fP0.SetComponents(-fZX25LengthX/2.e0,-fBoxWidthY,-fLayerDistanceZ); + AddRect(surfaceContainer, fGroupIndex, fChDensities, fZX123HeightZ, fZX25LengthX, fP0, fNz, fNx, fBoxU, 1, + fRectDiscZX2, fRectDiscZX2); + + /* No. 3 */ fP0.SetComponents(fZX25LengthX/2.e0,-fBoxWidthY,-fLayerDistanceZ); + AddRect(surfaceContainer, fGroupIndex, fChDensities, fZX123HeightZ, fZX1346LengthX, fP0, fNz, fNx, fBoxU, 1, + fRectDiscZX13, fRectDiscZX13); + + /* No. 4 */ fP0.SetComponents(fZX25LengthX/2.e0,-fBoxWidthY,-fBoxHeightZ); + AddRect(surfaceContainer, fGroupIndex, fChDensities, fZX456HeightZ, fZX1346LengthX, fP0, fNz, fNx, fBoxU, 1, + fRectDiscZX46, fRectDiscZX46); + + /* No. 5 */ fP0.SetComponents(-fZX25LengthX/2.e0,-fBoxWidthY,-fBoxHeightZ); + AddRect(surfaceContainer, fGroupIndex, fChDensities, fZX456HeightZ, fZX25LengthX, fP0, fNz, fNx, fBoxU, 1, + fRectDiscZX5, fRectDiscZX5); + + /* No. 6 */ fP0.SetComponents(-fBoxLengthX,-fBoxWidthY,-fBoxHeightZ); + AddRect(surfaceContainer, fGroupIndex, fChDensities, fZX456HeightZ, fZX1346LengthX, fP0, fNz, fNx, fBoxU, 1, + fRectDiscZX46, fRectDiscZX46); + + // ----------------------------- + // ZX-layer at y=fBoxWidthY, z<0 + // ----------------------------- + + /* No. 1 */ fP0.SetComponents(-fBoxLengthX,fBoxWidthY,-fLayerDistanceZ); + AddRect(surfaceContainer, fGroupIndex, fChDensities, fZX123HeightZ, fZX1346LengthX, fP0, fNz, fNx, fBoxU, 1, + fRectDiscZX13, fRectDiscZX13); + + /* No. 2 */ fP0.SetComponents(-fZX25LengthX/2.e0,fBoxWidthY,-fLayerDistanceZ); + AddRect(surfaceContainer, fGroupIndex, fChDensities, fZX123HeightZ, fZX25LengthX, fP0, fNz, fNx, fBoxU, 1, + fRectDiscZX2, fRectDiscZX2); + + /* No. 3 */ fP0.SetComponents(fZX25LengthX/2.e0,fBoxWidthY,-fLayerDistanceZ); + AddRect(surfaceContainer, fGroupIndex, fChDensities, fZX123HeightZ, fZX1346LengthX, fP0, fNz, fNx, fBoxU, 1, + fRectDiscZX13, fRectDiscZX13); + + /* No. 4 */ fP0.SetComponents(fZX25LengthX/2.e0,fBoxWidthY,-fBoxHeightZ); + AddRect(surfaceContainer, fGroupIndex, fChDensities, fZX456HeightZ, fZX1346LengthX, fP0, fNz, fNx, fBoxU, 1, + fRectDiscZX46, fRectDiscZX46); + + /* No. 5 */ fP0.SetComponents(-fZX25LengthX/2.e0,fBoxWidthY,-fBoxHeightZ); + AddRect(surfaceContainer, fGroupIndex, fChDensities, fZX456HeightZ, fZX25LengthX, fP0, fNz, fNx, fBoxU, 1, + fRectDiscZX5, fRectDiscZX5); + + /* No. 6 */ fP0.SetComponents(-fBoxLengthX,fBoxWidthY,-fBoxHeightZ); + AddRect(surfaceContainer, fGroupIndex, fChDensities, fZX456HeightZ, fZX1346LengthX, fP0, fNz, fNx, fBoxU, 1, + fRectDiscZX46, fRectDiscZX46); + + // ------------------------------ + // ZX-layer at y=-fBoxWidthY, z>0 + // ------------------------------ + + /* No. 1 */ fP0.SetComponents(-fBoxLengthX,-fBoxWidthY,fBoundaryHeightZ); + AddRect(surfaceContainer, fGroupIndex, fChDensities, fZX123HeightZ, fZX1346LengthX, fP0, fNz, fNx, fBoxU, 1, + fRectDiscZX13, fRectDiscZX13); + + /* No. 2 */ fP0.SetComponents(-fZX25LengthX/2.e0,-fBoxWidthY,fBoundaryHeightZ); + AddRect(surfaceContainer, fGroupIndex, fChDensities, fZX123HeightZ, fZX25LengthX, fP0, fNz, fNx, fBoxU, 1, + fRectDiscZX2, fRectDiscZX2); + + /* No. 3 */ fP0.SetComponents(fZX25LengthX/2.e0,-fBoxWidthY,fBoundaryHeightZ); + AddRect(surfaceContainer, fGroupIndex, fChDensities, fZX123HeightZ, fZX1346LengthX, fP0, fNz, fNx, fBoxU, 1, + fRectDiscZX13, fRectDiscZX13); + + /* No. 4 */ fP0.SetComponents(fZX25LengthX/2.e0,-fBoxWidthY,fLayerDistanceZ); + AddRect(surfaceContainer, fGroupIndex, fChDensities, fZX456HeightZ, fZX1346LengthX, fP0, fNz, fNx, fBoxU, 1, + fRectDiscZX46, fRectDiscZX46); + + /* No. 5 */ fP0.SetComponents(-fZX25LengthX/2.e0,-fBoxWidthY,fLayerDistanceZ); + AddRect(surfaceContainer, fGroupIndex, fChDensities, fZX456HeightZ, fZX25LengthX, fP0, fNz, fNx, fBoxU, 1, + fRectDiscZX5, fRectDiscZX5); + + /* No. 6 */ fP0.SetComponents(-fBoxLengthX,-fBoxWidthY,fLayerDistanceZ); + AddRect(surfaceContainer, fGroupIndex, fChDensities, fZX456HeightZ, fZX1346LengthX, fP0, fNz, fNx, fBoxU, 1, + fRectDiscZX46, fRectDiscZX46); + + // ----------------------------- + // ZX-layer at y=fBoxWidthY, z>0 + // ----------------------------- + + /* No. 1 */ fP0.SetComponents(-fBoxLengthX,fBoxWidthY,fBoundaryHeightZ); + AddRect(surfaceContainer, fGroupIndex, fChDensities, fZX123HeightZ, fZX1346LengthX, fP0, fNz, fNx, fBoxU, 1, + fRectDiscZX13, fRectDiscZX13); + + /* No. 2 */ fP0.SetComponents(-fZX25LengthX/2.e0,fBoxWidthY,fBoundaryHeightZ); + AddRect(surfaceContainer, fGroupIndex, fChDensities, fZX123HeightZ, fZX25LengthX, fP0, fNz, fNx, fBoxU, 1, + fRectDiscZX2, fRectDiscZX2); + + /* No. 3 */ fP0.SetComponents(fZX25LengthX/2.e0,fBoxWidthY,fBoundaryHeightZ); + AddRect(surfaceContainer, fGroupIndex, fChDensities, fZX123HeightZ, fZX1346LengthX, fP0, fNz, fNx, fBoxU, 1, + fRectDiscZX13, fRectDiscZX13); + + /* No. 4 */ fP0.SetComponents(fZX25LengthX/2.e0,fBoxWidthY,fLayerDistanceZ); + AddRect(surfaceContainer, fGroupIndex, fChDensities, fZX456HeightZ, fZX1346LengthX, fP0, fNz, fNx, fBoxU, 1, + fRectDiscZX46, fRectDiscZX46); + + /* No. 5 */ fP0.SetComponents(-fZX25LengthX/2.e0,fBoxWidthY,fLayerDistanceZ); + AddRect(surfaceContainer, fGroupIndex, fChDensities, fZX456HeightZ, fZX25LengthX, fP0, fNz, fNx, fBoxU, 1, + fRectDiscZX5, fRectDiscZX5); + + /* No. 6 */ fP0.SetComponents(-fBoxLengthX,fBoxWidthY,fLayerDistanceZ); + AddRect(surfaceContainer, fGroupIndex, fChDensities, fZX456HeightZ, fZX1346LengthX, fP0, fNz, fNx, fBoxU, 1, + fRectDiscZX46, fRectDiscZX46); + + } + +// ---------------------------------------------------------------------------- + + KEBIPolicy fIntegratorPolicy; +#ifdef KEMFIELD_USE_OPENCL + KOpenCLSurfaceContainer* oclContainer = new KOpenCLSurfaceContainer( surfaceContainer ); + KOpenCLInterface::GetInstance()->SetActiveData( oclContainer ); + KOpenCLElectrostaticBoundaryIntegrator integrator { + fIntegratorPolicy.CreateOpenCLIntegrator(*oclContainer)}; + KBoundaryIntegralMatrix< KOpenCLBoundaryIntegrator< KElectrostaticBasis > > A( *oclContainer, integrator ); + KBoundaryIntegralVector< KOpenCLBoundaryIntegrator< KElectrostaticBasis > > b( *oclContainer, integrator ); + KBoundaryIntegralSolutionVector< KOpenCLBoundaryIntegrator< KElectrostaticBasis > > x( *oclContainer, integrator ); + + KRobinHood< KElectrostaticBoundaryIntegrator::ValueType, KRobinHood_OpenCL > robinHood; + +#else + KElectrostaticBoundaryIntegrator integrator{KEBIFactory::MakeDefault()}; /* default: numeric integrator */ + + KBoundaryIntegralMatrix A(surfaceContainer,integrator); + KBoundaryIntegralSolutionVector x(surfaceContainer,integrator); + KBoundaryIntegralVector b(surfaceContainer,integrator); + +// KGaussianElimination gaussianElimination; +// gaussianElimination.Solve(A,x,b); + +#ifdef MULTIRH + KMultiElementRobinHood robinHood; +#else + KRobinHood robinHood; +#endif + +#endif + robinHood.SetTolerance(1.e-8); + robinHood.SetResidualCheckInterval(1000); + + robinHood.AddVisitor(new KIterationDisplay()); + + KIterationTracker* tracker = new KIterationTracker(); + tracker->Interval(1); + tracker->WriteInterval(100); + tracker->MaxIterationStamps(1.e6); + robinHood.AddVisitor(tracker); + KIterativeStateWriter* stateWriter = new KIterativeStateWriter(surfaceContainer); + stateWriter->Interval(50000); + stateWriter->SaveNameRoot("TestDielectrics"); + robinHood.AddVisitor(stateWriter); + + robinHood.Solve(A,x,b); + +// ---------------------------------------------------------------------------- + + clock_t fTimeChDenStart(0); + clock_t fTimeChDenEnd(0); + + double fTimeChDen1(0.); + KEMThreeVector fTimeChDen2(0.,0.,0.); + + fTimeChDenStart = clock(); + +#ifdef KEMFIELD_USE_OPENCL + KOpenCLSurfaceContainer* oclContainer2; + oclContainer2 = new KOpenCLSurfaceContainer( surfaceContainer ); + KOpenCLInterface::GetInstance()->SetActiveData( oclContainer2 ); + KOpenCLElectrostaticBoundaryIntegrator* fOCLIntegrator2 = new KOpenCLElectrostaticBoundaryIntegrator{ + fIntegratorPolicy.CreateOpenCLConfig(), + *oclContainer2 }; + KIntegratingFieldSolver< KOpenCLElectrostaticBoundaryIntegrator >* direct_solver + = new KIntegratingFieldSolver< KOpenCLElectrostaticBoundaryIntegrator >( *oclContainer2, *fOCLIntegrator2 ); + direct_solver->Initialize(); +#else + KIntegratingFieldSolver* direct_solver + = new KIntegratingFieldSolver< KElectrostaticBoundaryIntegrator >( surfaceContainer, integrator ); +#endif + + + + + + fTimeChDenEnd = clock(); + + fTimeChDen1 = ((double)(fTimeChDenEnd-fTimeChDenStart))/CLOCKS_PER_SEC; + fTimeChDen2 = CalcTime(fTimeChDen1); + +// ---------------------------------------------------------------------------- + + std::cout << fGroupIndex << " wire and rectangle objects have been defined and discretized into" << std::endl; + std::cout << fChDensities << " elements with independent charge densities." << std::endl << std::endl; + std::cout << "Time for charge density calculation:" << std::endl; + std::cout << fTimeChDen2.Z() << " hours , " << fTimeChDen2.Y() << " minutes , " << fTimeChDen2.X() << " seconds." << std::endl << std::endl; + +// ---------------------------------------------------------------------------- + + clock_t fTimeFieldStart(0); + clock_t fTimeFieldEnd(0); + + double fTimeField1(0.); + KEMThreeVector fTimeField2(0., 0., 0.); + + fTimeFieldStart = clock(); + + + KEMThreeVector gEField(0.,0.,0.); + double gPotential(0.); + + + TFile* gROOTFile = new TFile(fFieldOutput.c_str(), "RECREATE"); + TGraph* gGraphEField = new TGraph(gSteps); + TGraph* gGraphPot = new TGraph(gSteps); + TGraph* gGraphEFieldR = new TGraph(gSteps); + TGraph* gGraphD = new TGraph(gSteps); + + TCanvas gCanvas("gCanvas", "Electrostatics of two-phase cube", 0, 0, 800, 600); + gCanvas.SetTitle("TestDielectrics"); + gGraphEField->SetTitle("Electric Field in z-Direction;z [m];E_z [V/m]"); + gGraphPot->SetTitle("Electric Potential;z [m];U [V]"); + gGraphEFieldR->SetTitle("Electric Field in radial direction;z [m];E_r [V/m]"); + gGraphD->SetTitle("Electric displacement field in z-Direction;z [m];D_z [V/m]"); + + double Er(0.); + std::pair result; + + for(int i=0; iElectricFieldAndPotential( gLocation ); + gEField = result.first; + gPotential = result.second; + + if(gLocation[2]< 0.2 && gLocation[2]> -0.2){ + Er = sqrt((gEField[0]*gEField[0]) + (gEField[1]*gEField[1])); + gGraphEField -> SetPoint(i,gLocation[2],gEField[2]); + gGraphPot -> SetPoint(i,gLocation[2],gPotential); + gGraphEFieldR -> SetPoint(i, gLocation[2], Er); + + if(fBoundary){ + if(gLocation[2]<0 ){ + gGraphD -> SetPoint(i,gLocation[2], gEField[2]*fLXeEpsR); + } + + else{ + gGraphD -> SetPoint(i,gLocation[2], gEField[2]*fGXeEpsR); + } + + + } + + else{ + + gGraphD->SetPoint(i,gLocation[2], gEField[2]); + + } + } + + gLocation[2]= gLocation[2] + gStepsize; + + } + + + gGraphEField->Draw("AP"); + gGraphEFieldR->Draw("AP"); + gGraphPot->Draw("AP"); + gGraphD->Draw("AP"); + + gGraphEField->SetMarkerColor(kRed); + gGraphEField->SetMarkerSize(0.5); + gGraphEField->SetMarkerStyle(8); + + gGraphEFieldR->SetMarkerColor(kRed); + gGraphEFieldR->SetMarkerSize(0.5); + gGraphEFieldR->SetMarkerStyle(8); + + gGraphPot->SetMarkerColor(kRed); + gGraphPot->SetMarkerSize(0.5); + gGraphPot->SetMarkerStyle(8); + + gGraphD->SetMarkerColor(kRed); + gGraphD->SetMarkerSize(0.5); + gGraphD->SetMarkerStyle(8); + + gGraphEField->Write("EField_Z"); + gGraphEFieldR->Write("EField_R"); + gGraphPot->Write("Potential"); + gGraphD->Write("D_Z"); + + + + fTimeFieldEnd = clock(); + fTimeField1 = ((double)(fTimeFieldEnd-fTimeFieldStart))/CLOCKS_PER_SEC; + fTimeField2 = CalcTime(fTimeField1); + +// ---------------------------------------------------------------------------- + + std::cout << "Time for field and potential calculation:" << std::endl; + std::cout << "(" << 4*k << " points)" << std::endl; + std::cout << fTimeField2.Z() << " hours , " << fTimeField2.Y() << " minutes , " << fTimeField2.X() << " seconds." << std::endl; + + KEMFileInterface::GetInstance()->Write( surfaceContainer, "surfaceContainer" ); + gROOTFile->Close(); + + surfaceContainer.clear(); +// ---------------------------------------------------------------------------- + + return 0; +} diff --git a/KEMField/Source/2.0/Tests/TestDiskCapacitance.cc b/KEMField/Source/Tests/TestDiskCapacitance.cc similarity index 100% rename from KEMField/Source/2.0/Tests/TestDiskCapacitance.cc rename to KEMField/Source/Tests/TestDiskCapacitance.cc diff --git a/KEMField/Source/2.0/Tests/TestEMFileInterface.cc b/KEMField/Source/Tests/TestEMFileInterface.cc similarity index 100% rename from KEMField/Source/2.0/Tests/TestEMFileInterface.cc rename to KEMField/Source/Tests/TestEMFileInterface.cc diff --git a/KEMField/Source/2.0/Tests/TestElectromagnetViewer.cc b/KEMField/Source/Tests/TestElectromagnetViewer.cc similarity index 100% rename from KEMField/Source/2.0/Tests/TestElectromagnetViewer.cc rename to KEMField/Source/Tests/TestElectromagnetViewer.cc diff --git a/KEMField/Source/2.0/Tests/TestElectromagnets.cc b/KEMField/Source/Tests/TestElectromagnets.cc similarity index 100% rename from KEMField/Source/2.0/Tests/TestElectromagnets.cc rename to KEMField/Source/Tests/TestElectromagnets.cc diff --git a/KEMField/Source/2.0/Tests/TestGeometry.cc b/KEMField/Source/Tests/TestGeometry.cc similarity index 100% rename from KEMField/Source/2.0/Tests/TestGeometry.cc rename to KEMField/Source/Tests/TestGeometry.cc diff --git a/KEMField/Source/2.0/Tests/TestIntegratorDistRatioLineSegmentROOT.cc b/KEMField/Source/Tests/TestIntegratorDistRatioLineSegmentROOT.cc similarity index 100% rename from KEMField/Source/2.0/Tests/TestIntegratorDistRatioLineSegmentROOT.cc rename to KEMField/Source/Tests/TestIntegratorDistRatioLineSegmentROOT.cc diff --git a/KEMField/Source/2.0/Tests/TestIntegratorDistRatioRectangleROOT.cc b/KEMField/Source/Tests/TestIntegratorDistRatioRectangleROOT.cc similarity index 100% rename from KEMField/Source/2.0/Tests/TestIntegratorDistRatioRectangleROOT.cc rename to KEMField/Source/Tests/TestIntegratorDistRatioRectangleROOT.cc diff --git a/KEMField/Source/2.0/Tests/TestIntegratorDistRatioTriangleROOT.cc b/KEMField/Source/Tests/TestIntegratorDistRatioTriangleROOT.cc similarity index 100% rename from KEMField/Source/2.0/Tests/TestIntegratorDistRatioTriangleROOT.cc rename to KEMField/Source/Tests/TestIntegratorDistRatioTriangleROOT.cc diff --git a/KEMField/Source/2.0/Tests/TestIntegratorFunctionality.cc b/KEMField/Source/Tests/TestIntegratorFunctionality.cc similarity index 100% rename from KEMField/Source/2.0/Tests/TestIntegratorFunctionality.cc rename to KEMField/Source/Tests/TestIntegratorFunctionality.cc diff --git a/KEMField/Source/2.0/Tests/TestIntegratorFunctionalityOpenCL.cc b/KEMField/Source/Tests/TestIntegratorFunctionalityOpenCL.cc similarity index 100% rename from KEMField/Source/2.0/Tests/TestIntegratorFunctionalityOpenCL.cc rename to KEMField/Source/Tests/TestIntegratorFunctionalityOpenCL.cc diff --git a/KEMField/Source/2.0/Tests/TestIntegratorLineSegmentROOTOpenCL.cc b/KEMField/Source/Tests/TestIntegratorLineSegmentROOTOpenCL.cc similarity index 100% rename from KEMField/Source/2.0/Tests/TestIntegratorLineSegmentROOTOpenCL.cc rename to KEMField/Source/Tests/TestIntegratorLineSegmentROOTOpenCL.cc diff --git a/KEMField/Source/2.0/Tests/TestIntegratorRWG.cc b/KEMField/Source/Tests/TestIntegratorRWG.cc similarity index 100% rename from KEMField/Source/2.0/Tests/TestIntegratorRWG.cc rename to KEMField/Source/Tests/TestIntegratorRWG.cc diff --git a/KEMField/Source/2.0/Tests/TestIntegratorRWGAccuracy.cc b/KEMField/Source/Tests/TestIntegratorRWGAccuracy.cc similarity index 100% rename from KEMField/Source/2.0/Tests/TestIntegratorRWGAccuracy.cc rename to KEMField/Source/Tests/TestIntegratorRWGAccuracy.cc diff --git a/KEMField/Source/2.0/Tests/TestIntegratorRectangleROOTOpenCL.cc b/KEMField/Source/Tests/TestIntegratorRectangleROOTOpenCL.cc similarity index 100% rename from KEMField/Source/2.0/Tests/TestIntegratorRectangleROOTOpenCL.cc rename to KEMField/Source/Tests/TestIntegratorRectangleROOTOpenCL.cc diff --git a/KEMField/Source/2.0/Tests/TestIntegratorSpeed.cc b/KEMField/Source/Tests/TestIntegratorSpeed.cc similarity index 100% rename from KEMField/Source/2.0/Tests/TestIntegratorSpeed.cc rename to KEMField/Source/Tests/TestIntegratorSpeed.cc diff --git a/KEMField/Source/2.0/Tests/TestIntegratorSpeedWithKbdInput.cc b/KEMField/Source/Tests/TestIntegratorSpeedWithKbdInput.cc similarity index 100% rename from KEMField/Source/2.0/Tests/TestIntegratorSpeedWithKbdInput.cc rename to KEMField/Source/Tests/TestIntegratorSpeedWithKbdInput.cc diff --git a/KEMField/Source/2.0/Tests/TestIntegratorTriangleROOTOpenCL.cc b/KEMField/Source/Tests/TestIntegratorTriangleROOTOpenCL.cc similarity index 100% rename from KEMField/Source/2.0/Tests/TestIntegratorTriangleROOTOpenCL.cc rename to KEMField/Source/Tests/TestIntegratorTriangleROOTOpenCL.cc diff --git a/KEMField/Source/2.0/Tests/TestInverseDistance.cc b/KEMField/Source/Tests/TestInverseDistance.cc similarity index 100% rename from KEMField/Source/2.0/Tests/TestInverseDistance.cc rename to KEMField/Source/Tests/TestInverseDistance.cc diff --git a/KEMField/Source/2.0/Tests/TestKMessageInterface.cc b/KEMField/Source/Tests/TestKMessageInterface.cc similarity index 100% rename from KEMField/Source/2.0/Tests/TestKMessageInterface.cc rename to KEMField/Source/Tests/TestKMessageInterface.cc diff --git a/KEMField/Source/2.0/Tests/TestKSP1.cc b/KEMField/Source/Tests/TestKSP1.cc similarity index 100% rename from KEMField/Source/2.0/Tests/TestKSP1.cc rename to KEMField/Source/Tests/TestKSP1.cc diff --git a/KEMField/Source/2.0/Tests/TestKSP2.cc b/KEMField/Source/Tests/TestKSP2.cc similarity index 100% rename from KEMField/Source/2.0/Tests/TestKSP2.cc rename to KEMField/Source/Tests/TestKSP2.cc diff --git a/KEMField/Source/2.0/Tests/TestOpenCL.cc b/KEMField/Source/Tests/TestOpenCL.cc similarity index 100% rename from KEMField/Source/2.0/Tests/TestOpenCL.cc rename to KEMField/Source/Tests/TestOpenCL.cc diff --git a/KEMField/Source/2.0/Tests/TestOpenCLPlugin.cc b/KEMField/Source/Tests/TestOpenCLPlugin.cc similarity index 100% rename from KEMField/Source/2.0/Tests/TestOpenCLPlugin.cc rename to KEMField/Source/Tests/TestOpenCLPlugin.cc diff --git a/KEMField/Source/2.0/Tests/TestPETSc.cc b/KEMField/Source/Tests/TestPETSc.cc similarity index 100% rename from KEMField/Source/2.0/Tests/TestPETSc.cc rename to KEMField/Source/Tests/TestPETSc.cc diff --git a/KEMField/Source/2.0/Tests/TestPETSc1.cc b/KEMField/Source/Tests/TestPETSc1.cc similarity index 100% rename from KEMField/Source/2.0/Tests/TestPETSc1.cc rename to KEMField/Source/Tests/TestPETSc1.cc diff --git a/KEMField/Source/2.0/Tests/TestPETSc2.cc b/KEMField/Source/Tests/TestPETSc2.cc similarity index 100% rename from KEMField/Source/2.0/Tests/TestPETSc2.cc rename to KEMField/Source/Tests/TestPETSc2.cc diff --git a/KEMField/Source/2.0/Tests/TestSVDSolver.cc b/KEMField/Source/Tests/TestSVDSolver.cc similarity index 100% rename from KEMField/Source/2.0/Tests/TestSVDSolver.cc rename to KEMField/Source/Tests/TestSVDSolver.cc diff --git a/KEMField/Source/2.0/Tests/TestSphereCapacitance.cc b/KEMField/Source/Tests/TestSphereCapacitance.cc similarity index 100% rename from KEMField/Source/2.0/Tests/TestSphereCapacitance.cc rename to KEMField/Source/Tests/TestSphereCapacitance.cc diff --git a/KEMField/Source/2.0/Tests/TestSuperposition.cc b/KEMField/Source/Tests/TestSuperposition.cc similarity index 99% rename from KEMField/Source/2.0/Tests/TestSuperposition.cc rename to KEMField/Source/Tests/TestSuperposition.cc index 295677e51..2691c02eb 100644 --- a/KEMField/Source/2.0/Tests/TestSuperposition.cc +++ b/KEMField/Source/Tests/TestSuperposition.cc @@ -55,9 +55,9 @@ #ifdef KEMFIELD_USE_MPI #include "KRobinHood_MPI.hh" -#define MPI_SINGLE_PROCESS if (KMPIInterface::GetInstance()->GetProcess()==0) +//#define MPI_SINGLE_PROCESS if (KMPIInterface::GetInstance()->GetProcess()==0) #else -#define MPI_SINGLE_PROCESS +//#define MPI_SINGLE_PROCESS #endif #ifdef KEMFIELD_USE_OPENCL diff --git a/KEMField/Source/2.0/Tests/TestSymmetryGroups.cc b/KEMField/Source/Tests/TestSymmetryGroups.cc similarity index 100% rename from KEMField/Source/2.0/Tests/TestSymmetryGroups.cc rename to KEMField/Source/Tests/TestSymmetryGroups.cc diff --git a/KEMField/Source/2.0/Tests/TestTriangles.cc b/KEMField/Source/Tests/TestTriangles.cc similarity index 100% rename from KEMField/Source/2.0/Tests/TestTriangles.cc rename to KEMField/Source/Tests/TestTriangles.cc diff --git a/KEMField/Source/2.0/Tests/TestTypelists.cc b/KEMField/Source/Tests/TestTypelists.cc similarity index 100% rename from KEMField/Source/2.0/Tests/TestTypelists.cc rename to KEMField/Source/Tests/TestTypelists.cc diff --git a/KEMField/Source/2.0/Tests/TestVectorTypes.cc b/KEMField/Source/Tests/TestVectorTypes.cc similarity index 100% rename from KEMField/Source/2.0/Tests/TestVectorTypes.cc rename to KEMField/Source/Tests/TestVectorTypes.cc diff --git a/KEMField/Source/2.0/Tests/TestVisitor.cc b/KEMField/Source/Tests/TestVisitor.cc similarity index 100% rename from KEMField/Source/2.0/Tests/TestVisitor.cc rename to KEMField/Source/Tests/TestVisitor.cc diff --git a/KEMField/Source/2.0/Tests/TestZonalHarmonics.cc b/KEMField/Source/Tests/TestZonalHarmonics.cc similarity index 100% rename from KEMField/Source/2.0/Tests/TestZonalHarmonics.cc rename to KEMField/Source/Tests/TestZonalHarmonics.cc diff --git a/KEMField/Source/2.0/Tests/include/KElectrostaticBoundaryIntegratorOptions.hh b/KEMField/Source/Tests/include/KElectrostaticBoundaryIntegratorOptions.hh similarity index 100% rename from KEMField/Source/2.0/Tests/include/KElectrostaticBoundaryIntegratorOptions.hh rename to KEMField/Source/Tests/include/KElectrostaticBoundaryIntegratorOptions.hh diff --git a/KEMField/Source/2.0/Tests/TestCubatureTriangleIntegrator.hh b/KEMField/Source/Tests/include/TestCubatureTriangleIntegrator.hh similarity index 100% rename from KEMField/Source/2.0/Tests/TestCubatureTriangleIntegrator.hh rename to KEMField/Source/Tests/include/TestCubatureTriangleIntegrator.hh diff --git a/KEMField/Source/2.0/Tests/TestRWGTriangleIntegrator.hh b/KEMField/Source/Tests/include/TestRWGTriangleIntegrator.hh similarity index 100% rename from KEMField/Source/2.0/Tests/TestRWGTriangleIntegrator.hh rename to KEMField/Source/Tests/include/TestRWGTriangleIntegrator.hh diff --git a/KEMField/Source/2.0/Visualization/CMakeLists.txt b/KEMField/Source/Visualization/CMakeLists.txt similarity index 100% rename from KEMField/Source/2.0/Visualization/CMakeLists.txt rename to KEMField/Source/Visualization/CMakeLists.txt diff --git a/KEMField/Source/2.0/Visualization/include/KEMFieldCanvas.hh b/KEMField/Source/Visualization/include/KEMFieldCanvas.hh similarity index 100% rename from KEMField/Source/2.0/Visualization/include/KEMFieldCanvas.hh rename to KEMField/Source/Visualization/include/KEMFieldCanvas.hh diff --git a/KEMField/Source/2.0/Visualization/src/KEMFieldCanvas.cc b/KEMField/Source/Visualization/src/KEMFieldCanvas.cc similarity index 100% rename from KEMField/Source/2.0/Visualization/src/KEMFieldCanvas.cc rename to KEMField/Source/Visualization/src/KEMFieldCanvas.cc diff --git a/KEMField/Source/2.0/XML/CMakeLists.txt b/KEMField/Source/XML/CMakeLists.txt similarity index 100% rename from KEMField/Source/2.0/XML/CMakeLists.txt rename to KEMField/Source/XML/CMakeLists.txt diff --git a/KEMField/Source/2.0/XML/Complete/ElectricFieldExplicitSuperposition.xml b/KEMField/Source/XML/Complete/ElectricFieldExplicitSuperposition.xml similarity index 100% rename from KEMField/Source/2.0/XML/Complete/ElectricFieldExplicitSuperposition.xml rename to KEMField/Source/XML/Complete/ElectricFieldExplicitSuperposition.xml diff --git a/KEMField/Source/2.0/XML/Complete/ElectricFields.xml b/KEMField/Source/XML/Complete/ElectricFields.xml similarity index 100% rename from KEMField/Source/2.0/XML/Complete/ElectricFields.xml rename to KEMField/Source/XML/Complete/ElectricFields.xml diff --git a/KEMField/Source/2.0/XML/Complete/MagneticFields.xml b/KEMField/Source/XML/Complete/MagneticFields.xml similarity index 100% rename from KEMField/Source/2.0/XML/Complete/MagneticFields.xml rename to KEMField/Source/XML/Complete/MagneticFields.xml diff --git a/KGeoBag/CMakeLists.txt b/KGeoBag/CMakeLists.txt index bd472dfde..199390579 100644 --- a/KGeoBag/CMakeLists.txt +++ b/KGeoBag/CMakeLists.txt @@ -1,20 +1,22 @@ -cmake_minimum_required( VERSION 2.8.6 ) +cmake_minimum_required( VERSION ${CMAKE_MINIMUM_VERSION} ) -project( KGeoBag ) -include( KasperDefaults ) - -# module settings -set( MODULE_VERSION_MAJOR 2 ) -set( MODULE_VERSION_MINOR 1 ) +# KGeoBag version +set( MODULE_VERSION_MAJOR 3 ) +set( MODULE_VERSION_MINOR 0 ) set( MODULE_VERSION_PATCH 0 ) set( MODULE_VERSION "${MODULE_VERSION_MAJOR}.${MODULE_VERSION_MINOR}.${MODULE_VERSION_PATCH}" ) +#project( KGeoBag VERSION ${MODULE_VERSION}) +project( KGeoBag ) + +include( KasperDefaults ) + kasper_require_cpp11() # internal dependencies kasper_find_module( Kommon ) foreach( FLAG ${Kommon_CFLAGS} ) - add_definitions( -D${FLAG} ) + add_definitions( -D${FLAG} ) endforeach( FLAG ) # external dependencies @@ -23,9 +25,16 @@ kasper_external_include_directories( ${GSL_INCLUDE_DIRS} ) #option( KGeoBag_USE_VTK "Enable visualization with VTK" OFF ) #option( KGeoBag_USE_ROOT "Enable visualization with ROOT" OFF ) +set( KGeoBag_USE_BOOST ${KASPER_USE_BOOST} ) set( KGeoBag_USE_VTK ${KASPER_USE_VTK} ) set( KGeoBag_USE_ROOT ${KASPER_USE_ROOT} ) +if( KGeoBag_USE_BOOST ) + find_package( Boost 1.43.0 COMPONENTS filesystem REQUIRED ) + kasper_external_include_directories( ${Boost_INCLUDE_DIRS} ) + set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS KGeoBag_USE_BOOST ) +endif() + if( KGeoBag_USE_VTK ) kasper_find_vtk() set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS KGeoBag_USE_VTK ) @@ -43,7 +52,7 @@ kasper_module_paths( TheBag ) # debugging kasper_module_debug() if( KGeoBag_ENABLE_DEBUG ) - add_cflag (KGeoBag_ENABLE_DEBUG) + add_cflag (KGeoBag_ENABLE_DEBUG) endif() ## testing diff --git a/KGeoBag/Source/Bindings/CMakeLists.txt b/KGeoBag/Source/Bindings/CMakeLists.txt index 427ae1f9c..c9d8ecdd4 100644 --- a/KGeoBag/Source/Bindings/CMakeLists.txt +++ b/KGeoBag/Source/Bindings/CMakeLists.txt @@ -16,6 +16,7 @@ set( BINDINGS_HEADER_FILES Shapes/Complex/Include/KGPortHousingBuilder.hh Shapes/Complex/Include/KGRodBuilder.hh Shapes/Complex/Include/KGRotatedObjectBuilder.hh + Shapes/Complex/Include/KGComplexAnnulusBuilder.hh # planar paths Shapes/PlanarShapes/Include/KGPlanarLineSegmentBuilder.hh @@ -129,6 +130,7 @@ set( BINDINGS_SOURCE_FILES Shapes/Complex/Source/KGPortHousingBuilder.cc Shapes/Complex/Source/KGRodBuilder.cc Shapes/Complex/Source/KGRotatedObjectBuilder.cc + Shapes/Complex/Source/KGComplexAnnulusBuilder.cc # planar paths Shapes/PlanarShapes/Source/KGPlanarLineSegmentBuilder.cc diff --git a/KGeoBag/Source/Bindings/Extensions/Appearance/Include/KGAppearanceBuilder.hh b/KGeoBag/Source/Bindings/Extensions/Appearance/Include/KGAppearanceBuilder.hh index 8a3e58e28..d4f29720e 100644 --- a/KGeoBag/Source/Bindings/Extensions/Appearance/Include/KGAppearanceBuilder.hh +++ b/KGeoBag/Source/Bindings/Extensions/Appearance/Include/KGAppearanceBuilder.hh @@ -62,7 +62,7 @@ namespace katrin if( tSurfaces.size() == 0 ) { coremsg( eWarning ) << "no surfaces found for specifier <" << aContainer->AsReference< string >() << ">" << eom; - return false; + return true; } for( tSurfaceIt = tSurfaces.begin(); tSurfaceIt != tSurfaces.end(); tSurfaceIt++ ) @@ -81,7 +81,7 @@ namespace katrin if( tSpaces.size() == 0 ) { coremsg( eWarning ) << "no spaces found for specifier <" << aContainer->AsReference< string >() << ">" << eom; - return false; + return true; } for( tSpaceIt = tSpaces.begin(); tSpaceIt != tSpaces.end(); tSpaceIt++ ) diff --git a/KGeoBag/Source/Bindings/Extensions/AxialMesh/Include/KGAxialMeshBuilder.hh b/KGeoBag/Source/Bindings/Extensions/AxialMesh/Include/KGAxialMeshBuilder.hh index 39048fd84..d223e25f1 100644 --- a/KGeoBag/Source/Bindings/Extensions/AxialMesh/Include/KGAxialMeshBuilder.hh +++ b/KGeoBag/Source/Bindings/Extensions/AxialMesh/Include/KGAxialMeshBuilder.hh @@ -52,7 +52,7 @@ namespace katrin if( tSurfaces.size() == 0 ) { coremsg( eWarning ) << "no surfaces found for specifier <" << aContainer->AsReference< string >() << ">" << eom; - return false; + return true; } for( tSurfaceIt = tSurfaces.begin(); tSurfaceIt != tSurfaces.end(); tSurfaceIt++ ) @@ -71,7 +71,7 @@ namespace katrin if( tSpaces.size() == 0 ) { coremsg( eWarning ) << "no spaces found for specifier <" << aContainer->AsReference< string >() << ">" << eom; - return false; + return true; } for( tSpaceIt = tSpaces.begin(); tSpaceIt != tSpaces.end(); tSpaceIt++ ) diff --git a/KGeoBag/Source/Bindings/Extensions/Deformation/Include/KGMeshDeformerBuilder.hh b/KGeoBag/Source/Bindings/Extensions/Deformation/Include/KGMeshDeformerBuilder.hh index 2fa817055..fd151a8d5 100644 --- a/KGeoBag/Source/Bindings/Extensions/Deformation/Include/KGMeshDeformerBuilder.hh +++ b/KGeoBag/Source/Bindings/Extensions/Deformation/Include/KGMeshDeformerBuilder.hh @@ -25,7 +25,7 @@ namespace katrin if( tSurfaces.size() == 0 ) { coremsg( eWarning ) << "no surfaces found for specifier <" << aContainer->AsReference< string >() << ">" << eom; - return false; + return true; } for( tSurfaceIt = tSurfaces.begin(); tSurfaceIt != tSurfaces.end(); tSurfaceIt++ ) @@ -44,7 +44,7 @@ namespace katrin if( tSpaces.size() == 0 ) { coremsg( eWarning ) << "no spaces found for specifier <" << aContainer->AsReference< string >() << ">" << eom; - return false; + return true; } for( tSpaceIt = tSpaces.begin(); tSpaceIt != tSpaces.end(); tSpaceIt++ ) diff --git a/KGeoBag/Source/Bindings/Extensions/DiscreteRotationalMesh/Include/KGDiscreteRotationalMeshBuilder.hh b/KGeoBag/Source/Bindings/Extensions/DiscreteRotationalMesh/Include/KGDiscreteRotationalMeshBuilder.hh index 3c4c85bd1..ed9845cb6 100644 --- a/KGeoBag/Source/Bindings/Extensions/DiscreteRotationalMesh/Include/KGDiscreteRotationalMeshBuilder.hh +++ b/KGeoBag/Source/Bindings/Extensions/DiscreteRotationalMesh/Include/KGDiscreteRotationalMeshBuilder.hh @@ -76,7 +76,7 @@ namespace katrin if( tSurfaces.size() == 0 ) { coremsg( eWarning ) << "no surfaces found for specifier <" << aContainer->AsReference< string >() << ">" << eom; - return false; + return true; } for( tSurfaceIt = tSurfaces.begin(); tSurfaceIt != tSurfaces.end(); tSurfaceIt++ ) @@ -95,7 +95,7 @@ namespace katrin if( tSpaces.size() == 0 ) { coremsg( eWarning ) << "no spaces found for specifier <" << aContainer->AsReference< string >() << ">" << eom; - return false; + return true; } for( tSpaceIt = tSpaces.begin(); tSpaceIt != tSpaces.end(); tSpaceIt++ ) diff --git a/KGeoBag/Source/Bindings/Extensions/Mesh/Include/KGMeshBuilder.hh b/KGeoBag/Source/Bindings/Extensions/Mesh/Include/KGMeshBuilder.hh index f1d41c238..8afd0ae86 100644 --- a/KGeoBag/Source/Bindings/Extensions/Mesh/Include/KGMeshBuilder.hh +++ b/KGeoBag/Source/Bindings/Extensions/Mesh/Include/KGMeshBuilder.hh @@ -52,7 +52,7 @@ namespace katrin if( tSurfaces.size() == 0 ) { coremsg( eWarning ) << "no surfaces found for specifier <" << aContainer->AsReference< string >() << ">" << eom; - return false; + return true; } for( tSurfaceIt = tSurfaces.begin(); tSurfaceIt != tSurfaces.end(); tSurfaceIt++ ) @@ -71,7 +71,7 @@ namespace katrin if( tSpaces.size() == 0 ) { coremsg( eWarning ) << "no spaces found for specifier <" << aContainer->AsReference< string >() << ">" << eom; - return false; + return true; } for( tSpaceIt = tSpaces.begin(); tSpaceIt != tSpaces.end(); tSpaceIt++ ) diff --git a/KGeoBag/Source/Bindings/Shapes/Complex/Include/KGComplexAnnulusBuilder.hh b/KGeoBag/Source/Bindings/Shapes/Complex/Include/KGComplexAnnulusBuilder.hh new file mode 100644 index 000000000..e7dbd7463 --- /dev/null +++ b/KGeoBag/Source/Bindings/Shapes/Complex/Include/KGComplexAnnulusBuilder.hh @@ -0,0 +1,111 @@ +#ifndef KGCOMPLEXANNULUSBUILDER_HH_ +#define KGCOMPLEXANNULUSBUILDER_HH_ + +#include "KComplexElement.hh" + +#include "KGWrappedSurface.hh" +#include "KGWrappedSpace.hh" +#include "KGComplexAnnulus.hh" +using namespace KGeoBag; + +namespace katrin +{ + + typedef KComplexElement< KGComplexAnnulus::Ring > KGComplexAnnulusRingBuilder; + + template< > + inline bool KGComplexAnnulusRingBuilder::AddAttribute(KContainer* anAttribute) + { + if (anAttribute->GetName() == "radius") + { + anAttribute->CopyTo( fObject, &KGComplexAnnulus::Ring::SetRSub ); + return true; + } + if (anAttribute->GetName() == "x") + { + double a[ 2 ] = {}; + anAttribute->CopyTo(a[ 0 ]); + a[ 1 ] = fObject->GetASub(1); + fObject->SetASub(a); + return true; + } + if (anAttribute->GetName() == "y") + { + double a[ 2 ] = {}; + a[ 0 ] = fObject->GetASub(0); + anAttribute->CopyTo(a[ 1 ]); + fObject->SetASub(a); + return true; + } + return false; + } + + + typedef KComplexElement< KGComplexAnnulus > KGComplexAnnulusBuilder; + + template< > + inline bool KGComplexAnnulusBuilder::AddAttribute(KContainer* anAttribute) + { + if (anAttribute->GetName() == "radius") + { + anAttribute->CopyTo(fObject, &KGComplexAnnulus::SetRMain ); + return true; + } + if (anAttribute->GetName() == "radial_mesh_count") + { + fObject->SetRadialMeshMain( anAttribute->AsReference() ); + return true; + } + if (anAttribute->GetName() == "axial_mesh_count") + { + fObject->SetPolyMain( anAttribute->AsReference() ); + return true; + } + return false; + } + + template< > + inline bool KGComplexAnnulusBuilder::AddElement(KContainer* anElement) + { + if (anElement->GetName() == "ring") + { + KGComplexAnnulus::Ring* Ring = NULL; + anElement->ReleaseTo(Ring); + fObject->AddRing(Ring); + Ring->Initialize(); + return true; + } + + return false; + } + + typedef KComplexElement< KGWrappedSurface< KGComplexAnnulus > > KGComplexAnnulusSurfaceBuilder; + + template<> + inline bool KGComplexAnnulusSurfaceBuilder::AddAttribute(KContainer* anAttribute) + { + if (anAttribute->GetName() == "name") + { + anAttribute->CopyTo(fObject, &KGWrappedSurface< KGComplexAnnulus >::SetName); + return true; + } + return false; + } + + template<> + inline bool KGComplexAnnulusSurfaceBuilder::AddElement(KContainer* anElement) + { + if (anElement->GetName() == "complex_annulus") + { + KGComplexAnnulus* object = NULL; + anElement->ReleaseTo(object); + KSmartPointer< KGComplexAnnulus > smartPtr(object); + fObject->SetObject(smartPtr); + return true; + } + return false; + } + +} + +#endif diff --git a/KGeoBag/Source/Bindings/Visualization/Root/Include/KGROOTGeometryPainterBuilder.hh b/KGeoBag/Source/Bindings/Visualization/Root/Include/KGROOTGeometryPainterBuilder.hh index 8c8169e52..0ad9a7ee9 100644 --- a/KGeoBag/Source/Bindings/Visualization/Root/Include/KGROOTGeometryPainterBuilder.hh +++ b/KGeoBag/Source/Bindings/Visualization/Root/Include/KGROOTGeometryPainterBuilder.hh @@ -35,7 +35,7 @@ namespace katrin if( tSurfaces.size() == 0 ) { coremsg( eWarning ) << "no surfaces found for specifier <" << aContainer->AsReference< string >() << ">" << eom; - return false; + return true; } for( tSurfaceIt = tSurfaces.begin(); tSurfaceIt != tSurfaces.end(); tSurfaceIt++ ) @@ -59,7 +59,7 @@ namespace katrin if( tSpaces.size() == 0 ) { coremsg( eWarning ) << "no spaces found for specifier <" << aContainer->AsReference< string >() << ">" << eom; - return false; + return true; } for( tSpaceIt = tSpaces.begin(); tSpaceIt != tSpaces.end(); tSpaceIt++ ) @@ -71,18 +71,18 @@ namespace katrin } if( aContainer->GetName() == "plane_normal" ) { - aContainer->CopyTo( fObject, &KGROOTGeometryPainter::SetPlaneNormal ); - return true; + aContainer->CopyTo( fObject, &KGROOTGeometryPainter::SetPlaneNormal ); + return true; } if( aContainer->GetName() == "plane_point" ) { - aContainer->CopyTo( fObject, &KGROOTGeometryPainter::SetPlanePoint ); - return true; + aContainer->CopyTo( fObject, &KGROOTGeometryPainter::SetPlanePoint ); + return true; } if( aContainer->GetName() == "swap_axis" ) { - aContainer->CopyTo( fObject, &KGROOTGeometryPainter::SetSwapAxis ); - return true; + aContainer->CopyTo( fObject, &KGROOTGeometryPainter::SetSwapAxis ); + return true; } if( aContainer->GetName() == "epsilon" ) { diff --git a/KGeoBag/Source/Bindings/Visualization/Vtk/Include/KGVTKAxialMeshPainterBuilder.hh b/KGeoBag/Source/Bindings/Visualization/Vtk/Include/KGVTKAxialMeshPainterBuilder.hh index b84d60d54..42b2aa319 100644 --- a/KGeoBag/Source/Bindings/Visualization/Vtk/Include/KGVTKAxialMeshPainterBuilder.hh +++ b/KGeoBag/Source/Bindings/Visualization/Vtk/Include/KGVTKAxialMeshPainterBuilder.hh @@ -68,7 +68,7 @@ namespace katrin if( tSurfaces.size() == 0 ) { coremsg( eWarning ) << "no surfaces found for specifier <" << aContainer->AsReference< string >() << ">" << eom; - return false; + return true; } for( tSurfaceIt = tSurfaces.begin(); tSurfaceIt != tSurfaces.end(); tSurfaceIt++ ) @@ -92,7 +92,7 @@ namespace katrin if( tSpaces.size() == 0 ) { coremsg( eWarning ) << "no spaces found for specifier <" << aContainer->AsReference< string >() << ">" << eom; - return false; + return true; } for( tSpaceIt = tSpaces.begin(); tSpaceIt != tSpaces.end(); tSpaceIt++ ) diff --git a/KGeoBag/Source/Bindings/Visualization/Vtk/Include/KGVTKDistanceTesterBuilder.hh b/KGeoBag/Source/Bindings/Visualization/Vtk/Include/KGVTKDistanceTesterBuilder.hh index 229a72182..1786ec1cd 100644 --- a/KGeoBag/Source/Bindings/Visualization/Vtk/Include/KGVTKDistanceTesterBuilder.hh +++ b/KGeoBag/Source/Bindings/Visualization/Vtk/Include/KGVTKDistanceTesterBuilder.hh @@ -35,7 +35,7 @@ namespace katrin if( tSurfaces.size() == 0 ) { coremsg( eWarning ) << "no surfaces found for specifier <" << aContainer->AsReference< string >() << ">" << eom; - return false; + return true; } for( tSurfaceIt = tSurfaces.begin(); tSurfaceIt != tSurfaces.end(); tSurfaceIt++ ) @@ -59,7 +59,7 @@ namespace katrin if( tSpaces.size() == 0 ) { coremsg( eWarning ) << "no spaces found for specifier <" << aContainer->AsReference< string >() << ">" << eom; - return false; + return true; } for( tSpaceIt = tSpaces.begin(); tSpaceIt != tSpaces.end(); tSpaceIt++ ) diff --git a/KGeoBag/Source/Bindings/Visualization/Vtk/Include/KGVTKGeometryPainterBuilder.hh b/KGeoBag/Source/Bindings/Visualization/Vtk/Include/KGVTKGeometryPainterBuilder.hh index 522a6588b..47cc07911 100644 --- a/KGeoBag/Source/Bindings/Visualization/Vtk/Include/KGVTKGeometryPainterBuilder.hh +++ b/KGeoBag/Source/Bindings/Visualization/Vtk/Include/KGVTKGeometryPainterBuilder.hh @@ -50,7 +50,7 @@ namespace katrin if( tSurfaces.size() == 0 ) { coremsg( eWarning ) << "no surfaces found for specifier <" << aContainer->AsReference< string >() << ">" << eom; - return false; + return true; } for( tSurfaceIt = tSurfaces.begin(); tSurfaceIt != tSurfaces.end(); tSurfaceIt++ ) @@ -74,7 +74,7 @@ namespace katrin if( tSpaces.size() == 0 ) { coremsg( eWarning ) << "no spaces found for specifier <" << aContainer->AsReference< string >() << ">" << eom; - return false; + return true; } for( tSpaceIt = tSpaces.begin(); tSpaceIt != tSpaces.end(); tSpaceIt++ ) diff --git a/KGeoBag/Source/Bindings/Visualization/Vtk/Include/KGVTKMeshPainterBuilder.hh b/KGeoBag/Source/Bindings/Visualization/Vtk/Include/KGVTKMeshPainterBuilder.hh index c840945bd..81e401dfa 100644 --- a/KGeoBag/Source/Bindings/Visualization/Vtk/Include/KGVTKMeshPainterBuilder.hh +++ b/KGeoBag/Source/Bindings/Visualization/Vtk/Include/KGVTKMeshPainterBuilder.hh @@ -68,7 +68,7 @@ namespace katrin if( tSurfaces.size() == 0 ) { coremsg( eWarning ) << "no surfaces found for specifier <" << aContainer->AsReference< string >() << ">" << eom; - return false; + return true; } for( tSurfaceIt = tSurfaces.begin(); tSurfaceIt != tSurfaces.end(); tSurfaceIt++ ) @@ -92,7 +92,7 @@ namespace katrin if( tSpaces.size() == 0 ) { coremsg( eWarning ) << "no spaces found for specifier <" << aContainer->AsReference< string >() << ">" << eom; - return false; + return true; } for( tSpaceIt = tSpaces.begin(); tSpaceIt != tSpaces.end(); tSpaceIt++ ) diff --git a/KGeoBag/Source/Bindings/Visualization/Vtk/Include/KGVTKNormalTesterBuilder.hh b/KGeoBag/Source/Bindings/Visualization/Vtk/Include/KGVTKNormalTesterBuilder.hh index 11f0c470e..360476c2a 100644 --- a/KGeoBag/Source/Bindings/Visualization/Vtk/Include/KGVTKNormalTesterBuilder.hh +++ b/KGeoBag/Source/Bindings/Visualization/Vtk/Include/KGVTKNormalTesterBuilder.hh @@ -35,7 +35,7 @@ namespace katrin if( tSurfaces.size() == 0 ) { coremsg( eWarning ) << "no surfaces found for specifier <" << aContainer->AsReference< string >() << ">" << eom; - return false; + return true; } for( tSurfaceIt = tSurfaces.begin(); tSurfaceIt != tSurfaces.end(); tSurfaceIt++ ) @@ -59,7 +59,7 @@ namespace katrin if( tSpaces.size() == 0 ) { coremsg( eWarning ) << "no spaces found for specifier <" << aContainer->AsReference< string >() << ">" << eom; - return false; + return true; } for( tSpaceIt = tSpaces.begin(); tSpaceIt != tSpaces.end(); tSpaceIt++ ) diff --git a/KGeoBag/Source/Bindings/Visualization/Vtk/Include/KGVTKOutsideTesterBuilder.hh b/KGeoBag/Source/Bindings/Visualization/Vtk/Include/KGVTKOutsideTesterBuilder.hh index c7236920a..0af204c30 100644 --- a/KGeoBag/Source/Bindings/Visualization/Vtk/Include/KGVTKOutsideTesterBuilder.hh +++ b/KGeoBag/Source/Bindings/Visualization/Vtk/Include/KGVTKOutsideTesterBuilder.hh @@ -35,7 +35,7 @@ namespace katrin if( tSurfaces.size() == 0 ) { coremsg( eWarning ) << "no surfaces found for specifier <" << aContainer->AsReference< string >() << ">" << eom; - return false; + return true; } for( tSurfaceIt = tSurfaces.begin(); tSurfaceIt != tSurfaces.end(); tSurfaceIt++ ) @@ -59,7 +59,7 @@ namespace katrin if( tSpaces.size() == 0 ) { coremsg( eWarning ) << "no spaces found for specifier <" << aContainer->AsReference< string >() << ">" << eom; - return false; + return true; } for( tSpaceIt = tSpaces.begin(); tSpaceIt != tSpaces.end(); tSpaceIt++ ) diff --git a/KGeoBag/Source/Bindings/Visualization/Vtk/Include/KGVTKPointTesterBuilder.hh b/KGeoBag/Source/Bindings/Visualization/Vtk/Include/KGVTKPointTesterBuilder.hh index 28e6e231a..91d14c5f4 100644 --- a/KGeoBag/Source/Bindings/Visualization/Vtk/Include/KGVTKPointTesterBuilder.hh +++ b/KGeoBag/Source/Bindings/Visualization/Vtk/Include/KGVTKPointTesterBuilder.hh @@ -35,7 +35,7 @@ namespace katrin if( tSurfaces.size() == 0 ) { coremsg( eWarning ) << "no surfaces found for specifier <" << aContainer->AsReference< string >() << ">" << eom; - return false; + return true; } for( tSurfaceIt = tSurfaces.begin(); tSurfaceIt != tSurfaces.end(); tSurfaceIt++ ) @@ -59,7 +59,7 @@ namespace katrin if( tSpaces.size() == 0 ) { coremsg( eWarning ) << "no spaces found for specifier <" << aContainer->AsReference< string >() << ">" << eom; - return false; + return true; } for( tSpaceIt = tSpaces.begin(); tSpaceIt != tSpaces.end(); tSpaceIt++ ) diff --git a/KGeoBag/Source/Bindings/Visualization/Vtk/Include/KGVTKRandomPointTesterBuilder.hh b/KGeoBag/Source/Bindings/Visualization/Vtk/Include/KGVTKRandomPointTesterBuilder.hh index a2dce694b..778600eff 100644 --- a/KGeoBag/Source/Bindings/Visualization/Vtk/Include/KGVTKRandomPointTesterBuilder.hh +++ b/KGeoBag/Source/Bindings/Visualization/Vtk/Include/KGVTKRandomPointTesterBuilder.hh @@ -35,7 +35,7 @@ namespace katrin if( tSurfaces.size() == 0 ) { coremsg( eWarning ) << "no surfaces found for specifier <" << aContainer->AsReference< string >() << ">" << eom; - return false; + return true; } for( tSurfaceIt = tSurfaces.begin(); tSurfaceIt != tSurfaces.end(); tSurfaceIt++ ) @@ -59,7 +59,7 @@ namespace katrin if( tSpaces.size() == 0 ) { coremsg( eWarning ) << "no spaces found for specifier <" << aContainer->AsReference< string >() << ">" << eom; - return false; + return true; } for( tSpaceIt = tSpaces.begin(); tSpaceIt != tSpaces.end(); tSpaceIt++ ) diff --git a/KGeoBag/Source/Core/Include/KGInterface.hh b/KGeoBag/Source/Core/Include/KGInterface.hh index 8941cd118..233c945a6 100644 --- a/KGeoBag/Source/Core/Include/KGInterface.hh +++ b/KGeoBag/Source/Core/Include/KGInterface.hh @@ -20,7 +20,7 @@ namespace KGeoBag static KGInterface* sInstance; public: - static const char sSeparator; + static const char sSeparator[]; static const char sNest; static const char sTag; static const char sRecurse; diff --git a/KGeoBag/Source/Core/Source/KGInterface.cc b/KGeoBag/Source/Core/Source/KGInterface.cc index 15134214d..35410b8bd 100644 --- a/KGeoBag/Source/Core/Source/KGInterface.cc +++ b/KGeoBag/Source/Core/Source/KGInterface.cc @@ -1,5 +1,7 @@ #include "KGCore.hh" +#include + using namespace std; namespace KGeoBag @@ -7,7 +9,7 @@ namespace KGeoBag KGInterface* KGInterface::sInstance = NULL; - const char KGInterface::sSeparator = ','; + const char KGInterface::sSeparator[] = "\t ,;"; const char KGInterface::sNest = '/'; const char KGInterface::sTag = '@'; const char KGInterface::sRecurse = ':'; @@ -146,65 +148,31 @@ namespace KGeoBag void KGInterface::RetrieveSurfacesBySpecifier( vector< KGSurface* >& anAccumulator, KGSpace* aNode, string aSpecifier ) { - size_t tSeparatorPos = aSpecifier.find_first_of( sSeparator ); - string tHead = aSpecifier.substr( 0, tSeparatorPos ); - string tTail = aSpecifier.substr( tSeparatorPos + 1 ); + vector< string > tPathList; + boost::split( tPathList, aSpecifier, boost::is_any_of(sSeparator) ); coremsg_debug( " retrieving surfaces for specifier <" << aSpecifier << "> at <" << aNode->GetName() << ">" << eom ); - if( tSeparatorPos == string::npos ) + for ( auto & tPath : tPathList ) { - string tPath = tHead; - coremsg_debug( " retrieving final surfaces for path <" << tPath << ">" << eom ); RetrieveSurfacesByPath( anAccumulator, aNode, tPath ); - - return; - } - else - { - string tPath = tHead; - - coremsg_debug( " retrieving surfaces for path <" << tPath << ">" << eom ); - - RetrieveSurfacesByPath( anAccumulator, aNode, tPath ); - - RetrieveSurfacesBySpecifier( anAccumulator, aNode, tTail ); - - return; } } void KGInterface::RetrieveSpacesBySpecifier( vector< KGSpace* >& anAccumulator, KGSpace* aNode, string aSpecifier ) { - size_t tSeparatorPos = aSpecifier.find_first_of( sSeparator ); - string tHead = aSpecifier.substr( 0, tSeparatorPos ); - string tTail = aSpecifier.substr( tSeparatorPos + 1 ); + vector< string > tPathList; + boost::split( tPathList, aSpecifier, boost::is_any_of(sSeparator) ); coremsg_debug( " retrieving spaces for specifier <" << aSpecifier << "> at <" << aNode->GetName() << ">" << eom ); - if( tSeparatorPos == string::npos ) + for ( auto & tPath : tPathList ) { - string tPath = tHead; - coremsg_debug( " retrieving final spaces for path <" << tPath << ">" << eom ); RetrieveSpacesByPath( anAccumulator, aNode, tPath ); - - return; - } - else - { - string tPath = tHead; - - coremsg_debug( " retrieving spaces for path <" << tPath << ">" << eom ); - - RetrieveSpacesByPath( anAccumulator, aNode, tPath ); - - RetrieveSpacesBySpecifier( anAccumulator, aNode, tTail ); - - return; } } diff --git a/KGeoBag/Source/Math/Include/KThreeVector.hh b/KGeoBag/Source/Math/Include/KThreeVector.hh index 8fb3b1ba5..c5ab58592 100644 --- a/KGeoBag/Source/Math/Include/KThreeVector.hh +++ b/KGeoBag/Source/Math/Include/KThreeVector.hh @@ -215,11 +215,11 @@ inline void KThreeVector::SetPolarAngle( const double &anAngle ) } inline void KThreeVector::SetAzimuthalAngleInDegrees( const double &anAngle ) { - SetAzimuthalAngle( KConst::Pi() / 360. * anAngle ); + SetAzimuthalAngle( KConst::Pi() / 180. * anAngle ); } inline void KThreeVector::SetPolarAngleInDegrees( const double &anAngle ) { - SetPolarAngle( KConst::Pi() / 360. * anAngle ); + SetPolarAngle( KConst::Pi() / 180. * anAngle ); } inline KThreeVector::operator double *() { @@ -318,11 +318,11 @@ inline double KThreeVector::AzimuthalAngle() const } inline double KThreeVector::PolarAngleInDegrees() const { - return PolarAngle() * 360. / KConst::Pi(); + return PolarAngle() * 180. / KConst::Pi(); } inline double KThreeVector::AzimuthalAngleInDegrees() const { - return AzimuthalAngle() * 360. / KConst::Pi(); + return AzimuthalAngle() * 180. / KConst::Pi(); } inline KThreeVector KThreeVector::Unit() const diff --git a/KGeoBag/Source/Shapes/CMakeLists.txt b/KGeoBag/Source/Shapes/CMakeLists.txt index 843d76a7c..d26a6a536 100644 --- a/KGeoBag/Source/Shapes/CMakeLists.txt +++ b/KGeoBag/Source/Shapes/CMakeLists.txt @@ -102,6 +102,9 @@ set( SHAPES_HEADER_FILES Complex/Include/KGRod.hh Complex/Include/KGRodSurface.hh Complex/Include/KGRodSpace.hh + Complex/Include/KGComplexAnnulus.hh + Complex/Include/KGComplexAnnulusSurface.hh + ) # source @@ -189,6 +192,7 @@ set( SHAPES_SOURCE_FILES Complex/Source/KGRotatedSpace.cc Complex/Source/KGPortHousingSpace.cc Complex/Source/KGConicSectPortHousingSpace.cc + Complex/Source/KGComplexAnnulus.cc ) # internal diff --git a/KGeoBag/Source/Shapes/Complex/Include/KGComplexAnnulus.hh b/KGeoBag/Source/Shapes/Complex/Include/KGComplexAnnulus.hh new file mode 100644 index 000000000..880ea1ecd --- /dev/null +++ b/KGeoBag/Source/Shapes/Complex/Include/KGComplexAnnulus.hh @@ -0,0 +1,138 @@ +#ifndef KGComplexAnnulus_DEF +#define KGComplexAnnulus_DEF + +#include + +#include "KGCoordinateTransform.hh" + +namespace KGeoBag +{ + class KGComplexAnnulus + { + public: + KGComplexAnnulus() : fCoordTransform(NULL) {} + KGComplexAnnulus(double rmain); + + virtual ~KGComplexAnnulus(); + + static std::string Name() { return "complex_annulus"; } + + void AddRing(double ASub[2], + double rsub); + + virtual KGComplexAnnulus* Clone() const; + + virtual void Initialize() const; + + bool ContainsPoint(const double* P) const; + double DistanceTo(const double* P,double* P_in=NULL,double* P_norm=NULL) const; + + void SetRMain(double r) {fRMain = r; } + void SetRadialMeshMain(int i) const { fRadialMeshMain = i; } + void SetPolyMain(int i) const { fPolyMain = i; } + + double GetRMain() const { return fRMain; } + int GetRadialMeshMain() const { return fRadialMeshMain; } + int GetPolyMain() const { return fPolyMain; } + + const KGCoordinateTransform* GetCoordinateTransform() const { return const_cast(fCoordTransform); } + + class Ring + { + public: + Ring() {} + Ring(KGComplexAnnulus* complexAnnulus) :fComplexAnnulus(complexAnnulus) {} + Ring(KGComplexAnnulus* complexAnnulus, + double ZSub[2], + double rsub); + + virtual ~Ring(); + + virtual Ring* Clone(KGComplexAnnulus*) const; + + virtual void Initialize(); + + KGComplexAnnulus* GetComplexAnnulus() const { return fComplexAnnulus; } + void SetComplexAnnulus(KGComplexAnnulus* a) { fComplexAnnulus = a; } + + virtual void ComputeLocalFrame(double *cen) const; + + virtual bool ContainsPoint(const double* P) const; + double DistanceTo(const double* P,double* P_in=NULL,double* P_norm=NULL) const; + + const KGCoordinateTransform* GetCoordinateTransform() const { return const_cast(fCoordTransform); } + + // intrinsic characteristics of the port: + void SetASub(double d[2]) { for (int i=0;i<2;i++) fASub[i] = d[i]; } + void SetRSub(double d) { fRSub = d; } + + double GetASub(int i) const { return (i<2) ? fASub[i] : 0; } + double GetRSub() const { return fRSub; } + double GetNorm(int i) const { return (i<2) ? fNorm[i] : 0; } + + // discretization parameters + void SetRadialMeshSub(int i) const { fRadialMeshSub = i; } + void SetPolySub(int i) const { fPolySub = i; } + + int GetRadialMeshSub() const { return fRadialMeshSub; } + int GetPolySub() const { return fPolySub; } + + private: + + // point describing the free end of the subordinate cyl. + double fASub[3]; + // radius of the subordinate cylinder + double fRSub; + + // unit vector (global coords) pointing from fASub to fCen + double fNorm[3]; + + // Determines the number of subelements created from the subordinate + // cylinder during discretization + mutable int fRadialMeshSub; + + // the # of sides of the polygon formed by the cross-section of the + // subordinate cylinder when it is discretized + mutable int fPolySub; + + protected: + + // pointer to port that owns this valve + KGComplexAnnulus* fComplexAnnulus; + // This could be changed to be handled by an external library + KGCoordinateTransform* fCoordTransform; + + // local origin and x,y,z unit vectors in the global frame. Local Origins don't tilt, so normal unit vectors are fine, just center gets shifted. + double fCen[3]; + double fX_loc[3] = {1,0,0}; + double fY_loc[3] = {0,1,0}; + double fZ_loc[3] = {0,0,1}; + }; + + void AddRing(KGComplexAnnulus::Ring*); + + unsigned int GetNRings() const { return fRings.size(); } + const KGComplexAnnulus::Ring* GetRing(int i) const { return const_cast(fRings.at(i)); } + + private: + // radius of the main ring + double fRMain; + + // Determines the number of subelements created from the main ring + // during discretization + mutable int fRadialMeshMain; + + // the # of sides of the polygon formed by the cross-section of the main + // ring when it is discretized + mutable int fPolyMain; + + // vector of sub rings associated with this port + std::vector fRings; + + // This could be changed to be handled by an external library + mutable KGCoordinateTransform* fCoordTransform; + }; + +} + +#endif /* ComplexAnnulus_DEF */ diff --git a/KGeoBag/Source/Shapes/Complex/Include/KGComplexAnnulusSurface.hh b/KGeoBag/Source/Shapes/Complex/Include/KGComplexAnnulusSurface.hh new file mode 100644 index 000000000..331893405 --- /dev/null +++ b/KGeoBag/Source/Shapes/Complex/Include/KGComplexAnnulusSurface.hh @@ -0,0 +1,15 @@ +#ifndef KGCOMPLEXANNULUSSURFACE_HH_ +#define KGCOMPLEXANNULUSSURFACE_HH_ + +#include "KGWrappedSurface.hh" + +#include "KGComplexAnnulus.hh" + +namespace KGeoBag +{ + + typedef KGWrappedSurface< KGComplexAnnulus > KGComplexAnnulusSurface; + +} + +#endif diff --git a/KGeoBag/Source/Shapes/Complex/Source/KGComplexAnnulus.cc b/KGeoBag/Source/Shapes/Complex/Source/KGComplexAnnulus.cc new file mode 100644 index 000000000..014a5e70a --- /dev/null +++ b/KGeoBag/Source/Shapes/Complex/Source/KGComplexAnnulus.cc @@ -0,0 +1,345 @@ +#include "KGComplexAnnulus.hh" + +#include +#include +#include +#include + +namespace KGeoBag +{ + KGComplexAnnulus::KGComplexAnnulus(double rmain) : + fCoordTransform(NULL) + { + fRMain = rmain; + } + + KGComplexAnnulus::~KGComplexAnnulus() + { + if (fCoordTransform) + delete fCoordTransform; + + for (unsigned int i=0;iSetComplexAnnulus(this); + + fRings.push_back(ring); + } + + KGComplexAnnulus* KGComplexAnnulus::Clone() const + { + KGComplexAnnulus* a = new KGComplexAnnulus(); + a->fRMain = fRMain; + a->fRadialMeshMain = fRadialMeshMain; + a->fPolyMain = fPolyMain; + + a->fCoordTransform = new KGCoordinateTransform(*fCoordTransform); + + for (unsigned int i=0;ifRings.push_back(fRings.at(i)->Clone(a)); + return a; + } + + void KGComplexAnnulus::Initialize() const + { + fRadialMeshMain = 30; + fPolyMain = 120; + + fCoordTransform = new KGCoordinateTransform(); + for (unsigned int i=0;iInitialize(); + } + + bool KGComplexAnnulus::ContainsPoint(const double* P) const + { + //Annulus is a 2D-Object, so the point must be on the same plane at the very least. + //Annulus is initialized as an object rotated around the z-axis with a defined radius, so the z-coordinates must be equivalent. + double epsilon = 1e-7; + if(fabs(P[2]) > epsilon){ + return false; + } + + //Is it within radius of annulus? + double pr = sqrt(P[0] * P[0] + P[1]*P[1]); + if(pr > fRMain){ + return false; + } + + //Is the point in a hole? + for(unsigned int i = 0; iContainsPoint(P)) return false; + } + + //Otherwise it must be contained. + return true; + + } + + double KGComplexAnnulus::DistanceTo(const double* P, double* P_in, double* P_norm) const{ + //Compute the closest point P_in to Point P as well as the norm vector pointing from point to closest point and returns the distance between them. + + double dist_main = 0; + double Norm[3] = {0,0,1}; //Norm vector of any annulus plane... + + //Compute the distance from point to x,y-Plane that is lifted by ZMain off the Origin. (using Hessian Normal) + + double D = P[2]*Norm[2]; + + //Compute the projected point on the plane and calculates it's distance towards the edge of the surface. + + double P_Plane[3]; + double PO[3]; + double PO_Norm_Sq = 0; + + for(unsigned int i = 0; i < 3; i++){ + P_Plane[i] = P[i] - D*Norm[i]; + PO[i] = P_Plane[i]; + PO_Norm_Sq += PO[i]*PO[i]; + } + + double PO_Norm = sqrt(PO_Norm_Sq); + + //Get case when the projection is in the annulus. + + if(PO_Norm < fRMain){ + for(unsigned int i = 0; i < 3; i++){ + P_in[i] = P_Plane[i]; + if(D > 0){ + P_norm[i] = -Norm[i]; + } + else P_norm[i] = Norm[i]; + } + dist_main = fabs(D); + return dist_main; + } + + //continuation of normal case. + + for(unsigned int i = 0; i < 3; i++){ + PO[i] /= PO_Norm; + } + + double t = fRMain; + double NormSq = 0; + + for(unsigned int i = 0; i < 3; i++){ + P_in[i] = t*PO[i]; + P_norm[i] = P_in[i] - P[i]; + NormSq += P_norm[i]*P_norm[i]; + } + + double Normalize = sqrt(NormSq); + + for(unsigned int i = 0; i < 3; i++){ + P_norm[i] /= Normalize; + } + + dist_main = Normalize; + + return dist_main; + } + + KGComplexAnnulus::Ring::Ring(KGComplexAnnulus* complexAnnulus, + double ASub[2], + double RSub) + : Ring(complexAnnulus) + { + for(unsigned int i = 0; i < 2; i++){ + fASub[i] = ASub[i]; + } + fASub[2] = 0.; + fRSub = RSub; + + Initialize(); + } + + KGComplexAnnulus::Ring::~Ring() + { + if (fCoordTransform) delete fCoordTransform; + } + + void KGComplexAnnulus::Ring::Initialize() + { + fRadialMeshSub = 6; + + ComputeLocalFrame(fCen); + + fCoordTransform = new KGCoordinateTransform(fCen, + fX_loc, + fY_loc, + fZ_loc); + + // for later calculations, we compute some parameters of the port here + double aSub_loc[3]; + fCoordTransform->ConvertToLocalCoords(fASub,aSub_loc,false); + + double LengthSq = 0; + + for (int i=0;i<3;i++) + { + fNorm[i] = fASub[i] - fCen[i]; + LengthSq += fNorm[i]*fNorm[i]; + } + + double Length = sqrt(LengthSq); + for (int i=0;i<3;i++) + fNorm[i]/=Length; + } + + KGComplexAnnulus::Ring* KGComplexAnnulus::Ring::Clone(KGComplexAnnulus* a) const + { + Ring* r = new Ring(); + + r->fComplexAnnulus = a; + + for (unsigned int i=0;i<3;i++) + { + r->fCen[i] = fCen[i]; + r->KGComplexAnnulus::Ring::fNorm[i] = KGComplexAnnulus::Ring::fNorm[i]; + r->fNorm[i] = fNorm[i]; + } + r->fCoordTransform = new KGCoordinateTransform(*fCoordTransform); + + r->fASub[0] = fASub[0]; + r->fASub[1] = fASub[1]; + r->fASub[2] = fASub[2]; // always 0 + r->fRSub = fRSub; + r->fRadialMeshSub = fRadialMeshSub; + r->fPolySub = fPolySub; + + return r; + } + + void KGComplexAnnulus::Ring::ComputeLocalFrame(double *cen) const + {//Shifts center of coordinate system towards center of ring. + + for (int i=0;i<2;i++) + { + cen[i] = fASub[i]; + } + cen[2] = 0.; + } + + bool KGComplexAnnulus::Ring::ContainsPoint(const double* P) const + { + // Checks if point

is contained by the port. + + // first, we transform to local coordinates + double P_loc[3]; + fCoordTransform->ConvertToLocalCoords(P,P_loc,false); + + //We check again if the point is even in the same x,y-plane: + double epsilon = 1e-7; + if(fabs(P_loc[2]) > epsilon) return false; + + double r_p = sqrt(P_loc[0]*P_loc[0] + P_loc[1]*P_loc[1]); + + // if the point is outside of the radius of the ring, return false. + if (r_p>fRSub) + return false; + + // if all of the above conditions are satisfied, return true + return true; + } + + double KGComplexAnnulus::Ring::DistanceTo(const double* P, double* P_in, double* P_norm) const{ + + //Let's first transform to local coordinates: + + double P_loc[3]; + fCoordTransform->ConvertToLocalCoords(P,P_loc,false); + + //Compute the closest point P_in to Point P as well as the norm vector pointing from point to closest point and returns the distance between them. + + double dist_main = 0; + double Norm[3] = {0,0,1}; //Norm vector of any annulus plane... + + //Compute the distance from point to x,y-Plane that is lifted by ZMain off the Origin. (using Hessian Normal) + + double D = P_loc[2]; + + //Compute the projected point on the plane and calculates it's distance towards the edge of the surface. + + double P_Plane[3]; + double PO[3]; + double PO_Norm_Sq = 0; + + for(unsigned int i = 0; i < 3; i++){ + P_Plane[i] = P_loc[i] - D*Norm[i]; + PO[i] = P_Plane[i]; + PO_Norm_Sq += PO[i]*PO[i]; + } + + double PO_Norm = sqrt(PO_Norm_Sq); + + //Get case when the projection is in the annulus. + + if(PO_Norm < fRSub){ + double P_in_loc[3]; + double P_in_glob[3]; + for(unsigned int i = 0; i < 3; i++){ + P_in_loc[i] = P_Plane[i]; + } + + fCoordTransform->ConvertToGlobalCoords(P_in_loc, P_in_glob,false); + + for(unsigned int i = 0; i < 3; i++){ + P_in[i] = P_in_glob[i]; + if(D > 0){ + P_norm[i] = -Norm[i]; + } + else P_norm[i] = Norm[i]; + } + + dist_main = fabs(D); + return dist_main; + } + + //continuation of normal case. + + for(unsigned int i = 0; i < 3; i++){ + PO[i] /= PO_Norm; + } + + double t =fRSub; + double NormSq = 0; + double P_in_loc[3]; + double P_norm_loc[3]; + + for(unsigned int i = 0; i < 3; i++){ + P_in_loc[i] = t*PO[i]; + P_norm_loc[i] = P_in_loc[i] - P_loc[i]; + NormSq += P_norm_loc[i]*P_norm_loc[i]; + } + + double Normalize = sqrt(NormSq); + + for(unsigned int i = 0; i < 3; i++){ + P_norm_loc[i] /= Normalize; + } + + fCoordTransform->ConvertToGlobalCoords(P_in_loc, P_in, false); + fCoordTransform->ConvertToGlobalCoords(P_norm_loc,P_norm,true); + + dist_main = Normalize; + + return dist_main; + } +} diff --git a/KGeoBag/Source/Shapes/Complex/Source/KGComplexAnnulusBuilder.cc b/KGeoBag/Source/Shapes/Complex/Source/KGComplexAnnulusBuilder.cc new file mode 100644 index 000000000..5b471ee2d --- /dev/null +++ b/KGeoBag/Source/Shapes/Complex/Source/KGComplexAnnulusBuilder.cc @@ -0,0 +1,28 @@ +#include "KGComplexAnnulusBuilder.hh" +#include "KGInterfaceBuilder.hh" + +using namespace std; +using namespace KGeoBag; + +namespace katrin +{ + + STATICINT sKGComplexAnnulusRingBuilderStructure = + KGComplexAnnulusRingBuilder::Attribute("radius") + + KGComplexAnnulusRingBuilder::Attribute("x") + + KGComplexAnnulusRingBuilder::Attribute("y"); + + STATICINT sKGComplexAnnulusBuilderStructure = + KGComplexAnnulusBuilder::Attribute("radius") + + KGComplexAnnulusBuilder::Attribute("radial_mesh_count") + + KGComplexAnnulusBuilder::Attribute("axial_mesh_count") + + KGComplexAnnulusBuilder::ComplexElement< KGComplexAnnulus::Ring >("ring"); + + STATICINT sKGComplexAnnulusSurfaceBuilderStructure = + KGComplexAnnulusSurfaceBuilder::Attribute("name") + + KGComplexAnnulusSurfaceBuilder::ComplexElement("complex_annulus"); + + STATICINT sKGComplexAnnulusSurfaceBuilder = + KGInterfaceBuilder::ComplexElement >("complex_annulus_surface"); + +} diff --git a/KGeoBag/Source/Visualization/Root/Include/KGROOTGeometryPainter.hh b/KGeoBag/Source/Visualization/Root/Include/KGROOTGeometryPainter.hh index 1669382b1..d2cd1b375 100644 --- a/KGeoBag/Source/Visualization/Root/Include/KGROOTGeometryPainter.hh +++ b/KGeoBag/Source/Visualization/Root/Include/KGROOTGeometryPainter.hh @@ -33,6 +33,13 @@ using katrin::KROOTPainter; #include "KGRotatedPolyLoopSpace.hh" #include "KGExtrudedCircleSpace.hh" #include "KGExtrudedPolyLoopSpace.hh" +#include "KGWrappedSurface.hh" +#include "KGPortHousingSurface.hh" +#include "KGBeamSurface.hh" +#include "KGBeam.hh" +#include "KGComplexAnnulus.hh" +#include "KGComplexAnnulusSurface.hh" + //include root stuff #include "TPolyLine.h" @@ -86,7 +93,10 @@ namespace KGeoBag public KGRotatedCircleSpace::Visitor, public KGRotatedPolyLoopSpace::Visitor, public KGExtrudedCircleSpace::Visitor, - public KGExtrudedPolyLoopSpace::Visitor + public KGExtrudedPolyLoopSpace::Visitor, + public KGPortHousingSurface::Visitor, + public KGBeamSurface::Visitor, + public KGComplexAnnulusSurface::Visitor { public: KGROOTGeometryPainter(); @@ -156,6 +166,9 @@ namespace KGeoBag virtual void VisitExtrudedPathSurface( KGExtrudedPolyLineSurface* aExtrudedPolyLineSurface ); virtual void VisitExtrudedPathSurface( KGExtrudedCircleSurface* aExtrudedCircleSurface ); virtual void VisitExtrudedPathSurface( KGExtrudedPolyLoopSurface* aExtrudedPolyLoopSurface ); + virtual void VisitWrappedSurface( KGWrappedSurface* aPortHousingSurface); + virtual void VisitWrappedSurface( KGWrappedSurface* aBeamSurface); + virtual void VisitWrappedSurface( KGWrappedSurface* aComplexAnnulus); //************** //space visitors @@ -173,6 +186,7 @@ namespace KGeoBag private: void LocalToGlobal( const KThreeVector& aLocal, KThreeVector& aGlobal ); + double distance(KTwoVector Vector1, KTwoVector Vector2); //********** //data types @@ -235,6 +249,22 @@ namespace KGeoBag { }; + class PortMesh: + public Mesh + { + }; + class BeamMesh: + public Mesh + { + }; + class RingMesh: + public Mesh + { + }; + + + + class Lines { public: @@ -261,6 +291,12 @@ namespace KGeoBag { }; + class ArcLines : + public Lines + { + }; + + class IntersectionPoints { public: @@ -293,6 +329,43 @@ namespace KGeoBag Set fData; }; + class SubPortOrderedPoints{ + public: + typedef OrderedPoints Element; + typedef deque< Element > Set; + typedef Set::iterator SetIt; + typedef Set::const_iterator SetCIt; + public: + Set fData; + }; + + class ConnectionPoints{ + public: + typedef pair Element; + typedef deque< Element > Group; + typedef Group::iterator GroupIt; + typedef Group::const_iterator GroupCIt; + typedef deque< Group > Set; + typedef Set::iterator SetIt; + typedef Set::const_iterator SetCIt; + public: + Set fData; + }; + + + class Partition + { + public: + typedef double Value; + typedef deque< Value > Set; + typedef Set::iterator It; + typedef Set::const_iterator CIt; + + public: + Set fData; + }; + + //**************** //points functions //**************** @@ -312,32 +385,62 @@ namespace KGeoBag void ClosedPointsRotatedToTorusMesh( const ClosedPoints& aPoints, TorusMesh& aMesh ); void OpenPointsExtrudedToFlatMesh( const OpenPoints& aPoints, const double& aZMin, const double& aZMax, FlatMesh& aMesh ); void ClosedPointsExtrudedToTubeMesh( const ClosedPoints& aPoints, const double& aZMin, const double& aZMax, TubeMesh& aMesh ); + void OpenPointsToShellMesh(const OpenPoints& aPoints, ShellMesh& aMesh,const unsigned int& aCount, const double& aPower, const double& AngleStart, const double& AngleStop); + void ClosedPointsToMainPortMesh(const double* PointA, const double* PointB, const double aRadius, PortMesh& aMesh); + void ClosedPointsToSubPortMesh(const KGPortHousing::CircularPort* aCircularPort, PortMesh& aMesh); + void ClosedPointsToBeamMesh(const vector> aStartCoord, const vector> aEndCoord, BeamMesh& aMesh); + void ClosedPointsToFlatMesh(const KSmartPointer aComplexAnnulus, FlatMesh& aMesh); + void ClosedPointsToRingMesh(const KSmartPointer aComplexAnnulus, RingMesh& aMesh); + + //************** //line functions //************** + void ShellMeshToArcLines(const ShellMesh aMesh, ArcLines& anArcLines); + void ShellMeshToParallelLines(const ShellMesh aMesh, ParallelLines& aParallelLines); void TubeMeshToCircleLines( const TubeMesh aMesh, CircleLines& aCircleLines ); void TubeMeshToParallelLines( const TubeMesh aMesh, ParallelLines& aParallelLines ); void TorusMeshToCircleLines( const TorusMesh aMesh, CircleLines& aCircleLines ); void TorusMeshToParallelLines( const TorusMesh aMesh, ParallelLines& aParallelLines ); + void PortMeshToCircleLines(const PortMesh aMesh, CircleLines& aCircleLines); + void PortMeshToParallelLines(const PortMesh aMesh, ParallelLines& aParallelLines); + void BeamMeshToCircleLines(const BeamMesh aMesh, CircleLines& aCircleLines); + void BeamMeshToParallelLines(const BeamMesh aMesh, ParallelLines& aParallelLines); + void FlatMeshToCircleLines(const FlatMesh aMesh, CircleLines& aCircleLines); + void RingMeshToCircleLines(const RingMesh aMesh, CircleLines& aCicleLines); + + //********************** //intersection functions //********************** void LinesToIntersections( const CircleLines aCircleLinesSet, IntersectionPoints& anIntersectionPoints ); + void LinesToIntersections( const ArcLines aCircleLinesSet, IntersectionPoints& anIntersectionPoints ); void LinesToIntersections( const ParallelLines aCircleLinesSet, IntersectionPoints& anIntersectionPoints ); void CalculatePlaneIntersection( const KThreeVector aStartPoint, const KThreeVector anEndPoint, KThreeVector& anIntersectionPoint, bool& anIntersection ); void TransformToPlaneSystem( const KThreeVector aPoint, KTwoVector& aPlanePoint ); void IntersectionPointsToOrderedPoints( const IntersectionPoints anIntersectionPoints, OrderedPoints& anOrderedPoints ); + void IntersectionPointsToOrderedPoints(const IntersectionPoints aMainIntersectionPoints, const IntersectionPoints aRingIntersectionPoints, OrderedPoints& anOrderdPoints); + void ShellIntersectionPointsToOrderedPoints(const IntersectionPoints anIntersectionPoints, OrderedPoints& OrderedPoints); void CreateClosedOrderedPoints( const IntersectionPoints anIntersectionPoints, OrderedPoints& anOrderedPoints ); + void CreateShellClosedOrderedPoints(const IntersectionPoints anIntersectionPoints, OrderedPoints& anOrderedPoints); void CreateOpenOrderedPoints( const IntersectionPoints anIntersectionPoints, OrderedPoints& anOrderedPoints ); + void CreateShellOpenOrderedPoints( const IntersectionPoints anIntersectionPoints, OrderedPoints& anOrderedPoints); void CreateDualOrderedPoints( const IntersectionPoints anIntersectionPoints, OrderedPoints& anOrderedPoints ); void CombineOrderedPoints( OrderedPoints& anOrderedPoints ); + void CombineOrderedPoints(OrderedPoints& aMainOrderedPoints, SubPortOrderedPoints& aSubOrderedPoints, OrderedPoints& anOrderedPoints); + + //******************* + //partition functions + //******************* + + void SymmetricPartition(const double& aStart, const double& aStop, const unsigned int& aCount, const double& aPower, Partition& aPartition ); //******************* diff --git a/KGeoBag/Source/Visualization/Root/Source/KGROOTGeometryPainter.cc b/KGeoBag/Source/Visualization/Root/Source/KGROOTGeometryPainter.cc index 9226efc7d..8b55c8416 100644 --- a/KGeoBag/Source/Visualization/Root/Source/KGROOTGeometryPainter.cc +++ b/KGeoBag/Source/Visualization/Root/Source/KGROOTGeometryPainter.cc @@ -11,13 +11,14 @@ using katrin::KConst; #include #include +#include using namespace std; namespace KGeoBag { - KGROOTGeometryPainter::KGROOTGeometryPainter() : + KGROOTGeometryPainter::KGROOTGeometryPainter() : fDefaultData(), fPlaneNormal( 0.0, 1.0, 0.0 ), fPlanePoint( 0.0, 0.0, 0.0 ), @@ -37,7 +38,7 @@ namespace KGeoBag fIgnore( true ) { } - KGROOTGeometryPainter::~KGROOTGeometryPainter() + KGROOTGeometryPainter::~KGROOTGeometryPainter() { for (size_t i=0; i::iterator tSurfaceIt; @@ -115,7 +116,7 @@ namespace KGeoBag { if ( tValue[j] > tMax ) { - tMax = tValue[j]; + tMax = tValue[j]; } } } @@ -128,7 +129,7 @@ namespace KGeoBag { if ( tValue[j] > tMax ) { - tMax = tValue[j]; + tMax = tValue[j]; } } } @@ -178,7 +179,7 @@ namespace KGeoBag { if ( tValue[j] > tMax ) { - tMax = tValue[j]; + tMax = tValue[j]; } } } @@ -191,7 +192,7 @@ namespace KGeoBag { if ( tValue[j] > tMax ) { - tMax = tValue[j]; + tMax = tValue[j]; } } } @@ -201,79 +202,79 @@ namespace KGeoBag std::string KGROOTGeometryPainter::GetXAxisLabel() { - return GetAxisLabel( fPlaneVectorA ); + return GetAxisLabel( fPlaneVectorA ); } std::string KGROOTGeometryPainter::GetYAxisLabel() { - return GetAxisLabel( fPlaneVectorB ); + return GetAxisLabel( fPlaneVectorB ); } std::string KGROOTGeometryPainter::GetAxisLabel( KThreeVector anAxis ) { - if ( anAxis.Y() < fEpsilon - && anAxis.Y() > -fEpsilon - && anAxis.Z() < fEpsilon - && anAxis.Z() > -fEpsilon ) - { - if ( anAxis.X() < 1.0 + fEpsilon - && anAxis.X() > 1.0 - fEpsilon) - { - return string( "x" ); - } - if ( anAxis.X() < -1.0 + fEpsilon - && anAxis.X() > -1.0 - fEpsilon) - { - return string( "-x" ); - } - } - - if ( anAxis.X() < fEpsilon - && anAxis.X() > -fEpsilon - && anAxis.Z() < fEpsilon - && anAxis.Z() > -fEpsilon ) - { - if ( anAxis.Y() < 1.0 + fEpsilon - && anAxis.Y() > 1.0 - fEpsilon) - { - return string( "y" ); - } - if ( anAxis.Y() < -1.0 + fEpsilon - && anAxis.Y() > -1.0 - fEpsilon) - { - return string( "-y" ); - } - } - - if ( anAxis.X() < fEpsilon - && anAxis.X() > -fEpsilon - && anAxis.Y() < fEpsilon - && anAxis.Y() > -fEpsilon ) - { - if ( anAxis.Z() < 1.0 + fEpsilon - && anAxis.Z() > 1.0 - fEpsilon) - { - return string( "z" ); - } - if ( anAxis.Z() < -1.0 + fEpsilon - && anAxis.Z() > -1.0 - fEpsilon) - { - return string( "-z" ); - } - } - - string tLabel; - stringstream ss; - ss << anAxis.X(); - tLabel += ss.str(); - tLabel += string( "/" ); - ss.str(""); - ss << anAxis.Y(); - tLabel += ss.str(); - tLabel += string( "/" ); - ss.str(""); - ss << anAxis.Z(); - tLabel += ss.str(); - return tLabel; + if ( anAxis.Y() < fEpsilon + && anAxis.Y() > -fEpsilon + && anAxis.Z() < fEpsilon + && anAxis.Z() > -fEpsilon ) + { + if ( anAxis.X() < 1.0 + fEpsilon + && anAxis.X() > 1.0 - fEpsilon) + { + return string( "x" ); + } + if ( anAxis.X() < -1.0 + fEpsilon + && anAxis.X() > -1.0 - fEpsilon) + { + return string( "-x" ); + } + } + + if ( anAxis.X() < fEpsilon + && anAxis.X() > -fEpsilon + && anAxis.Z() < fEpsilon + && anAxis.Z() > -fEpsilon ) + { + if ( anAxis.Y() < 1.0 + fEpsilon + && anAxis.Y() > 1.0 - fEpsilon) + { + return string( "y" ); + } + if ( anAxis.Y() < -1.0 + fEpsilon + && anAxis.Y() > -1.0 - fEpsilon) + { + return string( "-y" ); + } + } + + if ( anAxis.X() < fEpsilon + && anAxis.X() > -fEpsilon + && anAxis.Y() < fEpsilon + && anAxis.Y() > -fEpsilon ) + { + if ( anAxis.Z() < 1.0 + fEpsilon + && anAxis.Z() > 1.0 - fEpsilon) + { + return string( "z" ); + } + if ( anAxis.Z() < -1.0 + fEpsilon + && anAxis.Z() > -1.0 - fEpsilon) + { + return string( "-z" ); + } + } + + string tLabel; + stringstream ss; + ss << anAxis.X(); + tLabel += ss.str(); + tLabel += string( "/" ); + ss.str(""); + ss << anAxis.Y(); + tLabel += ss.str(); + tLabel += string( "/" ); + ss.str(""); + ss << anAxis.Z(); + tLabel += ss.str(); + return tLabel; } @@ -281,14 +282,16 @@ namespace KGeoBag void KGROOTGeometryPainter::Display() { - vismsg( eNormal ) <<"Drawing "<SetFillColor(kGreen+2); - fROOTSpaces.at(i)->Draw( "f" ); + fROOTSpaces.at(i)->SetFillColor(kGreen+2); + fROOTSpaces.at(i)->Draw( "f" ); } - vismsg( eNormal ) <<"Drawing "<SetLineColor(kBlack); @@ -299,7 +302,7 @@ namespace KGeoBag } void KGROOTGeometryPainter::Write() { - //root write + //root write return; } @@ -316,115 +319,118 @@ namespace KGeoBag void KGROOTGeometryPainter::CalculatePlaneCoordinateSystem() { - fPlaneNormal = fPlaneNormal.Unit(); - double tDirectionMagX = fabs( fPlaneNormal.X() ); - double tDirectionMagY = fabs( fPlaneNormal.Y() ); - double tDirectionMagZ = fabs( fPlaneNormal.Z() ); - - //plane normal looks in x direction - if ( tDirectionMagX >= tDirectionMagY && tDirectionMagX >= tDirectionMagZ ) - { - fPlaneVectorA.SetX( 0.0 ); - fPlaneVectorA.SetY( 1.0 ); - fPlaneVectorA.SetZ( 0.0 ); - - if ( fPlaneNormal.X() > fEpsilon || fPlaneNormal.X() < -1.*fEpsilon ) - { - fPlaneVectorA.SetX( -1.0 * fPlaneNormal.Y() / fPlaneNormal.X() ); - } - - fPlaneVectorB.SetX( fPlaneNormal.Y() * fPlaneVectorA.Z() - fPlaneNormal.Z() * fPlaneVectorA.Y() ); - fPlaneVectorB.SetY( fPlaneNormal.Z() * fPlaneVectorA.X() - fPlaneNormal.X() * fPlaneVectorA.Z() ); - fPlaneVectorB.SetZ( fPlaneNormal.X() * fPlaneVectorA.Y() - fPlaneNormal.Y() * fPlaneVectorA.X() ); - - fPlaneVectorA = fPlaneVectorA.Unit(); - fPlaneVectorB = fPlaneVectorB.Unit(); - - if ( fSwapAxis) - { - swap( fPlaneVectorA, fPlaneVectorB); - } - vismsg( eNormal ) << "Plane vectors are: "< fEpsilon || fPlaneVectorA.Dot( fPlaneNormal ) < -1.*fEpsilon ) - { - vismsg( eWarning ) <<"Scalar product of PlaneVector A and NormalVector is "< fEpsilon || fPlaneVectorB.Dot( fPlaneNormal ) < -1.*fEpsilon ) - { - vismsg( eWarning ) <<"Scalar product of PlaneVector B and NormalVector is "<= tDirectionMagX && tDirectionMagY >= tDirectionMagZ ) - { - fPlaneVectorA.SetX( 0.0 ); - fPlaneVectorA.SetY( 0.0 ); - fPlaneVectorA.SetZ( 1.0 ); - - if ( fPlaneNormal.Y() > fEpsilon || fPlaneNormal.Y() < -1.*fEpsilon ) - { - fPlaneVectorA.SetY( -1.0 * fPlaneNormal.Z() / fPlaneNormal.Y() ); - } - - fPlaneVectorB.SetX( fPlaneNormal.Y() * fPlaneVectorA.Z() - fPlaneNormal.Z() * fPlaneVectorA.Y() ); - fPlaneVectorB.SetY( fPlaneNormal.Z() * fPlaneVectorA.X() - fPlaneNormal.X() * fPlaneVectorA.Z() ); - fPlaneVectorB.SetZ( fPlaneNormal.X() * fPlaneVectorA.Y() - fPlaneNormal.Y() * fPlaneVectorA.X() ); - - fPlaneVectorA = fPlaneVectorA.Unit(); - fPlaneVectorB = fPlaneVectorB.Unit(); - - if ( fSwapAxis) - { - swap( fPlaneVectorA, fPlaneVectorB); - } - vismsg( eNormal ) << "Plane vectors are: "< fEpsilon || fPlaneVectorA.Dot( fPlaneNormal ) < -1.*fEpsilon ) - { - vismsg( eWarning ) <<"Scalar product of PlaneVector A and NormalVector is "< fEpsilon || fPlaneVectorB.Dot( fPlaneNormal ) < -1.*fEpsilon ) - { - vismsg( eWarning ) <<"Scalar product of PlaneVector B and NormalVector is "<= tDirectionMagX && tDirectionMagZ >= tDirectionMagY ) - { - fPlaneVectorA.SetX( 1.0 ); - fPlaneVectorA.SetY( 0.0 ); - fPlaneVectorA.SetZ( 0.0 ); - - if ( fPlaneNormal.Z() > fEpsilon || fPlaneNormal.Z() < -1.*fEpsilon ) - { - fPlaneVectorA.SetZ( -1.0 * fPlaneNormal.X() / fPlaneNormal.Z() ); - } - - fPlaneVectorB.SetX( fPlaneNormal.Y() * fPlaneVectorA.Z() - fPlaneNormal.Z() * fPlaneVectorA.Y() ); - fPlaneVectorB.SetY( fPlaneNormal.Z() * fPlaneVectorA.X() - fPlaneNormal.X() * fPlaneVectorA.Z() ); - fPlaneVectorB.SetZ( fPlaneNormal.X() * fPlaneVectorA.Y() - fPlaneNormal.Y() * fPlaneVectorA.X() ); - - fPlaneVectorA = fPlaneVectorA.Unit(); - fPlaneVectorB = fPlaneVectorB.Unit(); - - if ( fSwapAxis) - { - swap( fPlaneVectorA, fPlaneVectorB); - } - vismsg( eNormal ) << "Plane vectors are: "< fEpsilon || fPlaneVectorA.Dot( fPlaneNormal ) < -1.*fEpsilon ) - { - vismsg( eWarning ) <<"Scalar product of PlaneVector A and NormalVector is "< fEpsilon || fPlaneVectorB.Dot( fPlaneNormal ) < -1.*fEpsilon ) - { - vismsg( eWarning ) <<"Scalar product of PlaneVector B and NormalVector is "<= tDirectionMagY && tDirectionMagX >= tDirectionMagZ ) + { + fPlaneVectorA.SetX( 0.0 ); + fPlaneVectorA.SetY( 1.0 ); + fPlaneVectorA.SetZ( 0.0 ); + + if ( fPlaneNormal.X() > fEpsilon || fPlaneNormal.X() < -1.*fEpsilon ) + { + fPlaneVectorA.SetX( -1.0 * fPlaneNormal.Y() / fPlaneNormal.X() ); + } + + fPlaneVectorB.SetX( fPlaneNormal.Y() * fPlaneVectorA.Z() - fPlaneNormal.Z() * fPlaneVectorA.Y() ); + fPlaneVectorB.SetY( fPlaneNormal.Z() * fPlaneVectorA.X() - fPlaneNormal.X() * fPlaneVectorA.Z() ); + fPlaneVectorB.SetZ( fPlaneNormal.X() * fPlaneVectorA.Y() - fPlaneNormal.Y() * fPlaneVectorA.X() ); + + fPlaneVectorA = fPlaneVectorA.Unit(); + fPlaneVectorB = fPlaneVectorB.Unit(); + + if ( fSwapAxis) + { + swap( fPlaneVectorA, fPlaneVectorB); + } + vismsg( eInfo ) << "Plane vectors are: "< fEpsilon || fPlaneVectorA.Dot( fPlaneNormal ) < -1.*fEpsilon ) + { + vismsg( eWarning ) <<"Scalar product of PlaneVector A and NormalVector is "< fEpsilon || fPlaneVectorB.Dot( fPlaneNormal ) < -1.*fEpsilon ) + { + vismsg( eWarning ) <<"Scalar product of PlaneVector B and NormalVector is "<= tDirectionMagX && tDirectionMagY >= tDirectionMagZ ) + { + fPlaneVectorA.SetX( 0.0 ); + fPlaneVectorA.SetY( 0.0 ); + fPlaneVectorA.SetZ( 1.0 ); + + if ( fPlaneNormal.Y() > fEpsilon || fPlaneNormal.Y() < -1.*fEpsilon ) + { + fPlaneVectorA.SetY( -1.0 * fPlaneNormal.Z() / fPlaneNormal.Y() ); + } + + fPlaneVectorB.SetX( fPlaneNormal.Y() * fPlaneVectorA.Z() - fPlaneNormal.Z() * fPlaneVectorA.Y() ); + fPlaneVectorB.SetY( fPlaneNormal.Z() * fPlaneVectorA.X() - fPlaneNormal.X() * fPlaneVectorA.Z() ); + fPlaneVectorB.SetZ( fPlaneNormal.X() * fPlaneVectorA.Y() - fPlaneNormal.Y() * fPlaneVectorA.X() ); + + fPlaneVectorA = fPlaneVectorA.Unit(); + fPlaneVectorB = fPlaneVectorB.Unit(); + + if ( fSwapAxis) + { + swap( fPlaneVectorA, fPlaneVectorB); + } + vismsg( eInfo ) << "Plane vectors are: "< fEpsilon || fPlaneVectorA.Dot( fPlaneNormal ) < -1.*fEpsilon ) + { + vismsg( eWarning ) <<"Scalar product of PlaneVector A and NormalVector is "< fEpsilon || fPlaneVectorB.Dot( fPlaneNormal ) < -1.*fEpsilon ) + { + vismsg( eWarning ) <<"Scalar product of PlaneVector B and NormalVector is "<= tDirectionMagX && tDirectionMagZ >= tDirectionMagY ) + { + fPlaneVectorA.SetX( 1.0 ); + fPlaneVectorA.SetY( 0.0 ); + fPlaneVectorA.SetZ( 0.0 ); + + if ( fPlaneNormal.Z() > fEpsilon || fPlaneNormal.Z() < -1.*fEpsilon ) + { + fPlaneVectorA.SetZ( -1.0 * fPlaneNormal.X() / fPlaneNormal.Z() ); + } + + fPlaneVectorB.SetX( fPlaneNormal.Y() * fPlaneVectorA.Z() - fPlaneNormal.Z() * fPlaneVectorA.Y() ); + fPlaneVectorB.SetY( fPlaneNormal.Z() * fPlaneVectorA.X() - fPlaneNormal.X() * fPlaneVectorA.Z() ); + fPlaneVectorB.SetZ( fPlaneNormal.X() * fPlaneVectorA.Y() - fPlaneNormal.Y() * fPlaneVectorA.X() ); + + fPlaneVectorA = fPlaneVectorA.Unit(); + fPlaneVectorB = fPlaneVectorB.Unit(); + + if ( fSwapAxis) + { + swap( fPlaneVectorA, fPlaneVectorB); + } + vismsg( eInfo ) << "Plane vectors are: "< fEpsilon || fPlaneVectorA.Dot( fPlaneNormal ) < -1.*fEpsilon ) + { + vismsg( eWarning ) <<"Scalar product of PlaneVector A and NormalVector is "< fEpsilon || fPlaneVectorB.Dot( fPlaneNormal ) < -1.*fEpsilon ) + { + vismsg( eWarning ) <<"Scalar product of PlaneVector B and NormalVector is "<Path().operator ->(), + tPolyLinePoints); + + //create rotated points by rotating the open points from start to stop angle and leaving multiple points on the trail. Get a mesh of points (one group is one rotated open point). + ShellMesh tMeshPoints; + OpenPointsToShellMesh(tPolyLinePoints, tMeshPoints,aShellPolyLineSurface->ShellMeshCount(),aShellPolyLineSurface->ShellMeshPower(), aShellPolyLineSurface->AngleStart(),aShellPolyLineSurface->AngleStop()); + + //create circle and parallel lines + ArcLines tArcLines; + ParallelLines tParallelLines; + ShellMeshToArcLines(tMeshPoints, tArcLines); //Connect points that belong to one arc line e.g. the points directly left behind from open points in one group. + ShellMeshToParallelLines(tMeshPoints, tParallelLines); // connect the points in between two groups to create lines from one arc to another. A group are all lines between two arcs. + + //create intersection from lines by cutting the lines with the plane, saving the intersection points depending on what kind of line was cut. + IntersectionPoints tArcIntersections; + IntersectionPoints tParallelIntersections; + LinesToIntersections(tArcLines, tArcIntersections); + LinesToIntersections(tParallelLines, tParallelIntersections); + + + //combine circle and parallel intersections alternating, starting and ending with circle since every figure starts and ends with a circle. + IntersectionPoints tAllIntersections; + IntersectionPoints::SetCIt tCircleSetIt = + tArcIntersections.fData.begin(); + IntersectionPoints::SetCIt tParallelSetIt = + tParallelIntersections.fData.begin(); + tAllIntersections.fData.push_back(*tCircleSetIt); + tCircleSetIt++; + while (tCircleSetIt != tArcIntersections.fData.end()) { + tAllIntersections.fData.push_back(*tParallelSetIt); + tAllIntersections.fData.push_back(*tCircleSetIt); + tParallelSetIt++; + tCircleSetIt++; + } + //This should have ordered the points roughly for simple cases. + + //Ordering the points more sophisticated and pushing them into groups. Every group is one poly lines to be drawn. + OrderedPoints tOrderedPoints; + ShellIntersectionPointsToOrderedPoints(tAllIntersections, tOrderedPoints); + + OrderedPointsToROOTSurface(tOrderedPoints); // Creating the ROOT poly lines. + + //clear surface + fCurrentSurface = NULL; + return; } void KGROOTGeometryPainter::VisitShellPathSurface( KGShellPolyLoopSurface* ) { - vismsg( eWarning ) << "shell surfaces are not yet supported by the root geometry painter!"<* aPortHousingSurface) + { + KSmartPointer< KGPortHousing > fPortHousing = aPortHousingSurface ->GetObject(); + + //First we compute the main cylinder. + PortMesh tMainPortMesh; + ClosedPointsToMainPortMesh(fPortHousing->GetAMain(),fPortHousing->GetBMain(), fPortHousing->GetRMain(), tMainPortMesh); + + //Creating the circle and parallel lines: + + CircleLines tCircleLines; + ParallelLines tParallelLines; + PortMeshToCircleLines(tMainPortMesh, tCircleLines); + PortMeshToParallelLines(tMainPortMesh, tParallelLines); + + //create intersection from lines + IntersectionPoints tCircleIntersections; + IntersectionPoints tParallelIntersections; + LinesToIntersections( tCircleLines, tCircleIntersections ); + LinesToIntersections( tParallelLines, tParallelIntersections ); + + //combine circle and parallel intersections alternating, starting and ending with circle + IntersectionPoints tAllIntersections; + IntersectionPoints::SetCIt tCircleSetIt = tCircleIntersections.fData.begin(); + IntersectionPoints::SetCIt tParallelSetIt = tParallelIntersections.fData.begin(); + tAllIntersections.fData.push_back( *tCircleSetIt ); + tCircleSetIt++; + while ( tCircleSetIt != tCircleIntersections.fData.end() ) + { + tAllIntersections.fData.push_back( *tParallelSetIt ); + tAllIntersections.fData.push_back( *tCircleSetIt ); + tParallelSetIt++; + tCircleSetIt++; + } + + OrderedPoints tMainOrderedPoints; + IntersectionPointsToOrderedPoints( tAllIntersections, tMainOrderedPoints); + + //Now we try to commute the various ports. + + SubPortOrderedPoints tSubPortPoints; + + for(unsigned int i = 0; i < fPortHousing->GetNPorts(); i++){ + if( const KGPortHousing::RectangularPort* r = dynamic_cast< const KGPortHousing::RectangularPort* >( fPortHousing->GetPort( i ) ) ){ + vismsg(eWarning) << "Rectangular Ports yet to be implemented, aborting sub port house mesh." << eom; + delete r; + } + else if( const KGPortHousing::CircularPort* c = dynamic_cast< const KGPortHousing::CircularPort* >( fPortHousing->GetPort( i ) ) ){ + PortMesh tSubPortMesh; + ClosedPointsToSubPortMesh(c, tSubPortMesh); + + CircleLines tSubCircleLines; + ParallelLines tSubParallelLines; + PortMeshToCircleLines(tSubPortMesh, tSubCircleLines); + PortMeshToParallelLines(tSubPortMesh, tSubParallelLines); + + //create intersection from lines + IntersectionPoints tSubCircleIntersections; + IntersectionPoints tSubParallelIntersections; + LinesToIntersections( tSubCircleLines, tSubCircleIntersections ); + LinesToIntersections( tSubParallelLines, tSubParallelIntersections ); + + //combine circle and parallel intersections alternating, starting and ending with circle + IntersectionPoints tAllSubIntersections; + IntersectionPoints::SetCIt tSubCircleSetIt = tSubCircleIntersections.fData.begin(); + IntersectionPoints::SetCIt tSubParallelSetIt = tSubParallelIntersections.fData.begin(); + tAllSubIntersections.fData.push_back( *tSubCircleSetIt ); + tSubCircleSetIt++; + while ( tSubCircleSetIt != tSubCircleIntersections.fData.end() ) + { + tAllSubIntersections.fData.push_back( *tSubParallelSetIt ); + tAllSubIntersections.fData.push_back( *tSubCircleSetIt ); + tSubParallelSetIt++; + tSubCircleSetIt++; + } + + OrderedPoints tSubOrderedPoints; + + IntersectionPointsToOrderedPoints( tAllSubIntersections, tSubOrderedPoints); + + //Skip if there are no intersections. + if(tSubOrderedPoints.fData.size() == 0) continue; + + tSubPortPoints.fData.push_back(tSubOrderedPoints); + } + } + + //If the SubPorts had intersections with the plane, we need to properly take this into account and mix them with the OrderedPoints of Main Port. + OrderedPoints tOrderedPoints; + if(tSubPortPoints.fData.size() != 0){ + OrderedPoints SubPortSet = tSubPortPoints.fData.front(); + CombineOrderedPoints(tMainOrderedPoints, tSubPortPoints, tOrderedPoints); + } + + OrderedPointsToROOTSurface( tOrderedPoints ); + + //clear surface + fCurrentSurface = NULL; + + return; + } + + void KGROOTGeometryPainter::VisitWrappedSurface( KGWrappedSurface* aBeamSurface){ + + KSmartPointer fBeam = aBeamSurface->GetObject(); + vector> tStartCoord = fBeam->GetStartCoords(); + vector> tEndCoord = fBeam -> GetEndCoords(); + + //Create a Mesh + BeamMesh tBeamMesh; + ClosedPointsToBeamMesh(tStartCoord, tEndCoord, tBeamMesh); + + //Create Lines + CircleLines tCircleLines; + ParallelLines tParallelLines; + BeamMeshToCircleLines(tBeamMesh,tCircleLines); + BeamMeshToParallelLines(tBeamMesh,tParallelLines); + + //create intersection from lines + IntersectionPoints tCircleIntersections; + IntersectionPoints tParallelIntersections; + LinesToIntersections( tCircleLines, tCircleIntersections ); + LinesToIntersections( tParallelLines, tParallelIntersections ); + + //combine circle and parallel intersections alternating, starting and ending with circle + IntersectionPoints tAllIntersections; + IntersectionPoints::SetCIt tCircleSetIt = tCircleIntersections.fData.begin(); + IntersectionPoints::SetCIt tParallelSetIt = tParallelIntersections.fData.begin(); + tAllIntersections.fData.push_back( *tCircleSetIt ); + tCircleSetIt++; + while ( tCircleSetIt != tCircleIntersections.fData.end() ) + { + tAllIntersections.fData.push_back( *tParallelSetIt ); + tAllIntersections.fData.push_back( *tCircleSetIt ); + tParallelSetIt++; + tCircleSetIt++; + } + + OrderedPoints tOrderedPoints; + IntersectionPointsToOrderedPoints( tAllIntersections, tOrderedPoints); + + OrderedPointsToROOTSurface( tOrderedPoints ); + + return; + } + void KGROOTGeometryPainter::VisitWrappedSurface(KGWrappedSurface* aComplexAnnulus) + { + KSmartPointer fComplexAnnulus = aComplexAnnulus->GetObject(); + + //Meshing the main circle + + FlatMesh tFlatMesh; + ClosedPointsToFlatMesh(fComplexAnnulus, tFlatMesh); + + //Create Lines + + CircleLines tMainCircleLines; + FlatMeshToCircleLines(tFlatMesh, tMainCircleLines); + + //Create Intersections + + IntersectionPoints tMainCircleIntersections; + LinesToIntersections(tMainCircleLines, tMainCircleIntersections); + + //Meshing the sub rings + + RingMesh tRingMesh; + ClosedPointsToRingMesh(fComplexAnnulus, tRingMesh); + + //Create Lines + + CircleLines tRingCircleLines; + RingMeshToCircleLines(tRingMesh,tRingCircleLines); + + //Create Intersections + + IntersectionPoints tRingIntersections; + LinesToIntersections(tRingCircleLines,tRingIntersections); + + //Combining both Intersectionpoints to ordered points + + OrderedPoints tOrderedPoint; + IntersectionPointsToOrderedPoints(tMainCircleIntersections, tRingIntersections, tOrderedPoint); + + OrderedPointsToROOTSurface(tOrderedPoint); + + return; } + + //************** //space visitors //************** @@ -870,19 +1118,19 @@ namespace KGeoBag LinesToIntersections( tCircleLines, tCircleIntersections ); LinesToIntersections( tParallelLines, tParallelIntersections ); - //combine circle and parallel intersections alternating, starting and ending with circle - IntersectionPoints tAllIntersections; - IntersectionPoints::SetCIt tCircleSetIt = tCircleIntersections.fData.begin(); - IntersectionPoints::SetCIt tParallelSetIt = tParallelIntersections.fData.begin(); - tAllIntersections.fData.push_back( *tCircleSetIt ); - tCircleSetIt++; - while ( tCircleSetIt != tCircleIntersections.fData.end() ) - { - tAllIntersections.fData.push_back( *tParallelSetIt ); - tAllIntersections.fData.push_back( *tCircleSetIt ); - tParallelSetIt++; - tCircleSetIt++; - } + //combine circle and parallel intersections alternating, starting and ending with circle + IntersectionPoints tAllIntersections; + IntersectionPoints::SetCIt tCircleSetIt = tCircleIntersections.fData.begin(); + IntersectionPoints::SetCIt tParallelSetIt = tParallelIntersections.fData.begin(); + tAllIntersections.fData.push_back( *tCircleSetIt ); + tCircleSetIt++; + while ( tCircleSetIt != tCircleIntersections.fData.end() ) + { + tAllIntersections.fData.push_back( *tParallelSetIt ); + tAllIntersections.fData.push_back( *tCircleSetIt ); + tParallelSetIt++; + tCircleSetIt++; + } OrderedPoints tOrderedPoints; IntersectionPointsToOrderedPoints( tAllIntersections, tOrderedPoints); @@ -890,10 +1138,10 @@ namespace KGeoBag CombineOrderedPoints( tOrderedPoints ); //connect last and first point (Todo::This doesnt work out for some cases) - for ( OrderedPoints::SetIt tSetIt = tOrderedPoints.fData.begin(); tSetIt != tOrderedPoints.fData.end(); tSetIt++ ) - { - (*tSetIt).fData.push_back( *((*tSetIt).fData.begin()) ); - } + for ( OrderedPoints::SetIt tSetIt = tOrderedPoints.fData.begin(); tSetIt != tOrderedPoints.fData.end(); tSetIt++ ) + { + (*tSetIt).fData.push_back( *((*tSetIt).fData.begin()) ); + } OrderedPointsToROOTSpace( tOrderedPoints ); @@ -925,19 +1173,19 @@ namespace KGeoBag LinesToIntersections( tCircleLines, tCircleIntersections ); LinesToIntersections( tParallelLines, tParallelIntersections ); - //combine circle and parallel intersections alternating, starting and ending with circle - IntersectionPoints tAllIntersections; - IntersectionPoints::SetCIt tCircleSetIt = tCircleIntersections.fData.begin(); - IntersectionPoints::SetCIt tParallelSetIt = tParallelIntersections.fData.begin(); - tAllIntersections.fData.push_back( *tCircleSetIt ); - tCircleSetIt++; - while ( tCircleSetIt != tCircleIntersections.fData.end() ) - { - tAllIntersections.fData.push_back( *tParallelSetIt ); - tAllIntersections.fData.push_back( *tCircleSetIt ); - tParallelSetIt++; - tCircleSetIt++; - } + //combine circle and parallel intersections alternating, starting and ending with circle + IntersectionPoints tAllIntersections; + IntersectionPoints::SetCIt tCircleSetIt = tCircleIntersections.fData.begin(); + IntersectionPoints::SetCIt tParallelSetIt = tParallelIntersections.fData.begin(); + tAllIntersections.fData.push_back( *tCircleSetIt ); + tCircleSetIt++; + while ( tCircleSetIt != tCircleIntersections.fData.end() ) + { + tAllIntersections.fData.push_back( *tParallelSetIt ); + tAllIntersections.fData.push_back( *tCircleSetIt ); + tParallelSetIt++; + tCircleSetIt++; + } OrderedPoints tOrderedPoints; IntersectionPointsToOrderedPoints( tAllIntersections, tOrderedPoints); @@ -945,10 +1193,10 @@ namespace KGeoBag CombineOrderedPoints( tOrderedPoints ); //connect last and first point (Todo::This doesnt work out for some cases) - for ( OrderedPoints::SetIt tSetIt = tOrderedPoints.fData.begin(); tSetIt != tOrderedPoints.fData.end(); tSetIt++ ) - { - (*tSetIt).fData.push_back( *((*tSetIt).fData.begin()) ); - } + for ( OrderedPoints::SetIt tSetIt = tOrderedPoints.fData.begin(); tSetIt != tOrderedPoints.fData.end(); tSetIt++ ) + { + (*tSetIt).fData.push_back( *((*tSetIt).fData.begin()) ); + } OrderedPointsToROOTSpace( tOrderedPoints ); @@ -980,19 +1228,19 @@ namespace KGeoBag LinesToIntersections( tCircleLines, tCircleIntersections ); LinesToIntersections( tParallelLines, tParallelIntersections ); - //combine circle and parallel intersections alternating, starting and ending with circle - IntersectionPoints tAllIntersections; - IntersectionPoints::SetCIt tCircleSetIt = tCircleIntersections.fData.begin(); - IntersectionPoints::SetCIt tParallelSetIt = tParallelIntersections.fData.begin(); - tAllIntersections.fData.push_back( *tCircleSetIt ); - tCircleSetIt++; - while ( tCircleSetIt != tCircleIntersections.fData.end() ) - { - tAllIntersections.fData.push_back( *tParallelSetIt ); - tAllIntersections.fData.push_back( *tCircleSetIt ); - tParallelSetIt++; - tCircleSetIt++; - } + //combine circle and parallel intersections alternating, starting and ending with circle + IntersectionPoints tAllIntersections; + IntersectionPoints::SetCIt tCircleSetIt = tCircleIntersections.fData.begin(); + IntersectionPoints::SetCIt tParallelSetIt = tParallelIntersections.fData.begin(); + tAllIntersections.fData.push_back( *tCircleSetIt ); + tCircleSetIt++; + while ( tCircleSetIt != tCircleIntersections.fData.end() ) + { + tAllIntersections.fData.push_back( *tParallelSetIt ); + tAllIntersections.fData.push_back( *tCircleSetIt ); + tParallelSetIt++; + tCircleSetIt++; + } OrderedPoints tOrderedPoints; IntersectionPointsToOrderedPoints( tAllIntersections, tOrderedPoints); @@ -1000,10 +1248,10 @@ namespace KGeoBag CombineOrderedPoints( tOrderedPoints ); //connect last and first point (Todo::This doesnt work out for some cases) - for ( OrderedPoints::SetIt tSetIt = tOrderedPoints.fData.begin(); tSetIt != tOrderedPoints.fData.end(); tSetIt++ ) - { - (*tSetIt).fData.push_back( *((*tSetIt).fData.begin()) ); - } + for ( OrderedPoints::SetIt tSetIt = tOrderedPoints.fData.begin(); tSetIt != tOrderedPoints.fData.end(); tSetIt++ ) + { + (*tSetIt).fData.push_back( *((*tSetIt).fData.begin()) ); + } OrderedPointsToROOTSpace( tOrderedPoints ); @@ -1034,19 +1282,19 @@ namespace KGeoBag LinesToIntersections( tCircleLines, tCircleIntersections ); LinesToIntersections( tParallelLines, tParallelIntersections ); - //combine circle and parallel intersections alternating, starting and ending with circle - IntersectionPoints tAllIntersections; - IntersectionPoints::SetCIt tCircleSetIt = tCircleIntersections.fData.begin(); - IntersectionPoints::SetCIt tParallelSetIt = tParallelIntersections.fData.begin(); - tAllIntersections.fData.push_back( *tCircleSetIt ); - tCircleSetIt++; - while ( tCircleSetIt != tCircleIntersections.fData.end() ) - { - tAllIntersections.fData.push_back( *tParallelSetIt ); - tAllIntersections.fData.push_back( *tCircleSetIt ); - tParallelSetIt++; - tCircleSetIt++; - } + //combine circle and parallel intersections alternating, starting and ending with circle + IntersectionPoints tAllIntersections; + IntersectionPoints::SetCIt tCircleSetIt = tCircleIntersections.fData.begin(); + IntersectionPoints::SetCIt tParallelSetIt = tParallelIntersections.fData.begin(); + tAllIntersections.fData.push_back( *tCircleSetIt ); + tCircleSetIt++; + while ( tCircleSetIt != tCircleIntersections.fData.end() ) + { + tAllIntersections.fData.push_back( *tParallelSetIt ); + tAllIntersections.fData.push_back( *tCircleSetIt ); + tParallelSetIt++; + tCircleSetIt++; + } OrderedPoints tOrderedPoints; IntersectionPointsToOrderedPoints( tAllIntersections, tOrderedPoints); @@ -1080,28 +1328,28 @@ namespace KGeoBag LinesToIntersections( tCircleLines, tCircleIntersections ); LinesToIntersections( tParallelLines, tParallelIntersections ); - //combine circle and parallel intersections alternating, starting and ending with circle - IntersectionPoints tAllIntersections; - IntersectionPoints::SetCIt tCircleSetIt = tCircleIntersections.fData.begin(); - IntersectionPoints::SetCIt tParallelSetIt = tParallelIntersections.fData.begin(); - tAllIntersections.fData.push_back( *tCircleSetIt ); - tCircleSetIt++; - while ( tCircleSetIt != tCircleIntersections.fData.end() ) - { - tAllIntersections.fData.push_back( *tParallelSetIt ); - tAllIntersections.fData.push_back( *tCircleSetIt ); - tParallelSetIt++; - tCircleSetIt++; - } + //combine circle and parallel intersections alternating, starting and ending with circle + IntersectionPoints tAllIntersections; + IntersectionPoints::SetCIt tCircleSetIt = tCircleIntersections.fData.begin(); + IntersectionPoints::SetCIt tParallelSetIt = tParallelIntersections.fData.begin(); + tAllIntersections.fData.push_back( *tCircleSetIt ); + tCircleSetIt++; + while ( tCircleSetIt != tCircleIntersections.fData.end() ) + { + tAllIntersections.fData.push_back( *tParallelSetIt ); + tAllIntersections.fData.push_back( *tCircleSetIt ); + tParallelSetIt++; + tCircleSetIt++; + } OrderedPoints tOrderedPoints; IntersectionPointsToOrderedPoints( tAllIntersections, tOrderedPoints); //connect last and first point (Todo::This doesnt work out for some cases) - for ( OrderedPoints::SetIt tSetIt = tOrderedPoints.fData.begin(); tSetIt != tOrderedPoints.fData.end(); tSetIt++ ) - { - (*tSetIt).fData.push_back( *((*tSetIt).fData.begin()) ); - } + for ( OrderedPoints::SetIt tSetIt = tOrderedPoints.fData.begin(); tSetIt != tOrderedPoints.fData.end(); tSetIt++ ) + { + (*tSetIt).fData.push_back( *((*tSetIt).fData.begin()) ); + } OrderedPointsToROOTSpace( tOrderedPoints ); @@ -1112,13 +1360,13 @@ namespace KGeoBag } void KGROOTGeometryPainter::VisitExtrudedClosedPathSpace( KGExtrudedCircleSpace* ) { - vismsg( eWarning ) << "extruded spaces are not yet supported by the root geometry painter!"< shell mesh vertices" << eom ); + + return; + } + + void KGROOTGeometryPainter::ClosedPointsRotatedToTorusMesh( const ClosedPoints& aPoints, TorusMesh& aMesh ) { unsigned int tArc = fCurrentData->GetArc(); @@ -1408,868 +1702,1973 @@ namespace KGeoBag return; } - //************** - //line functions - //************** - - void KGROOTGeometryPainter::TubeMeshToCircleLines( const TubeMesh aMesh, CircleLines& aCircleLines ) + void KGROOTGeometryPainter::ClosedPointsToMainPortMesh(const double* PointA, const double* PointB, const double aRadius, PortMesh& aMesh) { - //object allocation - KThreeVector tPoint1, tPoint2; - Lines::Group tCircleLinesGroup; + KThreeVector FrontPoint(PointA); + KThreeVector BackPoint(PointB); - //create lines from tube mesh - for( TubeMesh::SetCIt tSetIt = aMesh.fData.begin(); tSetIt != aMesh.fData.end(); tSetIt++ ) + //In order to later have a very fine grid to fit in the holes created by the subports, we need more than just two circles. + unsigned int tArc = fCurrentData->GetArc(); + + KThreeVector tPoint; + PortMesh::Group tGroup; + double tCircleFraction; //Number of points along a circle + double aStartPointFront = FrontPoint.X() + aRadius; + + for(unsigned int tCircleCount = 0; tCircleCount < tArc; tCircleCount++ ) { - tCircleLinesGroup.clear(); - TubeMesh::GroupCIt tGroupIt = tSetIt->begin(); - //get case, when point is on z axis (no tube mesh, just single point) - if ( tSetIt->size() == 1 ) - { - LocalToGlobal( *tGroupIt, tPoint1 ); - tCircleLinesGroup.push_back( Lines::Line( tPoint1, tPoint1 ) ); - tCircleLinesGroup.push_back( Lines::Line( tPoint1, tPoint1 ) ); - aCircleLines.fData.push_back( tCircleLinesGroup ); - continue; - } - while ( ( tGroupIt + 1 ) != tSetIt->end() ) - { - LocalToGlobal( *tGroupIt, tPoint1 ); - LocalToGlobal( *(tGroupIt + 1), tPoint2 ); - tCircleLinesGroup.push_back( Lines::Line( tPoint1, tPoint2 ) ); - tGroupIt++; - } - //last point and first point - tCircleLinesGroup.push_back( Lines::Line( tCircleLinesGroup.back().second, tCircleLinesGroup.front().first ) ); - aCircleLines.fData.push_back( tCircleLinesGroup ); + tCircleFraction = (double) (tCircleCount) / (double) (tArc); + tPoint.Y() = aStartPointFront * cos( 2. * KConst::Pi() * tCircleFraction ); + tPoint.X() = aStartPointFront * sin( 2. * KConst::Pi() * tCircleFraction ); + tPoint.Z() = FrontPoint.Z(); + tGroup.push_back( tPoint ); } - vismsg_debug( "tube mesh into <" << aCircleLines.fData.size() << "> circle line groups with <" << tCircleLinesGroup.size() <<"> lines each" << eom ); + aMesh.fData.push_back(tGroup); + tGroup.clear(); + double tFraction; //Number of circles - } + for(unsigned int tCount = 0; tCount < tArc; tCount ++){ + tFraction = (double) (tCount) / (double) (tArc); + KThreeVector NextPoint = FrontPoint + (BackPoint - FrontPoint)*tFraction; + double aNextStartPoint = NextPoint.X() + aRadius; + for(unsigned int tCircleCount = 0; tCircleCount < tArc; tCircleCount ++ ) + { + tCircleFraction = (double) (tCircleCount) / (double) (tArc) ; + tPoint.Y() = aNextStartPoint * cos( 2. * KConst::Pi() * tCircleFraction ); + tPoint.X() = aNextStartPoint * sin( 2. * KConst::Pi() * tCircleFraction ); + tPoint.Z() = NextPoint.Z(); + tGroup.push_back( tPoint ); + } + aMesh.fData.push_back(tGroup); + tGroup.clear(); + } - void KGROOTGeometryPainter::TubeMeshToParallelLines( const TubeMesh aMesh, ParallelLines& aParallelLines ) + return; + } + + void KGROOTGeometryPainter::ClosedPointsToSubPortMesh(const KGPortHousing::CircularPort* aCircularPort, PortMesh& aMesh) { - //object allocation - KThreeVector tPoint1, tPoint2; - Lines::Group tParallelLinesGroup; + unsigned int tArc = fCurrentData->GetArc(); - //create lines from tube mesh - TubeMesh::SetCIt tSetIt = aMesh.fData.begin(); - while( ( tSetIt + 1 ) != aMesh.fData.end() ) - { - tParallelLinesGroup.clear(); - - //get case when user is stupid and creates e.g. a cylinder without radius - if ( tSetIt->size() == 1 && ( tSetIt + 1)->size() == 1 ) - { - vismsg ( eWarning ) <<"to less points in tube mesh, check your geometry"<size() == 1 ) - { - KThreeVector tSinglePoint = *(tSetIt->begin()); - LocalToGlobal( tSinglePoint, tPoint1 ); - for( TubeMesh::GroupCIt tNextGroupIt = ( tSetIt + 1)->begin(); tNextGroupIt != ( tSetIt + 1)->end(); tNextGroupIt ++ ) - { - LocalToGlobal( *tNextGroupIt, tPoint2 ); - tParallelLinesGroup.push_back( Lines::Line( tPoint1, tPoint2 ) ); - } - aParallelLines.fData.push_back( tParallelLinesGroup ); - tSetIt++; - continue; - } - - TubeMesh::GroupCIt tNextGroupIt = ( tSetIt + 1)->begin(); - //get case, when next point is on z axis (no tube mesh, just single point) - if ( ( tSetIt + 1)->size() == 1 ) - { - KThreeVector tSinglePoint = *( (tSetIt + 1)->begin()); - LocalToGlobal( tSinglePoint, tPoint2 ); - for( TubeMesh::GroupCIt tGroupIt = tSetIt->begin(); tGroupIt != tSetIt->end(); tGroupIt++ ) - { - LocalToGlobal( *tGroupIt, tPoint1 ); - tParallelLinesGroup.push_back( Lines::Line( tPoint1, tPoint2 ) ); - tNextGroupIt++; - } - aParallelLines.fData.push_back( tParallelLinesGroup ); - tSetIt++; - continue; - } + KThreeVector aStartPoint, anEndPoint; + KThreeVector aNorm; - //normal case if all groups have same size - for( TubeMesh::GroupCIt tGroupIt = tSetIt->begin(); tGroupIt != tSetIt->end(); tGroupIt++ ) - { - LocalToGlobal( *tGroupIt, tPoint1 ); - LocalToGlobal( *tNextGroupIt, tPoint2 ); - tParallelLinesGroup.push_back( Lines::Line( tPoint1, tPoint2 ) ); - tNextGroupIt++; - } - aParallelLines.fData.push_back( tParallelLinesGroup ); - tSetIt++; - } + aStartPoint.X() = aCircularPort->GetASub(0); + aStartPoint.Y() = aCircularPort->GetASub(1); + aStartPoint.Z() = aCircularPort->GetASub(2); - vismsg_debug( "tube mesh into <" << aParallelLines.fData.size() << "> parallel line groups with <" << tParallelLinesGroup.size() <<"> lines each" << eom ); + aNorm.X() = aCircularPort->GetNorm(0); + aNorm.Y() = aCircularPort->GetNorm(1); + aNorm.Z() = aCircularPort->GetNorm(2); - } + double aRadius = aCircularPort->GetRSub(); - void KGROOTGeometryPainter::TorusMeshToCircleLines( const TorusMesh aMesh, CircleLines& aCircleLines ) - { - //object allocation - KThreeVector tPoint1, tPoint2; - Lines::Group tCircleLinesGroup; + //Now we want to create the two circles using the inherent functions of KGPortHousing and some coordinate transformation. - //create lines from tube mesh - for( TubeMesh::SetCIt tSetIt = aMesh.fData.begin(); tSetIt != aMesh.fData.end(); tSetIt++ ) - { - tCircleLinesGroup.clear(); - TubeMesh::GroupCIt tGroupIt = tSetIt->begin(); - while ( ( tGroupIt + 1 ) != tSetIt->end() ) - { - LocalToGlobal( *tGroupIt, tPoint1 ); + KThreeVector tPointLocal1, tPointGlobal1; + KThreeVector aLocalStart; + PortMesh::Group tGroup1, tGroup2; + + double tFraction; + const KGCoordinateTransform* fCoordTransform = aCircularPort->GetCoordinateTransform(); + + fCoordTransform->ConvertToLocalCoords(aStartPoint,aLocalStart,false); + + //alright, now we have to rotate those points around the local z axis. + aLocalStart.X() += aRadius; + for(unsigned int tCount = 0; tCount < tArc; tCount++ ) + { + tFraction = (double) (tCount) / (double) (tArc); + tPointLocal1.Y() = aLocalStart.X() * cos( 2. * KConst::Pi() * tFraction ); + tPointLocal1.X() = aLocalStart.X() * sin( 2. * KConst::Pi() * tFraction ); + tPointLocal1.Z() = aLocalStart.Z(); + + fCoordTransform->ConvertToGlobalCoords(tPointLocal1, tPointGlobal1, false); + + tGroup1.push_back(tPointGlobal1); + } + + //From the first circle group we create parallel lines for every point using the norm vector given. + //we search for a point with distance to the z-axis equal the radius of the main cylinder. + + double aMainRadius = aCircularPort->GetPortHousing()->GetRMain(); + + for(PortMesh::GroupCIt tGroupIt1 = tGroup1.begin(); tGroupIt1 != tGroup1.end(); tGroupIt1 ++){ + KThreeVector tCircularStartPoint = *tGroupIt1; + KThreeVector tCircularEndPoint; + + double aHelper = (tCircularStartPoint.X()*aNorm.X() + tCircularStartPoint.Y()*aNorm.Y())/sqrt(aNorm.X()*aNorm.X() + aNorm.Y()*aNorm.Y()); + double aLineParameter = sqrt(aMainRadius*aMainRadius - tCircularStartPoint.X()*tCircularStartPoint.X() - tCircularStartPoint.Y()*tCircularStartPoint.Y() + aHelper*aHelper) - aHelper; + tCircularEndPoint = tCircularStartPoint + aLineParameter*aNorm; + tGroup2.push_back(tCircularEndPoint); + } + + aMesh.fData.push_back(tGroup1); + aMesh.fData.push_back(tGroup2); + + tGroup1.clear(); + tGroup2.clear(); + + return; + } + void KGROOTGeometryPainter::ClosedPointsToBeamMesh(const vector> aStartCoord, const vector> anEndCoord, BeamMesh& aMesh) + { + BeamMesh::Group tGroup; + + for(vector>::const_iterator tSetIt = aStartCoord.begin(); tSetIt != aStartCoord.end(); tSetIt++){ + vector tCoordinates = *tSetIt; + KThreeVector tPoint(tCoordinates.at(0),tCoordinates.at(1),tCoordinates.at(2)); + tGroup.push_back(tPoint); + } + + aMesh.fData.push_back(tGroup); + tGroup.clear(); + + for(vector>::const_iterator tSetIt = anEndCoord.begin(); tSetIt != anEndCoord.end(); tSetIt++){ + vector tCoordinates = *tSetIt; + KThreeVector tPoint(tCoordinates.at(0),tCoordinates.at(1),tCoordinates.at(2)); + tGroup.push_back(tPoint); + } + + aMesh.fData.push_back(tGroup); + + return; + } + void KGROOTGeometryPainter::ClosedPointsToFlatMesh(const KSmartPointer aComplexAnnulus, FlatMesh& aMesh) + { + unsigned int tArc = fCurrentData->GetArc(); + + double tRadius = aComplexAnnulus->GetRMain(); + FlatMesh::Group tGroup; + + KThreeVector aStartPoint; + KThreeVector tPoint; + KThreeVector xNorm(1,0,0); + aStartPoint = xNorm*tRadius; + + double tFraction; + + for(unsigned int tCount = 0; tCount < tArc; tCount++ ) + { + tFraction = (double) (tCount) / (double) (tArc); + tPoint.Y() = aStartPoint.X() * cos( 2. * KConst::Pi() * tFraction ); + tPoint.X() = aStartPoint.X() * sin( 2. * KConst::Pi() * tFraction ); + tPoint.Z() = aStartPoint.Z(); + tGroup.push_back(tPoint); + } + + aMesh.fData.push_back(tGroup); + tGroup.clear(); + + return; + } + + void KGROOTGeometryPainter::ClosedPointsToRingMesh(const KSmartPointer aComplexAnnulus, RingMesh& aMesh) + { + unsigned int tArc = fCurrentData->GetArc(); + + RingMesh::Group tGroup; + + for(unsigned int i = 0; i < aComplexAnnulus->GetNRings(); i++){ + const KGComplexAnnulus::Ring* aRing = aComplexAnnulus->GetRing(i); + double tRadius = aRing->GetRSub(); + KThreeVector aGlobalStart(aRing->GetASub(0), aRing->GetASub(1),0); + KThreeVector aLocalStart; + KThreeVector xNorm(1,0,0); + const KGCoordinateTransform* fCoordTransform = aRing->GetCoordinateTransform(); + + fCoordTransform->ConvertToLocalCoords(aGlobalStart,aLocalStart,false); + + aLocalStart += tRadius*xNorm; + KThreeVector tGlobalPoint, tLocalPoint; + + double tFraction; + for(unsigned int tCount = 0; tCount < tArc; tCount++ ) + { + tFraction = (double) (tCount) / (double) (tArc); + tLocalPoint.Y() = aLocalStart.X() * cos( 2. * KConst::Pi() * tFraction ); + tLocalPoint.X() = aLocalStart.X() * sin( 2. * KConst::Pi() * tFraction ); + tLocalPoint.Z() = aLocalStart.Z(); + + fCoordTransform->ConvertToGlobalCoords(tLocalPoint,tGlobalPoint,false); + + tGroup.push_back(tGlobalPoint); + } + aMesh.fData.push_back(tGroup); + tGroup.clear(); + } + return; + } + + + //************** + //line functions + //************** + + void KGROOTGeometryPainter::TubeMeshToCircleLines( const TubeMesh aMesh, CircleLines& aCircleLines ) + { + //object allocation + KThreeVector tPoint1, tPoint2; + Lines::Group tCircleLinesGroup; + + //create lines from tube mesh + for( TubeMesh::SetCIt tSetIt = aMesh.fData.begin(); tSetIt != aMesh.fData.end(); tSetIt++ ) + { + tCircleLinesGroup.clear(); + TubeMesh::GroupCIt tGroupIt = tSetIt->begin(); + //get case, when point is on z axis (no tube mesh, just single point) + if ( tSetIt->size() == 1 ) + { + LocalToGlobal( *tGroupIt, tPoint1 ); + tCircleLinesGroup.push_back( Lines::Line( tPoint1, tPoint1 ) ); + tCircleLinesGroup.push_back( Lines::Line( tPoint1, tPoint1 ) ); + aCircleLines.fData.push_back( tCircleLinesGroup ); + continue; + } + while ( ( tGroupIt + 1 ) != tSetIt->end() ) + { + LocalToGlobal( *tGroupIt, tPoint1 ); + LocalToGlobal( *(tGroupIt + 1), tPoint2 ); + tCircleLinesGroup.push_back( Lines::Line( tPoint1, tPoint2 ) ); + tGroupIt++; + } + //last point and first point + tCircleLinesGroup.push_back( Lines::Line( tCircleLinesGroup.back().second, tCircleLinesGroup.front().first ) ); + aCircleLines.fData.push_back( tCircleLinesGroup ); + } + + vismsg_debug( "tube mesh into <" << aCircleLines.fData.size() << "> circle line groups with <" << tCircleLinesGroup.size() <<"> lines each" << eom ); + + } + void KGROOTGeometryPainter::ShellMeshToArcLines( const ShellMesh aMesh, ArcLines& anArcLines ) + { + //object allocation + KThreeVector tPoint1, tPoint2; + Lines::Group tArcLinesGroup; + + //create lines from tube mesh + for( TubeMesh::SetCIt tSetIt = aMesh.fData.begin(); tSetIt != aMesh.fData.end(); tSetIt++ ) + { + tArcLinesGroup.clear(); + TubeMesh::GroupCIt tGroupIt = tSetIt->begin(); + //get case, when point is on z axis (no tube mesh, just single point) + if ( tSetIt->size() == 1 ) + { + LocalToGlobal( *tGroupIt, tPoint1 ); + tArcLinesGroup.push_back( Lines::Line( tPoint1, tPoint1 ) ); + tArcLinesGroup.push_back( Lines::Line( tPoint1, tPoint1 ) ); + anArcLines.fData.push_back( tArcLinesGroup ); + continue; + } + while ( ( tGroupIt + 1 ) != tSetIt->end() ) + { + LocalToGlobal( *tGroupIt, tPoint1 ); + LocalToGlobal( *(tGroupIt + 1), tPoint2 ); + tArcLinesGroup.push_back( Lines::Line( tPoint1, tPoint2 ) ); + tGroupIt++; + } + anArcLines.fData.push_back( tArcLinesGroup ); + } + + vismsg_debug( "shell mesh into <" << anArcLines.fData.size() << "> arc line groups with <" << tArcLinesGroup.size() <<"> lines each" << eom ); + + } + + + void KGROOTGeometryPainter::TubeMeshToParallelLines( const TubeMesh aMesh, ParallelLines& aParallelLines ) + { + //object allocation + KThreeVector tPoint1, tPoint2; + Lines::Group tParallelLinesGroup; + + //create lines from tube mesh + TubeMesh::SetCIt tSetIt = aMesh.fData.begin(); + while( ( tSetIt + 1 ) != aMesh.fData.end() ) + { + tParallelLinesGroup.clear(); + + //get case when user is stupid and creates e.g. a cylinder without radius + if ( tSetIt->size() == 1 && ( tSetIt + 1)->size() == 1 ) + { + vismsg ( eWarning ) <<"to less points in tube mesh, check your geometry"<size() == 1 ) + { + KThreeVector tSinglePoint = *(tSetIt->begin()); + LocalToGlobal( tSinglePoint, tPoint1 ); + for( TubeMesh::GroupCIt tNextGroupIt = ( tSetIt + 1)->begin(); tNextGroupIt != ( tSetIt + 1)->end(); tNextGroupIt ++ ) + { + LocalToGlobal( *tNextGroupIt, tPoint2 ); + tParallelLinesGroup.push_back( Lines::Line( tPoint1, tPoint2 ) ); + } + aParallelLines.fData.push_back( tParallelLinesGroup ); + tSetIt++; + continue; + } + + TubeMesh::GroupCIt tNextGroupIt = ( tSetIt + 1)->begin(); + //get case, when next point is on z axis (no tube mesh, just single point) + if ( ( tSetIt + 1)->size() == 1 ) + { + KThreeVector tSinglePoint = *( (tSetIt + 1)->begin()); + LocalToGlobal( tSinglePoint, tPoint2 ); + for( TubeMesh::GroupCIt tGroupIt = tSetIt->begin(); tGroupIt != tSetIt->end(); tGroupIt++ ) + { + LocalToGlobal( *tGroupIt, tPoint1 ); + tParallelLinesGroup.push_back( Lines::Line( tPoint1, tPoint2 ) ); + tNextGroupIt++; + } + aParallelLines.fData.push_back( tParallelLinesGroup ); + tSetIt++; + continue; + } + + //normal case if all groups have same size + for( TubeMesh::GroupCIt tGroupIt = tSetIt->begin(); tGroupIt != tSetIt->end(); tGroupIt++ ) + { + LocalToGlobal( *tGroupIt, tPoint1 ); + LocalToGlobal( *tNextGroupIt, tPoint2 ); + tParallelLinesGroup.push_back( Lines::Line( tPoint1, tPoint2 ) ); + tNextGroupIt++; + } + aParallelLines.fData.push_back( tParallelLinesGroup ); + tSetIt++; + } + + vismsg_debug( "tube mesh into <" << aParallelLines.fData.size() << "> parallel line groups with <" << tParallelLinesGroup.size() <<"> lines each" << eom ); + + } + + void KGROOTGeometryPainter::ShellMeshToParallelLines( const ShellMesh aMesh, ParallelLines& aParallelLines ) + { + //object allocation + KThreeVector tPoint1, tPoint2; + Lines::Group tParallelLinesGroup; + + //create lines from shell mesh + ShellMesh::SetCIt tSetIt = aMesh.fData.begin(); + while( ( tSetIt + 1 ) != aMesh.fData.end() ) + { + tParallelLinesGroup.clear(); + + //get case when user is stupid and creates e.g. a cylinder without radius + if ( tSetIt->size() == 1 && ( tSetIt + 1)->size() == 1 ) + { + vismsg ( eWarning ) <<"to less points in tube mesh, check your geometry"<size() == 1 ) + { + KThreeVector tSinglePoint = *(tSetIt->begin()); + LocalToGlobal( tSinglePoint, tPoint1 ); + for( ShellMesh::GroupCIt tNextGroupIt = ( tSetIt + 1)->begin(); tNextGroupIt != ( tSetIt + 1)->end(); tNextGroupIt ++ ) + { + LocalToGlobal( *tNextGroupIt, tPoint2 ); + tParallelLinesGroup.push_back( Lines::Line( tPoint1, tPoint2 ) ); + } + aParallelLines.fData.push_back( tParallelLinesGroup ); + tSetIt++; + continue; + } + + ShellMesh::GroupCIt tNextGroupIt = ( tSetIt + 1)->begin(); + //get case, when next point is on z axis (no shell mesh, just single point) + if ( ( tSetIt + 1)->size() == 1 ) + { + KThreeVector tSinglePoint = *( (tSetIt + 1)->begin()); + LocalToGlobal( tSinglePoint, tPoint2 ); + for( ShellMesh::GroupCIt tGroupIt = tSetIt->begin(); tGroupIt != tSetIt->end(); tGroupIt++ ) + { + LocalToGlobal( *tGroupIt, tPoint1 ); + tParallelLinesGroup.push_back( Lines::Line( tPoint1, tPoint2 ) ); + tNextGroupIt++; + } + aParallelLines.fData.push_back( tParallelLinesGroup ); + tSetIt++; + continue; + } + + //normal case if all groups have same size + for( ShellMesh::GroupCIt tGroupIt = tSetIt->begin(); tGroupIt != tSetIt->end(); tGroupIt++ ) + { + LocalToGlobal( *tGroupIt, tPoint1 ); + LocalToGlobal( *tNextGroupIt, tPoint2 ); + tParallelLinesGroup.push_back( Lines::Line( tPoint1, tPoint2 ) ); + tNextGroupIt++; + } + aParallelLines.fData.push_back( tParallelLinesGroup ); + tSetIt++; + } + + vismsg_debug( "shell mesh into <" << aParallelLines.fData.size() << "> parallel line groups with <" << tParallelLinesGroup.size() <<"> lines each" << eom ); + + } + + + void KGROOTGeometryPainter::TorusMeshToCircleLines( const TorusMesh aMesh, CircleLines& aCircleLines ) + { + //object allocation + KThreeVector tPoint1, tPoint2; + Lines::Group tCircleLinesGroup; + + //create lines from tube mesh + for( TubeMesh::SetCIt tSetIt = aMesh.fData.begin(); tSetIt != aMesh.fData.end(); tSetIt++ ) + { + tCircleLinesGroup.clear(); + TubeMesh::GroupCIt tGroupIt = tSetIt->begin(); + while ( ( tGroupIt + 1 ) != tSetIt->end() ) + { + LocalToGlobal( *tGroupIt, tPoint1 ); LocalToGlobal( *(tGroupIt + 1), tPoint2 ); tCircleLinesGroup.push_back( Lines::Line( tPoint1, tPoint2 ) ); - tGroupIt++; - } - //last point and first point - tCircleLinesGroup.push_back( Lines::Line( tCircleLinesGroup.back().second, tCircleLinesGroup.front().first ) ); - aCircleLines.fData.push_back( tCircleLinesGroup ); + tGroupIt++; + } + //last point and first point + tCircleLinesGroup.push_back( Lines::Line( tCircleLinesGroup.back().second, tCircleLinesGroup.front().first ) ); + aCircleLines.fData.push_back( tCircleLinesGroup ); + } + + vismsg_debug( "tube mesh into <" << aCircleLines.fData.size() << "> circle line groups with <" << tCircleLinesGroup.size() <<"> lines each" << eom ); + + } + + void KGROOTGeometryPainter::TorusMeshToParallelLines( const TorusMesh aMesh, ParallelLines& aParallelLines ) + { + //object allocation + KThreeVector tPoint1, tPoint2; + Lines::Group tParallelLinesGroup; + + //create lines from tube mesh + TubeMesh::SetCIt tSetIt = aMesh.fData.begin(); + while( ( tSetIt + 1 ) != aMesh.fData.end() ) + { + tParallelLinesGroup.clear(); + TubeMesh::GroupCIt tNextGroupIt = ( tSetIt + 1)->begin(); + for( TubeMesh::GroupCIt tGroupIt = tSetIt->begin(); tGroupIt != tSetIt->end(); tGroupIt++ ) + { + LocalToGlobal( *tGroupIt, tPoint1 ); + LocalToGlobal( *tNextGroupIt, tPoint2 ); + tParallelLinesGroup.push_back( Lines::Line( tPoint1, tPoint2 ) ); + tNextGroupIt++; + } + aParallelLines.fData.push_back( tParallelLinesGroup ); + tSetIt++; + } + + vismsg_debug( "tube mesh into <" << aParallelLines.fData.size() << "> parallel line groups with <" << tParallelLinesGroup.size() <<"> lines each" << eom ); + + } + void KGROOTGeometryPainter::PortMeshToCircleLines( const PortMesh aMesh, CircleLines& aCircleLines ) + { + //object allocation + KThreeVector tPoint1, tPoint2; + Lines::Group tCircleLinesGroup; + + //create lines from port mesh + for( PortMesh::SetCIt tSetIt = aMesh.fData.begin(); tSetIt != aMesh.fData.end(); tSetIt++ ) + { + tCircleLinesGroup.clear(); + PortMesh::GroupCIt tGroupIt = tSetIt->begin(); + //get case, when point is on z axis (no port mesh, just single point) + if ( tSetIt->size() == 1 ) + { + LocalToGlobal( *tGroupIt, tPoint1 ); + tCircleLinesGroup.push_back( Lines::Line( tPoint1, tPoint1 ) ); + tCircleLinesGroup.push_back( Lines::Line( tPoint1, tPoint1 ) ); + aCircleLines.fData.push_back( tCircleLinesGroup ); + continue; + } + while ( ( tGroupIt + 1 ) != tSetIt->end() ) + { + LocalToGlobal( *tGroupIt, tPoint1 ); + LocalToGlobal( *(tGroupIt + 1), tPoint2 ); + tCircleLinesGroup.push_back( Lines::Line( tPoint1, tPoint2 ) ); + tGroupIt++; + } + //last point and first point + tCircleLinesGroup.push_back( Lines::Line( tCircleLinesGroup.back().second, tCircleLinesGroup.front().first ) ); + aCircleLines.fData.push_back( tCircleLinesGroup ); + } + } + + void KGROOTGeometryPainter::PortMeshToParallelLines( const PortMesh aMesh, ParallelLines& aParallelLines ) + { + //object allocation + KThreeVector tPoint1, tPoint2; + Lines::Group tParallelLinesGroup; + + //create lines from port mesh + PortMesh::SetCIt tSetIt = aMesh.fData.begin(); + while( ( tSetIt + 1 ) != aMesh.fData.end() ) + { + tParallelLinesGroup.clear(); + + //get case when user is stupid and creates e.g. a cylinder without radius + if ( tSetIt->size() == 1 && ( tSetIt + 1)->size() == 1 ) + { + vismsg ( eWarning ) <<"to less points in port mesh, check your geometry"<size() == 1 ) + { + KThreeVector tSinglePoint = *(tSetIt->begin()); + LocalToGlobal( tSinglePoint, tPoint1 ); + for( PortMesh::GroupCIt tNextGroupIt = ( tSetIt + 1)->begin(); tNextGroupIt != ( tSetIt + 1)->end(); tNextGroupIt ++ ) + { + LocalToGlobal( *tNextGroupIt, tPoint2 ); + tParallelLinesGroup.push_back( Lines::Line( tPoint1, tPoint2 ) ); + } + aParallelLines.fData.push_back( tParallelLinesGroup ); + tSetIt++; + continue; + } + + PortMesh::GroupCIt tNextGroupIt = ( tSetIt + 1)->begin(); + //get case, when next point is on z axis (no port mesh, just single point) + if ( ( tSetIt + 1)->size() == 1 ) + { + KThreeVector tSinglePoint = *( (tSetIt + 1)->begin()); + LocalToGlobal( tSinglePoint, tPoint2 ); + for( PortMesh::GroupCIt tGroupIt = tSetIt->begin(); tGroupIt != tSetIt->end(); tGroupIt++ ) + { + LocalToGlobal( *tGroupIt, tPoint1 ); + tParallelLinesGroup.push_back( Lines::Line( tPoint1, tPoint2 ) ); + tNextGroupIt++; + } + aParallelLines.fData.push_back( tParallelLinesGroup ); + tSetIt++; + continue; + } + + double epsilon = 1e-7; + //normal case if all groups have same size + for( PortMesh::GroupCIt tGroupIt = tSetIt->begin(); tGroupIt != tSetIt->end(); tGroupIt++ ) + { + LocalToGlobal( *tGroupIt, tPoint1 ); + LocalToGlobal( *tNextGroupIt, tPoint2 ); + tNextGroupIt++; + //Skip points that are the same (causing errors later on) + if((tPoint1 - tPoint2).Magnitude() < epsilon) continue; + tParallelLinesGroup.push_back( Lines::Line( tPoint1, tPoint2 ) ); + } + aParallelLines.fData.push_back( tParallelLinesGroup ); + tSetIt++; + } + } + + void KGROOTGeometryPainter::BeamMeshToCircleLines(const BeamMesh aMesh, CircleLines& aCircleLines) + { + //object allocation + KThreeVector tPoint1, tPoint2; + Lines::Group tCircleLinesGroup; + + //create lines from tube mesh + for( BeamMesh::SetCIt tSetIt = aMesh.fData.begin(); tSetIt != aMesh.fData.end(); tSetIt++ ) + { + tCircleLinesGroup.clear(); + BeamMesh::GroupCIt tGroupIt = tSetIt->begin(); + //get case, when point is on z axis (no tube mesh, just single point) + if ( tSetIt->size() == 1 ) + { + LocalToGlobal( *tGroupIt, tPoint1 ); + tCircleLinesGroup.push_back( Lines::Line( tPoint1, tPoint1 ) ); + tCircleLinesGroup.push_back( Lines::Line( tPoint1, tPoint1 ) ); + aCircleLines.fData.push_back( tCircleLinesGroup ); + continue; + } + while ( ( tGroupIt + 1 ) != tSetIt->end() ) + { + LocalToGlobal( *tGroupIt, tPoint1 ); + LocalToGlobal( *(tGroupIt + 1), tPoint2 ); + tCircleLinesGroup.push_back( Lines::Line( tPoint1, tPoint2 ) ); + tGroupIt++; + } + //last point and first point + tCircleLinesGroup.push_back( Lines::Line( tCircleLinesGroup.back().second, tCircleLinesGroup.front().first ) ); + aCircleLines.fData.push_back( tCircleLinesGroup ); + } + } + + void KGROOTGeometryPainter::BeamMeshToParallelLines(const BeamMesh aMesh, ParallelLines& aParallelLines) + { + //object allocation + KThreeVector tPoint1, tPoint2; + Lines::Group tParallelLinesGroup; + + //create lines from tube mesh + BeamMesh::SetCIt tSetIt = aMesh.fData.begin(); + while( ( tSetIt + 1 ) != aMesh.fData.end() ) + { + tParallelLinesGroup.clear(); + + //get case when user is stupid and creates e.g. a cylinder without radius + if ( tSetIt->size() == 1 && ( tSetIt + 1)->size() == 1 ) + { + vismsg ( eWarning ) <<"to less points in tube mesh, check your geometry"<size() == 1 ) + { + KThreeVector tSinglePoint = *(tSetIt->begin()); + LocalToGlobal( tSinglePoint, tPoint1 ); + for( BeamMesh::GroupCIt tNextGroupIt = ( tSetIt + 1)->begin(); tNextGroupIt != ( tSetIt + 1)->end(); tNextGroupIt ++ ) + { + LocalToGlobal( *tNextGroupIt, tPoint2 ); + tParallelLinesGroup.push_back( Lines::Line( tPoint1, tPoint2 ) ); + } + aParallelLines.fData.push_back( tParallelLinesGroup ); + tSetIt++; + continue; + } + + BeamMesh::GroupCIt tNextGroupIt = ( tSetIt + 1)->begin(); + //get case, when next point is on z axis (no tube mesh, just single point) + if ( ( tSetIt + 1)->size() == 1 ) + { + KThreeVector tSinglePoint = *( (tSetIt + 1)->begin()); + LocalToGlobal( tSinglePoint, tPoint2 ); + for( BeamMesh::GroupCIt tGroupIt = tSetIt->begin(); tGroupIt != tSetIt->end(); tGroupIt++ ) + { + LocalToGlobal( *tGroupIt, tPoint1 ); + tParallelLinesGroup.push_back( Lines::Line( tPoint1, tPoint2 ) ); + tNextGroupIt++; + } + aParallelLines.fData.push_back( tParallelLinesGroup ); + tSetIt++; + continue; + } + + //normal case if all groups have same size + for( BeamMesh::GroupCIt tGroupIt = tSetIt->begin(); tGroupIt != tSetIt->end(); tGroupIt++ ) + { + LocalToGlobal( *tGroupIt, tPoint1 ); + LocalToGlobal( *tNextGroupIt, tPoint2 ); + tParallelLinesGroup.push_back( Lines::Line( tPoint1, tPoint2 ) ); + tNextGroupIt++; + } + aParallelLines.fData.push_back( tParallelLinesGroup ); + tSetIt++; + } + + vismsg_debug( "beam mesh into <" << aParallelLines.fData.size() << "> parallel line groups with <" << tParallelLinesGroup.size() <<"> lines each" << eom ); + + } + void KGROOTGeometryPainter::FlatMeshToCircleLines(const FlatMesh aMesh, CircleLines& aCircleLines) + { + //object allocation + KThreeVector tPoint1, tPoint2; + Lines::Group tCircleLinesGroup; + + //create lines from flat mesh + for( FlatMesh::SetCIt tSetIt = aMesh.fData.begin(); tSetIt != aMesh.fData.end(); tSetIt++ ) + { + tCircleLinesGroup.clear(); + FlatMesh::GroupCIt tGroupIt = tSetIt->begin(); + while ( ( tGroupIt + 1 ) != tSetIt->end() ) + { + LocalToGlobal( *tGroupIt, tPoint1 ); + LocalToGlobal( *(tGroupIt + 1), tPoint2 ); + tCircleLinesGroup.push_back( Lines::Line( tPoint1, tPoint2 ) ); + tGroupIt++; + } + //last point and first point + tCircleLinesGroup.push_back( Lines::Line( tCircleLinesGroup.back().second, tCircleLinesGroup.front().first ) ); + aCircleLines.fData.push_back( tCircleLinesGroup ); + } + + vismsg_debug( "flat mesh into <" << aCircleLines.fData.size() << "> circle line groups with <" << tCircleLinesGroup.size() <<"> lines each" << eom ); + + } + void KGROOTGeometryPainter::RingMeshToCircleLines(const RingMesh aMesh, CircleLines& aCircleLines) + { + //object allocation + KThreeVector tPoint1, tPoint2; + Lines::Group tCircleLinesGroup; + + //create lines from ring mesh + for( RingMesh::SetCIt tSetIt = aMesh.fData.begin(); tSetIt != aMesh.fData.end(); tSetIt++ ) + { + tCircleLinesGroup.clear(); + RingMesh::GroupCIt tGroupIt = tSetIt->begin(); + while ( ( tGroupIt + 1 ) != tSetIt->end() ) + { + LocalToGlobal( *tGroupIt, tPoint1 ); + LocalToGlobal( *(tGroupIt + 1), tPoint2 ); + tCircleLinesGroup.push_back( Lines::Line( tPoint1, tPoint2 ) ); + tGroupIt++; + } + //last point and first point + tCircleLinesGroup.push_back( Lines::Line( tCircleLinesGroup.back().second, tCircleLinesGroup.front().first ) ); + aCircleLines.fData.push_back( tCircleLinesGroup ); + } + + vismsg_debug( "ring mesh into <" << aCircleLines.fData.size() << "> circle line groups with <" << tCircleLinesGroup.size() <<"> lines each" << eom ); + + } + + + + + //********************** + //intersection functions + //********************** + + void KGROOTGeometryPainter::LinesToIntersections( const CircleLines aCircleLines, IntersectionPoints& anIntersectionPoints ) + { + vismsg_debug( "Calculating intersection of <"< circle lines" < arc lines" < parallel lines" < -1.0 * fEpsilon ) + { + //plane and line parallel + anIntersection = false; + return; + } + else + { + anIntersection = true; + } + double tLambda = tNumerator / tDenominator; + +// vismsg_debug( tNumerator<<"\t"< -1.0 * fEpsilon ) +// { +// tLambda = 0.0; +// } + + if ( tLambda > -fEpsilon && tLambda < 1.0 - fEpsilon ) + { +// vismsg_debug( "found intersection, lamda is "< with size<"<"< with size<"<"< 1 ) + { + if ( tStartState == IntersectionPoints::eUndefined ) + { + tStartState = tOrigin; + tEndState = tOrigin; + tNewIntersectionPoints.fData.push_back( tNamedGroup ); + } + else + { + tEndState = tOrigin; + tNewIntersectionPoints.fData.push_back( tNamedGroup ); + } + + } + + + if ( ( tGroup.size() <= 1 && tOrigin == IntersectionPoints::eCircle && tStartState != IntersectionPoints::eUndefined ) || tSetIt == anIntersectionPoints.fData.end() - 1 ) + { + //which case do we have? + if ( tStartState == IntersectionPoints::eParallel && tEndState == IntersectionPoints::eParallel ) + { + //case 1, closed ordered points +#ifdef KGeoBag_ENABLE_DEBUG + for ( IntersectionPoints::SetIt tTestIt = tNewIntersectionPoints.fData.begin(); tTestIt != tNewIntersectionPoints.fData.end(); tTestIt++) + { + IntersectionPoints::NamedGroup tNamedGroup = *tTestIt; + IntersectionPoints::Origin tOrigin = tNamedGroup.second; + vismsg_debug( "group type is: "< 0) { + if (tStartState == IntersectionPoints::eUndefined) { + tStartState = tOrigin; + tEndState = tOrigin; + tNewIntersectionPoints.fData.push_back(tNamedGroup); + } else { + tEndState = tOrigin; + tNewIntersectionPoints.fData.push_back(tNamedGroup); + } + } + + //Reaching the end of loop: + if (tSetIt == anIntersectionPoints.fData.end() - 1) { + OpenPoints tPoints1; + for (IntersectionPoints::SetCIt tNewSetIt = + tNewIntersectionPoints.fData.begin(); + tNewSetIt != tNewIntersectionPoints.fData.end(); + tNewSetIt++) { + IntersectionPoints::NamedGroup tNewNamedGroup = *tNewSetIt; + IntersectionPoints::Group tNewGroup = tNewNamedGroup.first; + KTwoVector tPoint1 = tNewGroup.front(); + tPoints1.fData.push_back(tPoint1); + } + anOrderedPoints.fData.push_back(tPoints1); + } + } + } else { + for (IntersectionPoints::SetCIt tSetIt = + anIntersectionPoints.fData.begin(); + tSetIt != anIntersectionPoints.fData.end(); tSetIt++) { + IntersectionPoints::NamedGroup tNamedGroup = *tSetIt; + IntersectionPoints::Origin tOrigin = tNamedGroup.second; + IntersectionPoints::Group tGroup = tNamedGroup.first; + + if (tGroup.size() > 1 && !IsSingleIntersection) { + if (tStartState == IntersectionPoints::eUndefined) { + tStartState = tOrigin; + tEndState = tOrigin; + tNewIntersectionPoints.fData.push_back(tNamedGroup); + } else { + tEndState = tOrigin; + tNewIntersectionPoints.fData.push_back(tNamedGroup); + } + } + + if ((tGroup.size() <= 1 && tOrigin == IntersectionPoints::eCircle + && tStartState != IntersectionPoints::eUndefined) + || tSetIt == anIntersectionPoints.fData.end() - 1) { + //which case do we have? + if (tStartState == IntersectionPoints::eParallel + && tEndState == IntersectionPoints::eParallel) { + //case 1, closed ordered points + + CreateShellClosedOrderedPoints(tNewIntersectionPoints, + anOrderedPoints); + } + if (tStartState == IntersectionPoints::eParallel + && tEndState == IntersectionPoints::eCircle) { + //case 2, open ordered points + + CreateShellOpenOrderedPoints(tNewIntersectionPoints, + anOrderedPoints); + } + if (tStartState == IntersectionPoints::eCircle + && tEndState == IntersectionPoints::eParallel) { + //case 2, reversed open ordered points + + reverse(tNewIntersectionPoints.fData.begin(), + tNewIntersectionPoints.fData.end()); + CreateShellOpenOrderedPoints(tNewIntersectionPoints, + anOrderedPoints); + } + if (tStartState == IntersectionPoints::eCircle + && tEndState == IntersectionPoints::eCircle) { + //case 3, dual ordered points + + CreateDualOrderedPoints(tNewIntersectionPoints, + anOrderedPoints); + } + + tStartState = IntersectionPoints::eUndefined; + tEndState = IntersectionPoints::eUndefined; + tNewIntersectionPoints.fData.clear(); + } + } + } + if (anOrderedPoints.fData.size() == 0) { + vismsg_debug ("plane did not cross geometry"<= 2 ) + { + //check which rotation direction this group has + KTwoVector tStartPoint = *(tLastParallelGroup.fData.begin()); + KTwoVector tNextPoint = *(tLastParallelGroup.fData.begin() + 1); + KTwoVector tLastPoint = *(tLastParallelGroup.fData.end() - 1); + if ( (tStartPoint - tNextPoint).MagnitudeSquared() > (tStartPoint - tLastPoint).MagnitudeSquared() ) + { + //lets reverte the group (but keep the start point) + vismsg_debug( "Reverting because: "< circle line groups with <" << tCircleLinesGroup.size() <<"> lines each" << eom ); + //first create some open points with the intersectionpoints without the last parallel intersection + IntersectionPoints tTempIntersectionPoints; + tTempIntersectionPoints.fData.insert(tTempIntersectionPoints.fData.end(), + anIntersectionPoints.fData.begin(), + anIntersectionPoints.fData.end() - 1); + CreateShellOpenOrderedPoints(tTempIntersectionPoints, anOrderedPoints); + + Points tPointsHigh = *(anOrderedPoints.fData.end() - 2); + Points tPointsLow = *(anOrderedPoints.fData.end() - 1); + tClosedPointsHigh.fData.insert(tClosedPointsHigh.fData.end(), + tPointsHigh.fData.begin(), tPointsHigh.fData.end()); + tClosedPointsLow.fData.insert(tClosedPointsLow.fData.end(), + tPointsLow.fData.begin(), tPointsLow.fData.end()); + anOrderedPoints.fData.pop_back(); + anOrderedPoints.fData.pop_back(); + + //now we just have to add the last parallel intersection to the points and connect them + KTwoVector tLastOpenPointHigh = *(tClosedPointsHigh.fData.end() - 1); + KTwoVector tLastOpenPointLow = *(tClosedPointsLow.fData.end() - 1); + IntersectionPoints::SetCIt tSetIt = anIntersectionPoints.fData.end() - 1; + //look for the points in the group that is closest to the first circle points + IntersectionPoints::GroupCIt tStartGroupItHigh; + IntersectionPoints::GroupCIt tStartGroupItLow; + double tMinHigh = 1e10; + double tMinLow = 1e10; + for (IntersectionPoints::GroupCIt tGroupIt = (*tSetIt).first.begin(); + tGroupIt != (*tSetIt).first.end(); tGroupIt++) { + KTwoVector tPoint = *tGroupIt; + double tTempMinHigh = (tPoint - tLastOpenPointHigh).MagnitudeSquared(); + double tTempMinLow = (tPoint - tLastOpenPointLow).MagnitudeSquared(); + if (tTempMinHigh < tMinHigh) { + tMinHigh = tTempMinHigh; + tStartGroupItHigh = tGroupIt; + } + if (tTempMinLow < tMinLow) { + tMinLow = tTempMinLow; + tStartGroupItLow = tGroupIt; + } + } + + //now sort the last parallel group in the right order + OpenPoints tLastParallelGroupHigh, tLastParallelGroupLow; + tLastParallelGroupHigh.fData.insert(tLastParallelGroupHigh.fData.end(), + tStartGroupItHigh, (*tSetIt).first.end()); + tLastParallelGroupLow.fData.insert(tLastParallelGroupLow.fData.end(), + (*tSetIt).first.begin(), tStartGroupItLow + 1); + + if (tLastParallelGroupHigh.fData.size() >= 2) { + //check which rotation direction this group has + KTwoVector tStartPoint = *(tLastParallelGroupHigh.fData.begin()); + KTwoVector tLastPoint = *(tLastParallelGroupHigh.fData.end() - 1); + KTwoVector tCirclePoint = *(tClosedPointsHigh.fData.begin()); + if ((tStartPoint - tCirclePoint).MagnitudeSquared() + < (tLastPoint - tCirclePoint).MagnitudeSquared()) { + //lets reverte the group (but keep the start point) + reverse(tLastParallelGroupHigh.fData.begin(), + tLastParallelGroupHigh.fData.end()); + } + } + + if (tLastParallelGroupLow.fData.size() >= 2) { + //check which rotation direction this group has + KTwoVector tStartPoint = *(tLastParallelGroupLow.fData.begin()); + KTwoVector tLastPoint = *(tLastParallelGroupLow.fData.end() - 1); + KTwoVector tCirclePoint = *(tClosedPointsHigh.fData.begin()); + if ((tStartPoint - tCirclePoint).MagnitudeSquared() + < (tLastPoint - tCirclePoint).MagnitudeSquared()) { + //lets reverte the group (but keep the start point) + reverse(tLastParallelGroupLow.fData.begin(), + tLastParallelGroupLow.fData.end()); + } + } + //and put that stuff into the main OpenPoints + tClosedPointsHigh.fData.insert(tClosedPointsHigh.fData.end(), + tLastParallelGroupHigh.fData.begin(), + tLastParallelGroupHigh.fData.end()); + tClosedPointsLow.fData.insert(tClosedPointsLow.fData.end(), + tLastParallelGroupLow.fData.begin(), + tLastParallelGroupLow.fData.end()); + + anOrderedPoints.fData.push_back(tClosedPointsHigh); + anOrderedPoints.fData.push_back(tClosedPointsLow); + return; } - void KGROOTGeometryPainter::TorusMeshToParallelLines( const TorusMesh aMesh, ParallelLines& aParallelLines ) + + void KGROOTGeometryPainter::CreateOpenOrderedPoints( const IntersectionPoints anIntersectionPoints, OrderedPoints& anOrderedPoints ) { - //object allocation - KThreeVector tPoint1, tPoint2; - Lines::Group tParallelLinesGroup; + OpenPoints tOpenPoints; - //create lines from tube mesh - TubeMesh::SetCIt tSetIt = aMesh.fData.begin(); - while( ( tSetIt + 1 ) != aMesh.fData.end() ) - { - tParallelLinesGroup.clear(); - TubeMesh::GroupCIt tNextGroupIt = ( tSetIt + 1)->begin(); - for( TubeMesh::GroupCIt tGroupIt = tSetIt->begin(); tGroupIt != tSetIt->end(); tGroupIt++ ) - { - LocalToGlobal( *tGroupIt, tPoint1 ); - LocalToGlobal( *tNextGroupIt, tPoint2 ); - tParallelLinesGroup.push_back( Lines::Line( tPoint1, tPoint2 ) ); - tNextGroupIt++; - } - aParallelLines.fData.push_back( tParallelLinesGroup ); - tSetIt++; - } + //keep an iterater to the high point of the first circle + KTwoVector tHighPointFirstCircle; - vismsg_debug( "tube mesh into <" << aParallelLines.fData.size() << "> parallel line groups with <" << tParallelLinesGroup.size() <<"> lines each" << eom ); + vismsg_debug( "Inserting the circle intersection points "< tPoint2.X() + tPoint2.Y() ) + { + tOpenPoints.fData.push_front( tPoint1 ); + tOpenPoints.fData.push_back( tPoint2 ); + } + else + { + tOpenPoints.fData.push_front( tPoint2 ); + tOpenPoints.fData.push_back( tPoint1 ); + } - } + if ( tSetIt == anIntersectionPoints.fData.begin() + 1 ) + { + tHighPointFirstCircle = *(tOpenPoints.fData.begin()); + } + } + } +// for( OpenPoints::It tIt = tOpenPoints.fData.begin(); tIt != tOpenPoints.fData.end(); tIt++ ) +// { +// vismsg( eDebug ) <<*tIt< circle lines" < tTempPointsMap; + OpenPoints tTempPoints; + + vismsg_debug( "have points:" < tCirclePointLow.X() ) + || ( tPoint.X() > tCirclePointHigh.X() && tPoint.X() < tCirclePointLow.X() ) ) + && ( ( tPoint.Y() < tCirclePointHigh.Y() && tPoint.Y() > tCirclePointLow.Y() ) + || ( tPoint.Y() > tCirclePointHigh.Y() && tPoint.Y() < tCirclePointLow.Y() ) ) ) + { + tTempPointsMap.insert( pair(tPoint.X(), tPoint ) ); + } + } - void KGROOTGeometryPainter::LinesToIntersections( const ParallelLines aParallelLines, IntersectionPoints& anIntersectionPoints ) - { - vismsg_debug( "Calculating intersection of <"< parallel lines" <::iterator tMapIt = tTempPointsMap.begin(); tMapIt != tTempPointsMap.end(); tMapIt++ ) + { + vismsg_debug( (*tMapIt).second < -1.0 * fEpsilon ) - { - //plane and line parallel - anIntersection = false; - return; - } - else - { - anIntersection = true; - } - double tLambda = tNumerator / tDenominator; - -// vismsg_debug( tNumerator<<"\t"< -1.0 * fEpsilon ) -// { -// tLambda = 0.0; -// } - - if ( tLambda > -fEpsilon && tLambda < 1.0 - fEpsilon ) - { -// vismsg_debug( "found intersection, lamda is "< tCirclePointLow.X() ) + || ( tPoint.X() > tCirclePointHigh.X() && tPoint.X() < tCirclePointLow.X() ) ) + && ( ( tPoint.Y() < tCirclePointHigh.Y() && tPoint.Y() > tCirclePointLow.Y() ) + || ( tPoint.Y() > tCirclePointHigh.Y() && tPoint.Y() < tCirclePointLow.Y() ) ) ) + { + tTempPointsMap.insert( pair(tPoint.X(), tPoint ) ); + } + } - vismsg( eWarning ) <<"this should never be called - problem in TransformToPlaneSystem function"<::iterator tMapIt = tTempPointsMap.begin(); tMapIt != tTempPointsMap.end(); tMapIt++ ) + { + vismsg_debug( (*tMapIt).second < tCirclePointLow.X() ) + { + tTempPoints.fData.push_back( (*tMapIt).second ); + } + else + { + tTempPoints.fData.push_front( (*tMapIt).second ); + } + } - void KGROOTGeometryPainter::IntersectionPointsToOrderedPoints( const IntersectionPoints anIntersectionPoints, OrderedPoints& anOrderedPoints ) - { - //the intersection points now have to be sorted, to create one (or more) ordered points (which later can be connected to form a shape on the canvas) - //3 possible cases here - //case 1: Closed ordered points ( data starts and ends with parallel intersection points (or just one group of parallel )) - //case 2: Open ordered points ( data starts with parallel intersectionpoints and ends with circle intersection points, or vice versa ) - //case 3: Dual ordered points ( data has only circle intersection points ) + //now insert in tOpenPoints + tOpenPoints.fData.insert(tOpenPointsBackIt, tTempPoints.fData.begin(), tTempPoints.fData.end() ); - IntersectionPoints::Origin tStartState = IntersectionPoints::eUndefined; - IntersectionPoints::Origin tEndState = IntersectionPoints::eUndefined; + tOpenPointsFrontIt++; + tOpenPointsBackIt--; + } + } - IntersectionPoints tNewIntersectionPoints; +// for( OpenPoints::It tIt = tOpenPoints.fData.begin(); tIt != tOpenPoints.fData.end(); tIt++ ) +// { +// vismsg( eDebug ) <<*tIt<::max(); + for ( IntersectionPoints::GroupCIt tGroupIt = (*tSetIt).first.begin(); tGroupIt != (*tSetIt).first.end(); tGroupIt++ ) + { + KTwoVector tPoint = *tGroupIt; + double tTempMin = ( tPoint - tFirstCirclePoint ).MagnitudeSquared(); + if ( tTempMin < tMin ) + { + tMin = tTempMin; + tStartGroupIt = tGroupIt; + } + } + vismsg_debug( "closest point is "<<*tStartGroupIt< with size<"<"< with size<"<"< 1 ) - { - if ( tStartState == IntersectionPoints::eUndefined ) - { - tStartState = tOrigin; - tEndState = tOrigin; - tNewIntersectionPoints.fData.push_back( tNamedGroup ); - } - else - { - tEndState = tOrigin; - tNewIntersectionPoints.fData.push_back( tNamedGroup ); - } - - } - - - if ( ( tGroup.size() <= 1 && tOrigin == IntersectionPoints::eCircle && tStartState != IntersectionPoints::eUndefined ) || tSetIt == anIntersectionPoints.fData.end() - 1 ) - { - //which case do we have? - if ( tStartState == IntersectionPoints::eParallel && tEndState == IntersectionPoints::eParallel ) - { - //case 1, closed ordered points -#ifdef KGeoBag_ENABLE_DEBUG - for ( IntersectionPoints::SetIt tTestIt = tNewIntersectionPoints.fData.begin(); tTestIt != tNewIntersectionPoints.fData.end(); tTestIt++) - { - IntersectionPoints::NamedGroup tNamedGroup = *tTestIt; - IntersectionPoints::Origin tOrigin = tNamedGroup.second; - vismsg_debug( "group type is: "<= 2 ) + { + //check which rotation direction this group has + KTwoVector tStartPoint = *(tLastParallelGroup.fData.begin()); + KTwoVector tNextPoint = *(tLastParallelGroup.fData.begin() + 1); + KTwoVector tLastPoint = *(tLastParallelGroup.fData.end() - 1); + if ( (tStartPoint - tNextPoint).MagnitudeSquared() > (tStartPoint - tLastPoint).MagnitudeSquared() ) + { + //lets reverte the group (but keep the start point) + vismsg_debug( "Reverting because: "<= 2 ) - { - //check which rotation direction this group has - KTwoVector tStartPoint = *(tLastParallelGroup.fData.begin()); - KTwoVector tNextPoint = *(tLastParallelGroup.fData.begin() + 1); - KTwoVector tLastPoint = *(tLastParallelGroup.fData.end() - 1); - if ( (tStartPoint - tNextPoint).MagnitudeSquared() > (tStartPoint - tLastPoint).MagnitudeSquared() ) - { - //lets reverte the group (but keep the start point) - vismsg_debug( "Reverting because: "< tPoint2.X() + tPoint2.Y() ) - { - tOpenPoints.fData.push_front( tPoint1 ); - tOpenPoints.fData.push_back( tPoint2 ); - } - else - { - tOpenPoints.fData.push_front( tPoint2 ); - tOpenPoints.fData.push_back( tPoint1 ); - } - - if ( tSetIt == anIntersectionPoints.fData.begin() + 1 ) - { - tHighPointFirstCircle = *(tOpenPoints.fData.begin()); - } - } - } - -// for( OpenPoints::It tIt = tOpenPoints.fData.begin(); tIt != tOpenPoints.fData.end(); tIt++ ) -// { -// vismsg( eNormal ) <<*tIt< tTempPointsMap; - OpenPoints tTempPoints; - - vismsg_debug( "have points:" < tCirclePointLow.X() ) - || ( tPoint.X() > tCirclePointHigh.X() && tPoint.X() < tCirclePointLow.X() ) ) - && ( ( tPoint.Y() < tCirclePointHigh.Y() && tPoint.Y() > tCirclePointLow.Y() ) - || ( tPoint.Y() > tCirclePointHigh.Y() && tPoint.Y() < tCirclePointLow.Y() ) ) ) - { - tTempPointsMap.insert( pair(tPoint.X(), tPoint ) ); - } - } - - vismsg_debug( "using:" <::iterator tMapIt = tTempPointsMap.begin(); tMapIt != tTempPointsMap.end(); tMapIt++ ) - { - vismsg_debug( (*tMapIt).second < tCirclePointLow.X() ) - || ( tPoint.X() > tCirclePointHigh.X() && tPoint.X() < tCirclePointLow.X() ) ) - && ( ( tPoint.Y() < tCirclePointHigh.Y() && tPoint.Y() > tCirclePointLow.Y() ) - || ( tPoint.Y() > tCirclePointHigh.Y() && tPoint.Y() < tCirclePointLow.Y() ) ) ) - { - tTempPointsMap.insert( pair(tPoint.X(), tPoint ) ); - } - } - - vismsg_debug( "using:" <::iterator tMapIt = tTempPointsMap.begin(); tMapIt != tTempPointsMap.end(); tMapIt++ ) - { - vismsg_debug( (*tMapIt).second < tCirclePointLow.X() ) - { - tTempPoints.fData.push_back( (*tMapIt).second ); - } - else - { - tTempPoints.fData.push_front( (*tMapIt).second ); - } - } - - //now insert in tOpenPoints - tOpenPoints.fData.insert(tOpenPointsBackIt, tTempPoints.fData.begin(), tTempPoints.fData.end() ); - - tOpenPointsFrontIt++; - tOpenPointsBackIt--; - } - } - -// for( OpenPoints::It tIt = tOpenPoints.fData.begin(); tIt != tOpenPoints.fData.end(); tIt++ ) -// { -// vismsg( eNormal ) <<*tIt<::max(); - for ( IntersectionPoints::GroupCIt tGroupIt = (*tSetIt).first.begin(); tGroupIt != (*tSetIt).first.end(); tGroupIt++ ) - { - KTwoVector tPoint = *tGroupIt; - double tTempMin = ( tPoint - tFirstCirclePoint ).MagnitudeSquared(); - if ( tTempMin < tMin ) - { - tMin = tTempMin; - tStartGroupIt = tGroupIt; - } - } - vismsg_debug( "closest point is "<<*tStartGroupIt<= 2 ) - { - //check which rotation direction this group has - KTwoVector tStartPoint = *(tLastParallelGroup.fData.begin()); - KTwoVector tNextPoint = *(tLastParallelGroup.fData.begin() + 1); - KTwoVector tLastPoint = *(tLastParallelGroup.fData.end() - 1); - if ( (tStartPoint - tNextPoint).MagnitudeSquared() > (tStartPoint - tLastPoint).MagnitudeSquared() ) - { - //lets reverte the group (but keep the start point) - vismsg_debug( "Reverting because: "< tPoint2.X() + tPoint2.Y()) { + tOpenPoints1.fData.push_back(tPoint1); + tOpenPoints2.fData.push_back(tPoint2); + } else { + tOpenPoints1.fData.push_back(tPoint2); + tOpenPoints2.fData.push_back(tPoint1); + } + + if (tSetIt == anIntersectionPoints.fData.begin() + 1) { + tHighPointFirstCircle = *(tOpenPoints1.fData.begin()); + tLowPointFirstCircle = *(tOpenPoints2.fData.begin()); + } + } + } + + //now insert the parallel intersection points + OpenPoints::It tOpenPoints1It = tOpenPoints1.fData.begin(); + OpenPoints::It tOpenPoints2It = tOpenPoints2.fData.begin(); + + vismsg_debug( "Inserting the parallel intersection points "< tTempPointsMap; + OpenPoints tTempPoints; + + vismsg_debug( "have points:" < tCirclePointLow.X()) + || (tPoint.X() > tCirclePointHigh.X() + && tPoint.X() < tCirclePointLow.X())) + && ((tPoint.Y() < tCirclePointHigh.Y() + && tPoint.Y() > tCirclePointLow.Y()) + || (tPoint.Y() > tCirclePointHigh.Y() + && tPoint.Y() < tCirclePointLow.Y()))) { + tTempPointsMap.insert( + pair(tPoint.X(), tPoint)); + } + } + + vismsg_debug( "using:" <::iterator tMapIt = + tTempPointsMap.begin(); tMapIt != tTempPointsMap.end(); + tMapIt++) { + vismsg_debug( (*tMapIt).second < tCirclePointLow.X()) + || (tPoint.X() > tCirclePointHigh.X() + && tPoint.X() < tCirclePointLow.X())) + && ((tPoint.Y() < tCirclePointHigh.Y() + && tPoint.Y() > tCirclePointLow.Y()) + || (tPoint.Y() > tCirclePointHigh.Y() + && tPoint.Y() < tCirclePointLow.Y()))) { + tTempPointsMap.insert( + pair(tPoint.X(), tPoint)); + } + } + + vismsg_debug( "using:" <::iterator tMapIt = + tTempPointsMap.begin(); tMapIt != tTempPointsMap.end(); + tMapIt++) { + vismsg_debug( (*tMapIt).second < tCirclePointLow.X()) { + tTempPoints.fData.push_back((*tMapIt).second); + } else { + tTempPoints.fData.push_front((*tMapIt).second); + } + } + + //now insert in tOpenPoints + tOpenPoints2.fData.insert(tOpenPoints2It + 1, + tTempPoints.fData.begin(), tTempPoints.fData.end()); + + tOpenPoints1It++; + tOpenPoints2It++; + } + } + + //now we treat the first parallel group + vismsg_debug( "Inserting first parallel intersection group "<::max(); + double tMinLow = std::numeric_limits::max(); + for (IntersectionPoints::GroupCIt tGroupIt = (*tSetIt).first.begin(); + tGroupIt != (*tSetIt).first.end(); tGroupIt++) { + KTwoVector tPoint = *tGroupIt; + double tTempMinHigh = (tPoint - tFirstCirclePoint1).MagnitudeSquared(); + double tTempMinLow = (tPoint - tFirstCirclePoint2).MagnitudeSquared(); + if (tTempMinHigh < tMinHigh) { + tMinHigh = tTempMinHigh; + tStartGroupItHigh = tGroupIt; + } + if (tTempMinLow < tMinLow) { + tMinLow = tTempMinLow; + tStartGroupItLow = tGroupIt; + } + } + + //now sort the last parallel group in the right order + OpenPoints tLastParallelGroupHigh, tLastParallelGroupLow; + tLastParallelGroupHigh.fData.insert(tLastParallelGroupHigh.fData.end(), + tStartGroupItHigh, (*tSetIt).first.end()); + tLastParallelGroupLow.fData.insert(tLastParallelGroupLow.fData.end(), + (*tSetIt).first.begin(), tStartGroupItLow + 1); + + if (tLastParallelGroupHigh.fData.size() >= 2) { + //check which rotation direction this group has + KTwoVector tStartPoint = *(tLastParallelGroupHigh.fData.begin()); + KTwoVector tLastPoint = *(tLastParallelGroupHigh.fData.end() - 1); + KTwoVector tCirclePoint = *(tOpenPoints1.fData.begin()); + if ((tStartPoint - tCirclePoint).MagnitudeSquared() + < (tLastPoint - tCirclePoint).MagnitudeSquared()) { + //lets reverte the group (but keep the start point) + reverse(tLastParallelGroupHigh.fData.begin(), + tLastParallelGroupHigh.fData.end()); + } + } + + if (tLastParallelGroupLow.fData.size() >= 2) { + //check which rotation direction this group has + KTwoVector tStartPoint = *(tLastParallelGroupLow.fData.begin()); + KTwoVector tLastPoint = *(tLastParallelGroupLow.fData.end() - 1); + KTwoVector tCirclePoint = *(tOpenPoints1.fData.begin()); + if ((tStartPoint - tCirclePoint).MagnitudeSquared() + < (tLastPoint - tCirclePoint).MagnitudeSquared()) { + //lets reverte the group (but keep the start point) + reverse(tLastParallelGroupLow.fData.begin(), + tLastParallelGroupLow.fData.end()); + } + } + + OpenPoints::It tHighPointFirstCircleIt, tLowPointFirstCircleIt; + for (OpenPoints::It tIt = tOpenPoints1.fData.begin(); + tIt != tOpenPoints1.fData.end(); tIt++) { + KTwoVector tPoint = *tIt; + if (fabs(tPoint.X() - tHighPointFirstCircle.X()) < fEpsilon + && fabs(tPoint.Y() - tHighPointFirstCircle.Y()) < fEpsilon) { + tHighPointFirstCircleIt = tIt; + break; + } + } + for (OpenPoints::It tIt = tOpenPoints2.fData.begin(); + tIt != tOpenPoints2.fData.end(); tIt++) { + KTwoVector tPoint = *tIt; + if (fabs(tPoint.X() - tLowPointFirstCircle.X()) < fEpsilon + && fabs(tPoint.Y() - tLowPointFirstCircle.Y()) < fEpsilon) { + tLowPointFirstCircleIt = tIt; + break; + } + } + + //and put that stuff into the main OpenPoints + tOpenPoints1.fData.insert(tHighPointFirstCircleIt, + tLastParallelGroupHigh.fData.begin(), + tLastParallelGroupHigh.fData.end()); + tOpenPoints2.fData.insert(tLowPointFirstCircleIt, + tLastParallelGroupLow.fData.begin(), + tLastParallelGroupLow.fData.end()); + + anOrderedPoints.fData.push_back(tOpenPoints1); + anOrderedPoints.fData.push_back(tOpenPoints2); + return; } void KGROOTGeometryPainter::CreateDualOrderedPoints( const IntersectionPoints anIntersectionPoints, OrderedPoints& anOrderedPoints ) { - OpenPoints tPoints1, tPoints2; - for( IntersectionPoints::SetCIt tSetIt = anIntersectionPoints.fData.begin(); tSetIt != anIntersectionPoints.fData.end(); tSetIt++ ) - { - IntersectionPoints::NamedGroup tNamedGroup = *tSetIt; - IntersectionPoints::Origin tOrigin = tNamedGroup.second; - IntersectionPoints::Group tGroup = tNamedGroup.first; - if ( tGroup.size() > 2 || tOrigin != IntersectionPoints::eCircle ) - { - continue; - } - KTwoVector tPoint1 = tGroup.front(); - KTwoVector tPoint2 = tGroup.back(); - vismsg_debug( "group with type <"< has points: "< tPoint2.X() + tPoint2.Y() ) - { - tPoints1.fData.push_back( tPoint1 ); - tPoints2.fData.push_back( tPoint2 ); - } - else - { - tPoints1.fData.push_back( tPoint2 ); - tPoints2.fData.push_back( tPoint1 ); - } - } - - anOrderedPoints.fData.push_back( tPoints1 ); - anOrderedPoints.fData.push_back( tPoints2 ); - return; + OpenPoints tPoints1, tPoints2; + for( IntersectionPoints::SetCIt tSetIt = anIntersectionPoints.fData.begin(); tSetIt != anIntersectionPoints.fData.end(); tSetIt++ ) + { + IntersectionPoints::NamedGroup tNamedGroup = *tSetIt; + IntersectionPoints::Origin tOrigin = tNamedGroup.second; + IntersectionPoints::Group tGroup = tNamedGroup.first; + if ( tGroup.size() > 2 || tOrigin != IntersectionPoints::eCircle ) + { + continue; + } + KTwoVector tPoint1 = tGroup.front(); + KTwoVector tPoint2 = tGroup.back(); + vismsg_debug( "group with type <"< has points: "< tPoint2.X() + tPoint2.Y() ) + { + tPoints1.fData.push_back( tPoint1 ); + tPoints2.fData.push_back( tPoint2 ); + } + else + { + tPoints1.fData.push_back( tPoint2 ); + tPoints2.fData.push_back( tPoint1 ); + } + } + + anOrderedPoints.fData.push_back( tPoints1 ); + anOrderedPoints.fData.push_back( tPoints2 ); + return; } void KGROOTGeometryPainter::CombineOrderedPoints( OrderedPoints& anOrderedPoints ) { //check for two groups of points and combine - //this function is needed, if a space cross the z axis, like the wafer + //this function is needed, if a space cross the z axis, like the wafer if ( anOrderedPoints.fData.size() == 2 ) { - Points tNewPoints; - OrderedPoints::SetCIt tSetIt = anOrderedPoints.fData.begin(); - Points tPoints = *tSetIt; - for ( Points::CIt tGroupIt = tPoints.fData.begin(); tGroupIt != tPoints.fData.end(); tGroupIt++ ) - { - KTwoVector tPoint = *tGroupIt; - tNewPoints.fData.push_back( tPoint ); - } - tSetIt++; - tPoints = *tSetIt; - for ( Points::Set::const_reverse_iterator tReversedGroupIt = tPoints.fData.rbegin(); tReversedGroupIt != tPoints.fData.rend(); tReversedGroupIt++ ) - { - KTwoVector tPoint = *tReversedGroupIt; - tNewPoints.fData.push_back( tPoint ); - } - anOrderedPoints.fData.clear(); - anOrderedPoints.fData.push_back( tNewPoints ); + Points tNewPoints; + OrderedPoints::SetCIt tSetIt = anOrderedPoints.fData.begin(); + Points tPoints = *tSetIt; + for ( Points::CIt tGroupIt = tPoints.fData.begin(); tGroupIt != tPoints.fData.end(); tGroupIt++ ) + { + KTwoVector tPoint = *tGroupIt; + tNewPoints.fData.push_back( tPoint ); + } + tSetIt++; + tPoints = *tSetIt; + for ( Points::Set::const_reverse_iterator tReversedGroupIt = tPoints.fData.rbegin(); tReversedGroupIt != tPoints.fData.rend(); tReversedGroupIt++ ) + { + KTwoVector tPoint = *tReversedGroupIt; + tNewPoints.fData.push_back( tPoint ); + } + anOrderedPoints.fData.clear(); + anOrderedPoints.fData.push_back( tNewPoints ); } } @@ -2280,129 +3679,356 @@ namespace KGeoBag void KGROOTGeometryPainter::OrderedPointsToROOTSurface( const OrderedPoints anOrderedPoints) { - for ( OrderedPoints::SetCIt tSetIt = anOrderedPoints.fData.begin(); tSetIt != anOrderedPoints.fData.end(); tSetIt++ ) - { - TPolyLine* tPolyLine = new TPolyLine(); - KTwoVector tLastPoint; - Points tPoints = *tSetIt; - for ( Points::CIt tGroupIt = tPoints.fData.begin(); tGroupIt != tPoints.fData.end(); tGroupIt++ ) - { - KTwoVector tPoint = *tGroupIt; - if ( tPoint.X() == tLastPoint.X() && tPoint.Y() == tLastPoint.Y() && tGroupIt !=tPoints.fData.begin() ) - { - //skip points that are the same - continue; - } - tPolyLine->SetNextPoint( tPoint.X(), tPoint.Y() ); - tLastPoint = tPoint; - } - fROOTSurfaces.push_back( tPolyLine ); - } - return; + for ( OrderedPoints::SetCIt tSetIt = anOrderedPoints.fData.begin(); tSetIt != anOrderedPoints.fData.end(); tSetIt++ ) + { + TPolyLine* tPolyLine = new TPolyLine(); + KTwoVector tLastPoint; + Points tPoints = *tSetIt; + + vismsg_debug( "adding polyline with " << tPoints.fData.size() << " ordered points to ROOT surfaces" << eom ); + + for ( Points::CIt tGroupIt = tPoints.fData.begin(); tGroupIt != tPoints.fData.end(); tGroupIt++ ) + { + KTwoVector tPoint = *tGroupIt; + if ( tPoint.X() == tLastPoint.X() && tPoint.Y() == tLastPoint.Y() && tGroupIt !=tPoints.fData.begin() ) + { + //skip points that are the same + continue; + } + tPolyLine->SetNextPoint( tPoint.X(), tPoint.Y() ); + tLastPoint = tPoint; + } + if ( tPolyLine->Size() > 0 ) + { + fROOTSurfaces.push_back( tPolyLine ); + } + } + return; + } + + void KGROOTGeometryPainter::CombineOrderedPoints(OrderedPoints& aMainOrderedPoints, SubPortOrderedPoints& aSubOrderedPoints, OrderedPoints& anOrderedPoints){ + //This function is for PortHousing + //There should be two cases: Either the subordered Points have 1 group (diagonal cut) or 2 groups (more likely). + //The Number of groups afterwards should be the same as subports in the second case. + + //Let's first extract the Points the points closest to the main cylinder from the subports. + ConnectionPoints tConnectionPoints; + for(SubPortOrderedPoints::SetCIt tSetIt = aSubOrderedPoints.fData.begin(); tSetIt != aSubOrderedPoints.fData.end(); tSetIt++){ + OrderedPoints anOrderedPoint = *tSetIt; + ConnectionPoints::Group tConnectionGroup; + if(anOrderedPoint.fData.size() > 1){ + for(OrderedPoints::SetCIt tSubSetIt = anOrderedPoint.fData.begin(); tSubSetIt != anOrderedPoint.fData.end(); tSubSetIt++){ + Points tPoints = *tSubSetIt; + //KTwoVector tConnectionVector = tPoints.fData.back(); + pair tConnectionPoint; + tConnectionPoint.first = tPoints.fData.back(); + tConnectionGroup.push_back(tConnectionPoint); + } + } + if(anOrderedPoint.fData.size() == 1){ + for(OrderedPoints::SetCIt tSubSetIt = anOrderedPoint.fData.begin(); tSubSetIt != anOrderedPoint.fData.end(); tSubSetIt++){ + Points tPoints = *tSubSetIt; + pair tConnectionPointFront; + tConnectionPointFront.first = tPoints.fData.front(); + pair tConnectionPointBack ; + tConnectionPointFront.first = tPoints.fData.back(); + tConnectionGroup.push_back(tConnectionPointFront); + tConnectionGroup.push_back(tConnectionPointBack); + } + } + tConnectionPoints.fData.push_back(tConnectionGroup); + } + + //Now we need to search for the points on the main cylinder, that are closest to the connection points, but not in between one group of them. + ConnectionPoints tMainConnectionPoints; + + for(ConnectionPoints::SetCIt tSetIt = tConnectionPoints.fData.begin(); tSetIt != tConnectionPoints.fData.end(); tSetIt++){ + ConnectionPoints::Group tConnectionGroup = *tSetIt; + pair ClosestPointFront; + pair ClosestPointBack; + KTwoVector Initialise(-1000,-1000); + ClosestPointFront.first = Initialise; + ClosestPointBack.first = Initialise; + + //In Fact, I just punched in one more loop that is obsolete in the previous analysis. Maybe we can merge this without "if". + for(OrderedPoints::SetCIt tMainIt = aMainOrderedPoints.fData.begin(); tMainIt != aMainOrderedPoints.fData.end(); tMainIt++){ + OrderedPoints::Element tMainOrderedPoint = *tMainIt; + + for(Points::CIt tGroupIt = tMainOrderedPoint.fData.begin(); tGroupIt != tMainOrderedPoint.fData.end(); tGroupIt++){ + KTwoVector TempPoint = *tGroupIt; + if(distance(TempPoint,tConnectionGroup.front().first) < distance(ClosestPointFront.first,tConnectionGroup.front().first) + && distance(TempPoint,tConnectionGroup.back().first) > distance(tConnectionGroup.back().first,tConnectionGroup.front().first)){ + ClosestPointFront.first = TempPoint; + ClosestPointFront.second = tMainIt; + } + if(distance(TempPoint,tConnectionGroup.back().first) < distance(ClosestPointBack.first,tConnectionGroup.back().first) + && distance(TempPoint,tConnectionGroup.front().first) > distance(tConnectionGroup.back().first,tConnectionGroup.front().first)){ + ClosestPointBack.first = TempPoint; + ClosestPointBack.second = tMainIt; + } + } + } + ConnectionPoints::Group tMainConnectionGroup; + tMainConnectionGroup.push_front(ClosestPointFront); + tMainConnectionGroup.push_back(ClosestPointBack); + tMainConnectionPoints.fData.push_back(tMainConnectionGroup); + tMainConnectionGroup.clear(); + } + + //Right. Now we have the Main Connection Group again. We need to break up the main ordered points again in number of groups corresponding to the number of subgroups. 2 -> 4. 3->5. 4->6 etc. + //This is not a circle anymore, so this time we can be more sure about where we start, which might make things less complicated. + double epsilon = 1e-7; + + for(OrderedPoints::SetCIt tMainSetIt = aMainOrderedPoints.fData.begin(); tMainSetIt != aMainOrderedPoints.fData.end(); tMainSetIt++){ + OrderedPoints::Element tMainOrderedPoint = *tMainSetIt; + bool IsInBetween = false; + Points tTempOrdered; + //We need to check again if a point is in between two connection points or not by comparing the distance between the point and the connection points + //We also need to make sure to not check for Connection points from the opposite parallel group. + for(Points::CIt tPointIt = tMainOrderedPoint.fData.begin(); tPointIt != tMainOrderedPoint.fData.end(); tPointIt++){ + KTwoVector tMainPoint = *tPointIt; + + for(ConnectionPoints::SetCIt tSetIt = tMainConnectionPoints.fData.begin(); tSetIt != tMainConnectionPoints.fData.end(); tSetIt++){ + ConnectionPoints::Group tConnectionGroup = *tSetIt; + if(tConnectionGroup.front().second != tMainSetIt){ + //Wrong connection group, skip. + continue; + } + if(distance(tConnectionGroup.front().first,tMainPoint) < distance(tConnectionGroup.front().first, tConnectionGroup.back().first) + && distance(tConnectionGroup.back().first,tMainPoint) < distance(tConnectionGroup.front().first, tConnectionGroup.back().first)){ + //Point is in between two connection points; + IsInBetween = true; + break; + } + if(distance(tConnectionGroup.front().first,tMainPoint) < epsilon || distance(tConnectionGroup.back().first,tMainPoint) < epsilon){ + //Point actually is a connection point; + tTempOrdered.fData.push_back(tMainPoint); + if(!IsInBetween){ + IsInBetween = true; + anOrderedPoints.fData.push_back(tTempOrdered); + tTempOrdered.fData.clear(); + } + else IsInBetween = false; + break; + } + } + if(IsInBetween){ + continue; + } + tTempOrdered.fData.push_back(tMainPoint); + + } + anOrderedPoints.fData.push_back(tTempOrdered); + tTempOrdered.fData.clear(); + + } + + //Now we just have to add the connection points to the subports intersection points + + for(SubPortOrderedPoints::SetCIt tSetIt = aSubOrderedPoints.fData.begin(); tSetIt != aSubOrderedPoints.fData.end(); tSetIt++){ + OrderedPoints anOrderedPoint = *tSetIt; + if(anOrderedPoint.fData.size() > 1){ + for(OrderedPoints::SetCIt tSubSetIt = anOrderedPoint.fData.begin(); tSubSetIt != anOrderedPoint.fData.end(); tSubSetIt++){ + Points tPoints = *tSubSetIt; + KTwoVector tConnectionPoint = tPoints.fData.back(); + KTwoVector ClosestPoint(-1000,-1000); + //Gotta search for the right main connection point again. Feel like there is an easier way like tagging the point beforehand. + for(ConnectionPoints::SetCIt tConnSetIt = tMainConnectionPoints.fData.begin(); tConnSetIt != tMainConnectionPoints.fData.end(); tConnSetIt++){ + ConnectionPoints::Group ConnectionGroup = *tConnSetIt; + KTwoVector First = ConnectionGroup.front().first; + KTwoVector Second = ConnectionGroup.back().first; + if(distance(First,tConnectionPoint) < distance(ClosestPoint,tConnectionPoint)){ + ClosestPoint = First; + } + if(distance(Second,tConnectionPoint) < distance(ClosestPoint,tConnectionPoint)){ + ClosestPoint = Second; + } + } + tPoints.fData.push_back(ClosestPoint); + anOrderedPoints.fData.push_back(tPoints); + } + } + if(anOrderedPoint.fData.size() == 1){ + for(OrderedPoints::SetCIt tSubSetIt = anOrderedPoint.fData.begin(); tSubSetIt != anOrderedPoint.fData.end(); tSubSetIt++){ + Points tPoints = *tSubSetIt; + KTwoVector tConnectionPointFront = tPoints.fData.front(); + KTwoVector tConnectionPointBack = tPoints.fData.back(); + KTwoVector ClosestPointFront = tPoints.fData.back(); + KTwoVector ClosestPointBack = tPoints.fData.front(); + for(ConnectionPoints::SetCIt tConnSetIt = tMainConnectionPoints.fData.begin(); tConnSetIt != tMainConnectionPoints.fData.end(); tConnSetIt++){ + ConnectionPoints::Group ConnectionGroup = *tConnSetIt; + KTwoVector First = ConnectionGroup.front().first; + KTwoVector Second = ConnectionGroup.back().first; + if(distance(First,tConnectionPointFront) < distance(ClosestPointFront,tConnectionPointFront)){ + ClosestPointFront = First; + } + if(distance(Second,tConnectionPointFront) < distance(ClosestPointFront,tConnectionPointFront)){ + ClosestPointFront = Second; + } + if(distance(First,tConnectionPointBack) < distance(ClosestPointBack,tConnectionPointBack)){ + ClosestPointBack = First; + } + if(distance(Second,tConnectionPointBack) < distance(ClosestPointBack,tConnectionPointBack)){ + ClosestPointBack = Second; + } + } + tPoints.fData.push_back(ClosestPointBack); + tPoints.fData.push_front(ClosestPointFront); + anOrderedPoints.fData.push_back(tPoints); + } + } + } + + return; + } + + double KGROOTGeometryPainter::distance(KTwoVector Vector1, KTwoVector Vector2) + { + double distance = sqrt((Vector1.X() - Vector2.X())*(Vector1.X() - Vector2.X()) + (Vector1.Y() - Vector2.Y())*(Vector1.Y() - Vector2.Y())); + + return distance; + } + + //******************* + //Partition Functions + //******************* + + void KGROOTGeometryPainter::SymmetricPartition( const double& aStart, const double& aStop, const unsigned int& aCount, const double& aPower, Partition& aPartition ) + { + double tPower = aPower; + double tStart = aStart; + double tStop = aStop; + double tMid = .5 * (tStop - tStart); + double tY; + double tX; + + aPartition.fData.clear(); + for( unsigned int tIndex = 0; tIndex <= aCount; tIndex++ ) + { + tY = (double) (tIndex) / (double) (aCount); + if( tY < 0.5 ) + { + tX = tStart + tMid * pow( 2. * tY, tPower ); + } + else + { + tX = tStop - tMid * pow( 2. - 2. * tY, tPower ); + } + aPartition.fData.push_back( tX ); + } + + return; } + void KGROOTGeometryPainter::OrderedPointsToROOTSpace( const OrderedPoints anOrderedPoints) { - for ( OrderedPoints::SetCIt tSetIt = anOrderedPoints.fData.begin(); tSetIt != anOrderedPoints.fData.end(); tSetIt++ ) - { - TPolyLine* tPolyLine = new TPolyLine(); - KTwoVector tLastPoint; - Points tPoints = *tSetIt; - for ( Points::CIt tGroupIt = tPoints.fData.begin(); tGroupIt != tPoints.fData.end(); tGroupIt++ ) - { - KTwoVector tPoint = *tGroupIt; - if ( tPoint.X() == tLastPoint.X() && tPoint.Y() == tLastPoint.Y() && tGroupIt !=tPoints.fData.begin() ) - { - //skip points that are the same - continue; - } - tPolyLine->SetNextPoint( tPoint.X(), tPoint.Y() ); - tLastPoint = tPoint; - } - fROOTSpaces.push_back( tPolyLine ); - } - return; + for ( OrderedPoints::SetCIt tSetIt = anOrderedPoints.fData.begin(); tSetIt != anOrderedPoints.fData.end(); tSetIt++ ) + { + TPolyLine* tPolyLine = new TPolyLine(); + KTwoVector tLastPoint; + Points tPoints = *tSetIt; + + vismsg_debug( "adding polyline with " << tPoints.fData.size() << " ordered points to ROOT spaces" << eom ); + + for ( Points::CIt tGroupIt = tPoints.fData.begin(); tGroupIt != tPoints.fData.end(); tGroupIt++ ) + { + KTwoVector tPoint = *tGroupIt; + if ( tPoint.X() == tLastPoint.X() && tPoint.Y() == tLastPoint.Y() && tGroupIt !=tPoints.fData.begin() ) + { + //skip points that are the same + continue; + } + tPolyLine->SetNextPoint( tPoint.X(), tPoint.Y() ); + tLastPoint = tPoint; + } + if ( tPolyLine->Size() > 0 ) + { + fROOTSpaces.push_back( tPolyLine ); + } + } + return; } // void KGROOTGeometryPainter::IntersectionsToROOT( const IntersectionPoints aCircleIntersection, const IntersectionPoints aParallelIntersection ) // { -// for( IntersectionPoints::SetCIt tSetIt = aCircleIntersection.fData.begin(); tSetIt != aCircleIntersection.fData.end(); tSetIt++ ) -// { -// IntersectionPoints::Group tGroup = *tSetIt; -// if ( tGroup.size() > 2 ) -// { -// vismsg( eWarning ) <<"It looks like Stefan forgot one case in connecting the intersection points, so your drawing may look like bullshit"<SetLineColor( kRed ); -// -// for( IntersectionPoints::SetCIt tSetIt = aParallelIntersection.fData.begin(); tSetIt != aParallelIntersection.fData.end(); tSetIt++ ) -// { -// IntersectionPoints::Group tGroup = *tSetIt; -// for( IntersectionPoints::GroupCIt tGroupIt = tGroup.begin(); tGroupIt != tGroup.end(); tGroupIt++ ) -// { -// tPolyLine1->SetNextPoint( (*tGroupIt).X(), (*tGroupIt).Y() ); -// } -// } -// -// for( IntersectionPoints::SetCIt tSetIt = aCircleIntersection.fData.begin(); tSetIt != aCircleIntersection.fData.end(); tSetIt++ ) -// { -// IntersectionPoints::Group tGroup = *tSetIt; -// for( IntersectionPoints::GroupCIt tGroupIt = tGroup.begin(); tGroupIt != tGroup.end(); tGroupIt++ ) -// { -// tPolyLine2->SetNextPoint( (*tGroupIt).X(), (*tGroupIt).Y() ); -// } -// } -// -// fROOTSurfaces.push_back( tPolyLine1 ); -// fROOTSurfaces.push_back( tPolyLine2 ); -// -// return; +// for( IntersectionPoints::SetCIt tSetIt = aCircleIntersection.fData.begin(); tSetIt != aCircleIntersection.fData.end(); tSetIt++ ) +// { +// IntersectionPoints::Group tGroup = *tSetIt; +// if ( tGroup.size() > 2 ) +// { +// vismsg( eWarning ) <<"It looks like Stefan forgot one case in connecting the intersection points, so your drawing may look like bullshit"<SetLineColor( kRed ); +// +// for( IntersectionPoints::SetCIt tSetIt = aParallelIntersection.fData.begin(); tSetIt != aParallelIntersection.fData.end(); tSetIt++ ) +// { +// IntersectionPoints::Group tGroup = *tSetIt; +// for( IntersectionPoints::GroupCIt tGroupIt = tGroup.begin(); tGroupIt != tGroup.end(); tGroupIt++ ) +// { +// tPolyLine1->SetNextPoint( (*tGroupIt).X(), (*tGroupIt).Y() ); +// } +// } +// +// for( IntersectionPoints::SetCIt tSetIt = aCircleIntersection.fData.begin(); tSetIt != aCircleIntersection.fData.end(); tSetIt++ ) +// { +// IntersectionPoints::Group tGroup = *tSetIt; +// for( IntersectionPoints::GroupCIt tGroupIt = tGroup.begin(); tGroupIt != tGroup.end(); tGroupIt++ ) +// { +// tPolyLine2->SetNextPoint( (*tGroupIt).X(), (*tGroupIt).Y() ); +// } +// } +// +// fROOTSurfaces.push_back( tPolyLine1 ); +// fROOTSurfaces.push_back( tPolyLine2 ); +// +// return; // } // void KGROOTGeometryPainter::PolyLinesToROOT( const PolyLines aPolyLine ) // { -// for( PolyLines::SetCIt tSetIt = aPolyLine.fData.begin(); tSetIt != aPolyLine.fData.end(); tSetIt++ ) -// { -// TPolyLine* tPolyLine = new TPolyLine(); -// Points tPoints = (*tSetIt); -// for ( Points::CIt tPointsIt = tPoints.fData.begin(); tPointsIt != tPoints.fData.end(); tPoints++ ) -// { -// KTwoVector tPoint = *tPointsIt; -// tPolyLine->SetNextPoint( tPoint.X(), tPoint.Y() ); -// } -// } +// for( PolyLines::SetCIt tSetIt = aPolyLine.fData.begin(); tSetIt != aPolyLine.fData.end(); tSetIt++ ) +// { +// TPolyLine* tPolyLine = new TPolyLine(); +// Points tPoints = (*tSetIt); +// for ( Points::CIt tPointsIt = tPoints.fData.begin(); tPointsIt != tPoints.fData.end(); tPoints++ ) +// { +// KTwoVector tPoint = *tPointsIt; +// tPolyLine->SetNextPoint( tPoint.X(), tPoint.Y() ); +// } +// } // } @@ -2487,100 +4113,100 @@ namespace KGeoBag // LocalToGlobal( *tGroupIt, tPoint ); // if ( tGroupIt == tSetIt->begin() ) // { -// if ( tSetIt != aMesh.fData.begin() ) -// { -// CalculatePlaneIntersection( tPointSetLast, tPoint, tIntersectionPoint, tIntersection ); -// if ( tIntersection ) -// { -// tIntersectionPoints.push_back( tIntersectionPoint ); -// } -// } -// tPointSetLast = tPoint; +// if ( tSetIt != aMesh.fData.begin() ) +// { +// CalculatePlaneIntersection( tPointSetLast, tPoint, tIntersectionPoint, tIntersection ); +// if ( tIntersection ) +// { +// tIntersectionPoints.push_back( tIntersectionPoint ); +// } +// } +// tPointSetLast = tPoint; // } // else // { -// CalculatePlaneIntersection( tPointGroupLast, tPoint, tIntersectionPoint, tIntersection ); -// if ( tIntersection ) -// { -// tIntersectionPoints.push_back( tIntersectionPoint ); -// } +// CalculatePlaneIntersection( tPointGroupLast, tPoint, tIntersectionPoint, tIntersection ); +// if ( tIntersection ) +// { +// tIntersectionPoints.push_back( tIntersectionPoint ); +// } // } // if ( tGroupIt == tSetIt->end() - 1 ) // { -// CalculatePlaneIntersection( tPoint, tPointSetLast, tIntersectionPoint, tIntersection ); -// if ( tIntersection ) -// { -// tIntersectionPoints.push_back( tIntersectionPoint ); -// } +// CalculatePlaneIntersection( tPoint, tPointSetLast, tIntersectionPoint, tIntersection ); +// if ( tIntersection ) +// { +// tIntersectionPoints.push_back( tIntersectionPoint ); +// } // } // tPointGroupLast = tPoint; // } // } // // -// if ( fPlane == eZYPlane ) -// { -// TPolyLine* tPolyLine1 = new TPolyLine(); -// TPolyLine* tPolyLine2 = new TPolyLine(); -// -// TColor* tColor = new TColor(); -// tColor->SetRGB( fCurrentData->GetColor().GetRed(), fCurrentData->GetColor().GetGreen(), fCurrentData->GetColor().GetBlue() ); -// tPolyLine1->SetLineColor( tColor->GetNumber() ); -// tPolyLine2->SetLineColor( tColor->GetNumber() ); -// -// delete tColor; -// -// vector::iterator tIt; -// for ( tIt = tIntersectionPoints.begin(); tIt != tIntersectionPoints.end(); tIt++ ) -// { -// tPolyLine1->SetNextPoint( (*tIt).Z(), (*tIt).Y() ); -// tIt++; -// tPolyLine2->SetNextPoint( (*tIt).Z(), (*tIt).Y() ); -// } -// fROOTSurfaces.push_back( tPolyLine1 ); -// fROOTSurfaces.push_back( tPolyLine2 ); -// } -// -// if ( fPlane == eZXPlane ) -// { -// TPolyLine* tPolyLine1 = new TPolyLine(); -// TPolyLine* tPolyLine2 = new TPolyLine(); -// -// TColor* tColor = new TColor(); -// tColor->SetRGB( fCurrentData->GetColor().GetRed(), fCurrentData->GetColor().GetGreen(), fCurrentData->GetColor().GetBlue() ); -// tPolyLine1->SetLineColor( tColor->GetNumber() ); -// tPolyLine2->SetLineColor( tColor->GetNumber() ); -// -// delete tColor; -// -// vector::iterator tIt; -// for ( tIt = tIntersectionPoints.begin(); tIt != tIntersectionPoints.end(); tIt++ ) -// { -// tPolyLine1->SetNextPoint( (*tIt).Z(), (*tIt).X() ); -// tIt++; -// tPolyLine2->SetNextPoint( (*tIt).Z(), (*tIt).X() ); -// } -// fROOTSurfaces.push_back( tPolyLine1 ); -// fROOTSurfaces.push_back( tPolyLine2 ); -// } -// -// if ( fPlane == eXYPlane ) -// { -// TPolyLine* tPolyLine = new TPolyLine(); -// -// TColor* tColor = new TColor(); -// tColor->SetRGB( fCurrentData->GetColor().GetRed(), fCurrentData->GetColor().GetGreen(), fCurrentData->GetColor().GetBlue() ); -// tPolyLine->SetLineColor( tColor->GetNumber() ); -// -// delete tColor; -// -// vector::iterator tIt; -// for ( tIt = tIntersectionPoints.begin(); tIt != tIntersectionPoints.end(); tIt++ ) -// { -// tPolyLine->SetNextPoint( (*tIt).Z(), (*tIt).X() ); -// } -// fROOTSurfaces.push_back( tPolyLine ); -// } +// if ( fPlane == eZYPlane ) +// { +// TPolyLine* tPolyLine1 = new TPolyLine(); +// TPolyLine* tPolyLine2 = new TPolyLine(); +// +// TColor* tColor = new TColor(); +// tColor->SetRGB( fCurrentData->GetColor().GetRed(), fCurrentData->GetColor().GetGreen(), fCurrentData->GetColor().GetBlue() ); +// tPolyLine1->SetLineColor( tColor->GetNumber() ); +// tPolyLine2->SetLineColor( tColor->GetNumber() ); +// +// delete tColor; +// +// vector::iterator tIt; +// for ( tIt = tIntersectionPoints.begin(); tIt != tIntersectionPoints.end(); tIt++ ) +// { +// tPolyLine1->SetNextPoint( (*tIt).Z(), (*tIt).Y() ); +// tIt++; +// tPolyLine2->SetNextPoint( (*tIt).Z(), (*tIt).Y() ); +// } +// fROOTSurfaces.push_back( tPolyLine1 ); +// fROOTSurfaces.push_back( tPolyLine2 ); +// } +// +// if ( fPlane == eZXPlane ) +// { +// TPolyLine* tPolyLine1 = new TPolyLine(); +// TPolyLine* tPolyLine2 = new TPolyLine(); +// +// TColor* tColor = new TColor(); +// tColor->SetRGB( fCurrentData->GetColor().GetRed(), fCurrentData->GetColor().GetGreen(), fCurrentData->GetColor().GetBlue() ); +// tPolyLine1->SetLineColor( tColor->GetNumber() ); +// tPolyLine2->SetLineColor( tColor->GetNumber() ); +// +// delete tColor; +// +// vector::iterator tIt; +// for ( tIt = tIntersectionPoints.begin(); tIt != tIntersectionPoints.end(); tIt++ ) +// { +// tPolyLine1->SetNextPoint( (*tIt).Z(), (*tIt).X() ); +// tIt++; +// tPolyLine2->SetNextPoint( (*tIt).Z(), (*tIt).X() ); +// } +// fROOTSurfaces.push_back( tPolyLine1 ); +// fROOTSurfaces.push_back( tPolyLine2 ); +// } +// +// if ( fPlane == eXYPlane ) +// { +// TPolyLine* tPolyLine = new TPolyLine(); +// +// TColor* tColor = new TColor(); +// tColor->SetRGB( fCurrentData->GetColor().GetRed(), fCurrentData->GetColor().GetGreen(), fCurrentData->GetColor().GetBlue() ); +// tPolyLine->SetLineColor( tColor->GetNumber() ); +// +// delete tColor; +// +// vector::iterator tIt; +// for ( tIt = tIntersectionPoints.begin(); tIt != tIntersectionPoints.end(); tIt++ ) +// { +// tPolyLine->SetNextPoint( (*tIt).Z(), (*tIt).X() ); +// } +// fROOTSurfaces.push_back( tPolyLine ); +// } // // // diff --git a/KGeoBag/Source/Visualization/Vtk/Source/KGVTKGeometryPainter.cc b/KGeoBag/Source/Visualization/Vtk/Source/KGVTKGeometryPainter.cc index 1e06baa3d..73a2d7e32 100644 --- a/KGeoBag/Source/Visualization/Vtk/Source/KGVTKGeometryPainter.cc +++ b/KGeoBag/Source/Visualization/Vtk/Source/KGVTKGeometryPainter.cc @@ -4,6 +4,11 @@ #include "KFile.h" using katrin::KFile; +#ifdef KGeoBag_USE_BOOST +//#include "KPathUtils.h" +//using katrin::KPathUtils; +#endif + #include "KConst.h" using katrin::KConst; @@ -28,7 +33,7 @@ namespace KGeoBag KGVTKGeometryPainter::KGVTKGeometryPainter() : fFile(), fPath( "" ), - fWriteSTL( true ), + fWriteSTL( false ), fSurfaces(), fSpaces(), fDefaultData(), @@ -108,7 +113,7 @@ namespace KGeoBag { string tFile; - if( fFile.length() > 0 ) + if( ! fFile.empty() ) { if ( fPath.empty() ) { @@ -116,6 +121,9 @@ namespace KGeoBag } else { +#ifdef KGeoBag_USE_BOOST +// KPathUtils::MakeDirectory( fPath ); +#endif tFile = fPath + string( "/" ) + fFile; } } @@ -141,7 +149,7 @@ namespace KGeoBag { string tFile; - if( fFile.length() > 0 ) + if( ! fFile.empty() ) { if ( fPath.empty() ) { @@ -149,6 +157,9 @@ namespace KGeoBag } else { +#ifdef KGeoBag_USE_BOOST +// KPathUtils::MakeDirectory( fPath ); +#endif tFile = fPath + string( "/" ) + fFile; } @@ -1288,8 +1299,8 @@ void KGVTKGeometryPainter::VisitShellPathSurface( KGShellPolyLoopSurface* aShell { aThreePoints.fData.clear(); - // determine number of rod vertices - unsigned int tNCoordinates = aRodSpace->GetObject()->GetNCoordinates(); + // determine number of rod vertices + unsigned int tNCoordinates = aRodSpace->GetObject()->GetNCoordinates(); // 1 SubThreePoint object = 2 Vertices ThreePoints tSubThreePoints; @@ -1298,17 +1309,17 @@ void KGVTKGeometryPainter::VisitShellPathSurface( KGShellPolyLoopSurface* aShell for( unsigned int tCoordinateIt=0; tCoordinateIt<(tNCoordinates-1); tCoordinateIt++ ) { - tSubThreePoints.fData.clear(); + tSubThreePoints.fData.clear(); tStartPoint.SetComponents( - aRodSpace->GetObject()->GetCoordinate(tCoordinateIt)[0], - aRodSpace->GetObject()->GetCoordinate(tCoordinateIt)[1], - aRodSpace->GetObject()->GetCoordinate(tCoordinateIt)[2] + aRodSpace->GetObject()->GetCoordinate(tCoordinateIt)[0], + aRodSpace->GetObject()->GetCoordinate(tCoordinateIt)[1], + aRodSpace->GetObject()->GetCoordinate(tCoordinateIt)[2] ); tEndPoint.SetComponents( - aRodSpace->GetObject()->GetCoordinate(tCoordinateIt+1, 0), - aRodSpace->GetObject()->GetCoordinate(tCoordinateIt+1, 1), - aRodSpace->GetObject()->GetCoordinate(tCoordinateIt+1, 2) + aRodSpace->GetObject()->GetCoordinate(tCoordinateIt+1, 0), + aRodSpace->GetObject()->GetCoordinate(tCoordinateIt+1, 1), + aRodSpace->GetObject()->GetCoordinate(tCoordinateIt+1, 2) ); tSubThreePoints.fData.push_back( tStartPoint ); @@ -1324,16 +1335,16 @@ void KGVTKGeometryPainter::VisitShellPathSurface( KGShellPolyLoopSurface* aShell { aThreePoints.fData.clear(); - // gathering data from wire array object - unsigned int tWiresInArray = aConicalWireArraySurface->GetObject()->GetNWires(); - double tThetaOffset = aConicalWireArraySurface->GetObject()->GetThetaStart() * (KConst::Pi() / 180.); + // gathering data from wire array object + unsigned int tWiresInArray = aConicalWireArraySurface->GetObject()->GetNWires(); + double tThetaOffset = aConicalWireArraySurface->GetObject()->GetThetaStart() * (KConst::Pi() / 180.); - double tZ1 = aConicalWireArraySurface->GetObject()->GetZ1(); - double tR1 = aConicalWireArraySurface->GetObject()->GetR1(); - double tZ2 = aConicalWireArraySurface->GetObject()->GetZ2(); - double tR2 = aConicalWireArraySurface->GetObject()->GetR2(); + double tZ1 = aConicalWireArraySurface->GetObject()->GetZ1(); + double tR1 = aConicalWireArraySurface->GetObject()->GetR1(); + double tZ2 = aConicalWireArraySurface->GetObject()->GetZ2(); + double tR2 = aConicalWireArraySurface->GetObject()->GetR2(); - double tAngleStep = 2*KConst::Pi()/tWiresInArray; + double tAngleStep = 2*KConst::Pi()/tWiresInArray; // 1 SubThreePoint object = 2 Vertices ThreePoints tSubThreePoints; @@ -1342,17 +1353,17 @@ void KGVTKGeometryPainter::VisitShellPathSurface( KGShellPolyLoopSurface* aShell for( unsigned int tWireIt=0; tWireItGetArc(); + unsigned int tArc = fCurrentData->GetArc(); double tFraction; unsigned int tCount; @@ -1585,45 +1596,45 @@ void KGVTKGeometryPainter::ClosedPointsRotatedToTorusMesh( const ClosedPoints& a for( ThreePoints::CIt tThreePointsIt = aThreePoints.fData.begin(); tThreePointsIt != aThreePoints.fData.end(); tThreePointsIt++ ) { - // define start and end point - tStartPoint = *tThreePointsIt; - tThreePointsIt++; - tEndPoint = *tThreePointsIt; - - // determine center of rod axis - tCenterPoint = (tEndPoint + tStartPoint)/2.; - - // rod axis unit vector - tAxisUnit = (tEndPoint-tStartPoint).Unit(); - if(fabs(tAxisUnit.GetZ())>1. && tAxisUnit.GetZ()>0.) tAxisUnit.SetZ(1.); - if(fabs(tAxisUnit.GetZ())>1. && tAxisUnit.GetZ()<0.) tAxisUnit.SetZ(-1.); - - // computation of Euler angles - tR = sqrt(tAxisUnit.GetX()*tAxisUnit.GetX() + tAxisUnit.GetY()*tAxisUnit.GetY()); - tTheta = toDegree * acos(tAxisUnit.GetZ()); - - if(tR<1.e-10) - tPhi=0.; - else - { - if(tAxisUnit.GetX() >= 0. && tAxisUnit.GetY() >= 0.) - tPhi=180.-toDegree*asin(tAxisUnit.GetX()/tR); - else if(tAxisUnit.GetX() >= 0. && tAxisUnit.GetY() <= 0.) - tPhi=toDegree*asin(tAxisUnit.GetX()/tR); - else if(tAxisUnit.GetX() <= 0. && tAxisUnit.GetY() >= 0.) - tPhi=180.+toDegree*asin(-tAxisUnit.GetX()/tR); - else - tPhi=360.-toDegree*asin(-tAxisUnit.GetX()/tR); - } - - tEulerZXZ.SetRotationEuler( tPhi, tTheta, 0. ); - - - // computing and setting mesh points + // define start and end point + tStartPoint = *tThreePointsIt; + tThreePointsIt++; + tEndPoint = *tThreePointsIt; + + // determine center of rod axis + tCenterPoint = (tEndPoint + tStartPoint)/2.; + + // rod axis unit vector + tAxisUnit = (tEndPoint-tStartPoint).Unit(); + if(fabs(tAxisUnit.GetZ())>1. && tAxisUnit.GetZ()>0.) tAxisUnit.SetZ(1.); + if(fabs(tAxisUnit.GetZ())>1. && tAxisUnit.GetZ()<0.) tAxisUnit.SetZ(-1.); + + // computation of Euler angles + tR = sqrt(tAxisUnit.GetX()*tAxisUnit.GetX() + tAxisUnit.GetY()*tAxisUnit.GetY()); + tTheta = toDegree * acos(tAxisUnit.GetZ()); + + if(tR<1.e-10) + tPhi=0.; + else + { + if(tAxisUnit.GetX() >= 0. && tAxisUnit.GetY() >= 0.) + tPhi=180.-toDegree*asin(tAxisUnit.GetX()/tR); + else if(tAxisUnit.GetX() >= 0. && tAxisUnit.GetY() <= 0.) + tPhi=toDegree*asin(tAxisUnit.GetX()/tR); + else if(tAxisUnit.GetX() <= 0. && tAxisUnit.GetY() >= 0.) + tPhi=180.+toDegree*asin(-tAxisUnit.GetX()/tR); + else + tPhi=360.-toDegree*asin(-tAxisUnit.GetX()/tR); + } + + tEulerZXZ.SetRotationEuler( tPhi, tTheta, 0. ); + + + // computing and setting mesh points tGroup.clear(); for( tCount = 0; tCount < tArc; tCount++ ) { - tEulerZXZ.SetOrigin( tStartPoint ); + tEulerZXZ.SetOrigin( tStartPoint ); tFraction = (double) (tCount) / (double) (tArc); tPoint.X() = (tStartPoint.X() + aTubeRadius * cos( 2. * KConst::Pi() * tFraction )); @@ -1639,7 +1650,7 @@ void KGVTKGeometryPainter::ClosedPointsRotatedToTorusMesh( const ClosedPoints& a tGroup.clear(); for( tCount = 0; tCount < tArc; tCount++ ) { - tEulerZXZ.SetOrigin( tEndPoint ); + tEulerZXZ.SetOrigin( tEndPoint ); tFraction = (double) (tCount) / (double) (tArc); tPoint.X() = (tEndPoint.X() + aTubeRadius * cos( 2. * KConst::Pi() * tFraction )); @@ -1655,11 +1666,11 @@ void KGVTKGeometryPainter::ClosedPointsRotatedToTorusMesh( const ClosedPoints& a } vismsg_debug( "rotated open points into <" << aMesh.fData.size() * aMesh.fData.front().size() << "> tube mesh vertices" << eom ); - return; + return; } void KGVTKGeometryPainter::ThreePointsToTubeMeshToVTK( const ThreePoints& aThreePoints, TubeMesh& aMesh, const double& aTubeRadius ) { - unsigned int tArc = fCurrentData->GetArc(); + unsigned int tArc = fCurrentData->GetArc(); double tFraction; unsigned int tCount; @@ -1681,44 +1692,44 @@ void KGVTKGeometryPainter::ClosedPointsRotatedToTorusMesh( const ClosedPoints& a for( ThreePoints::CIt tThreePointsIt = aThreePoints.fData.begin(); tThreePointsIt != aThreePoints.fData.end(); tThreePointsIt++ ) { - // define start and end point - tStartPoint = *tThreePointsIt; - tThreePointsIt++; - tEndPoint = *tThreePointsIt; - - // determine center of rod axis - tCenterPoint = (tEndPoint + tStartPoint)/2.; - - // rod axis unit vector - tAxisUnit = (tEndPoint-tStartPoint).Unit(); - if(fabs(tAxisUnit.GetZ())>1. && tAxisUnit.GetZ()>0.) tAxisUnit.SetZ(1.); - if(fabs(tAxisUnit.GetZ())>1. && tAxisUnit.GetZ()<0.) tAxisUnit.SetZ(-1.); - - // computation of Euler angles - tR = sqrt(tAxisUnit.GetX()*tAxisUnit.GetX() + tAxisUnit.GetY()*tAxisUnit.GetY()); - tTheta = toDegree * acos(tAxisUnit.GetZ()); - - if(tR<1.e-10) - tPhi=0.; - else - { - if(tAxisUnit.GetX() >= 0. && tAxisUnit.GetY() >= 0.) - tPhi=180.-toDegree*asin(tAxisUnit.GetX()/tR); - else if(tAxisUnit.GetX() >= 0. && tAxisUnit.GetY() <= 0.) - tPhi=toDegree*asin(tAxisUnit.GetX()/tR); - else if(tAxisUnit.GetX() <= 0. && tAxisUnit.GetY() >= 0.) - tPhi=180.+toDegree*asin(-tAxisUnit.GetX()/tR); - else - tPhi=360.-toDegree*asin(-tAxisUnit.GetX()/tR); - } - - tEulerZXZ.SetRotationEuler( tPhi, tTheta, 0. ); - - // computing and setting mesh points + // define start and end point + tStartPoint = *tThreePointsIt; + tThreePointsIt++; + tEndPoint = *tThreePointsIt; + + // determine center of rod axis + tCenterPoint = (tEndPoint + tStartPoint)/2.; + + // rod axis unit vector + tAxisUnit = (tEndPoint-tStartPoint).Unit(); + if(fabs(tAxisUnit.GetZ())>1. && tAxisUnit.GetZ()>0.) tAxisUnit.SetZ(1.); + if(fabs(tAxisUnit.GetZ())>1. && tAxisUnit.GetZ()<0.) tAxisUnit.SetZ(-1.); + + // computation of Euler angles + tR = sqrt(tAxisUnit.GetX()*tAxisUnit.GetX() + tAxisUnit.GetY()*tAxisUnit.GetY()); + tTheta = toDegree * acos(tAxisUnit.GetZ()); + + if(tR<1.e-10) + tPhi=0.; + else + { + if(tAxisUnit.GetX() >= 0. && tAxisUnit.GetY() >= 0.) + tPhi=180.-toDegree*asin(tAxisUnit.GetX()/tR); + else if(tAxisUnit.GetX() >= 0. && tAxisUnit.GetY() <= 0.) + tPhi=toDegree*asin(tAxisUnit.GetX()/tR); + else if(tAxisUnit.GetX() <= 0. && tAxisUnit.GetY() >= 0.) + tPhi=180.+toDegree*asin(-tAxisUnit.GetX()/tR); + else + tPhi=360.-toDegree*asin(-tAxisUnit.GetX()/tR); + } + + tEulerZXZ.SetRotationEuler( tPhi, tTheta, 0. ); + + // computing and setting mesh points tGroup.clear(); for( tCount = 0; tCount < tArc; tCount++ ) { - tEulerZXZ.SetOrigin( tStartPoint ); + tEulerZXZ.SetOrigin( tStartPoint ); tFraction = (double) (tCount) / (double) (tArc); tPoint.X() = (tStartPoint.X() + aTubeRadius * cos( 2. * KConst::Pi() * tFraction )); @@ -1734,7 +1745,7 @@ void KGVTKGeometryPainter::ClosedPointsRotatedToTorusMesh( const ClosedPoints& a tGroup.clear(); for( tCount = 0; tCount < tArc; tCount++ ) { - tEulerZXZ.SetOrigin( tEndPoint ); + tEulerZXZ.SetOrigin( tEndPoint ); tFraction = (double) (tCount) / (double) (tArc); tPoint.X() = (tEndPoint.X() + aTubeRadius * cos( 2. * KConst::Pi() * tFraction )); @@ -1755,7 +1766,7 @@ void KGVTKGeometryPainter::ClosedPointsRotatedToTorusMesh( const ClosedPoints& a } vismsg_debug( "rotated open points into <" << aMesh.fData.size() * aMesh.fData.front().size() << "> tube mesh vertices" << eom ); - return; + return; } //******************* @@ -2053,10 +2064,10 @@ void KGVTKGeometryPainter::ClosedPointsRotatedToTorusMesh( const ClosedPoints& a } void KGVTKGeometryPainter::TubeMeshToVTK( const KThreeVector& anApexStart, const TubeMesh& aMesh, const KThreeVector& anApexEnd ) { - if ( aMesh.fData.size() == 0 ) - { - vismsg( eWarning ) <<"mesh has size of zero, check your geometry"< +#include + +#include "KMessage.h" +#include "KTextFile.h" + +#include "KCommandLineTokenizer.hh" +#include "KXMLTokenizer.hh" +#include "KVariableProcessor.hh" +#include "KIncludeProcessor.hh" +#include "KLoopProcessor.hh" +#include "KConditionProcessor.hh" +#include "KElementProcessor.hh" +#include "KTagProcessor.hh" +#include "KPrintProcessor.hh" + +#ifdef Kommon_USE_ROOT +#include "KFormulaProcessor.hh" +#endif + +#ifdef KSC_USE_KALI +#include "KKaliProcessor.hh" +#endif + +#include "KThreeVector.hh" + +#include "KSToolbox.h" +#include "KSMainMessage.h" + +#include "KSRootMagneticField.h" + +#include "TGraph.h" +#include "TH2.h" +#include "TApplication.h" +#include "TCanvas.h" +#include "TAxis.h" +#include "TPaletteAxis.h" +#include "TStyle.h" + +#include + + +using namespace Kassiopeia; +using namespace katrin; +using namespace KGeoBag; + +int main( int argc, char** argv ) +{ + if( argc < 9 ) + { + cout << "usage: ./SimpleMagneticFieldCalculator [ <...>] " << endl; + // ./CrossSectionBrCalculator ~/Work/kasper/install/config/Kassiopeia/Examples/TestProject8Simulation.xml -1.0 1.0 -1.0 1.0 0.0 1000 field_electromagnet + // ./SimpleMagneticFieldCalculator ~/Work/kasper/install/config/Kassiopeia/Examples/TestProject8Simulation.xml 0.6143 0.0972 0.0 field_electromagnet + exit( -1 ); + } + + string tFileName( argv[ 1 ] ); + + // string X( argv[ 2 ] ); + // string Y( argv[ 3 ] ); + // string Z( argv[ 4 ] ); + // string tSpaceString(" "); + // string tCombine = X+tSpaceString+Y+tSpaceString+Z; + // istringstream Converter( tCombine ); + // KThreeVector tPosition; + // Converter >> tPosition; + + double x_min = strtod( argv[2], NULL ); + double x_max = strtod( argv[3], NULL ); + double y_min = strtod( argv[4], NULL ); + double y_max = strtod( argv[5], NULL ); + double z = strtod( argv[6], NULL ); + int n = strtol( argv[7], NULL, 10 ); + + //std::cout << x_min << " " << x_max << " " <GetObjectAs< KSMagneticField >( argv[tIndex] ); + tMagneticFieldObject->Initialize(); + tRootMagneticField.AddMagneticField( tMagneticFieldObject ); + } + + KThreeVector tMagneticField; + + double magnetic_field_magnitudes[n+1][n+1]; + + for( int i=0; i <= n; i++ ) + { + for ( int j=0; j <= n; j++ ) + { + KThreeVector tPosition ( x_min + (x_max-x_min)*i/n, y_min + (y_max-y_min)*j/n, z ); + tRootMagneticField.CalculateField( tPosition, 0.0, tMagneticField ); + magnetic_field_magnitudes[i][j] = tMagneticField.Dot( tPosition ) / tPosition.Magnitude() ; + if (magnetic_field_magnitudes[i][j] > 0.1 ){ + magnetic_field_magnitudes[i][j] = 0.1; + } + else if (magnetic_field_magnitudes[i][j] < -0.1 ){ + magnetic_field_magnitudes[i][j] = -0.1; + } + // magnetic_field_magnitudes[i][j] = log10( tMagneticField.Magnitude() ); + //std::cout << tPosition << "\n"; + } + } + + TApplication* tApplication = new TApplication("app", 0, 0 ); + + TCanvas* c1 = new TCanvas("c1","Track Comparison",200,10,1000,700); + + TH2* h2 = new TH2D("h2", "Central Cross-Section B_r", n+1, x_min, x_max, n+1, y_min, y_max); + + for( int i=0; i <= n; i++ ) + { + for ( int j=0; j <= n; j++ ) + { + h2->Fill( x_min + (x_max-x_min)*i/n, y_min + (y_max-y_min)*j/n, magnetic_field_magnitudes[i][j] ); + } + } + h2->GetXaxis()->SetTitle("x"); + h2->GetYaxis()->SetTitle("y"); + h2->GetZaxis()->SetTitle("log10 of B"); + + h2->GetXaxis()->CenterTitle(); + h2->GetYaxis()->CenterTitle(); + h2->GetZaxis()->CenterTitle(); + + TPaletteAxis *palette=(TPaletteAxis*)h2->FindObject("palette"); + //palette->SetTitle("log10 of B"); + + TStyle *style = new TStyle("Style", "Style_Description"); + style->SetPalette(1, 0); + h2->Draw("COLZ"); + + c1->Update(); + + tApplication->Run(); + + // mainmsg( eNormal ) <<"Magnetic Field at position "<GetObjectAs< KSMagneticField >( argv[tIndex] ); + tMagneticFieldObject->Deinitialize(); + } + KSToolbox::DeleteInstance(); + + return 0; +} diff --git a/Kassiopeia/Applications/Examples/Source/CrossSectionBthetaCalculator.cxx b/Kassiopeia/Applications/Examples/Source/CrossSectionBthetaCalculator.cxx new file mode 100644 index 000000000..9a07dabb9 --- /dev/null +++ b/Kassiopeia/Applications/Examples/Source/CrossSectionBthetaCalculator.cxx @@ -0,0 +1,192 @@ +#include +#include + +#include "KMessage.h" +#include "KTextFile.h" + +#include "KCommandLineTokenizer.hh" +#include "KXMLTokenizer.hh" +#include "KVariableProcessor.hh" +#include "KIncludeProcessor.hh" +#include "KLoopProcessor.hh" +#include "KConditionProcessor.hh" +#include "KElementProcessor.hh" +#include "KTagProcessor.hh" +#include "KPrintProcessor.hh" + +#ifdef Kommon_USE_ROOT +#include "KFormulaProcessor.hh" +#endif + +#ifdef KSC_USE_KALI +#include "KKaliProcessor.hh" +#endif + +#include "KThreeVector.hh" + +#include "KSToolbox.h" +#include "KSMainMessage.h" + +#include "KSRootMagneticField.h" + +#include "TGraph.h" +#include "TH2.h" +#include "TApplication.h" +#include "TCanvas.h" +#include "TAxis.h" +#include "TPaletteAxis.h" +#include "TStyle.h" + +#include + + +using namespace Kassiopeia; +using namespace katrin; +using namespace KGeoBag; + +int main( int argc, char** argv ) +{ + if( argc < 9 ) + { + cout << "usage: ./SimpleMagneticFieldCalculator [ <...>] " << endl; + // ./CrossSectionBthetaCalculator ~/Work/kasper/install/config/Kassiopeia/Examples/TestProject8Simulation.xml -1.0 1.0 -1.0 1.0 0.0 1000 field_electromagnet + // ./SimpleMagneticFieldCalculator ~/Work/kasper/install/config/Kassiopeia/Examples/TestProject8Simulation.xml 0.6143 0.0972 0.0 field_electromagnet + exit( -1 ); + } + + string tFileName( argv[ 1 ] ); + + // string X( argv[ 2 ] ); + // string Y( argv[ 3 ] ); + // string Z( argv[ 4 ] ); + // string tSpaceString(" "); + // string tCombine = X+tSpaceString+Y+tSpaceString+Z; + // istringstream Converter( tCombine ); + // KThreeVector tPosition; + // Converter >> tPosition; + + double x_min = strtod( argv[2], NULL ); + double x_max = strtod( argv[3], NULL ); + double y_min = strtod( argv[4], NULL ); + double y_max = strtod( argv[5], NULL ); + double z = strtod( argv[6], NULL ); + int n = strtol( argv[7], NULL, 10 ); + + //std::cout << x_min << " " << x_max << " " <GetObjectAs< KSMagneticField >( argv[tIndex] ); + tMagneticFieldObject->Initialize(); + tRootMagneticField.AddMagneticField( tMagneticFieldObject ); + } + + KThreeVector tMagneticField; + + double magnetic_field_magnitudes[n+1][n+1]; + + for( int i=0; i <= n; i++ ) + { + for ( int j=0; j <= n; j++ ) + { + KThreeVector tPosition ( x_min + (x_max-x_min)*i/n, y_min + (y_max-y_min)*j/n, z ); + tRootMagneticField.CalculateField( tPosition, 0.0, tMagneticField ); + magnetic_field_magnitudes[i][j] = tMagneticField.Cross( tPosition ).Magnitude() / tPosition.Magnitude() ; + if (magnetic_field_magnitudes[i][j] > 0.1 ){ + magnetic_field_magnitudes[i][j] = 0.1; + } + else if (magnetic_field_magnitudes[i][j] < -0.1 ){ + magnetic_field_magnitudes[i][j] = -0.1; + } + // magnetic_field_magnitudes[i][j] = log10( tMagneticField.Magnitude() ); + //std::cout << tPosition << "\n"; + } + } + + TApplication* tApplication = new TApplication("app", 0, 0 ); + + TCanvas* c1 = new TCanvas("c1","Track Comparison",200,10,1000,700); + + TH2* h2 = new TH2D("h2", "Central Cross-Section B_theta", n+1, x_min, x_max, n+1, y_min, y_max); + + for( int i=0; i <= n; i++ ) + { + for ( int j=0; j <= n; j++ ) + { + h2->Fill( x_min + (x_max-x_min)*i/n, y_min + (y_max-y_min)*j/n, magnetic_field_magnitudes[i][j] ); + } + } + h2->GetXaxis()->SetTitle("x"); + h2->GetYaxis()->SetTitle("y"); + h2->GetZaxis()->SetTitle("log10 of B"); + + h2->GetXaxis()->CenterTitle(); + h2->GetYaxis()->CenterTitle(); + h2->GetZaxis()->CenterTitle(); + + TPaletteAxis *palette=(TPaletteAxis*)h2->FindObject("palette"); + //palette->SetTitle("log10 of B"); + + TStyle *style = new TStyle("Style", "Style_Description"); + style->SetPalette(1, 0); + h2->Draw("COLZ"); + + c1->Update(); + + tApplication->Run(); + + // mainmsg( eNormal ) <<"Magnetic Field at position "<GetObjectAs< KSMagneticField >( argv[tIndex] ); + tMagneticFieldObject->Deinitialize(); + } + KSToolbox::DeleteInstance(); + + return 0; +} diff --git a/Kassiopeia/Applications/Examples/Source/CrossSectionMagneticFieldCalculator.cxx b/Kassiopeia/Applications/Examples/Source/CrossSectionMagneticFieldCalculator.cxx new file mode 100644 index 000000000..77463d738 --- /dev/null +++ b/Kassiopeia/Applications/Examples/Source/CrossSectionMagneticFieldCalculator.cxx @@ -0,0 +1,193 @@ +#include +#include + +#include "KMessage.h" +#include "KTextFile.h" + +#include "KCommandLineTokenizer.hh" +#include "KXMLTokenizer.hh" +#include "KVariableProcessor.hh" +#include "KIncludeProcessor.hh" +#include "KLoopProcessor.hh" +#include "KConditionProcessor.hh" +#include "KElementProcessor.hh" +#include "KTagProcessor.hh" +#include "KPrintProcessor.hh" + +#ifdef Kommon_USE_ROOT +#include "KFormulaProcessor.hh" +#endif + +#ifdef KSC_USE_KALI +#include "KKaliProcessor.hh" +#endif + +#include "KThreeVector.hh" + +#include "KSToolbox.h" +#include "KSMainMessage.h" + +#include "KSRootMagneticField.h" + +#include "TGraph.h" +#include "TH2.h" +#include "TApplication.h" +#include "TCanvas.h" +#include "TAxis.h" +#include "TPaletteAxis.h" +#include "TStyle.h" + +#include + + +using namespace Kassiopeia; +using namespace katrin; +using namespace KGeoBag; + +int main( int argc, char** argv ) +{ + if( argc < 9 ) + { + cout << "usage: ./SimpleMagneticFieldCalculator [ <...>] " << endl; + // ./CrossSectionMagneticFieldCalculator ~/Work/kasper/install/config/Kassiopeia/Examples/TestProject8Simulation.xml -1.0 1.0 -1.0 1.0 0.0 1000 field_electromagnet + // ./SimpleMagneticFieldCalculator ~/Work/kasper/install/config/Kassiopeia/Examples/TTestProject8Simulation.xml 0.6143 0.0972 0.0 field_electromagnet + // ./CrossSectionMagneticFieldCalculator ~/Work/kasper/install/config/Kassiopeia/Examples/TestProject8Simulation.xml -0.1 0.1 -0.1 0.1 2.45 1000 field_electromagnet + exit( -1 ); + } + + string tFileName( argv[ 1 ] ); + + // string X( argv[ 2 ] ); + // string Y( argv[ 3 ] ); + // string Z( argv[ 4 ] ); + // string tSpaceString(" "); + // string tCombine = X+tSpaceString+Y+tSpaceString+Z; + // istringstream Converter( tCombine ); + // KThreeVector tPosition; + // Converter >> tPosition; + + double x_min = strtod( argv[2], NULL ); + double x_max = strtod( argv[3], NULL ); + double y_min = strtod( argv[4], NULL ); + double y_max = strtod( argv[5], NULL ); + double z = strtod( argv[6], NULL ); + int n = strtol( argv[7], NULL, 10 ); + + //std::cout << x_min << " " << x_max << " " <GetObjectAs< KSMagneticField >( argv[tIndex] ); + tMagneticFieldObject->Initialize(); + tRootMagneticField.AddMagneticField( tMagneticFieldObject ); + } + + KThreeVector tMagneticField; + + double magnetic_field_magnitudes[n+1][n+1]; + + for( int i=0; i <= n; i++ ) + { + for ( int j=0; j <= n; j++ ) + { + KThreeVector tPosition ( x_min + (x_max-x_min)*i/n, y_min + (y_max-y_min)*j/n, z ); + tRootMagneticField.CalculateField( tPosition, 0.0, tMagneticField ); + // magnetic_field_magnitudes[i][j] = tMagneticField.Dot( tPosition ) / tPosition.Magnitude() ; + // if (magnetic_field_magnitudes[i][j] > 0.1 ){ + // magnetic_field_magnitudes[i][j] = 0.1; + // } + // else if (magnetic_field_magnitudes[i][j] < -0.1 ){ + // magnetic_field_magnitudes[i][j] = -0.1; + // } + magnetic_field_magnitudes[i][j] = log10( tMagneticField.Magnitude() ); + //std::cout << tPosition << "\n"; + } + } + + TApplication* tApplication = new TApplication("app", 0, 0 ); + + TCanvas* c1 = new TCanvas("c1","Track Comparison",200,10,1000,700); + + TH2* h2 = new TH2D("h2", "Central Cross-Section Magnetic Field", n+1, x_min, x_max, n+1, y_min, y_max); + + for( int i=0; i <= n; i++ ) + { + for ( int j=0; j <= n; j++ ) + { + h2->Fill( x_min + (x_max-x_min)*i/n, y_min + (y_max-y_min)*j/n, magnetic_field_magnitudes[i][j] ); + } + } + h2->GetXaxis()->SetTitle("x"); + h2->GetYaxis()->SetTitle("y"); + h2->GetZaxis()->SetTitle("log10 of B"); + + h2->GetXaxis()->CenterTitle(); + h2->GetYaxis()->CenterTitle(); + h2->GetZaxis()->CenterTitle(); + + TPaletteAxis *palette=(TPaletteAxis*)h2->FindObject("palette"); + //palette->SetTitle("log10 of B"); + + TStyle *style = new TStyle("Style", "Style_Description"); + style->SetPalette(1, 0); + h2->Draw("COLZ"); + + c1->Update(); + + tApplication->Run(); + + // mainmsg( eNormal ) <<"Magnetic Field at position "<GetObjectAs< KSMagneticField >( argv[tIndex] ); + tMagneticFieldObject->Deinitialize(); + } + KSToolbox::DeleteInstance(); + + return 0; +} diff --git a/Kassiopeia/Applications/Examples/Source/MultiFileAnalysis.cxx b/Kassiopeia/Applications/Examples/Source/MultiFileAnalysis.cxx new file mode 100644 index 000000000..816a57e03 --- /dev/null +++ b/Kassiopeia/Applications/Examples/Source/MultiFileAnalysis.cxx @@ -0,0 +1,236 @@ +#include "KSReadFileROOT.h" +#include "TGraph.h" +#include "TH1.h" +#include "TApplication.h" +#include "TCanvas.h" +#include "TAxis.h" + +#include + +#include +#include + +using namespace Kassiopeia; + +int main() +{ + + int term_max_step_count = 0; + int term_max_r_count = 0; + int term_minmax_z_count = 0; + + std::vector term_times; + + std::vector initial_ke_values; + std::vector final_ke_values; + + // string file_base = "~/Work/P8 Tech Note/Center_Standard/"; + // string filelist[] = {"09_09_16__1", "09_09_16__2", "09_10_16__1", "09_11_16__1", "09_12_16__1"}; + // string file_base = "~/Work/P8 Tech Note/Frustrum_Standard/"; + // string filelist[] = {"09_13_16__1", "09_16_16__1", "09_17_16__1"}; + // string file_base = "~/Work/P8 Tech Note/Center_Double_End/"; + // string filelist[] = {""}; + // string file_base = "~/Work/P8 Tech Note/Frustrum_Double_End/"; + // string filelist[] = {""}; + // string file_base = "~/Work/P8 Tech Note/Center_Half_End/"; + // string filelist[] = {""}; + // string file_base = "~/Work/P8 Tech Note/Frustrum_Half_End/"; + // string filelist[] = {""}; + // string file_base = "~/Work/P8 Tech Note/Center_1000kA/"; + // string filelist[] = {""}; + // string file_base = "~/Work/P8 Tech Note/Center_800kA/"; + // string filelist[] = {""}; + // string file_base = "~/Work/P8 Tech Note/Center_Double_T/"; + // string filelist[] = {"10_03_16", "10_10_16"}; + // string file_base = "~/Work/P8 Tech Note/Center_Half_T/"; + // string filelist[] = {""}; + // string file_base = "~/Work/P8 Tech Note/Center_Half_T/"; + // string filelist[] = {""}; + string file_base = "~/Work/P8 Tech Note/Center_Double_t/"; + string filelist[] = {""}; + // string file_base = "~/Work/P8 Tech Note/Center_Half_T_450kA/"; + // string filelist[] = {""}; + string file_end = "/Project8Simulation.root"; + + for ( string filename : filelist ) + { + + KRootFile* tRootFile = new KRootFile(); + tRootFile->AddToNames( file_base + filename + file_end ); + + KSReadFileROOT tReader; + tReader.OpenFile(tRootFile ); + + KSReadRunROOT& tRunReader = tReader.GetRun(); + KSReadEventROOT& tEventReader = tReader.GetEvent(); + KSReadTrackROOT& tTrackReader = tReader.GetTrack(); + //KSReadStepROOT& tStepReader= tReader.GetStep(); + + //KSReadObjectROOT& tCell = tStepReader.GetObject( "component_track_world" ); + //KSDouble& tTime = tCell.Get< KSDouble >( "time" ); + //KSThreeVector& tMomentum = tCell.Get< KSThreeVector >( "momentum" ); + + KSReadObjectROOT& tCell = tTrackReader.GetObject( "component_track_world" ); + KSString& tTerm = tCell.Get( "terminator_name" ); + + KSDouble& tTime = tCell.Get< KSDouble >( "final_time" ); + KSDouble& tIKE = tCell.Get< KSDouble >( "initial_kinetic_energy" ); + KSDouble& tFKE = tCell.Get< KSDouble >( "final_kinetic_energy" ); + + //vector* list_a = new vector(); + //vector* list_b = new vector(); + + for( tRunReader = 0; tRunReader <= tRunReader.GetLastRunIndex(); tRunReader++ ) + { + for( tEventReader = tRunReader.GetFirstEventIndex(); tEventReader <= tRunReader.GetLastEventIndex(); tEventReader++ ) + { + for( tTrackReader = tEventReader.GetFirstTrackIndex(); tTrackReader <= tEventReader.GetLastTrackIndex(); tTrackReader++ ) + { + // for( tStepReader = tTrackReader.GetFirstStepIndex(); tStepReader <= tTrackReader.GetLastStepIndex(); tStepReader++ ) + // { + // if( tCell.Valid() && i % 1000 == 999) + // { + // //std::cout << "Time: " << tTime.Value() << "\t\tMomentum_Z: " << tMomentum.Value().Z() << "\n"; + // time_list->push_back( tTime.Value() ); + // momentum_z_list->push_back( tMomentum.Value().Z() ); + // } + // i++; + // } + + if(tCell.Valid()) + { + if( tTerm.Value() == "term_max_steps" ) + { + term_max_step_count++; + final_ke_values.push_back(tFKE.Value()); + } + else if( tTerm.Value() == "term_max_r" ) + { + term_max_r_count++; + } + else if( tTerm.Value() == "term_max_z" || tTerm.Value() == "term_min_z" ) + { + term_minmax_z_count++; + } + else + { + std::cout << "Error: bad terminator name.\n"; + } + term_times.push_back(tTime.Value()); + initial_ke_values.push_back(tIKE.Value()); + } + } + } + } + + //tReader.CloseFile(); + + delete tRootFile; + + } + + std::cout << "Number trapped: " << term_max_step_count << "\n"; + + // TApplication* tApplication = new TApplication("app", 0, 0 ); + // + // TCanvas* c1 = new TCanvas("c1","Track Comparison",200,10,1000,700); + + //double bar_x[] = {1. ,3. ,5. }; + // char* bar_names[] = {"Trapped", "Escaped Radially", "Escaped Axially"}; + // double bar_values[] = {term_max_step_count, term_max_r_count, term_minmax_z_count}; + + // double remaining_count [60]; + // double bar_names [60]; + // for (int i = 0; i < 60; i++){ + // remaining_count[i] = 100; + // bar_names[i] = 0.01 * i; + // } + // + // for (int i = 0; i < term_times.size(); i++){ + // //std::cout << term_times[i] << "\n"; + // for (int j = 59; j > 100.0*term_times[i]; j--){ + // remaining_count[j]--; + // } + // } + + // TGraph *gr1 = new TGraph( 4, bar_names, bar_values ); + // gr1->SetFillColor(40); + // // gr1->SetMarkerColor(4); + // gr1->Draw("AB"); + // gr1->GetXaxis()->SetTitle( "Result" ); + // gr1->GetYaxis()->SetTitle( "Frequency" ); + // gr1->GetXaxis()->CenterTitle(); + // gr1->GetYaxis()->CenterTitle(); + // gr1->SetTitle( "Distribution of Simulation Results"); + // gr1->Draw("AB"); + // + // TH1* h1 = new TH1I("h1", "Distribution of Simulation Results", 3, 0, 6); + // + // for( int i = 0; i < 3; i++) + // { + // h1->Fill( bar_names[i], bar_values[i] ); + // //h1->GetXaxis()->SetBinLabel( i, bar_names[i] ); + // } + // h1->GetXaxis()->SetTitle("Result"); + // h1->GetYaxis()->SetTitle("Frequency"); + // h1->GetXaxis()->CenterTitle(); + // h1->GetYaxis()->CenterTitle(); + // h1->SetFillColor(40); + // h1->Draw("HIST"); + + // TGraph *gr1 = new TGraph( 4, bar_names, remaining_count ); + // gr1->SetFillColor(40); + // // gr1->SetMarkerColor(4); + // gr1->Draw("AB"); + // gr1->GetXaxis()->SetTitle( "Time (s)" ); + // gr1->GetYaxis()->SetTitle( "Particles Still in Trap" ); + // gr1->GetXaxis()->CenterTitle(); + // gr1->GetYaxis()->CenterTitle(); + // gr1->SetTitle( "Particles Trapped as a Function of Time"); + // gr1->Draw("AB"); + + // TH1* h1 = new TH1I("h1", "Particles Trapped as a Function of Time", 60, 0, 0.60); + // + // for( int i = 0; i < 60; i++) + // { + // h1->Fill( bar_names[i], remaining_count[i] ); + // //h1->GetXaxis()->SetBinLabel( i, bar_names[i] ); + // } + // h1->GetXaxis()->SetTitle("Time (s)"); + // h1->GetYaxis()->SetTitle("Particles Still in Trap"); + // h1->GetXaxis()->CenterTitle(); + // h1->GetYaxis()->CenterTitle(); + // h1->SetFillColor(40); + // h1->Draw("HIST"); + + // c1->Update(); + // + // tApplication->Run(); + + std::ofstream TTStream; + std::ofstream IKEStream; + std::ofstream FKEStream; + + TTStream.open("Termination_Times.txt"); + for (unsigned int i = 0; i < term_times.size(); i++){ + TTStream << term_times[i]; + TTStream << "\t"; + } + TTStream.close(); + + IKEStream.open("Initial_Kinetic_Energies.txt"); + for (unsigned int i = 0; i < initial_ke_values.size(); i++){ + IKEStream << initial_ke_values[i]; + IKEStream << "\t"; + } + IKEStream.close(); + + FKEStream.open("Final_Kinetic_Energies.txt"); + for (unsigned int i = 0; i < final_ke_values.size(); i++){ + FKEStream << final_ke_values[i]; + FKEStream << "\t"; + } + FKEStream.close(); + + return 0; +} diff --git a/Kassiopeia/Bindings/CMakeLists.txt b/Kassiopeia/Bindings/CMakeLists.txt index c09308a48..8ff349586 100644 --- a/Kassiopeia/Bindings/CMakeLists.txt +++ b/Kassiopeia/Bindings/CMakeLists.txt @@ -120,8 +120,10 @@ set( BINDINGS_HEADER_FILES Interactions/Include/KSIntSpinFlipBuilder.h Interactions/Include/KSIntDecayBuilder.h Interactions/Include/KSIntSurfaceSpecularBuilder.h + Interactions/Include/KSIntSurfaceUCNBuilder.h Interactions/Include/KSIntSurfaceDiffuseBuilder.h Interactions/Include/KSIntSurfaceMultiplicationBuilder.h + Interactions/Include/KSIntSurfaceSpinFlipBuilder.h Interactions/Include/KESSSurfaceInteractionBuilder.h Interactions/Include/KESSElasticElsepaBuilder.h Interactions/Include/KESSInelasticPennBuilder.h @@ -129,6 +131,7 @@ set( BINDINGS_HEADER_FILES # modifiers Modifiers/Include/KSModDynamicEnhancementBuilder.h + Modifiers/Include/KSModSplitOnTurnBuilder.h Modifiers/Include/KSModEventReportBuilder.h # navigators @@ -323,15 +326,17 @@ set( BINDINGS_SOURCE_FILES Interactions/Source/KSIntDecayCalculatorFerencBBRTransitionBuilder.cxx Interactions/Source/KSIntDecayCalculatorFerencIonisationBuilder.cxx Interactions/Source/KSIntCalculatorHydrogenBuilder.cxx - Interactions/Source/KSIntCalculatorIonBuilder.cxx + Interactions/Source/KSIntCalculatorIonBuilder.cxx Interactions/Source/KSIntCalculatorArgonBuilder.cxx Interactions/Source/KSIntCalculatorKESSBuilder.cxx Interactions/Source/KSIntScatteringBuilder.cxx Interactions/Source/KSIntSpinFlipBuilder.cxx Interactions/Source/KSIntDecayBuilder.cxx Interactions/Source/KSIntSurfaceSpecularBuilder.cxx + Interactions/Source/KSIntSurfaceUCNBuilder.cxx Interactions/Source/KSIntSurfaceDiffuseBuilder.cxx Interactions/Source/KSIntSurfaceMultiplicationBuilder.cxx + Interactions/Source/KSIntSurfaceSpinFlipBuilder.cxx Interactions/Source/KESSSurfaceInteractionBuilder.cxx Interactions/Source/KESSElasticElsepaBuilder.cxx Interactions/Source/KESSInelasticPennBuilder.cxx @@ -339,6 +344,7 @@ set( BINDINGS_SOURCE_FILES # modifiers Modifiers/Source/KSModDynamicEnhancementBuilder.cxx + Modifiers/Source/KSModSplitOnTurnBuilder.cxx Modifiers/Source/KSModEventReportBuilder.cxx # navigators diff --git a/Kassiopeia/Bindings/Fields/Source/KSFieldKEMFieldObjectsBuilder.cxx b/Kassiopeia/Bindings/Fields/Source/KSFieldKEMFieldObjectsBuilder.cxx index 21d823c5c..033fbf26b 100644 --- a/Kassiopeia/Bindings/Fields/Source/KSFieldKEMFieldObjectsBuilder.cxx +++ b/Kassiopeia/Bindings/Fields/Source/KSFieldKEMFieldObjectsBuilder.cxx @@ -19,7 +19,7 @@ #include "KMagneticSuperpositionFieldBuilder.hh" #include "KStaticElectromagnetFieldBuilder.hh" -#ifdef KASPER_USE_VTK +#ifdef Kassiopeia_USE_VTK #include "KElectrostaticPotentialmapBuilder.hh" #include "KMagnetostaticFieldmapBuilder.hh" #endif @@ -36,7 +36,7 @@ STATICINT sKSRootConstant = KSRootBuilder::ComplexElement< KElectrostaticBoundaryFieldWithKGeoBag >( "ksfield_electrostatic" ) + KSRootBuilder::ComplexElement< KRampedElectricField >( "ksfield_electric_ramped" ) + KSRootBuilder::ComplexElement< KRampedElectric2Field >( "ksfield_electric_ramped_2fields") + -#ifdef KASPER_USE_VTK +#ifdef Kassiopeia_USE_VTK KSRootBuilder::ComplexElement< KElectrostaticPotentialmap >( "ksfield_electric_potentialmap" ) + KSRootBuilder::ComplexElement< KElectrostaticPotentialmapCalculator >( "ksfield_electric_potentialmap_calculator" ) + #endif @@ -47,7 +47,7 @@ STATICINT sKSRootConstant = KSRootBuilder::ComplexElement< KMagneticDipoleField >( "ksfield_magnetic_dipole" ) + KSRootBuilder::ComplexElement< KRampedMagneticField >( "ksfield_magnetic_ramped" ) + KSRootBuilder::ComplexElement< KMagneticSuperpositionField >( "ksfield_magnetic_super_position" ) + -#ifdef KASPER_USE_VTK +#ifdef Kassiopeia_USE_VTK KSRootBuilder::ComplexElement< KMagnetostaticFieldmap >( "ksfield_magnetic_fieldmap" ) + KSRootBuilder::ComplexElement< KMagnetostaticFieldmapCalculator >( "ksfield_magnetic_fieldmap_calculator" ) + #endif diff --git a/Kassiopeia/Bindings/Generators/Include/KSGenDirectionSurfaceCompositeBuilder.h b/Kassiopeia/Bindings/Generators/Include/KSGenDirectionSurfaceCompositeBuilder.h index 1ff7da6cc..4949c16e5 100644 --- a/Kassiopeia/Bindings/Generators/Include/KSGenDirectionSurfaceCompositeBuilder.h +++ b/Kassiopeia/Bindings/Generators/Include/KSGenDirectionSurfaceCompositeBuilder.h @@ -35,7 +35,7 @@ namespace katrin if(tSurfaces.size() == 0) { genmsg(eWarning) << "no surfaces found for specifier <" << aContainer->AsReference() << ">" << eom; - return false; + return true; } for(tSurfaceIt = tSurfaces.begin(); tSurfaceIt != tSurfaces.end(); tSurfaceIt++) { diff --git a/Kassiopeia/Bindings/Generators/Include/KSGenPositionMaskBuilder.h b/Kassiopeia/Bindings/Generators/Include/KSGenPositionMaskBuilder.h index c3c546a15..f08d389a5 100644 --- a/Kassiopeia/Bindings/Generators/Include/KSGenPositionMaskBuilder.h +++ b/Kassiopeia/Bindings/Generators/Include/KSGenPositionMaskBuilder.h @@ -32,7 +32,7 @@ namespace katrin if(tSpaces.size() == 0) { genmsg(eWarning) << "no spaces found for specifier <" << aContainer->AsReference() << ">" << eom; - return false; + return true; } for(vector< KGeoBag::KGSpace* >::iterator tSpaceIt = tSpaces.begin(); tSpaceIt != tSpaces.end(); tSpaceIt++) @@ -47,7 +47,7 @@ namespace katrin if(tSpaces.size() == 0) { genmsg(eWarning) << "no spaces found for specifier <" << aContainer->AsReference() << ">" << eom; - return false; + return true; } for(vector< KGeoBag::KGSpace* >::iterator tSpaceIt = tSpaces.begin(); tSpaceIt != tSpaces.end(); tSpaceIt++) diff --git a/Kassiopeia/Bindings/Generators/Include/KSGenPositionMeshSurfaceRandomBuilder.h b/Kassiopeia/Bindings/Generators/Include/KSGenPositionMeshSurfaceRandomBuilder.h index fa177b6e1..868014f09 100644 --- a/Kassiopeia/Bindings/Generators/Include/KSGenPositionMeshSurfaceRandomBuilder.h +++ b/Kassiopeia/Bindings/Generators/Include/KSGenPositionMeshSurfaceRandomBuilder.h @@ -44,7 +44,7 @@ namespace katrin if( tSurfaces.size() == 0 ) { genmsg( eWarning ) << "no surfaces found for specifier <" << aContainer->AsReference< std::string >() << ">" << eom; - return false; + return true; } for( tSurfaceIt = tSurfaces.begin(); tSurfaceIt != tSurfaces.end(); tSurfaceIt++ ) diff --git a/Kassiopeia/Bindings/Generators/Include/KSGenPositionSpaceRandomBuilder.h b/Kassiopeia/Bindings/Generators/Include/KSGenPositionSpaceRandomBuilder.h index a54af791b..ca945ca13 100644 --- a/Kassiopeia/Bindings/Generators/Include/KSGenPositionSpaceRandomBuilder.h +++ b/Kassiopeia/Bindings/Generators/Include/KSGenPositionSpaceRandomBuilder.h @@ -30,21 +30,21 @@ namespace katrin if(aContainer->GetName() == "spaces") { - vector< KGeoBag::KGSpace* > tSpaces = KGeoBag::KGInterface::GetInstance()->RetrieveSpaces( aContainer->AsReference< std::string >() ); - vector< KGeoBag::KGSpace* >::iterator tSpaceIt; - KGeoBag::KGSpace* tSpace; - - if(tSpaces.size() == 0) { - genmsg(eWarning) << "no spaces found for specifier <" << aContainer->AsReference< std::string >() << ">" << eom; - return false; - } - - for(tSpaceIt = tSpaces.begin(); tSpaceIt != tSpaces.end(); tSpaceIt++) { - tSpace = *tSpaceIt; - fObject->AddSpace(tSpace); - } - return true; - } + vector< KGeoBag::KGSpace* > tSpaces = KGeoBag::KGInterface::GetInstance()->RetrieveSpaces( aContainer->AsReference< std::string >() ); + vector< KGeoBag::KGSpace* >::iterator tSpaceIt; + KGeoBag::KGSpace* tSpace; + + if(tSpaces.size() == 0) { + genmsg(eWarning) << "no spaces found for specifier <" << aContainer->AsReference< std::string >() << ">" << eom; + return true; + } + + for(tSpaceIt = tSpaces.begin(); tSpaceIt != tSpaces.end(); tSpaceIt++) { + tSpace = *tSpaceIt; + fObject->AddSpace(tSpace); + } + return true; + } return false; } diff --git a/Kassiopeia/Bindings/Generators/Include/KSGenPositionSurfaceRandomBuilder.h b/Kassiopeia/Bindings/Generators/Include/KSGenPositionSurfaceRandomBuilder.h index 2d1543a9d..177b64eb1 100644 --- a/Kassiopeia/Bindings/Generators/Include/KSGenPositionSurfaceRandomBuilder.h +++ b/Kassiopeia/Bindings/Generators/Include/KSGenPositionSurfaceRandomBuilder.h @@ -35,7 +35,7 @@ namespace katrin if(tSurfaces.size() == 0) { genmsg(eWarning) << "no surfaces found for specifier <" << aContainer->AsReference() << ">" << eom; - return false; + return true; } for(tSurfaceIt = tSurfaces.begin(); tSurfaceIt != tSurfaces.end(); tSurfaceIt++) { diff --git a/Kassiopeia/Bindings/Generators/Include/KSGenValueSetBuilder.h b/Kassiopeia/Bindings/Generators/Include/KSGenValueSetBuilder.h index 460591f93..e62952cca 100644 --- a/Kassiopeia/Bindings/Generators/Include/KSGenValueSetBuilder.h +++ b/Kassiopeia/Bindings/Generators/Include/KSGenValueSetBuilder.h @@ -28,6 +28,11 @@ namespace katrin aContainer->CopyTo( fObject, &KSGenValueSet::SetValueStop ); return true; } + if( aContainer->GetName() == "value_increment" ) + { + aContainer->CopyTo( fObject, &KSGenValueSet::SetValueIncrement ); + return true; + } if( aContainer->GetName() == "value_count" ) { aContainer->CopyTo( fObject, &KSGenValueSet::SetValueCount ); diff --git a/Kassiopeia/Bindings/Generators/Source/KSGenGeneratorCompositeBuilder.cxx b/Kassiopeia/Bindings/Generators/Source/KSGenGeneratorCompositeBuilder.cxx index 3e4ccaedd..6cced2bbd 100644 --- a/Kassiopeia/Bindings/Generators/Source/KSGenGeneratorCompositeBuilder.cxx +++ b/Kassiopeia/Bindings/Generators/Source/KSGenGeneratorCompositeBuilder.cxx @@ -68,7 +68,7 @@ namespace katrin KSGenGeneratorCompositeBuilder::ComplexElement< KSGenPositionSphericalComposite >( "position_spherical_composite" ) + KSGenGeneratorCompositeBuilder::ComplexElement< KSGenPositionFrustrumComposite >( "position_frustrum_composite" ) + KSGenGeneratorCompositeBuilder::ComplexElement< KSGenPositionSpaceRandom >( "position_space_random" ) + - KSGenGeneratorCompositeBuilder::ComplexElement< KSGenPositionSurfaceRandom >( "position_surface_random" ) + +// KSGenGeneratorCompositeBuilder::ComplexElement< KSGenPositionSurfaceRandom >( "position_surface_random" ) + KSGenGeneratorCompositeBuilder::ComplexElement< KSGenPositionSurfaceAdjustmentStep >( "position_surface_adjustment_step" ) + KSGenGeneratorCompositeBuilder::ComplexElement< KSGenPositionMeshSurfaceRandom >( "position_mesh_surface_random" ) + KSGenGeneratorCompositeBuilder::ComplexElement< KSGenPositionMask >( "position_mask" ) + diff --git a/Kassiopeia/Bindings/Generators/Source/KSGenPositionMaskBuilder.cxx b/Kassiopeia/Bindings/Generators/Source/KSGenPositionMaskBuilder.cxx index 24b90eeac..4691c8a29 100644 --- a/Kassiopeia/Bindings/Generators/Source/KSGenPositionMaskBuilder.cxx +++ b/Kassiopeia/Bindings/Generators/Source/KSGenPositionMaskBuilder.cxx @@ -29,7 +29,7 @@ namespace katrin KSGenPositionMaskBuilder::ComplexElement< KSGenPositionRectangularComposite >( "position_rectangular_composite" ) + KSGenPositionMaskBuilder::ComplexElement< KSGenPositionCylindricalComposite >( "position_cylindrical_composite" ) + KSGenPositionMaskBuilder::ComplexElement< KSGenPositionSphericalComposite >( "position_spherical_composite" ) + - KSGenPositionMaskBuilder::ComplexElement< KSGenPositionSurfaceRandom >( "position_surface_random" ) + +// KSGenPositionMaskBuilder::ComplexElement< KSGenPositionSurfaceRandom >( "position_surface_random" ) + KSGenPositionMaskBuilder::ComplexElement< KSGenPositionSpaceRandom >( "position_space_random" ) + KSGenPositionMaskBuilder::ComplexElement< KSGenPositionMeshSurfaceRandom >( "position_mesh_surface_random" ); diff --git a/Kassiopeia/Bindings/Generators/Source/KSGenValueSetBuilder.cxx b/Kassiopeia/Bindings/Generators/Source/KSGenValueSetBuilder.cxx index 5b2ba74d9..c58425b04 100644 --- a/Kassiopeia/Bindings/Generators/Source/KSGenValueSetBuilder.cxx +++ b/Kassiopeia/Bindings/Generators/Source/KSGenValueSetBuilder.cxx @@ -16,6 +16,7 @@ namespace katrin KSGenValueSetBuilder::Attribute< string >( "name" ) + KSGenValueSetBuilder::Attribute< double >( "value_start" ) + KSGenValueSetBuilder::Attribute< double >( "value_stop" ) + + KSGenValueSetBuilder::Attribute< double >( "value_increment" ) + KSGenValueSetBuilder::Attribute< unsigned int >( "value_count" ); STATICINT sKSGenValueSet = diff --git a/Kassiopeia/Bindings/Geometry/Include/KSGeoSideBuilder.h b/Kassiopeia/Bindings/Geometry/Include/KSGeoSideBuilder.h index c9e8d4997..837a43da0 100644 --- a/Kassiopeia/Bindings/Geometry/Include/KSGeoSideBuilder.h +++ b/Kassiopeia/Bindings/Geometry/Include/KSGeoSideBuilder.h @@ -29,7 +29,7 @@ namespace katrin if( tSurfaces.size() == 0 ) { oprmsg( eWarning ) << "no surfaces found for specifier <" << aContainer->AsReference< std::string >() << ">" << eom; - return false; + return true; } for( tSurfaceIt = tSurfaces.begin(); tSurfaceIt != tSurfaces.end(); tSurfaceIt++ ) @@ -51,7 +51,7 @@ namespace katrin if( tSpaces.size() == 0 ) { oprmsg( eWarning ) << "no spaces found for specifier <" << aContainer->AsReference< std::string >() << ">" << eom; - return false; + return true; } for( tSpaceIt = tSpaces.begin(); tSpaceIt != tSpaces.end(); tSpaceIt++ ) diff --git a/Kassiopeia/Bindings/Geometry/Include/KSGeoSurfaceBuilder.h b/Kassiopeia/Bindings/Geometry/Include/KSGeoSurfaceBuilder.h index 0a7b2983b..14ebfa4d9 100644 --- a/Kassiopeia/Bindings/Geometry/Include/KSGeoSurfaceBuilder.h +++ b/Kassiopeia/Bindings/Geometry/Include/KSGeoSurfaceBuilder.h @@ -29,7 +29,7 @@ namespace katrin if( tSurfaces.size() == 0 ) { oprmsg( eWarning ) << "no surfaces found for specifier <" << aContainer->AsReference< std::string >() << ">" << eom; - return false; + return true; } for( tSurfaceIt = tSurfaces.begin(); tSurfaceIt != tSurfaces.end(); tSurfaceIt++ ) @@ -51,7 +51,7 @@ namespace katrin if( tSpaces.size() == 0 ) { oprmsg( eWarning ) << "no spaces found for specifier <" << aContainer->AsReference< std::string >() << ">" << eom; - return false; + return true; } for( tSpaceIt = tSpaces.begin(); tSpaceIt != tSpaces.end(); tSpaceIt++ ) diff --git a/Kassiopeia/Bindings/Interactions/Include/KSIntSurfaceSpinFlipBuilder.h b/Kassiopeia/Bindings/Interactions/Include/KSIntSurfaceSpinFlipBuilder.h new file mode 100644 index 000000000..b41c1527a --- /dev/null +++ b/Kassiopeia/Bindings/Interactions/Include/KSIntSurfaceSpinFlipBuilder.h @@ -0,0 +1,31 @@ +#ifndef Kassiopeia_KSIntSurfaceSpinFlipBuilder_h_ +#define Kassiopeia_KSIntSurfaceSpinFlipBuilder_h_ + +#include "KComplexElement.hh" +#include "KSIntSurfaceSpinFlip.h" + +using namespace Kassiopeia; +namespace katrin +{ + + typedef KComplexElement< KSIntSurfaceSpinFlip > KSIntSurfaceSpinFlipBuilder; + + template< > + inline bool KSIntSurfaceSpinFlipBuilder::AddAttribute( KContainer* aContainer ) + { + if( aContainer->GetName() == "name" ) + { + aContainer->CopyTo( fObject, &KNamed::SetName ); + return true; + } + if( aContainer->GetName() == "probability" ) + { + aContainer->CopyTo( fObject, &KSIntSurfaceSpinFlip::SetProbability ); + return true; + } + return false; + } + +} + +#endif diff --git a/Kassiopeia/Bindings/Interactions/Include/KSIntSurfaceUCNBuilder.h b/Kassiopeia/Bindings/Interactions/Include/KSIntSurfaceUCNBuilder.h new file mode 100644 index 000000000..c0f12d2e9 --- /dev/null +++ b/Kassiopeia/Bindings/Interactions/Include/KSIntSurfaceUCNBuilder.h @@ -0,0 +1,35 @@ +#ifndef Kassiopeia_KSIntSurfaceUCNBuilder_h_ +#define Kassiopeia_KSIntSurfaceUCNBuilder_h_ + +#include "KComplexElement.hh" +#include "KSIntSurfaceUCN.h" + +using namespace Kassiopeia; +namespace katrin +{ + + typedef KComplexElement< KSIntSurfaceUCN > KSIntSurfaceUCNBuilder; + + template< > + inline bool KSIntSurfaceUCNBuilder::AddAttribute( KContainer* aContainer ) + { + if( aContainer->GetName() == "name" ) + { + aContainer->CopyTo( fObject, &KNamed::SetName ); + return true; + } + if( aContainer->GetName() == "transmission_probability" ) + { + aContainer->CopyTo( fObject, &KSIntSurfaceUCN::SetProbability ); + return true; + } + if( aContainer->GetName() == "spin_flip_probability" ) + { + aContainer->CopyTo( fObject, &KSIntSurfaceUCN::SetSpinFlipProbability ); + return true; + } + return false; + } + +} +#endif diff --git a/Kassiopeia/Bindings/Interactions/Source/KSIntSurfaceSpinFlipBuilder.cxx b/Kassiopeia/Bindings/Interactions/Source/KSIntSurfaceSpinFlipBuilder.cxx new file mode 100644 index 000000000..f23213231 --- /dev/null +++ b/Kassiopeia/Bindings/Interactions/Source/KSIntSurfaceSpinFlipBuilder.cxx @@ -0,0 +1,19 @@ +#include "KSIntSurfaceSpinFlipBuilder.h" +#include "KSRootBuilder.h" + +using namespace Kassiopeia; +namespace katrin +{ + + template< > + KSIntSurfaceSpinFlipBuilder::~KComplexElement() + { + } + + STATICINT sKSIntSurfaceSpinFlipStructure = + KSIntSurfaceSpinFlipBuilder::Attribute< string >( "name" ) + + KSIntSurfaceSpinFlipBuilder::Attribute< double >( "probability" ); + + STATICINT sKSIntSurfaceSpinFlipElement = + KSRootBuilder::ComplexElement< KSIntSurfaceSpinFlip >( "ksint_surface_spin_flip" ); +} diff --git a/Kassiopeia/Bindings/Interactions/Source/KSIntSurfaceUCNBuilder.cxx b/Kassiopeia/Bindings/Interactions/Source/KSIntSurfaceUCNBuilder.cxx new file mode 100644 index 000000000..c7ab0836e --- /dev/null +++ b/Kassiopeia/Bindings/Interactions/Source/KSIntSurfaceUCNBuilder.cxx @@ -0,0 +1,22 @@ +#include "KSIntSurfaceUCNBuilder.h" +#include "KSRootBuilder.h" + +using namespace Kassiopeia; +using namespace std; + +namespace katrin +{ + + template< > + KSIntSurfaceUCNBuilder::~KComplexElement() + { + } + + STATICINT sKSIntSurfaceUCNStructure = + KSIntSurfaceUCNBuilder::Attribute< string >( "name" ) + + KSIntSurfaceUCNBuilder::Attribute< double >( "spin_flip_probability" ) + + KSIntSurfaceUCNBuilder::Attribute< double >( "transmission_probability" ); + + STATICINT sKSIntSurfaceUCNElement = + KSRootBuilder::ComplexElement< KSIntSurfaceUCN >( "ksint_surface_UCN" ); +} diff --git a/Kassiopeia/Bindings/Modifiers/Include/KSModSplitOnTurnBuilder.h b/Kassiopeia/Bindings/Modifiers/Include/KSModSplitOnTurnBuilder.h new file mode 100644 index 000000000..ab729cc11 --- /dev/null +++ b/Kassiopeia/Bindings/Modifiers/Include/KSModSplitOnTurnBuilder.h @@ -0,0 +1,45 @@ +#ifndef Kassiopeia_KSModSplitOnTurnBuilder_h_ +#define Kassiopeia_KSModSplitOnTurnBuilder_h_ + +#include "KComplexElement.hh" +#include "KSModSplitOnTurn.h" +#include "KToolbox.h" + +using namespace Kassiopeia; + +namespace katrin +{ + typedef KComplexElement< KSModSplitOnTurn > KSModSplitOnTurnBuilder; + + template< > + inline bool KSModSplitOnTurnBuilder::AddAttribute(KContainer *aContainer) + { + if( aContainer->GetName() == "name" ) + { + aContainer->CopyTo( fObject, &KNamed::SetName ); + return true; + } + if( aContainer->GetName() == "direction" ) + { + if( aContainer->AsReference< std::string >() == "forward" ) + { + fObject->SetDirection( KSModSplitOnTurn::eForward ); + return true; + } + if( aContainer->AsReference< std::string >() == "backward" ) + { + fObject->SetDirection( KSModSplitOnTurn::eBackward ); + return true; + } + if( aContainer->AsReference< std::string >() == "both" ) + { + fObject->SetDirection( KSModSplitOnTurn::eForward | KSModSplitOnTurn::eBackward ); + return true; + } + return true; + } + return false; + } +} + +#endif // Kassiopeia_KSModSplitOnTurnBuilder_h_ diff --git a/Kassiopeia/Bindings/Modifiers/Source/KSModSplitOnTurnBuilder.cxx b/Kassiopeia/Bindings/Modifiers/Source/KSModSplitOnTurnBuilder.cxx new file mode 100644 index 000000000..13cdbdece --- /dev/null +++ b/Kassiopeia/Bindings/Modifiers/Source/KSModSplitOnTurnBuilder.cxx @@ -0,0 +1,20 @@ +#include "KSModSplitOnTurnBuilder.h" +#include "KSRootBuilder.h" + +using namespace Kassiopeia; +using namespace std; + +namespace katrin +{ + template< > + KSModSplitOnTurnBuilder::~KComplexElement() + { + } + + STATICINT SKSModSplitOnTurnStructure = + KSModSplitOnTurnBuilder::Attribute< string >( "name" ) + + KSModSplitOnTurnBuilder::Attribute< string >( "direction" ); + + STATICINT sKSModSplitOnTurn = + KSRootBuilder::ComplexElement< KSModSplitOnTurn >( "ksmod_split_on_turn" ); +} diff --git a/Kassiopeia/Bindings/Objects/Include/KSCommandMemberBuilder.h b/Kassiopeia/Bindings/Objects/Include/KSCommandMemberBuilder.h index 3f97b470e..eb27ae1e3 100644 --- a/Kassiopeia/Bindings/Objects/Include/KSCommandMemberBuilder.h +++ b/Kassiopeia/Bindings/Objects/Include/KSCommandMemberBuilder.h @@ -3,6 +3,7 @@ #include "KComplexElement.hh" #include "KSCommandMember.h" +#include "KSObjectsMessage.h" #include "KToolbox.h" using namespace Kassiopeia; @@ -13,9 +14,9 @@ namespace katrin { public: std::string fName; - KSComponent* fParent; - KSComponent* fChild; - std::string fField; + std::string fFieldName; + std::string fParentName; + std::string fChildName; }; typedef KComplexElement< KSCommandMemberData > KSCommandMemberBuilder; @@ -38,20 +39,20 @@ namespace katrin } if( aContainer->GetName() == "parent" ) { - KSComponent* tComponent = KToolbox::GetInstance().Get< KSComponent >( aContainer->AsReference< std::string >() ); - fObject->fParent = tComponent; + std::string tParent = aContainer->AsReference< std::string >(); + fObject->fParentName = tParent; return true; } if( aContainer->GetName() == "child" ) { - KSComponent* tComponent = KToolbox::GetInstance().Get< KSComponent >( aContainer->AsReference< std::string >() ); - fObject->fChild = tComponent; + std::string tChild = aContainer->AsReference< std::string >(); + fObject->fChildName = tChild; return true; } if( aContainer->GetName() == "field" ) { std::string tField = aContainer->AsReference< std::string >(); - fObject->fField = tField; + fObject->fFieldName = tField; return true; } return false; @@ -60,8 +61,22 @@ namespace katrin template< > inline bool KSCommandMemberBuilder::End() { - KSCommand* tCommand = fObject->fParent->Command( fObject->fField, fObject->fChild ); - if( fObject->fName.length() != 0 ) + KSComponent* tParent = KToolbox::GetInstance().Get< KSComponent >( fObject->fParentName ); + if ( tParent == nullptr ) + { + objctmsg( eError ) << "command member <" << fObject->fName << "> could not find parent <" << fObject->fParentName << ">" << eom; + } + KSComponent* tChild = KToolbox::GetInstance().Get< KSComponent >( fObject->fChildName ); + if ( tChild == nullptr ) + { + objctmsg( eError ) << "command member <" << fObject->fName << "> could not find child <" << fObject->fChildName << ">" << eom; + } + KSCommand* tCommand = tParent->Command( fObject->fFieldName, tChild ); + if ( tCommand == nullptr ) + { + objctmsg( eError ) << "command member <" << fObject->fName << "> could not find field <" << fObject->fFieldName << "> with parent <" << fObject->fParentName << ">" << eom; + } + if( ! fObject->fName.empty() ) { tCommand->SetName( fObject->fName ); } diff --git a/Kassiopeia/Bindings/Objects/Include/KSCommandMemberSimpleBuilder.h b/Kassiopeia/Bindings/Objects/Include/KSCommandMemberSimpleBuilder.h index 77a695ac0..fdfd8958d 100644 --- a/Kassiopeia/Bindings/Objects/Include/KSCommandMemberSimpleBuilder.h +++ b/Kassiopeia/Bindings/Objects/Include/KSCommandMemberSimpleBuilder.h @@ -15,14 +15,14 @@ namespace katrin public: KSCommandMemberSimpleData() : fName(""), - fParent(0), - fChild(0), - fField("") + fParentName(""), + fChildName(""), + fFieldName("") {} std::string fName; - KSComponent* fParent; - KSComponent* fChild; - std::string fField; + std::string fParentName; + std::string fChildName; + std::string fFieldName; }; //marco definition, @@ -55,14 +55,14 @@ namespace katrin }\ if( aContainer->GetName() == "parent" )\ {\ - KSComponent* tParent = KToolbox::GetInstance().Get< KSComponent >( aContainer->AsReference< std::string >() );\ - fObject->fParent = tParent;\ + std::string tParent = aContainer->AsReference< std::string >();\ + fObject->fParentName = tParent;\ return true;\ }\ if( aContainer->GetName() == "child" )\ {\ - KSComponent* tComponent = KToolbox::GetInstance().Get< KSComponent >( aContainer->AsReference< std::string >() );\ - fObject->fChild = tComponent;\ + std::string tComponent = aContainer->AsReference< std::string >();\ + fObject->fChildName = tComponent;\ return true;\ }\ return false;\ @@ -70,13 +70,26 @@ namespace katrin template< >\ inline bool KSCommandMember ## xBUILDERNAME ## Builder::End()\ {\ - fObject->fField = xFIELDNAME ;\ - if ( fObject->fParent == 0 )\ + fObject->fFieldName = xFIELDNAME ;\ + if ( fObject->fParentName.empty() ) {\ + fObject->fParentName = xDEFAULTPARENTNAME;\ + }\ + KSComponent* tParent = KToolbox::GetInstance().Get< KSComponent >( fObject->fParentName );\ + if ( tParent == nullptr )\ + {\ + objctmsg( eError ) << "command member <" << fObject->fName << "> could not find parent <" << fObject->fParentName << ">" << eom;\ + }\ + KSComponent* tChild = KToolbox::GetInstance().Get< KSComponent >( fObject->fChildName );\ + if ( tChild == nullptr )\ + {\ + objctmsg( eError ) << "command member <" << fObject->fName << "> could not find child <" << fObject->fChildName << ">" << eom;\ + }\ + KSCommand* tCommand = tParent->Command( fObject->fFieldName, tChild );\ + if ( tCommand == nullptr )\ {\ - fObject->fParent = KToolbox::GetInstance().Get< KSComponent >( xDEFAULTPARENTNAME );\ + objctmsg( eError ) << "command member <" << fObject->fName << "> could not find field <" << fObject->fFieldName << "> with parent <" << fObject->fParentName << ">" << eom;\ }\ - KSCommand* tCommand = fObject->fParent->Command( fObject->fField, fObject->fChild );\ - if( fObject->fName.length() != 0 )\ + if( ! fObject->fName.empty() )\ {\ tCommand->SetName( fObject->fName );\ }\ diff --git a/Kassiopeia/Bindings/Objects/Include/KSComponentMemberBuilder.h b/Kassiopeia/Bindings/Objects/Include/KSComponentMemberBuilder.h index 8659dcbbb..1de43227c 100644 --- a/Kassiopeia/Bindings/Objects/Include/KSComponentMemberBuilder.h +++ b/Kassiopeia/Bindings/Objects/Include/KSComponentMemberBuilder.h @@ -1,9 +1,10 @@ #ifndef Kassiopeia_KSComponentMemberBuilder_h_ #define Kassiopeia_KSComponentMemberBuilder_h_ +#include "KToolbox.h" #include "KComplexElement.hh" #include "KSComponentMember.h" -#include "KToolbox.h" +#include "KSObjectsMessage.h" using namespace Kassiopeia; namespace katrin @@ -13,8 +14,8 @@ namespace katrin { public: std::string fName; - KSComponent* fParent; - std::string fField; + std::string fFieldName; + std::string fParentName; }; typedef KComplexElement< KSComponentMemberData > KSComponentBuilder; @@ -37,14 +38,14 @@ namespace katrin } if( aContainer->GetName() == "parent" ) { - KSComponent* tComponent = KToolbox::GetInstance().Get< KSComponent >( aContainer->AsReference< std::string >() ); - fObject->fParent = tComponent; + std::string tParent = aContainer->AsReference< std::string >(); + fObject->fParentName = tParent; return true; } if( aContainer->GetName() == "field" ) { std::string tField = aContainer->AsReference< std::string >(); - fObject->fField = tField; + fObject->fFieldName = tField; return true; } return false; @@ -53,8 +54,17 @@ namespace katrin template< > inline bool KSComponentBuilder::End() { - KSComponent* tComponent = fObject->fParent->Component( fObject->fField ); - if( fObject->fName.size() != 0 ) + KSComponent* tParent = KToolbox::GetInstance().Get< KSComponent >( fObject->fParentName ); + if ( tParent == nullptr ) + { + objctmsg( eError ) << "component member <" << fObject->fName << "> could not find parent <" << fObject->fParentName << ">" << eom; + } + KSComponent* tComponent = tParent->Component( fObject->fFieldName ); + if ( tComponent == nullptr ) + { + objctmsg( eError ) << "component member <" << fObject->fName << "> could not find field <" << fObject->fFieldName << "> with parent <" << fObject->fParentName << ">" << eom; + } + if( ! fObject->fName.empty() ) { tComponent->SetName( fObject->fName ); } diff --git a/Kassiopeia/Bindings/Terminators/Include/KSTermMinDistanceBuilder.h b/Kassiopeia/Bindings/Terminators/Include/KSTermMinDistanceBuilder.h index ceaab94d0..413ec02ae 100644 --- a/Kassiopeia/Bindings/Terminators/Include/KSTermMinDistanceBuilder.h +++ b/Kassiopeia/Bindings/Terminators/Include/KSTermMinDistanceBuilder.h @@ -22,22 +22,22 @@ namespace katrin } if( aContainer->GetName() == "surfaces" ) { - std::vector< KGeoBag::KGSurface* > tSurfaces = KGeoBag::KGInterface::GetInstance()->RetrieveSurfaces( aContainer->AsReference< std::string >() ); - std::vector< KGeoBag::KGSurface* >::const_iterator tSurfaceIt; - KGeoBag::KGSurface* tSurface; + std::vector< KGeoBag::KGSurface* > tSurfaces = KGeoBag::KGInterface::GetInstance()->RetrieveSurfaces( aContainer->AsReference< std::string >() ); + std::vector< KGeoBag::KGSurface* >::const_iterator tSurfaceIt; + KGeoBag::KGSurface* tSurface; - if( tSurfaces.size() == 0 ) - { - oprmsg( eWarning ) << "no surfaces found for specifier <" << aContainer->AsReference< std::string >() << ">" << eom; - return false; - } + if( tSurfaces.size() == 0 ) + { + oprmsg( eWarning ) << "no surfaces found for specifier <" << aContainer->AsReference< std::string >() << ">" << eom; + return true; + } - for( tSurfaceIt = tSurfaces.begin(); tSurfaceIt != tSurfaces.end(); tSurfaceIt++ ) - { - tSurface = *tSurfaceIt; - fObject->AddSurface( tSurface ); - } - return true; + for( tSurfaceIt = tSurfaces.begin(); tSurfaceIt != tSurfaces.end(); tSurfaceIt++ ) + { + tSurface = *tSurfaceIt; + fObject->AddSurface( tSurface ); + } + return true; } if( aContainer->GetName() == "spaces" ) { @@ -47,8 +47,8 @@ namespace katrin if( tSpaces.size() == 0 ) { - oprmsg( eWarning ) << "no spaces found for specifier <" << aContainer->AsReference< std::string >() << ">" << eom; - return false; + oprmsg( eWarning ) << "no spaces found for specifier <" << aContainer->AsReference< std::string >() << ">" << eom; + return true; } for( tSpaceIt = tSpaces.begin(); tSpaceIt != tSpaces.end(); tSpaceIt++ ) diff --git a/Kassiopeia/CMakeLists.txt b/Kassiopeia/CMakeLists.txt index 78aebbda2..dd0d7f0bb 100644 --- a/Kassiopeia/CMakeLists.txt +++ b/Kassiopeia/CMakeLists.txt @@ -4,25 +4,29 @@ # please be considerate and make additions as neatly as you can. # thank you! -dan. -cmake_minimum_required( VERSION 2.8.6 ) - -project( Kassiopeia ) -include( KasperDefaults ) +cmake_minimum_required( VERSION ${CMAKE_MINIMUM_VERSION} ) if(POLICY CMP0053) cmake_policy(SET CMP0053 OLD) endif() -# module version +# Kassiopeia version set( MODULE_VERSION_MAJOR 3 ) -set( MODULE_VERSION_MINOR 3 ) -set( MODULE_VERSION_PATCH 2 ) +set( MODULE_VERSION_MINOR 5 ) +set( MODULE_VERSION_PATCH 0 ) set( MODULE_VERSION "${MODULE_VERSION_MAJOR}.${MODULE_VERSION_MINOR}.${MODULE_VERSION_PATCH}" ) +#project( Kassiopeia VERSION ${MODULE_VERSION} ) +project( Kassiopeia ) + +include( KasperDefaults ) + # require c++11 kasper_require_cpp11() # module options +# build in boost functionality [utilities] +SET( Kassiopeia_USE_BOOST ${KASPER_USE_BOOST} ) # build in root functionality [writers, visualization] SET( Kassiopeia_USE_ROOT ${KASPER_USE_ROOT} ) # build in vtk functionality [visualization] @@ -34,33 +38,40 @@ kasper_module_paths( Kassiopeia ) # module debugging kasper_module_debug() if( Kassiopeia_ENABLE_DEBUG ) - add_cflag( Kassiopeia_ENABLE_DEBUG ) + dd_cflag( Kassiopeia_ENABLE_DEBUG ) +endif() + +# external dependencies: boost +if( Kassiopeia_USE_BOOST ) + find_package( Boost 1.43.0 COMPONENTS filesystem REQUIRED ) + kasper_external_include_directories( ${Boost_INCLUDE_DIRS} ) + add_definitions( -DKassiopeia_USE_BOOST ) endif() # external dependencies: root if( Kassiopeia_USE_ROOT ) - find_package( ROOT 5.24.0 REQUIRED ) - kasper_external_include_directories( ${ROOT_INCLUDE_DIRS} ) - add_definitions( -DKassiopeia_USE_ROOT ) + find_package( ROOT 5.24.0 REQUIRED ) + kasper_external_include_directories( ${ROOT_INCLUDE_DIRS} ) + add_definitions( -DKassiopeia_USE_ROOT ) endif() # external dependencies: vtk if( Kassiopeia_USE_VTK ) - kasper_find_vtk() - add_definitions( -DKassiopeia_USE_VTK ) + kasper_find_vtk() + add_definitions( -DKassiopeia_USE_VTK ) endif() # internal dependencies: kommon kasper_find_module( Kommon ) foreach( FLAG ${Kommon_CFLAGS} ) - add_definitions( -D${FLAG} ) + add_definitions( -D${FLAG} ) endforeach() # internal dependencies: kgeobag kasper_find_module( KGeoBag ) foreach( FLAG ${KGeoBag_CFLAGS} ) - add_definitions( -D${FLAG} ) + add_definitions( -D${FLAG} ) endforeach() # # internal dependencies: kemfield @@ -118,13 +129,14 @@ add_subdirectory( Readers ) add_subdirectory( XML ) add_subdirectory( Visualization ) add_subdirectory( Bindings ) +add_subdirectory( Python ) add_subdirectory( Applications/Simulation ) add_subdirectory( Applications/Validation ) if( Kassiopeia_USE_ROOT ) - add_subdirectory( Applications/Examples ) - add_subdirectory( Applications/Other ) + add_subdirectory( Applications/Examples ) + add_subdirectory( Applications/Other ) endif( ) kasper_install_module() diff --git a/Kassiopeia/Fields/Source/KSFieldFinder.cxx b/Kassiopeia/Fields/Source/KSFieldFinder.cxx index 7ddb812b7..aad6f6934 100644 --- a/Kassiopeia/Fields/Source/KSFieldFinder.cxx +++ b/Kassiopeia/Fields/Source/KSFieldFinder.cxx @@ -6,6 +6,7 @@ */ #include "KSFieldFinder.h" +#include "KSFieldsMessage.h" #include "KToolbox.h" #include "KEMToolbox.hh" @@ -22,27 +23,51 @@ namespace Kassiopeia { KSElectricField* getElectricField(std::string name) { - if(KToolbox::GetInstance().Get(name)) + fieldmsg_debug("Trying to retrieve electric field <" << name << "> from toolbox" << eom); + + if (KToolbox::GetInstance().Get(name) != nullptr) + { return KToolbox::GetInstance().Get(name); + } - //This is a glaring memory leak - return new KSElectricKEMField(KToolbox::GetInstance().Get(name)); + if (KToolbox::GetInstance().Get(name) != nullptr) + { + //This is a glaring memory leak + return new KSElectricKEMField(KToolbox::GetInstance().Get(name)); + } + + fieldmsg( eError ) << "Electric field <" << name << "> does not exist in toolbox" << eom; + return nullptr; } KSMagneticField* getMagneticField(std::string name) { - if(KToolbox::GetInstance().Get(name)) + fieldmsg_debug("Trying to retrieve magnetic field <" << name << "> from toolbox" << eom); + + if (KToolbox::GetInstance().Get(name) != nullptr) + { return KToolbox::GetInstance().Get(name); + } + + if (KToolbox::GetInstance().Get(name) != nullptr) + { + //This is a glaring memory leak + return new KSMagneticKEMField(KToolbox::GetInstance().Get(name)); + } - //This is a glaring memory leak - return new KSMagneticKEMField(KToolbox::GetInstance().Get(name)); + fieldmsg( eError ) << "Magnetic field <" << name << "> does not exist in toolbox" << eom; + return nullptr; } std::vector< KSMagneticField* > getAllMagneticFields() { + fieldmsg_debug("Trying to retrieve all magnetic fields from toolbox" << eom); + auto fields = KToolbox::GetInstance().GetAll(); - if(fields.empty()) { - for (auto entry : KToolbox::GetInstance().GetAll()) { + if (fields.empty()) + { + for (auto entry : KToolbox::GetInstance().GetAll()) + { //This is a glaring memory leak fields.push_back(new KSMagneticKEMField(entry)); } diff --git a/Kassiopeia/Generators/Include/KSGenGeneratorSimulation.h b/Kassiopeia/Generators/Include/KSGenGeneratorSimulation.h index d6b96d613..ac5625716 100644 --- a/Kassiopeia/Generators/Include/KSGenGeneratorSimulation.h +++ b/Kassiopeia/Generators/Include/KSGenGeneratorSimulation.h @@ -31,6 +31,7 @@ namespace Kassiopeia virtual void ExecuteGeneration( KSParticleQueue& aPrimaries ); public: + // note that some of these member variables cannot be set via XML bindings yet ;K_SET_GET( std::string, Base ); ;K_SET_GET( std::string, Path ); ;K_SET_GET( std::string, PositionX ); @@ -51,6 +52,11 @@ namespace Kassiopeia ;K_SET_GET( std::string, KineticEnergyName ); ;K_SET_GET( std::string, TimeName ); ;K_SET_GET( std::string, PIDName ); + ;K_SET_GET( KThreeVector, DefaultPosition ); + ;K_SET_GET( KThreeVector, DefaultDirection ); + ;K_SET_GET( double, DefaultEnergy ); + ;K_SET_GET( double, DefaultTime ); + ;K_SET_GET( int, DefaultPID ); protected: void InitializeComponent(); diff --git a/Kassiopeia/Generators/Include/KSGenValueSet.h b/Kassiopeia/Generators/Include/KSGenValueSet.h index 6bda1e644..9bb9dd532 100644 --- a/Kassiopeia/Generators/Include/KSGenValueSet.h +++ b/Kassiopeia/Generators/Include/KSGenValueSet.h @@ -23,6 +23,7 @@ namespace Kassiopeia public: K_SET_GET( double, ValueStart ) K_SET_GET( double, ValueStop ) + K_SET_GET( double, ValueIncrement ) K_SET_GET( unsigned int, ValueCount ) }; diff --git a/Kassiopeia/Generators/Source/KSGenGeneratorSimulation.cxx b/Kassiopeia/Generators/Source/KSGenGeneratorSimulation.cxx index c4116d544..3b6d5814d 100644 --- a/Kassiopeia/Generators/Source/KSGenGeneratorSimulation.cxx +++ b/Kassiopeia/Generators/Source/KSGenGeneratorSimulation.cxx @@ -26,6 +26,11 @@ namespace Kassiopeia fKineticEnergyName( "final_kinetic_energy" ), fTimeName( "final_time" ), fPIDName( "" ), + fDefaultPosition( KThreeVector(0,0,0) ), + fDefaultDirection( KThreeVector(0,0,0) ), + fDefaultEnergy( 1. ), + fDefaultTime( 0. ), + fDefaultPID( 11 ), // electron fRootFile( NULL ), fFormulaPositionX( NULL ), fFormulaPositionY( NULL ), @@ -234,11 +239,11 @@ namespace Kassiopeia continue; } - KThreeVector tPosition(0, 0, 0); - KThreeVector tDirection(0, 0, 0); - double tEnergy = 0.; - double tTime = 0.; - int tPID = 11; + KThreeVector tPosition = fDefaultPosition; + KThreeVector tDirection = fDefaultDirection; + double tEnergy = fDefaultEnergy; + double tTime = fDefaultTime; + int tPID = fDefaultPID; if ( ! fPositionName.empty() ) { @@ -284,6 +289,9 @@ namespace Kassiopeia tParticle->SetKineticEnergy_eV( tEnergy ); tParticle->SetTime( tTime ); tParticle->AddLabel( GetName() ); + tParticle->AddLabel( std::to_string(tRunReader.GetRunIndex()) ); // append run/event/track no. to creator name + tParticle->AddLabel( std::to_string(tEventReader.GetEventIndex()) ); + tParticle->AddLabel( std::to_string(tTrackReader.GetTrackIndex()) ); aParticleQueue.push_back( tParticle ); } diff --git a/Kassiopeia/Generators/Source/KSGenValueSet.cxx b/Kassiopeia/Generators/Source/KSGenValueSet.cxx index 5df63d995..bcae804ad 100644 --- a/Kassiopeia/Generators/Source/KSGenValueSet.cxx +++ b/Kassiopeia/Generators/Source/KSGenValueSet.cxx @@ -1,4 +1,5 @@ #include "KSGenValueSet.h" +#include "KSGeneratorsMessage.h" namespace Kassiopeia { @@ -6,6 +7,7 @@ namespace Kassiopeia KSGenValueSet::KSGenValueSet() : fValueStart( 0. ), fValueStop( 0. ), + fValueIncrement( 0. ), fValueCount( 0 ) { } @@ -13,6 +15,7 @@ namespace Kassiopeia KSComponent(), fValueStart( aCopy.fValueStart ), fValueStop( aCopy.fValueStop ), + fValueIncrement( aCopy.fValueIncrement ), fValueCount( aCopy.fValueCount ) { } @@ -27,9 +30,21 @@ namespace Kassiopeia void KSGenValueSet::DiceValue( vector< double >& aDicedValues ) { double tValue; - double tValueIncrement = (fValueStop - fValueStart) / ((double) (fValueCount > 1 ? fValueCount - 1 : 1)); + double tValueCount = fValueCount; + double tValueIncrement = (fValueStop - fValueStart) / ((double) (tValueCount > 1 ? tValueCount - 1 : 1)); - for( unsigned int tIndex = 0; tIndex < fValueCount; tIndex++ ) + if ( fValueIncrement != 0. ) + { + if ( (fValueCount > 0) && (fValueIncrement != tValueIncrement) ) // only fail if the two definitions do not match + { + genmsg( eError ) << "generator <" << GetName() << "> cannot dice <" << fValueCount << "> values with a step size of <" << fValueIncrement << ">" << eom; + return; + } + tValueIncrement = fValueIncrement; + tValueCount = (fValueStop - fValueStart) / tValueIncrement; + } + + for( unsigned int tIndex = 0; tIndex < tValueCount; tIndex++ ) { tValue = fValueStart + tIndex * tValueIncrement; aDicedValues.push_back( tValue ); diff --git a/Kassiopeia/Interactions/CMakeLists.txt b/Kassiopeia/Interactions/CMakeLists.txt index a27d8a254..63510a03b 100644 --- a/Kassiopeia/Interactions/CMakeLists.txt +++ b/Kassiopeia/Interactions/CMakeLists.txt @@ -24,9 +24,12 @@ set( INTERACTIONS_HEADER_BASENAMES KSIntCalculatorArgon.h KSIntSurfaceSpecular.h + KSIntSurfaceUCN.h KSIntSurfaceDiffuse.h KSIntSurfaceMultiplication.h + KSIntSurfaceSpinFlip.h + KESSElasticElsepa.h KESSInelasticBetheFano.h KESSInelasticPenn.h @@ -73,9 +76,12 @@ set( INTERACTIONS_SOURCE_BASENAMES KSIntCalculatorArgon.cxx KSIntSurfaceSpecular.cxx + KSIntSurfaceUCN.cxx KSIntSurfaceDiffuse.cxx KSIntSurfaceMultiplication.cxx + KSIntSurfaceSpinFlip.cxx + KESSElasticElsepa.cxx KESSInelasticBetheFano.cxx KESSInelasticPenn.cxx diff --git a/Kassiopeia/Interactions/Include/KSIntSurfaceSpinFlip.h b/Kassiopeia/Interactions/Include/KSIntSurfaceSpinFlip.h new file mode 100644 index 000000000..baebdde2d --- /dev/null +++ b/Kassiopeia/Interactions/Include/KSIntSurfaceSpinFlip.h @@ -0,0 +1,33 @@ +#ifndef Kassiopeia_KSIntSurfaceSpinFlip_h_ +#define Kassiopeia_KSIntSurfaceSpinFlip_h_ + +#include "KSSurfaceInteraction.h" + +#include "KField.h" + +namespace Kassiopeia +{ + + class KSStep; + + class KSIntSurfaceSpinFlip : + public KSComponentTemplate< KSIntSurfaceSpinFlip, KSSurfaceInteraction > + { + public: + KSIntSurfaceSpinFlip(); + KSIntSurfaceSpinFlip( const KSIntSurfaceSpinFlip& aCopy ); + KSIntSurfaceSpinFlip* Clone() const; + virtual ~KSIntSurfaceSpinFlip(); + + public: + void ExecuteInteraction( const KSParticle& anInitialParticle, KSParticle& aFinalParticle, KSParticleQueue& aSecondaries ); + + public: + + K_SET_GET( double, Probability ) + + }; + +} + +#endif diff --git a/Kassiopeia/Interactions/Include/KSIntSurfaceUCN.h b/Kassiopeia/Interactions/Include/KSIntSurfaceUCN.h new file mode 100644 index 000000000..ba56fdb3c --- /dev/null +++ b/Kassiopeia/Interactions/Include/KSIntSurfaceUCN.h @@ -0,0 +1,35 @@ +#ifndef Kassiopeia_KSIntSurfaceUCN_h_ +#define Kassiopeia_KSIntSurfaceUCN_h_ + +#include "KSSurfaceInteraction.h" + +#include "KField.h" + +namespace Kassiopeia +{ + + class KSStep; + + class KSIntSurfaceUCN : + public KSComponentTemplate< KSIntSurfaceUCN, KSSurfaceInteraction > + { + public: + KSIntSurfaceUCN(); + KSIntSurfaceUCN( const KSIntSurfaceUCN& aCopy ); + KSIntSurfaceUCN* Clone() const; + virtual ~KSIntSurfaceUCN(); + + public: + void ExecuteInteraction( const KSParticle& anInitialParticle, KSParticle& aFinalParticle, KSParticleQueue& aSecondaries ); + void ExecuteReflection( const KSParticle& anInitialParticle, KSParticle& aFinalParticle, KSParticleQueue& aSecondaries ); + void ExecuteTransmission( const KSParticle& anInitialParticle, KSParticle& aFinalParticle, KSParticleQueue& aSecondaries ); + + public: + K_SET_GET( double, Probability ) // transmission probability + K_SET_GET( double, SpinFlipProbability) + + }; + +} + +#endif diff --git a/Kassiopeia/Interactions/Source/KSIntSurfaceSpinFlip.cxx b/Kassiopeia/Interactions/Source/KSIntSurfaceSpinFlip.cxx new file mode 100644 index 000000000..aced15f67 --- /dev/null +++ b/Kassiopeia/Interactions/Source/KSIntSurfaceSpinFlip.cxx @@ -0,0 +1,49 @@ +#include "KSIntSurfaceSpinFlip.h" + +#include "KSInteractionsMessage.h" + +#include "KRandom.h" +using katrin::KRandom; + +#include "KConst.h" +using katrin::KConst; + +#include +#include + +namespace Kassiopeia +{ + + KSIntSurfaceSpinFlip::KSIntSurfaceSpinFlip() : + fProbability( .0 ) + { + std::cout << "/* spin flip interaction created */" << std::endl; + } + KSIntSurfaceSpinFlip::KSIntSurfaceSpinFlip( const KSIntSurfaceSpinFlip& aCopy ) : + KSComponent(), + fProbability( aCopy.fProbability ) + { + std::cout << "/* spin flip interaction created */" << std::endl; + } + KSIntSurfaceSpinFlip* KSIntSurfaceSpinFlip::Clone() const + { + return new KSIntSurfaceSpinFlip( *this ); + } + KSIntSurfaceSpinFlip::~KSIntSurfaceSpinFlip() + { + } + + void KSIntSurfaceSpinFlip::ExecuteInteraction( const KSParticle& anInitialParticle, KSParticle& aFinalParticle, KSParticleQueue& /*aQueue*/ ) + { + std::cout << "/* spin flip interaction executed */" << std::endl; + double tChoice = KRandom::GetInstance().Uniform( 0., 1. ); + if( tChoice < fProbability ) + { + aFinalParticle = anInitialParticle; + aFinalParticle.SetAlignedSpin( -1.0 * anInitialParticle.GetAlignedSpin() ); + aFinalParticle.SetSpinAngle( -1.0 * anInitialParticle.GetSpinAngle() ); + } + return; + } + +} diff --git a/Kassiopeia/Interactions/Source/KSIntSurfaceUCN.cxx b/Kassiopeia/Interactions/Source/KSIntSurfaceUCN.cxx new file mode 100644 index 000000000..23f61f8cf --- /dev/null +++ b/Kassiopeia/Interactions/Source/KSIntSurfaceUCN.cxx @@ -0,0 +1,112 @@ +#include "KSIntSurfaceUCN.h" + +#include "KSInteractionsMessage.h" + +#include "KRandom.h" +using katrin::KRandom; + +namespace Kassiopeia +{ + + KSIntSurfaceUCN::KSIntSurfaceUCN() : + fProbability( .0 ), + fSpinFlipProbability( 0. ) + { + } + KSIntSurfaceUCN::KSIntSurfaceUCN( const KSIntSurfaceUCN& aCopy ) : + KSComponent(), + fProbability( aCopy.fProbability ), + fSpinFlipProbability( aCopy.fSpinFlipProbability ) + { + } + KSIntSurfaceUCN* KSIntSurfaceUCN::Clone() const + { + return new KSIntSurfaceUCN( *this ); + } + KSIntSurfaceUCN::~KSIntSurfaceUCN() + { + } + + void KSIntSurfaceUCN::ExecuteInteraction( const KSParticle& anInitialParticle, KSParticle& aFinalParticle, KSParticleQueue& aQueue ) + { + double tChoice = KRandom::GetInstance().Uniform( 0., 1. ); + if( tChoice < fProbability ) + { + ExecuteTransmission( anInitialParticle, aFinalParticle, aQueue ); + } + else + { + ExecuteReflection( anInitialParticle, aFinalParticle, aQueue ); + } + return; + } + void KSIntSurfaceUCN::ExecuteReflection( const KSParticle& anInitialParticle, KSParticle& aFinalParticle, KSParticleQueue& ) + { + KThreeVector tNormal; + if( anInitialParticle.GetCurrentSurface() != NULL ) + { + tNormal = anInitialParticle.GetCurrentSurface()->Normal( anInitialParticle.GetPosition() ); + } + else if( anInitialParticle.GetCurrentSide() != NULL ) + { + tNormal = anInitialParticle.GetCurrentSide()->Normal( anInitialParticle.GetPosition() ); + } + else + { + intmsg( eError ) << "surface UCN interaction named <" << GetName() << "> was given a particle with neither a surface nor a side set" << eom; + return; + } + KThreeVector tInitialMomentum = anInitialParticle.GetMomentum(); + KThreeVector tInitialNormalMomentum = tInitialMomentum.Dot( tNormal ) * tNormal; + KThreeVector tInitialTangentMomentum = tInitialMomentum - tInitialNormalMomentum; + + KThreeVector tSpin = aFinalParticle.GetSpin(); + double tAlignedSpin = aFinalParticle.GetAlignedSpin(); + double tSpinAngle = aFinalParticle.GetSpinAngle(); + + double tChoice = KRandom::GetInstance().Uniform( 0., 1. ); + if( tChoice < 2*fSpinFlipProbability ) // there's a 50-50 chance of getting the old spin after measurement, hence the 2* + { + bool done = false; + while ( !done ){ + double tx = KRandom::GetInstance().Uniform( -1., 1. ); + double ty = KRandom::GetInstance().Uniform( -1., 1. ); + double tz = KRandom::GetInstance().Uniform( -1., 1. ); + if ( tx*tx + ty*ty + tz*tz < 1. ){ + tSpin = KThreeVector( tx, ty, tz ); + tSpin = tSpin/tSpin.Magnitude(); + tAlignedSpin = tSpin.Dot( anInitialParticle.GetMagneticField() ) / anInitialParticle.GetMagneticField().Magnitude(); + tSpinAngle = KRandom::GetInstance().Uniform( 0., 180. ); + done = true; + } + } + } + + aFinalParticle = anInitialParticle; + aFinalParticle.SetMomentum( tInitialTangentMomentum - tInitialNormalMomentum ); + + // spin changes need to happen aftet SetMomentum to make Spin0 correct + + aFinalParticle.SetInitialSpin( tSpin ); + aFinalParticle.SetAlignedSpin( tAlignedSpin ); + aFinalParticle.SetSpinAngle( tSpinAngle ); + + return; + } + void KSIntSurfaceUCN::ExecuteTransmission( const KSParticle& anInitialParticle, KSParticle& aFinalParticle, KSParticleQueue& ) + { + + KThreeVector tSpin = aFinalParticle.GetSpin(); + double tAlignedSpin = aFinalParticle.GetAlignedSpin(); + double tSpinAngle = aFinalParticle.GetSpinAngle(); + + aFinalParticle = anInitialParticle; + + aFinalParticle.SetInitialSpin( tSpin ); + aFinalParticle.SetAlignedSpin( tAlignedSpin ); + aFinalParticle.SetSpinAngle( tSpinAngle ); + + return; + } + +} diff --git a/Kassiopeia/Modifiers/CMakeLists.txt b/Kassiopeia/Modifiers/CMakeLists.txt index e5ae71f59..379fe99c7 100644 --- a/Kassiopeia/Modifiers/CMakeLists.txt +++ b/Kassiopeia/Modifiers/CMakeLists.txt @@ -2,6 +2,7 @@ set( MODIFIERS_HEADER_BASENAMES KSModifiersMessage.h KSModDynamicEnhancement.h + KSModSplitOnTurn.h KSModEventReport.h ) set( MODIFIERS_HEADER_PATH @@ -15,6 +16,7 @@ endforeach( BASENAME ) set( MODIFIERS_SOURCE_BASENAMES KSModifiersMessage.cxx KSModDynamicEnhancement.cxx + KSModSplitOnTurn.cxx KSModEventReport.cxx ) set( MODIFIERS_SOURCE_PATH diff --git a/Kassiopeia/Modifiers/Include/KSModSplitOnTurn.h b/Kassiopeia/Modifiers/Include/KSModSplitOnTurn.h new file mode 100644 index 000000000..36572cf2b --- /dev/null +++ b/Kassiopeia/Modifiers/Include/KSModSplitOnTurn.h @@ -0,0 +1,47 @@ +#ifndef Kassiopeia_KSModSplitOnTurn_h_ +#define Kassiopeia_KSModSplitOnTurn_h_ + +#include "KField.h" +#include "KSStepModifier.h" +#include "KSComponentTemplate.h" + +namespace Kassiopeia +{ + + class KSModSplitOnTurn : + public KSComponentTemplate< KSModSplitOnTurn, KSStepModifier > + { + public: + enum { + // use binary numbers here (allows combinations like `eForward | eBackward`) + eForward = 0b0001, + eBackward = 0b0010, + }; + + public: + KSModSplitOnTurn(); + KSModSplitOnTurn( const KSModSplitOnTurn& aCopy); + KSModSplitOnTurn* Clone() const; + virtual ~KSModSplitOnTurn(); + + public: + bool ExecutePreStepModification( KSParticle& anInitialParticle, KSParticleQueue& aQueue ); + bool ExecutePostStepModification( KSParticle& anInitialParticle, KSParticle& aFinalParticle, KSParticleQueue& aQueue ); + + public: + K_SET_GET( int, Direction ); + + private: + double fCurrentDotProduct; + + private: + void InitializeComponent(); + void DeinitializeComponent(); + + protected: + virtual void PullDeupdateComponent(); + virtual void PushDeupdateComponent(); + }; +} + +#endif diff --git a/Kassiopeia/Modifiers/Source/KSModSplitOnTurn.cxx b/Kassiopeia/Modifiers/Source/KSModSplitOnTurn.cxx new file mode 100644 index 000000000..9e72b1fa2 --- /dev/null +++ b/Kassiopeia/Modifiers/Source/KSModSplitOnTurn.cxx @@ -0,0 +1,75 @@ +#include "KSModSplitOnTurn.h" +#include "KSModifiersMessage.h" +#include "KSParticleFactory.h" + +namespace Kassiopeia +{ + KSModSplitOnTurn::KSModSplitOnTurn(): + fDirection( eForward | eBackward ), + fCurrentDotProduct( 0. ) + { + } + + KSModSplitOnTurn::KSModSplitOnTurn(const KSModSplitOnTurn &aCopy ): + KSComponent(), + fDirection( aCopy.fDirection ), + fCurrentDotProduct( aCopy.fCurrentDotProduct ) + { + } + + KSModSplitOnTurn* KSModSplitOnTurn::Clone() const + { + return new KSModSplitOnTurn( *this ); + } + + KSModSplitOnTurn::~KSModSplitOnTurn() + { + } + + bool KSModSplitOnTurn::ExecutePreStepModification(KSParticle& /*anInitialParticle*/, KSParticleQueue& /*aQueue*/) + { + return false; //intial particle state not changed + } + + bool KSModSplitOnTurn::ExecutePostStepModification(KSParticle& /*anInitialParticle*/, KSParticle& aFinalParticle, KSParticleQueue& aQueue) + { + double DotProduct = aFinalParticle.GetMagneticField().Dot( aFinalParticle.GetMomentum() ); + + if( DotProduct * fCurrentDotProduct < 0. ) + { + if ( ((fDirection & eForward) && fCurrentDotProduct > 0.) || ((fDirection & eBackward) && fCurrentDotProduct < 0.) ) + { + fCurrentDotProduct = DotProduct; + + KSParticle* tSplitParticle = new KSParticle( aFinalParticle ); + tSplitParticle->ResetFieldCaching(); + aQueue.push_back( tSplitParticle ); + + aFinalParticle.SetLabel( GetName() ); + aFinalParticle.SetActive( false ); + + return true; //final particle state has changed + } + } + + fCurrentDotProduct = DotProduct; + return false; //final particle state has not changed + } + + void KSModSplitOnTurn::InitializeComponent() + { + } + void KSModSplitOnTurn::DeinitializeComponent() + { + } + + void KSModSplitOnTurn::PullDeupdateComponent() + { + } + void KSModSplitOnTurn::PushDeupdateComponent() + { + } + + //STATICINT sKSModSplitOnTurnDict = + // KSDictionary< KSModSplitOnTurn >::AddComponent( &KSModSplitOnTurn::GetEnhancement, "enhancement_factor" ); +} diff --git a/Kassiopeia/Navigators/Source/KSNavSurface.cxx b/Kassiopeia/Navigators/Source/KSNavSurface.cxx index 956e0838f..c41abcdc3 100644 --- a/Kassiopeia/Navigators/Source/KSNavSurface.cxx +++ b/Kassiopeia/Navigators/Source/KSNavSurface.cxx @@ -64,8 +64,8 @@ namespace Kassiopeia navmsg( eNormal ) << " transmission occurred on child surface <" << tCurrentSurface->GetName() << ">" << eom; aFinalParticle = aNavigationParticle; - aFinalParticle.SetLabel( GetName() ); - aFinalParticle.AddLabel( tCurrentSurface->GetName() ); + aFinalParticle.SetLabel( GetName() ); + aFinalParticle.AddLabel( tCurrentSurface->GetName() ); aFinalParticle.AddLabel( "transmission" ); if( fTransmissionSplit == true ) @@ -85,8 +85,8 @@ namespace Kassiopeia navmsg( eNormal ) << " reflection occurred on child surface <" << tCurrentSurface->GetName() << ">" << eom; aFinalParticle = aNavigationParticle; - aFinalParticle.SetLabel( GetName() ); - aFinalParticle.AddLabel( tCurrentSurface->GetName() ); + aFinalParticle.SetLabel( GetName() ); + aFinalParticle.AddLabel( tCurrentSurface->GetName() ); aFinalParticle.AddLabel( "reflection" ); if( fReflectionSplit == true ) @@ -97,7 +97,6 @@ namespace Kassiopeia tTransmissionSplitParticle->ResetFieldCaching(); aParticleQueue.push_back( tTransmissionSplitParticle ); aFinalParticle.SetActive( false ); - } return; } diff --git a/Kassiopeia/Objects/Include/KSComponentTemplate.h b/Kassiopeia/Objects/Include/KSComponentTemplate.h index c7a04d26d..07df503b7 100644 --- a/Kassiopeia/Objects/Include/KSComponentTemplate.h +++ b/Kassiopeia/Objects/Include/KSComponentTemplate.h @@ -50,6 +50,12 @@ namespace Kassiopeia } KSCommand* Command( const std::string& aField, KSComponent* aChild ) { + if ( aChild == nullptr ) + { + objctmsg( eError ) << "component <" << this->GetName() << "> could not build command named <" << aField << "> (invalid child component)" << eom; + return nullptr; + } + objctmsg_debug( "component <" << this->GetName() << "> building command named <" << aField << ">" << eom ) KSCommand* tCommand = KSDictionary< XThisType >::GetCommand( this, aChild, aField ); if( tCommand == NULL ) diff --git a/Kassiopeia/Operators/Include/KSParticle.h b/Kassiopeia/Operators/Include/KSParticle.h index 58af00e47..8965a3281 100644 --- a/Kassiopeia/Operators/Include/KSParticle.h +++ b/Kassiopeia/Operators/Include/KSParticle.h @@ -46,6 +46,7 @@ namespace Kassiopeia public: static const std::string sSeparator; + const std::string& GetLabel( ) const; void SetLabel( const std::string& aLabel ); void AddLabel( const std::string& aLabel ); void ReleaseLabel( std::string& aLabel ); @@ -125,7 +126,7 @@ namespace Kassiopeia public: const long long& GetPID() const; - const std::string& GetStringID() const; + const std::string& GetStringID() const; const double& GetMass() const; const double& GetCharge() const; const double& GetSpinMagnitude() const; @@ -133,7 +134,7 @@ namespace Kassiopeia protected: long long fPID; - std::string fStringID; + std::string fStringID; double fMass; // in kg double fCharge; // in Coulomb double fSpinMagnitude; // in hbar diff --git a/Kassiopeia/Operators/Source/KSParticle.cxx b/Kassiopeia/Operators/Source/KSParticle.cxx index 3711a16c8..3d8784901 100644 --- a/Kassiopeia/Operators/Source/KSParticle.cxx +++ b/Kassiopeia/Operators/Source/KSParticle.cxx @@ -14,9 +14,9 @@ namespace Kassiopeia const string KSParticle::sSeparator = string( ":" ); - //********** - //assignment - //********** +//////////// +//assignment +//////////// KSParticle::KSParticle() : fLabel( "" ), @@ -38,7 +38,7 @@ namespace Kassiopeia fElectricFieldCalculator( NULL ), fPID( 0 ), - fStringID( "" ), + fStringID( "" ), fMass( 0. ), fCharge( 0. ), fSpinMagnitude( 0. ), @@ -120,7 +120,7 @@ namespace Kassiopeia fElectricFieldCalculator( aParticle.fElectricFieldCalculator ), fPID( aParticle.fPID ), - fStringID( aParticle.fStringID ), + fStringID( aParticle.fStringID ), fMass( aParticle.fMass ), fCharge( aParticle.fCharge ), fSpinMagnitude( aParticle.fSpinMagnitude ), @@ -204,7 +204,7 @@ namespace Kassiopeia fElectricFieldCalculator = aParticle.fElectricFieldCalculator; fPID = aParticle.fPID; - fStringID = aParticle.fStringID; + fStringID = aParticle.fStringID; fMass = aParticle.fMass; fCharge = aParticle.fCharge; fSpinMagnitude = aParticle.fSpinMagnitude; @@ -275,13 +275,13 @@ namespace Kassiopeia } void KSParticle::Print() const { - oprmsg( eNormal ); + oprmsg( eInfo ); oprmsg << "particle state:" << ret; oprmsg << " id: " << fPID << ret; - oprmsg << " string id: " << fStringID << ret; + oprmsg << " string id: " << fStringID << ret; oprmsg << " mass: " << fMass << ret; oprmsg << " charge: " << fCharge << ret; - oprmsg << " spin magnitude: " << fSpinMagnitude << ret; + oprmsg << " spin magnitude: " << fSpinMagnitude << ret; oprmsg << " gyromagnetic ratio: " << fGyromagneticRatio << ret; oprmsg << ret; oprmsg << " t: " << fTime << ret; @@ -324,6 +324,10 @@ namespace Kassiopeia return false; if ( !isfinite(fSpin0) || !isfinite(fSpin.X()) || !isfinite(fSpin.Y()) || !isfinite(fSpin.Z()) ) return false; + /** require E > 0 for tracking */ + if ( fMomentum.MagnitudeSquared() <= 0. ) + return false; + // other properties if ( !isfinite(GetMagneticField().MagnitudeSquared()) ) return false; @@ -333,10 +337,14 @@ namespace Kassiopeia return true; } - //****** - //labels - //****** +//////// +//labels +//////// + const string& KSParticle::GetLabel( ) const + { + return fLabel; + } void KSParticle::SetLabel( const string& aLabel ) { fLabel = aLabel; @@ -398,9 +406,9 @@ namespace Kassiopeia return fParentStepId; } -//***** +/////// //state -//***** +/////// void KSParticle::SetActive( const bool& aFlag ) { @@ -417,11 +425,11 @@ namespace Kassiopeia fCurrentSpace = aSpace; if ( fCurrentSpace != 0 ) { - fCurrentSpaceName = fCurrentSpace->GetName(); + fCurrentSpaceName = fCurrentSpace->GetName(); } else { - fCurrentSpaceName = string( "" ); + fCurrentSpaceName = string( "" ); } return; } @@ -431,7 +439,7 @@ namespace Kassiopeia } const string& KSParticle::GetCurrentSpaceName() const { - return fCurrentSpaceName; + return fCurrentSpaceName; } void KSParticle::SetCurrentSurface( KSSurface* aSurface ) @@ -439,11 +447,11 @@ namespace Kassiopeia fCurrentSurface = aSurface; if ( fCurrentSurface != 0 ) { - fCurrentSurfaceName = fCurrentSurface->GetName(); + fCurrentSurfaceName = fCurrentSurface->GetName(); } else { - fCurrentSurfaceName = string( "" ); + fCurrentSurfaceName = string( "" ); } return; } @@ -453,7 +461,7 @@ namespace Kassiopeia } const string& KSParticle::GetCurrentSurfaceName() const { - return fCurrentSurfaceName; + return fCurrentSurfaceName; } void KSParticle::SetCurrentSide( KSSide* aSide ) @@ -461,11 +469,11 @@ namespace Kassiopeia fCurrentSide = aSide; if ( fCurrentSide != 0 ) { - fCurrentSideName = fCurrentSide->GetName(); + fCurrentSideName = fCurrentSide->GetName(); } else { - fCurrentSideName = string( "" ); + fCurrentSideName = string( "" ); } return; } @@ -475,7 +483,7 @@ namespace Kassiopeia } const string& KSParticle::GetCurrentSideName() const { - return fCurrentSideName; + return fCurrentSideName; } void KSParticle::SetLastStepSurface( KSSurface* aSurface ) @@ -488,9 +496,9 @@ namespace Kassiopeia return fLastStepSurface; } -//*********** +///////////// //calculators -//*********** +///////////// void KSParticle::SetMagneticFieldCalculator( KSMagneticField* aMagFieldCalculator ) { @@ -531,9 +539,9 @@ namespace Kassiopeia } -//***************** +/////////////////// //static properties -//***************** +/////////////////// const long long& KSParticle::GetPID() const { @@ -542,7 +550,7 @@ namespace Kassiopeia const std::string& KSParticle::GetStringID() const { return fStringID; - } + } const double& KSParticle::GetMass() const { return fMass; @@ -560,9 +568,9 @@ namespace Kassiopeia return fGyromagneticRatio; } -//*************** +///////////////// //Quantum Numbers -//*************** +///////////////// void KSParticle::SetMainQuantumNumber(const int &t) { fMainQuantumNumber = t; @@ -580,9 +588,9 @@ namespace Kassiopeia return fSecondQuantumNumber; } -//**** +////// //time -//**** +////// void KSParticle::SetTime( const double& t ) { @@ -613,9 +621,9 @@ namespace Kassiopeia return fTime; } -//****** +//////// //length -//****** +//////// void KSParticle::SetLength( const double& l ) { @@ -631,9 +639,9 @@ namespace Kassiopeia return fLength; } -//******** +////////// //position -//******** +////////// const KThreeVector& KSParticle::GetPosition() const { @@ -778,9 +786,9 @@ namespace Kassiopeia return; } -//******** +////////// //momentum -//******** +////////// const KThreeVector& KSParticle::GetMomentum() const { @@ -897,8 +905,6 @@ namespace Kassiopeia fGetLongMomentumAction = &KSParticle::RecalculateLongMomentum; fGetTransMomentumAction = &KSParticle::RecalculateTransMomentum; - fGetLongVelocityAction = &KSParticle::RecalculateLongVelocity; - fGetTransVelocityAction = &KSParticle::RecalculateTransVelocity; fGetPolarAngleToBAction = &KSParticle::RecalculatePolarAngleToB; fGetCyclotronFrequencyAction = &KSParticle::RecalculateCyclotronFrequency; fGetOrbitalMagneticMomentAction = &KSParticle::RecalculateOrbitalMagneticMoment; @@ -938,9 +944,9 @@ namespace Kassiopeia return; } -//******** +////////// //velocity -//******** +////////// const KThreeVector& KSParticle::GetVelocity() const { @@ -998,9 +1004,9 @@ namespace Kassiopeia return; } -//******** +/////// //spin0 -//******** +/////// const double& KSParticle::GetSpin0() const { @@ -1041,9 +1047,9 @@ namespace Kassiopeia return; } -//******** +////// //spin -//******** +////// const KThreeVector& KSParticle::GetSpin() const { @@ -1262,9 +1268,9 @@ namespace Kassiopeia } -//***** +/////// //speed -//***** +/////// const double& KSParticle::GetSpeed() const { @@ -1320,9 +1326,9 @@ namespace Kassiopeia return; } -//************** +//////////////// //lorentz factor -//************** +//////////////// const double& KSParticle::GetLorentzFactor() const { @@ -1373,9 +1379,9 @@ namespace Kassiopeia return; } -//************** +//////////////// //kinetic energy -//************** +//////////////// const double& KSParticle::GetKineticEnergy() const { @@ -1428,7 +1434,7 @@ namespace Kassiopeia return; } -//setter and getter for KineticEnergy in eV + // setter and getter for KineticEnergy in eV void KSParticle::SetKineticEnergy_eV( const double& NewKineticEnergy ) { @@ -1451,9 +1457,9 @@ namespace Kassiopeia return fKineticEnergy_eV; } -//**************** +////////////////// //polar angle to z -//**************** +////////////////// const double& KSParticle::GetPolarAngleToZ() const { @@ -1510,9 +1516,9 @@ namespace Kassiopeia return; } -//******************** +////////////////////// //azimuthal angle to x -//******************** +////////////////////// const double& KSParticle::GetAzimuthalAngleToX() const { @@ -1598,9 +1604,9 @@ namespace Kassiopeia return; } -//************** +//////////////// //magnetic field -//************** +//////////////// const KThreeVector& KSParticle::GetMagneticField() const { @@ -1636,18 +1642,19 @@ namespace Kassiopeia void KSParticle::RecalculateMagneticField() const { - //std::cout << fMagneticFieldCalculator << " " << GetPosition() << " " << GetTime() << " " << fMagneticField << "\n"; - fMagneticFieldCalculator->CalculateField( GetPosition(), GetTime(), fMagneticField ); - fGetMagneticFieldAction = &KSParticle::DoNothing; + if(fMagneticFieldCalculator != NULL){ + fMagneticFieldCalculator->CalculateField( GetPosition(), GetTime(), fMagneticField ); + fGetMagneticFieldAction = &KSParticle::DoNothing; + } //RecalculateSpinBody(); return; } -//************** +//////////////// //electric field -//************** +//////////////// const KThreeVector& KSParticle::GetElectricField() const { @@ -1674,9 +1681,9 @@ namespace Kassiopeia return; } -//*********************** +///////////////////////// //magnetic field gradient -//*********************** +///////////////////////// const KThreeMatrix& KSParticle::GetMagneticGradient() const { @@ -1700,12 +1707,13 @@ namespace Kassiopeia { fMagneticFieldCalculator->CalculateGradient( GetPosition(), GetTime(), fMagneticGradient ); fGetMagneticGradientAction = &KSParticle::DoNothing; + return; } -//****************** +//////////////////// //electric potential -//****************** +//////////////////// const double& KSParticle::GetElectricPotential() const { @@ -1732,9 +1740,9 @@ namespace Kassiopeia return; } -//********************* +/////////////////////// //longitudinal momentum -//********************* +/////////////////////// void KSParticle::SetLongMomentum( const double& aNewLongMomentum ) { @@ -1784,9 +1792,9 @@ namespace Kassiopeia return; } -//******************* +///////////////////// //transverse momentum -//******************* +///////////////////// void KSParticle::SetTransMomentum( const double& NewTransMomentum ) { @@ -1839,9 +1847,9 @@ namespace Kassiopeia return; } -//********************* +/////////////////////// //longitudinal velocity -//********************* +/////////////////////// void KSParticle::SetLongVelocity( const double& NewLongVelocity ) { @@ -1899,9 +1907,9 @@ namespace Kassiopeia return; } -//******************* +///////////////////// //transverse velocity -//******************* +///////////////////// void KSParticle::SetTransVelocity( const double& NewTransVelocity ) { @@ -1959,9 +1967,9 @@ namespace Kassiopeia return; } -//**************** +////////////////// //polar angle to B -//**************** +////////////////// void KSParticle::SetPolarAngleToB( const double& NewPolarAngleToB ) { @@ -2017,9 +2025,9 @@ namespace Kassiopeia return; } -//******************* +///////////////////// //cyclotron frequency -//******************* +///////////////////// void KSParticle::SetCyclotronFrequency( const double& NewCyclotronFrequency ) { @@ -2058,7 +2066,7 @@ namespace Kassiopeia } void KSParticle::RecalculateCyclotronFrequency() const { - oprmsg_assert( fMagneticField.Magnitude(), != 0.0 ); + oprmsg_assert( fMagneticField.Magnitude(), != 0.0 ); fCyclotronFrequency = (fabs( GetCharge() ) * GetMagneticField().Magnitude()) / (2.0 * KConst::Pi() * GetMass() * GetLorentzFactor()); @@ -2075,9 +2083,9 @@ namespace Kassiopeia return fCyclotronFrequency; } -//*********************** +///////////////////////// //orbital magnetic moment -//*********************** +///////////////////////// const double& KSParticle::GetOrbitalMagneticMoment() const { @@ -2132,9 +2140,9 @@ namespace Kassiopeia return; } -//*********************** +///////////////////////// //guiding center position -//*********************** +///////////////////////// const KThreeVector& KSParticle::GetGuidingCenterPosition() const @@ -2151,7 +2159,7 @@ namespace Kassiopeia void KSParticle::RecalculateGuidingCenterPosition() const { - oprmsg_assert( fMagneticField.Magnitude(), != 0.0 ); + oprmsg_assert( fMagneticField.Magnitude(), != 0.0 ); fGuidingCenterPosition = GetPosition() + (1.0 / (GetCharge() * GetMagneticField().MagnitudeSquared())) * (GetMomentum().Cross( GetMagneticField() )); //calculate magnetic field at gc position @@ -2176,117 +2184,114 @@ namespace Kassiopeia return; } -//*********************** +////////////// //aligned spin -//*********************** +///////////// + const double& KSParticle::GetAlignedSpin() const + { + return fAlignedSpin; + } - const double& KSParticle::GetAlignedSpin() const - { - return fAlignedSpin; - } + void KSParticle::SetAlignedSpin( const double& anAlignedSpin ) const + { + fAlignedSpin = anAlignedSpin; + } - void KSParticle::SetAlignedSpin( const double& anAlignedSpin ) const - { - fAlignedSpin = anAlignedSpin; - } +//////////// +//spin angle +//////////// -//*********************** -//aligned spin -//*********************** + const double& KSParticle::GetSpinAngle() const + { + return fSpinAngle; + } + void KSParticle::SetSpinAngle( const double& aSpinAngle ) const + { + fSpinAngle = aSpinAngle; + } + + void KSParticle::RecalculateSpinBody() const + { + //std::cout << "RECALCULATING SPIN (body):\n\tInitial:\tspin0:\t" << fSpin0 << "\tspin: " << fSpin << "\n"; - const double& KSParticle::GetSpinAngle() const + KThreeVector LocalZ = fMagneticField / fMagneticField.Magnitude(); + KThreeVector LocalX ( LocalZ.Z() - LocalZ.Y(), LocalZ.X() - LocalZ.Z(), LocalZ.Y() - LocalZ.X() ); + LocalX = LocalX / LocalX.Magnitude(); + fAlignedSpin = fSpin.Dot( LocalZ ) / fSpin.Magnitude(); + if ( std::isnan( fAlignedSpin ) ) { - return fSpinAngle; + fAlignedSpin = 1.; + //std::cout << "*fixed NaN m (in KSP); B: " << fMagneticField << "\n"; } - - void KSParticle::SetSpinAngle( const double& aSpinAngle ) const + if (fAlignedSpin < 0.99999 && fAlignedSpin > -0.99999 ) { - fSpinAngle = aSpinAngle; + //std::cout << fSpin.Dot( LocalX ); + fSpinAngle = acos( fSpin.Dot( LocalX ) / fSpin.Magnitude() / sqrt( 1 - fAlignedSpin * fAlignedSpin ) ); } - - void KSParticle::RecalculateSpinBody() const + else { - //std::cout << "RECALCULATING SPIN (body):\n\tInitial:\tspin0:\t" << fSpin0 << "\tspin: " << fSpin << "\n"; - - KThreeVector LocalZ = fMagneticField / fMagneticField.Magnitude(); - KThreeVector LocalX ( LocalZ.Z() - LocalZ.Y(), LocalZ.X() - LocalZ.Z(), LocalZ.Y() - LocalZ.X() ); - LocalX = LocalX / LocalX.Magnitude(); - fAlignedSpin = fSpin.Dot( LocalZ ) / fSpin.Magnitude(); - if ( std::isnan( fAlignedSpin ) ) - { - fAlignedSpin = 1.; - //std::cout << "*fixed NaN m (in KSP); B: " << fMagneticField << "\n"; - } - if (fAlignedSpin < 0.99999 && fAlignedSpin > -0.99999 ) - { - //std::cout << fSpin.Dot( LocalX ); - fSpinAngle = acos( fSpin.Dot( LocalX ) / fSpin.Magnitude() / sqrt( 1 - fAlignedSpin * fAlignedSpin ) ); - } - else - { - fSpinAngle = 0; - } - - //std::cout << "\tFinal:\t\tm: " << fAlignedSpin << "\tphi: " << fSpinAngle << "\n"; + fSpinAngle = 0; } + //std::cout << "\tFinal:\t\tm: " << fAlignedSpin << "\tphi: " << fSpinAngle << "\n"; + } + STATICINT sKSParticleDict = - KSDictionary< KSParticle >::AddComponent( &KSParticle::GetParentRunId, "parent_run_id" ) + - KSDictionary< KSParticle >::AddComponent( &KSParticle::GetParentEventId, "parent_event_id" ) + - KSDictionary< KSParticle >::AddComponent( &KSParticle::GetParentTrackId, "parent_track_id" ) + - KSDictionary< KSParticle >::AddComponent( &KSParticle::GetParentStepId, "parent_step_id" ) + - KSDictionary< KSParticle >::AddComponent( &KSParticle::GetPID, "pid" ) + - KSDictionary< KSParticle >::AddComponent( &KSParticle::GetStringID, "string_id" ) + - KSDictionary< KSParticle >::AddComponent( &KSParticle::GetMass, "mass" ) + - KSDictionary< KSParticle >::AddComponent( &KSParticle::GetCharge, "charge" ) + - KSDictionary< KSParticle >::AddComponent( &KSParticle::GetSpinMagnitude, "total_spin" ) + - KSDictionary< KSParticle >::AddComponent( &KSParticle::GetGyromagneticRatio, "gyromagnetic_ratio" ) + + KSDictionary< KSParticle >::AddComponent( &KSParticle::GetParentRunId, "parent_run_id" ) + + KSDictionary< KSParticle >::AddComponent( &KSParticle::GetParentEventId, "parent_event_id" ) + + KSDictionary< KSParticle >::AddComponent( &KSParticle::GetParentTrackId, "parent_track_id" ) + + KSDictionary< KSParticle >::AddComponent( &KSParticle::GetParentStepId, "parent_step_id" ) + + KSDictionary< KSParticle >::AddComponent( &KSParticle::GetPID, "pid" ) + + KSDictionary< KSParticle >::AddComponent( &KSParticle::GetStringID, "string_id" ) + + KSDictionary< KSParticle >::AddComponent( &KSParticle::GetMass, "mass" ) + + KSDictionary< KSParticle >::AddComponent( &KSParticle::GetCharge, "charge" ) + + KSDictionary< KSParticle >::AddComponent( &KSParticle::GetSpinMagnitude, "total_spin" ) + + KSDictionary< KSParticle >::AddComponent( &KSParticle::GetGyromagneticRatio, "gyromagnetic_ratio" ) + KSDictionary< KSParticle >::AddComponent( &KSParticle::GetMainQuantumNumber, "n" ) + KSDictionary< KSParticle >::AddComponent( &KSParticle::GetSecondQuantumNumber, "l" ) + - KSDictionary< KSParticle >::AddComponent( &KSParticle::GetTime, "time" ) + - KSDictionary< KSParticle >::AddComponent( &KSParticle::GetLength, "length" ) + - KSDictionary< KSParticle >::AddComponent( &KSParticle::GetPosition, "position" ) + - KSDictionary< KSParticle >::AddComponent( &KSParticle::GetMomentum, "momentum" ) + - KSDictionary< KSParticle >::AddComponent( &KSParticle::GetVelocity, "velocity" ) + - KSDictionary< KSParticle >::AddComponent( &KSParticle::GetSpin0, "spin0" ) + - KSDictionary< KSParticle >::AddComponent( &KSParticle::GetSpin, "spin" ) + - KSDictionary< KSParticle >::AddComponent( &KSParticle::GetAlignedSpin, "aligned_spin" ) + - KSDictionary< KSParticle >::AddComponent( &KSParticle::GetSpinAngle, "spin_angle" ) + - KSDictionary< KSParticle >::AddComponent( &KSParticle::GetSpeed, "speed" ) + - KSDictionary< KSParticle >::AddComponent( &KSParticle::GetLorentzFactor, "lorentz_factor" ) + - KSDictionary< KSParticle >::AddComponent( &KSParticle::GetKineticEnergy, "kinetic_energy" ) + - KSDictionary< KSParticle >::AddComponent( &KSParticle::GetKineticEnergy_eV, "kinetic_energy_ev" ) + - KSDictionary< KSParticle >::AddComponent( &KSParticle::GetPolarAngleToZ, "polar_angle_to_z" ) + - KSDictionary< KSParticle >::AddComponent( &KSParticle::GetAzimuthalAngleToX, "azimuthal_angle_to_x" ) + - KSDictionary< KSParticle >::AddComponent( &KSParticle::GetMagneticField, "magnetic_field" ) + - KSDictionary< KSParticle >::AddComponent( &KSParticle::GetElectricField, "electric_field" ) + - KSDictionary< KSParticle >::AddComponent( &KSParticle::GetMagneticGradient, "magnetic_gradient" ) + - KSDictionary< KSParticle >::AddComponent( &KSParticle::GetElectricPotential, "electric_potential" ) + - KSDictionary< KSParticle >::AddComponent( &KSParticle::GetLongMomentum, "long_momentum" ) + - KSDictionary< KSParticle >::AddComponent( &KSParticle::GetTransMomentum, "trans_momentum" ) + - KSDictionary< KSParticle >::AddComponent( &KSParticle::GetLongVelocity, "long_velocity" ) + - KSDictionary< KSParticle >::AddComponent( &KSParticle::GetTransVelocity, "trans_velocity" ) + - KSDictionary< KSParticle >::AddComponent( &KSParticle::GetLongMomentum, "long_momentum" ) + - KSDictionary< KSParticle >::AddComponent( &KSParticle::GetPolarAngleToB, "polar_angle_to_b" ) + - KSDictionary< KSParticle >::AddComponent( &KSParticle::GetCyclotronFrequency, "cyclotron_frequency" ) + - KSDictionary< KSParticle >::AddComponent( &KSParticle::GetOrbitalMagneticMoment, "orbital_magnetic_moment" ) + - KSDictionary< KSParticle >::AddComponent( &KSParticle::GetGuidingCenterPosition, "guiding_center_position" ) + - KSDictionary< KSParticle >::AddComponent( &KSParticle::GetCurrentSpaceName, "current_space_name" ) + - KSDictionary< KSParticle >::AddComponent( &KSParticle::GetCurrentSurfaceName, "current_surface_name" ) + - KSDictionary< KSParticle >::AddComponent( &KSParticle::GetCurrentSideName, "current_side_name" ); - + KSDictionary< KSParticle >::AddComponent( &KSParticle::GetTime, "time" ) + + KSDictionary< KSParticle >::AddComponent( &KSParticle::GetLength, "length" ) + + KSDictionary< KSParticle >::AddComponent( &KSParticle::GetPosition, "position" ) + + KSDictionary< KSParticle >::AddComponent( &KSParticle::GetMomentum, "momentum" ) + + KSDictionary< KSParticle >::AddComponent( &KSParticle::GetVelocity, "velocity" ) + + KSDictionary< KSParticle >::AddComponent( &KSParticle::GetSpin0, "spin0" ) + + KSDictionary< KSParticle >::AddComponent( &KSParticle::GetSpin, "spin" ) + + KSDictionary< KSParticle >::AddComponent( &KSParticle::GetAlignedSpin, "aligned_spin" ) + + KSDictionary< KSParticle >::AddComponent( &KSParticle::GetSpinAngle, "spin_angle" ) + + KSDictionary< KSParticle >::AddComponent( &KSParticle::GetSpeed, "speed" ) + + KSDictionary< KSParticle >::AddComponent( &KSParticle::GetLorentzFactor, "lorentz_factor" ) + + KSDictionary< KSParticle >::AddComponent( &KSParticle::GetKineticEnergy, "kinetic_energy" ) + + KSDictionary< KSParticle >::AddComponent( &KSParticle::GetKineticEnergy_eV, "kinetic_energy_ev" ) + + KSDictionary< KSParticle >::AddComponent( &KSParticle::GetPolarAngleToZ, "polar_angle_to_z" ) + + KSDictionary< KSParticle >::AddComponent( &KSParticle::GetAzimuthalAngleToX, "azimuthal_angle_to_x" ) + + KSDictionary< KSParticle >::AddComponent( &KSParticle::GetMagneticField, "magnetic_field" ) + + KSDictionary< KSParticle >::AddComponent( &KSParticle::GetElectricField, "electric_field" ) + + KSDictionary< KSParticle >::AddComponent( &KSParticle::GetMagneticGradient, "magnetic_gradient" ) + + KSDictionary< KSParticle >::AddComponent( &KSParticle::GetElectricPotential, "electric_potential" ) + + KSDictionary< KSParticle >::AddComponent( &KSParticle::GetLongMomentum, "long_momentum" ) + + KSDictionary< KSParticle >::AddComponent( &KSParticle::GetTransMomentum, "trans_momentum" ) + + KSDictionary< KSParticle >::AddComponent( &KSParticle::GetLongVelocity, "long_velocity" ) + + KSDictionary< KSParticle >::AddComponent( &KSParticle::GetTransVelocity, "trans_velocity" ) + + KSDictionary< KSParticle >::AddComponent( &KSParticle::GetLongMomentum, "long_momentum" ) + + KSDictionary< KSParticle >::AddComponent( &KSParticle::GetPolarAngleToB, "polar_angle_to_b" ) + + KSDictionary< KSParticle >::AddComponent( &KSParticle::GetCyclotronFrequency, "cyclotron_frequency" ) + + KSDictionary< KSParticle >::AddComponent( &KSParticle::GetOrbitalMagneticMoment, "orbital_magnetic_moment" ) + + KSDictionary< KSParticle >::AddComponent( &KSParticle::GetGuidingCenterPosition, "guiding_center_position" ) + + KSDictionary< KSParticle >::AddComponent( &KSParticle::GetCurrentSpaceName, "current_space_name" ) + + KSDictionary< KSParticle >::AddComponent( &KSParticle::GetCurrentSurfaceName, "current_surface_name" ) + + KSDictionary< KSParticle >::AddComponent( &KSParticle::GetCurrentSideName, "current_side_name" ); STATICINT sKSKThreeVectorDict = - KSDictionary< KThreeVector >::AddComponent( &KThreeVector::GetX, "x" ) + - KSDictionary< KThreeVector >::AddComponent( &KThreeVector::GetY, "y" ) + - KSDictionary< KThreeVector >::AddComponent( &KThreeVector::GetZ, "z" ) + - KSDictionary< KThreeVector >::AddComponent( &KThreeVector::Magnitude, "magnitude" ) + - KSDictionary< KThreeVector >::AddComponent( &KThreeVector::MagnitudeSquared, "magnitude_squared" ) + - KSDictionary< KThreeVector >::AddComponent( &KThreeVector::Perp, "perp" ) + - KSDictionary< KThreeVector >::AddComponent( &KThreeVector::PerpSquared, "perp_squared" ) + - KSDictionary< KThreeVector >::AddComponent( &KThreeVector::PolarAngle, "polar_angle" ) + - KSDictionary< KThreeVector >::AddComponent( &KThreeVector::AzimuthalAngle, "azimuthal_angle" ); + KSDictionary< KThreeVector >::AddComponent( &KThreeVector::GetX, "x" ) + + KSDictionary< KThreeVector >::AddComponent( &KThreeVector::GetY, "y" ) + + KSDictionary< KThreeVector >::AddComponent( &KThreeVector::GetZ, "z" ) + + KSDictionary< KThreeVector >::AddComponent( &KThreeVector::Magnitude, "magnitude" ) + + KSDictionary< KThreeVector >::AddComponent( &KThreeVector::MagnitudeSquared, "magnitude_squared" ) + + KSDictionary< KThreeVector >::AddComponent( &KThreeVector::Perp, "perp" ) + + KSDictionary< KThreeVector >::AddComponent( &KThreeVector::PerpSquared, "perp_squared" ) + + KSDictionary< KThreeVector >::AddComponent( &KThreeVector::PolarAngle, "polar_angle" ) + + KSDictionary< KThreeVector >::AddComponent( &KThreeVector::AzimuthalAngle, "azimuthal_angle" ); } /* namespace Kassiopeia */ diff --git a/Kassiopeia/Operators/Source/KSParticleFactory.cxx b/Kassiopeia/Operators/Source/KSParticleFactory.cxx index 9fe8199c8..9eb82c6ad 100644 --- a/Kassiopeia/Operators/Source/KSParticleFactory.cxx +++ b/Kassiopeia/Operators/Source/KSParticleFactory.cxx @@ -51,7 +51,7 @@ namespace Kassiopeia return tParticle; } - + int KSParticleFactory::Define( const long long& aPID, const std::string& aStringID, const std::vector aAltStringIDs, const double& aMass, const double& aCharge, const double& aSpinMagnitude, const double& aGyromagneticRatio ) { ParticleIt tIter = fParticles.find( aPID ); @@ -116,7 +116,7 @@ namespace Kassiopeia return fElectricField; } - + // A "ghost" particle STATICINT sGhostDefinition = KSParticleFactory::GetInstance().Define( 0, "ghost", {}, 0., 0., 0., 0. ); @@ -140,13 +140,13 @@ namespace Kassiopeia //neutron STATICINT sNeutronDefinition = KSParticleFactory::GetInstance().Define( 2112, "n", {}, KConst::M_neut_kg(), 0., 0.5, -1.83247172e+8 ); - + //deuterium plus STATICINT sDeuteriumPlusDefinition = KSParticleFactory::GetInstance().Define( 99041, "D^+", {"D+"}, KConst::M_deut_kg(), KConst::Q(), 0.5, 0 ); - + //deuterium 2 plus STATICINT sDeuteriumTwoPlusDefinition = KSParticleFactory::GetInstance().Define( 99042, "D_2^+", {"D2^+","D2+"}, 2.0*KConst::M_deut_kg(), KConst::Q(), 0.5, 0 ); - + //deuterium 3 plus STATICINT sDeuteriumThreePlusDefinition = KSParticleFactory::GetInstance().Define( 99043, "D_3^+", {"D3^+","D3+"}, 3.0*KConst::M_deut_kg(), KConst::Q(), 0.5, 0 ); @@ -179,7 +179,7 @@ namespace Kassiopeia //H2+ (NOTE: One has to decide whether ortho or para for spin...) STATICINT sH2PlusDefinition = KSParticleFactory::GetInstance().Define( 99012, "H_2^+", {"H2^+","H2+"}, KConst::M_H2Plus_kg(), 1*KConst::Q(), 0.5, 0 ); - + //H3+ STATICINT sH3PlusDefinition = KSParticleFactory::GetInstance().Define( 99013, "H_3^+", {"H3^+","H3+"}, KConst::M_H3Plus_kg(), 1*KConst::Q(), 0.5, 0 ); diff --git a/Kassiopeia/Python/CMakeLists.txt b/Kassiopeia/Python/CMakeLists.txt new file mode 100644 index 000000000..b070497af --- /dev/null +++ b/Kassiopeia/Python/CMakeLists.txt @@ -0,0 +1,7 @@ +# $Id$ + +set( TOOLS_PYTHON_SOURCES + KassiopeiaReader.py +) + +install(FILES ${TOOLS_PYTHON_SOURCES} DESTINATION ${LIB_INSTALL_DIR}/python) diff --git a/Kassiopeia/Python/KassiopeiaReader.py b/Kassiopeia/Python/KassiopeiaReader.py new file mode 100644 index 000000000..a2e49c154 --- /dev/null +++ b/Kassiopeia/Python/KassiopeiaReader.py @@ -0,0 +1,353 @@ +#!/usr/bin/env python +# -*- coding: utf8 -*- + +from __future__ import unicode_literals, print_function + +import os +import ROOT + +class IteratorItem: + """ + A simple class to access items returned by Iterator.next(). + + Usage example: see below. + """ + + def __init__(self, data, filename, treename, index=-1): + """ + Initialize a new iterator item. + + Args: + data (dict): Data dictionary associated with this item. + filename (string): Name of the originating ROOT file. + treename (string): Name of the originating ROOT tree. + index (int): Index of the originating tree item. + """ + assert(type(data) == dict) + assert(type(filename) == str) + assert(type(treename) == str) + assert(type(index) == int) + + self.data = data + self.filename = filename + self.treename = treename + self.index = index + + def __str__(self): + return "%s:%s:%d" % (os.path.split(self.filename)[-1], self.treename, self.index) + + def __len__(self): + return len(self.data) + + def __dir__(self): + return self.data.keys() + + def __getattr__(self, name): + assert(type(name) == str) + + if not name in self.data: + raise KeyError("IteratorItem does not contain a field named '%s'" % name) + + return self.data[name] + +class Iterator: + """ + A simple class for reading Kassiopeia output. + + The class defines an iterator that can be used to access tree entries + in sequential order. This is typically more resource-effective than + loading the entire ROOT tree into memory before processing the data. + + Usage example: + import KassiopeiaReader + + reader = KassiopeiaReader.Iterator("QuadrupoleTrapSimulation.root") + + print("List of tree names:", dir(reader)) + + reader.loadTree('component_step_world') + + print("List of tree objects:", dir(reader)) + print("Total number of tracks:", len(reader.getTracks('TRACK_INDEX'))) + print("Total number of steps:", len(reader)) # do not load all steps here! + + first_step = reader.getTracks('FIRST_STEP_INDEX')[0] # first step of first track + last_step = reader.getTracks('LAST_STEP_INDEX')[0] # last step of first track + + num_steps = last_step - first_step + 1 + + print("Number of steps that will be read:", num_steps) + + reader.select('step_id', 'kinetic_energy') # only read two fields from tree + + sum_energy = 0. + for item in iter(reader): + sum_energy += item.kinetic_energy + if item.step_id >= last_step: + break + + print("Last step that was read:", step_id) + print("Average energy in 1st track:", sum_energy / num_steps) + + reader.closeFile() +""" + + def __init__(self, filename="", treename=""): + """ + Initialize reader and open ROOT file, if given. + + One can open multiple files sequentially with the same reader + object by the openFile() method. + + The ROOT tree must be loaded by the loadTree() method before + accessing the iterator. Alternatively one can load the entire + tree by the readTree() method, although this is not advised for + large trees since iterating is typically more efficient. + + Args: + filename (string): The name of the ROOT file to be opened. + treename (string): The name of the ROOT tree to be loaded. + """ + assert(type(filename) == str) + assert(type(treename) == str) + + self.file = None + self.closeFile() # initialize + + if filename: + self.openFile(filename) + + if treename: + self.loadTree(treename) + + def __str__(self): + if self.file: + if self.tree: + return "%s:%s" % (self.file.GetName(), self.tree.GetName()) + else: + return "%s" % (self.file.GetName()) + else: + return "(empty)" + + def __dir__(self): + if self.file: + if self.tree: + return self.leaves.keys() + else: + return self.treenames + else: + return [] + + def __len__(self): + return int(self.nev) + + def __iter__(self): + return self + + def __next__(self): + return self.next() + + def openFile(self, filename): + """ + Open ROOT file for reading. + + Args: + filename (string): The name of the ROOT file. + """ + assert(type(filename) == str) + + if self.file: + self.closeFile() + + if not os.path.exists(filename): + raise IOError("File '%s' does not exist" % (filename)) + + self.file = ROOT.TFile(filename, 'read') + if self.file.IsZombie(): + self.closeFile() + raise IOError("TFile '%s' could not be opened" % (filename)) + + forest = self.file.GetListOfKeys() + + self.treenames = [] + for i in range(forest.GetEntries()): + tree = forest.At(i) + name = tree.GetName() + if not name.endswith('_DATA'): + continue + + self.treenames.append(name[:-5]) # strip off '_DATA' + + def closeFile(self): + """ + Close the previously opened ROOT file. + """ + if self.file: + if self.file.IsOpen(): + self.file.Close() + + self.file = None + self.iev = 0 + self.nev = 0 + + self.tree = None + self.treenames = [] + self.leaves = {} + + def getRuns(self, fieldname=""): + assert(type(fieldname) == str) + + return self.getTree('RUN_DATA', fieldname) + + def getEvents(self, fieldname=""): + assert(type(fieldname) == str) + + return self.getTree('EVENT_DATA', fieldname) + + def getTracks(self, fieldname=""): + assert(type(fieldname) == str) + + return self.getTree('TRACK_DATA', fieldname) + + def getSteps(self, fieldname=""): + assert(type(fieldname) == str) + + return self.getTree('STEP_DATA', fieldname) + + def getTree(self, treename='RUN_DATA', fieldname=""): + """ + Return the entire contents of the given tree. + + Note: + For accessing the tree contents, the iterator approach + provides a faster method. + + Args: + treename (string): The name of a tree in the ROOT file. + + Returns: + dict: Full contents of the tree, like + { 'column1': [ values1 ], 'column2': [ values2 ], ... }. + """ + assert(type(treename) == str) + assert(type(fieldname) == str) + + if not self.file: + raise RuntimeError("A file must be opened before accessing a tree.") + + if not treename.endswith('_DATA'): + treename += '_DATA' + + tree = self.file.Get(treename) + foliage = tree.GetListOfLeaves() + + leaves = {} + for i in range(foliage.GetEntries()): + leaf = foliage.At(i) + name = leaf.GetName() + leaves[name] = leaf + + data = {} + for j in range(tree.GetEntries()): + tree.GetEntry(j) + + for name, leaf in leaves.items(): + if fieldname and name != fieldname: + continue + + if not name in data: + data[name] = [] + data[name].append( eval("tree." + name) ) + + if fieldname: + return data[fieldname] + else: + return data + + def loadTree(self, treename='output_track_world'): + """ + Prepare reading from the given tree and load column names. + + After loading, the tree contents can be read using the + iterator structure of this class. + + Note: + The ``select`` function allows to narrow down the + number of values that is read at each iteration. + + Args: + treename (string): The name of a tree in the ROOT file. + + Returns: + int: The number of tree entries. + """ + assert(type(treename) == str) + + if not self.file: + raise RuntimeError("A file must be opened before accessing a tree.") + + if not treename.endswith('_DATA'): + treename += '_DATA' + + try: + tree = self.file.Get(treename) + foliage = tree.GetListOfLeaves() + except AttributeError: + raise AttributeError("TFile '%s' has no tree named '%s'" % (self.file.GetName(), treename)) + + self.tree = tree + for i in range(foliage.GetEntries()): + leaf = foliage.At(i) + name = leaf.GetName() + self.leaves[name] = leaf + + self.iev = 0 + self.nev = self.tree.GetEntries() + + def reset(self): + """ + Reset the iterator to start at the first tree entry. + """ + self.iev = 0 + + def select(self, *fields): + """ + Select a given list of columns to be read at each iteration. + + Args: + fields (string): One or more names of fields to read while iterating. + """ + assert(type(fields) == tuple) + + leaves = {} + for name in fields: + assert(type(name) == str) + + if name in self.leaves.keys(): + leaves[name] = self.leaves[name] + + self.leaves = leaves + + def next(self): + """ + Iterate through the tree that was loaded before. + + Returns: + (IteratorItem): Contents of the tree at the current entry + as a dictionary-like object. + """ + if not self.file: + raise RuntimeError("A file must be opened before accessing a tree.") + + if self.iev >= self.nev: + self.reset() + raise StopIteration() + + self.tree.GetEntry(self.iev) + self.iev += 1 + + data = {} + for name, leaf in self.leaves.items(): + data[name] = eval("self.tree." + name) + + return IteratorItem(data, self.file.GetName(), self.tree.GetName(), self.iev-1) diff --git a/Kassiopeia/Simulation/Include/KSMainMessage.h b/Kassiopeia/Simulation/Include/KSMainMessage.h index b0208e9e4..7a2703cda 100644 --- a/Kassiopeia/Simulation/Include/KSMainMessage.h +++ b/Kassiopeia/Simulation/Include/KSMainMessage.h @@ -11,7 +11,7 @@ KMESSAGE_DECLARE( Kassiopeia, mainmsg ) mainmsg( eDebug ) << xCONTENT; #define mainmsg_assert( xVARIABLE, xASSERTION )\ - if (! (xVARIABLE xASSERTION)) fieldmsg( eError ) << "Assertion failed: " << #xVARIABLE << " " << #xASSERTION << " but " << #xVARIABLE << " is " << (xVARIABLE) << eom; + if (! (xVARIABLE xASSERTION)) mainmsg( eError ) << "Assertion failed: " << #xVARIABLE << " " << #xASSERTION << " but " << #xVARIABLE << " is " << (xVARIABLE) << eom; #endif diff --git a/Kassiopeia/Simulation/Include/KSRoot.h b/Kassiopeia/Simulation/Include/KSRoot.h index 3be1c5d45..ff3508ac6 100644 --- a/Kassiopeia/Simulation/Include/KSRoot.h +++ b/Kassiopeia/Simulation/Include/KSRoot.h @@ -62,14 +62,14 @@ namespace Kassiopeia static void GSLErrorHandler(const char* aReason, const char* aFile, int aLine, int aErrNo); private: + katrin::KToolbox& fToolbox; + KSSimulation* fSimulation; KSRun* fRun; KSEvent* fEvent; KSTrack* fTrack; KSStep* fStep; - katrin::KToolbox& fToolbox; - KSRootMagneticField* fRootMagneticField; KSRootElectricField* fRootElectricField; KSRootSpace* fRootSpace; @@ -87,7 +87,7 @@ namespace Kassiopeia KSRootRunModifier* fRootRunModifier; bool fOnce; - + bool fRestartNavigation; unsigned int fRunIndex; unsigned int fEventIndex; diff --git a/Kassiopeia/Simulation/Include/KSStep.h b/Kassiopeia/Simulation/Include/KSStep.h index f075cc999..4d66ecdfe 100644 --- a/Kassiopeia/Simulation/Include/KSStep.h +++ b/Kassiopeia/Simulation/Include/KSStep.h @@ -44,6 +44,14 @@ namespace Kassiopeia K_REFS( double, DiscreteEnergyChange ) K_REFS( double, DiscreteMomentumChange ) + //******** + //modifier + //******** + + public: + K_REFS( std::string, ModifierName ) + K_REFS( bool, ModifierFlag ) + //********** //terminator //********** diff --git a/Kassiopeia/Simulation/Source/KSRoot.cxx b/Kassiopeia/Simulation/Source/KSRoot.cxx index 69aa751b4..7fdb02328 100644 --- a/Kassiopeia/Simulation/Source/KSRoot.cxx +++ b/Kassiopeia/Simulation/Source/KSRoot.cxx @@ -50,42 +50,40 @@ namespace Kassiopeia string KSRoot::fStopSignalName = ""; KSRoot::KSRoot() : - fSimulation( NULL ), - fRun( new KSRun() ), - fEvent( new KSEvent() ), - fTrack( new KSTrack() ), - fStep( new KSStep() ), fToolbox( KToolbox::GetInstance() ), - fRootMagneticField( new KSRootMagneticField() ), - fRootElectricField( new KSRootElectricField() ), - fRootSpace( new KSRootSpace() ), - fRootGenerator( new KSRootGenerator() ), - fRootTrajectory( new KSRootTrajectory() ), - fRootSpaceInteraction( new KSRootSpaceInteraction() ), - fRootSpaceNavigator( new KSRootSpaceNavigator() ), - fRootSurfaceInteraction( new KSRootSurfaceInteraction() ), - fRootSurfaceNavigator( new KSRootSurfaceNavigator() ), - fRootTerminator( new KSRootTerminator() ), - fRootWriter( new KSRootWriter() ), - fRootStepModifier( new KSRootStepModifier() ), - fRootTrackModifier( new KSRootTrackModifier() ), - fRootEventModifier( new KSRootEventModifier() ), - fRootRunModifier( new KSRootRunModifier() ), + fSimulation( nullptr ), + fRun( nullptr ), + fEvent( nullptr ), + fTrack( nullptr ), + fStep( nullptr ), + fRootMagneticField( nullptr ), + fRootElectricField( nullptr ), + fRootSpace( nullptr ), + fRootGenerator( nullptr ), + fRootTrajectory( nullptr ), + fRootSpaceInteraction( nullptr ), + fRootSpaceNavigator( nullptr ), + fRootSurfaceInteraction( nullptr ), + fRootSurfaceNavigator( nullptr ), + fRootTerminator( nullptr ), + fRootWriter( nullptr ), + fRootStepModifier( nullptr ), + fRootTrackModifier( nullptr ), + fRootEventModifier( nullptr ), + fRootRunModifier( nullptr ), fRunIndex( 0 ), fEventIndex( 0 ), fTrackIndex( 0 ), fStepIndex( 0 ) { - KSParticleFactory::GetInstance().SetMagneticField( fRootMagneticField ); - KSParticleFactory::GetInstance().SetElectricField( fRootElectricField ); - fOnce = false; + fRestartNavigation = true; this->SetName( "root" ); if (fToolbox.Get("run") != NULL ) { - mainmsg(eWarning) << "Kassiopeia will re-use already existing root objects." << eom; + mainmsg(eWarning) << "New Kassiopeia instance will re-use already existing root objects." << eom; fRun = fToolbox.Get("run"); fEvent = fToolbox.Get("event"); @@ -111,178 +109,135 @@ namespace Kassiopeia return; } + fRun = new KSRun(); fRun->SetName( "run" ); fToolbox.Add(fRun, "run"); + fEvent = new KSEvent(); fEvent->SetName( "event" ); fToolbox.Add(fEvent); + fTrack = new KSTrack(); fTrack->SetName( "track" ); fToolbox.Add(fTrack); + fStep = new KSStep(); fStep->SetName( "step" ); fToolbox.Add(fStep); + fRootMagneticField = new KSRootMagneticField(); fRootMagneticField->SetName( "root_magnetic_field" ); fToolbox.Add(fRootMagneticField); + fRootElectricField = new KSRootElectricField(); fRootElectricField->SetName( "root_electric_field" ); fToolbox.Add(fRootElectricField); + fRootSpace = new KSRootSpace(); fRootSpace->SetName( "root_space" ); fToolbox.Add(fRootSpace); + fRootGenerator = new KSRootGenerator(); fRootGenerator->SetName( "root_generator" ); fRootGenerator->SetEvent( fEvent ); fToolbox.Add(fRootGenerator); + fRootTrajectory = new KSRootTrajectory(); fRootTrajectory->SetName( "root_trajectory" ); fRootTrajectory->SetStep( fStep ); fToolbox.Add(fRootTrajectory); + fRootSpaceInteraction = new KSRootSpaceInteraction(); fRootSpaceInteraction->SetName( "root_space_interaction" ); fRootSpaceInteraction->SetStep( fStep ); fRootSpaceInteraction->SetTrajectory( fRootTrajectory ); fToolbox.Add(fRootSpaceInteraction); + fRootSpaceNavigator = new KSRootSpaceNavigator(); fRootSpaceNavigator->SetName( "root_space_navigator" ); fRootSpaceNavigator->SetStep( fStep ); fRootSpaceNavigator->SetTrajectory( fRootTrajectory ); fToolbox.Add(fRootSpaceNavigator); + fRootSurfaceInteraction = new KSRootSurfaceInteraction(); fRootSurfaceInteraction->SetName( "root_surface_interaction" ); fRootSurfaceInteraction->SetStep( fStep ); fToolbox.Add(fRootSurfaceInteraction); + fRootSurfaceNavigator = new KSRootSurfaceNavigator(); fRootSurfaceNavigator->SetName( "root_surface_navigator" ); fRootSurfaceNavigator->SetStep( fStep ); fToolbox.Add(fRootSurfaceNavigator); + fRootTerminator = new KSRootTerminator(); fRootTerminator->SetName( "root_terminator" ); fRootTerminator->SetStep( fStep ); fToolbox.Add(fRootTerminator); + fRootWriter = new KSRootWriter(); fRootWriter->SetName( "root_writer" ); fToolbox.Add(fRootWriter); + fRootStepModifier = new KSRootStepModifier(); fRootStepModifier->SetName( "root_step_modifier" ); fRootStepModifier->SetStep( fStep ); fToolbox.Add( fRootStepModifier ); + fRootTrackModifier = new KSRootTrackModifier(); fRootTrackModifier->SetName( "root_track_modifier" ); fRootTrackModifier->SetTrack( fTrack ); fToolbox.Add( fRootTrackModifier ); + fRootEventModifier = new KSRootEventModifier(); fRootEventModifier->SetName( "root_event_modifier" ); fRootEventModifier->SetEvent( fEvent ); fToolbox.Add( fRootEventModifier ); + fRootRunModifier = new KSRootRunModifier(); fRootRunModifier->SetName( "root_run_modifier" ); fRootRunModifier->SetRun( fRun ); fToolbox.Add( fRootRunModifier ); + KSParticleFactory::GetInstance().SetMagneticField( fRootMagneticField ); + KSParticleFactory::GetInstance().SetElectricField( fRootElectricField ); } - KSRoot::KSRoot( const KSRoot& /*aCopy*/) : + KSRoot::KSRoot( const KSRoot& aCopy) : KSComponent(), - fSimulation( NULL ), - fRun( new KSRun() ), - fEvent( new KSEvent() ), - fTrack( new KSTrack() ), - fStep( new KSStep() ), fToolbox( KToolbox::GetInstance() ), - fRootMagneticField( new KSRootMagneticField() ), - fRootElectricField( new KSRootElectricField() ), - fRootSpace( new KSRootSpace() ), - fRootGenerator( new KSRootGenerator() ), - fRootTrajectory( new KSRootTrajectory() ), - fRootSpaceInteraction( new KSRootSpaceInteraction() ), - fRootSpaceNavigator( new KSRootSpaceNavigator() ), - fRootSurfaceInteraction( new KSRootSurfaceInteraction() ), - fRootSurfaceNavigator( new KSRootSurfaceNavigator() ), - fRootTerminator( new KSRootTerminator() ), - fRootWriter( new KSRootWriter() ), - fRootStepModifier( new KSRootStepModifier() ), - fRootTrackModifier( new KSRootTrackModifier() ), - fRootEventModifier( new KSRootEventModifier() ), - fRootRunModifier( new KSRootRunModifier() ), + fSimulation( NULL ), + fRun( aCopy.fRun ), + fEvent( aCopy.fEvent ), + fTrack( aCopy.fTrack ), + fStep( aCopy.fStep ), + fRootMagneticField( aCopy.fRootMagneticField ), + fRootElectricField( aCopy.fRootElectricField ), + fRootSpace( aCopy.fRootSpace ), + fRootGenerator( aCopy.fRootGenerator ), + fRootTrajectory( aCopy.fRootTrajectory ), + fRootSpaceInteraction( aCopy.fRootSpaceInteraction ), + fRootSpaceNavigator( aCopy.fRootSpaceNavigator ), + fRootSurfaceInteraction( aCopy.fRootSurfaceInteraction ), + fRootSurfaceNavigator( aCopy.fRootSurfaceNavigator ), + fRootTerminator( aCopy.fRootTerminator ), + fRootWriter( aCopy.fRootWriter ), + fRootStepModifier( aCopy.fRootStepModifier ), + fRootTrackModifier( aCopy.fRootTrackModifier ), + fRootEventModifier( aCopy.fRootEventModifier ), + fRootRunModifier( aCopy.fRootRunModifier ), fRunIndex( 0 ), fEventIndex( 0 ), fTrackIndex( 0 ), fStepIndex( 0 ) { - KSParticleFactory::GetInstance().SetMagneticField( fRootMagneticField ); - KSParticleFactory::GetInstance().SetElectricField( fRootElectricField ); - fOnce = false; + fRestartNavigation = true; - fRun->SetName( "run" ); - fToolbox.Add(fRun, "run"); - - fEvent->SetName( "event" ); - fToolbox.Add(fEvent); - - fTrack->SetName( "track" ); - fToolbox.Add(fTrack); - - fStep->SetName( "step" ); - fToolbox.Add(fStep); + mainmsg(eWarning) << "Copied Kassiopeia instance will re-use already existing root objects." << eom; this->SetName( "root" ); - fRootMagneticField->SetName( "root_magnetic_field" ); - fToolbox.Add(fRootMagneticField); - - fRootElectricField->SetName( "root_electric_field" ); - fToolbox.Add(fRootElectricField); - - fRootSpace->SetName( "root_space" ); - fToolbox.Add(fRootSpace); - - fRootGenerator->SetName( "root_generator" ); - fRootGenerator->SetEvent( fEvent ); - fToolbox.Add(fRootGenerator); - - fRootTrajectory->SetName( "root_trajectory" ); - fRootTrajectory->SetStep( fStep ); - fToolbox.Add(fRootTrajectory); - - fRootSpaceInteraction->SetName( "root_space_interaction" ); - fRootSpaceInteraction->SetStep( fStep ); - fRootSpaceInteraction->SetTrajectory( fRootTrajectory ); - fToolbox.Add(fRootSpaceInteraction); - - fRootSpaceNavigator->SetName( "root_space_navigator" ); - fRootSpaceNavigator->SetStep( fStep ); - fRootSpaceNavigator->SetTrajectory( fRootTrajectory ); - fToolbox.Add(fRootSpaceNavigator); - - fRootSurfaceInteraction->SetName( "root_surface_interaction" ); - fRootSurfaceInteraction->SetStep( fStep ); - fToolbox.Add(fRootSurfaceInteraction); - - fRootSurfaceNavigator->SetName( "root_surface_navigator" ); - fRootSurfaceNavigator->SetStep( fStep ); - fToolbox.Add(fRootSurfaceNavigator); - - fRootTerminator->SetName( "root_terminator" ); - fRootTerminator->SetStep( fStep ); - fToolbox.Add(fRootTerminator); - - fRootWriter->SetName( "root_writer" ); - fToolbox.Add(fRootWriter); - - fRootStepModifier->SetName( "root_step_modifier" ); - fToolbox.Add( fRootStepModifier ); - - fRootTrackModifier->SetName( "root_track_modifier" ); - fToolbox.Add( fRootTrackModifier ); - - fRootEventModifier->SetName( "root_event_modifier" ); - fToolbox.Add( fRootEventModifier ); - - fRootRunModifier->SetName( "root_run_modifier" ); - fToolbox.Add( fRootRunModifier ); - + KSParticleFactory::GetInstance().SetMagneticField( fRootMagneticField ); + KSParticleFactory::GetInstance().SetElectricField( fRootElectricField ); } KSRoot* KSRoot::Clone() const { @@ -297,6 +252,11 @@ namespace Kassiopeia void KSRoot::Execute( KSSimulation* aSimulation ) { + if ( aSimulation != fSimulation ) + { + fOnce = false; + } + fSimulation = aSimulation; vector< KSRunModifier* >* staticRunModifiers = fSimulation->GetStaticRunModifiers(); @@ -348,11 +308,18 @@ namespace Kassiopeia //GSL error handling fDefaultGSLErrorHandler = gsl_set_error_handler( &Kassiopeia::KSRoot::GSLErrorHandler ); - mainmsg( eNormal ) << "\u263B welcome to Kassiopeia 3.3 \u263B" << eom; + static const string sMessageSymbol = "\u263B "; + mainmsg( eNormal ) << sMessageSymbol << " welcome to Kassiopeia " << Kassiopeia_VERSION << " " << sMessageSymbol << eom; // version number from CMakeLists.txt + #ifdef Kassiopeia_ENABLE_DEBUG - mainmsg( eWarning ) << "Kassiopeia is running in debug mode - compile without debug flags to speed up simulations" << eom; + mainmsg( eWarning ) << "Kassiopeia is running in debug mode - compile without debug flags to speed up simulations." << eom; #endif + if (fSimulation->GetEvents() == 0) + { + mainmsg( eWarning ) << "Kassiopeia will not perform any tracking since the specified number of events is zero." << eom; + } + ExecuteRun(); mainmsg( eNormal ) << "finished!" << eom; @@ -429,8 +396,6 @@ namespace Kassiopeia // send report runmsg( eNormal ) << "processing run " << fRun->GetRunId() << "..." << eom; - - while( true ) { fRootRunModifier->ExecutePreRunModification(); @@ -501,6 +466,7 @@ namespace Kassiopeia //clear any internal trajectory state fRootTrajectory->Reset(); + fRestartNavigation = true; fRootEventModifier->ExecutePreEventModification(); @@ -598,7 +564,10 @@ namespace Kassiopeia fRootTrackModifier->ExecutePreTrackModification(); // start navigation - fRootSpaceNavigator->StartNavigation( fTrack->InitialParticle(), fRootSpace ); + if ( fRestartNavigation == true ) + { + fRootSpaceNavigator->StartNavigation( fTrack->InitialParticle(), fRootSpace ); + } // initialize step objects fStep->InitialParticle() = fTrack->InitialParticle(); @@ -606,13 +575,13 @@ namespace Kassiopeia //clear any internal trajectory state fRootTrajectory->Reset(); + fRestartNavigation = true; while( fStep->FinalParticle().IsActive() ) { //signal handler break if ( fStopRunSignal || fStopEventSignal || fStopTrackSignal ) { - cout<<"breaking!"<ParticleQueue().empty()) @@ -671,7 +640,10 @@ namespace Kassiopeia fTrackIndex++; // stop navigation - fRootSpaceNavigator->StopNavigation( fTrack->FinalParticle(), fRootSpace ); + if ( fRestartNavigation == true ) + { + fRootSpaceNavigator->StopNavigation( fTrack->FinalParticle(), fRootSpace ); + }; // send report trackmsg( eNormal ) << "...completed track " << fTrack->GetTrackId() << " <" << fTrack->GetTerminatorName() << "> after " << fTrack->GetTotalSteps() << " steps at " << fTrack->GetFinalParticle().GetPosition() << eom; @@ -685,7 +657,9 @@ namespace Kassiopeia { // run pre-step modification bool hasPreModified = fRootStepModifier->ExecutePreStepModification(); - if(hasPreModified){fRootTrajectory->Reset();}; + if (hasPreModified) { + fRootTrajectory->Reset(); + } // reset step fStep->StepId() = fStepIndex; @@ -756,14 +730,13 @@ namespace Kassiopeia if( fStep->TerminatorFlag() == false ) { // if the particle is not on a surface or side, continue with space calculations - if( (fStep->InitialParticle().GetCurrentSurface() == NULL) && (fStep->InitialParticle().GetCurrentSide() == NULL) ) + if( (fStep->InitialParticle().GetCurrentSurface() == nullptr) && (fStep->InitialParticle().GetCurrentSide() == nullptr) ) { // integrate the trajectory fRootTrajectory->CalculateTrajectory(); //need to check if an error handler event or stop signal //was triggered during the trajectory calculation - if( fGSLErrorSignal || fStopTrackSignal || fRootTrajectory->Check() ) { fStep->FinalParticle().SetActive(false); @@ -774,7 +747,10 @@ namespace Kassiopeia else { fStep->TerminatorName() = fStopSignalName; - if (fGSLErrorSignal) { mainmsg( eWarning ) << fGSLErrorString << eom; } + if (fGSLErrorSignal) + { + mainmsg( eWarning ) << fGSLErrorString << eom; + } } } else @@ -847,7 +823,16 @@ namespace Kassiopeia } // execute post-step modification - fRootStepModifier->ExecutePostStepModification(); + bool hasPostModified = fRootStepModifier->ExecutePostStepModification(); + if (hasPostModified) + { + fRootTrajectory->Reset(); + if( fStep->FinalParticle().IsActive() == false ) + { + fStep->TerminatorName() = fStep->ModifierName(); + fRestartNavigation = false; // this avoids losing internal navigation/terminator states + } + } // push update fStep->PushUpdate(); @@ -890,7 +875,15 @@ namespace Kassiopeia // execute post-step modification bool hasPostModified = fRootStepModifier->ExecutePostStepModification(); - if(hasPostModified){fRootTrajectory->Reset();}; + if (hasPostModified) + { + fRootTrajectory->Reset(); + if( fStep->FinalParticle().IsActive() == false ) + { + fStep->TerminatorName() = fStep->ModifierName(); + fRestartNavigation = false; // this avoids losing internal navigation/terminator states + } + } // push update fStep->PushUpdate(); diff --git a/Kassiopeia/Simulation/Source/KSRootStepModifier.cxx b/Kassiopeia/Simulation/Source/KSRootStepModifier.cxx index 679b671a5..0a7487460 100644 --- a/Kassiopeia/Simulation/Source/KSRootStepModifier.cxx +++ b/Kassiopeia/Simulation/Source/KSRootStepModifier.cxx @@ -69,15 +69,15 @@ namespace Kassiopeia { //the following disables any change made to the initial particle, why? *fModifierParticle = *fInitialParticle; - // fStep->ModifierName().clear(); - //fStep->ModificationFlag() = false; + fStep->ModifierName().clear(); + fStep->ModifierFlag() = false; if( fModifiers.End() == 0 ) { modmsg_debug( "modifier calculation:" << eom ) modmsg_debug( " no modifier active" << eom ) - //modmsg_debug( " modifier name: <" << fStep->GetModifierName() << ">" << eom ) - //modmsg_debug( " modifier flag: <" << fStep->GetModificationFlag() << ">" << eom ) + modmsg_debug( " modifier name: <" << fStep->GetModifierName() << ">" << eom ) + modmsg_debug( " modifier flag: <" << fStep->GetModifierFlag() << ">" << eom ) modmsg_debug( "modifier calculation terminator particle state: " << eom ) modmsg_debug( " modifier particle space: <" << (fModifierParticle->GetCurrentSpace() ? fModifierParticle->GetCurrentSpace()->GetName() : "" ) << ">" << eom ) @@ -94,22 +94,22 @@ namespace Kassiopeia return false; //changes to inital particle state disabled } - bool hasChangedState = ExecutePreStepModification( *fModifierParticle, *fParticleQueue ); + fStep->ModifierFlag() = ExecutePreStepModification( *fModifierParticle, *fParticleQueue ); - (void) hasChangedState; + (void) fStep->ModifierFlag(); //hasChangedState is unused because we are operating on the modifier particle //this disables any changes to the intial particle -// if( fStep->ModificationFlag() == true ) -// { -// modmsg_debug( "modifier calculation:" << eom ) -// modmsg_debug( " modification may occur" << eom ) -// } -// else -// { -// modmsg_debug( "modifier calculation:" << eom ) -// modmsg_debug( " modification will not occur" << eom ) -// } + if( fStep->ModifierFlag() == true ) + { + modmsg_debug( "modifier calculation:" << eom ) + modmsg_debug( " modification may occur" << eom ) + } + else + { + modmsg_debug( "modifier calculation:" << eom ) + modmsg_debug( " modification will not occur" << eom ) + } modmsg_debug( "modifier calculation modifier particle state: " << eom ) modmsg_debug( " modifier particle space: <" << (fModifierParticle->GetCurrentSpace() ? fModifierParticle->GetCurrentSpace()->GetName() : "" ) << ">" << eom ) @@ -129,9 +129,9 @@ namespace Kassiopeia bool KSRootStepModifier::ExecutePostStepModification() { bool hasChangedState = ExecutePostStepModification( *fModifierParticle, *fFinalParticle, *fParticleQueue ); - //fFinalParticle->ReleaseLabel( fStep->ModifierName() ); + fFinalParticle->ReleaseLabel( fStep->ModifierName() ); - modmsg_debug( "terminator execution:" << eom ) + modmsg_debug( "modifier execution:" << eom ) modmsg_debug( " terminator name: <" << fStep->TerminatorName() << ">" << eom ) modmsg_debug( " step continuous time: <" << fStep->ContinuousTime() << ">" << eom ) modmsg_debug( " step continuous length: <" << fStep->ContinuousLength() << ">" << eom ) @@ -141,7 +141,7 @@ namespace Kassiopeia modmsg_debug( " step discrete energy change: <" << fStep->DiscreteEnergyChange() << ">" << eom ) modmsg_debug( " step discrete momentum change: <" << fStep->DiscreteMomentumChange() << ">" << eom ) - modmsg_debug( "terminator final particle state: " << eom ) + modmsg_debug( "modifier final particle state: " << eom ) modmsg_debug( " final particle space: <" << (fModifierParticle->GetCurrentSpace() ? fModifierParticle->GetCurrentSpace()->GetName() : "" ) << ">" << eom ) modmsg_debug( " final particle surface: <" << (fModifierParticle->GetCurrentSurface() ? fModifierParticle->GetCurrentSurface()->GetName() : "" ) << ">" << eom ) modmsg_debug( " final particle time: <" << fModifierParticle->GetTime() << ">" << eom ) diff --git a/Kassiopeia/Simulation/Source/KSRootSurfaceNavigator.cxx b/Kassiopeia/Simulation/Source/KSRootSurfaceNavigator.cxx index 75cfd3777..eae0ce1a4 100644 --- a/Kassiopeia/Simulation/Source/KSRootSurfaceNavigator.cxx +++ b/Kassiopeia/Simulation/Source/KSRootSurfaceNavigator.cxx @@ -129,10 +129,10 @@ namespace Kassiopeia } void KSRootSurfaceNavigator::FinalizeNavigation() - { - FinalizeNavigation( *fFinalParticle ); - return; - } + { + FinalizeNavigation( *fFinalParticle ); + return; + } STATICINT sKSRootSurfaceNavigatorDict = KSDictionary< KSRootSurfaceNavigator >::AddCommand( &KSRootSurfaceNavigator::SetSurfaceNavigator, &KSRootSurfaceNavigator::ClearSurfaceNavigator, "set_surface_navigator", "clear_surface_navigator" ); diff --git a/Kassiopeia/Simulation/Source/KSRootTerminator.cxx b/Kassiopeia/Simulation/Source/KSRootTerminator.cxx index ed59247d8..ae7f3c9f8 100644 --- a/Kassiopeia/Simulation/Source/KSRootTerminator.cxx +++ b/Kassiopeia/Simulation/Source/KSRootTerminator.cxx @@ -157,6 +157,7 @@ namespace Kassiopeia return; } + void KSRootTerminator::ExecuteTermination() { ExecuteTermination( *fTerminatorParticle, *fFinalParticle, *fParticleQueue ); diff --git a/Kassiopeia/Simulation/Source/KSRootTrajectory.cxx b/Kassiopeia/Simulation/Source/KSRootTrajectory.cxx index a1947dd52..7693a4b68 100644 --- a/Kassiopeia/Simulation/Source/KSRootTrajectory.cxx +++ b/Kassiopeia/Simulation/Source/KSRootTrajectory.cxx @@ -1,6 +1,8 @@ #include "KSRootTrajectory.h" #include "KSTrajectoriesMessage.h" +#include + namespace Kassiopeia { @@ -122,6 +124,7 @@ namespace Kassiopeia if( !( fTrajectoryParticle->GetPosition() == fTrajectoryParticle->GetPosition() ) ) { trajmsg( eWarning ) << "trajectory <" << GetName() << "> encountered a NAN value in the position." << eom; + fTrajectoryParticle->Print(); fFailureFlag = true; return; } @@ -129,6 +132,7 @@ namespace Kassiopeia if( !( fTrajectoryParticle->GetMagneticField() == fTrajectoryParticle->GetMagneticField() ) ) { trajmsg( eWarning ) << "trajectory <" << GetName() << "> encountered a NAN value in the magnetic field." << eom; + fTrajectoryParticle->Print(); fFailureFlag = true; return; } @@ -136,6 +140,15 @@ namespace Kassiopeia if( !( fTrajectoryParticle->GetElectricField() == fTrajectoryParticle->GetElectricField() ) ) { trajmsg( eWarning ) << "trajectory <" << GetName() << "> encountered a NAN value in the electric field." << eom; + fTrajectoryParticle->Print(); + fFailureFlag = true; + return; + } + + if ( fTrajectoryParticle->GetMomentum().MagnitudeSquared() <= std::numeric_limits::min() ) // fastest option to check non-zero momentum + { + trajmsg( eWarning ) << "trajectory <" << GetName() << "> encountered a null value in the momentum." << eom; + fTrajectoryParticle->Print(); fFailureFlag = true; return; } diff --git a/Kassiopeia/Simulation/Source/KSSimulation.cxx b/Kassiopeia/Simulation/Source/KSSimulation.cxx index 5922b0edd..bd299e796 100644 --- a/Kassiopeia/Simulation/Source/KSSimulation.cxx +++ b/Kassiopeia/Simulation/Source/KSSimulation.cxx @@ -1,4 +1,5 @@ #include "KSSimulation.h" +#include "KSMainMessage.h" using namespace std; @@ -72,6 +73,14 @@ namespace Kassiopeia void KSSimulation::AddCommand( KSCommand* aCommand ) { + if ( aCommand == nullptr ) + { + mainmsg( eError ) << "simulation <" << this->GetName() << "> could not add invalid command" << eom; + return; + } + + mainmsg_debug( "simulation <" << this->GetName() << "> adding command <" << aCommand->GetName() << ">" << eom ); + std::vector< KSCommand* >::iterator tCommandIt; for( tCommandIt = fCommands.begin(); tCommandIt != fCommands.end(); tCommandIt++ ) { @@ -85,6 +94,14 @@ namespace Kassiopeia } void KSSimulation::RemoveCommand( KSCommand* aCommand ) { + if ( aCommand == nullptr ) + { + mainmsg( eError ) << "simulation <" << this->GetName() << "> could not remove invalid command" << eom; + return; + } + + mainmsg_debug( "simulation <" << this->GetName() << "> removing command <" << aCommand->GetName() << ">" << eom ); + std::vector< KSCommand* >::iterator tCommandIt; for( tCommandIt = fCommands.begin(); tCommandIt != fCommands.end(); tCommandIt++ ) { diff --git a/Kassiopeia/Simulation/Source/KSStep.cxx b/Kassiopeia/Simulation/Source/KSStep.cxx index 91d566434..81d4e95c5 100644 --- a/Kassiopeia/Simulation/Source/KSStep.cxx +++ b/Kassiopeia/Simulation/Source/KSStep.cxx @@ -16,6 +16,8 @@ namespace Kassiopeia fDiscreteSecondaries( 0 ), fDiscreteEnergyChange( 0. ), fDiscreteMomentumChange( 0. ), + fModifierName( "" ), + fModifierFlag( false ), fTerminatorName( "" ), fTerminatorFlag( false ), fTrajectoryName( "" ), @@ -53,6 +55,8 @@ namespace Kassiopeia fDiscreteSecondaries( aCopy.fDiscreteSecondaries ), fDiscreteEnergyChange( aCopy.fDiscreteSecondaries ), fDiscreteMomentumChange( aCopy.fDiscreteMomentumChange ), + fModifierName( aCopy.fModifierName ), + fModifierFlag( aCopy.fModifierFlag ), fTerminatorName( aCopy.fTerminatorName ), fTerminatorFlag( aCopy.fTerminatorFlag ), fTrajectoryName( aCopy.fTrajectoryName ), @@ -90,6 +94,8 @@ namespace Kassiopeia fDiscreteSecondaries = aCopy.fDiscreteSecondaries; fDiscreteEnergyChange = aCopy.fDiscreteEnergyChange; fDiscreteMomentumChange = aCopy.fDiscreteMomentumChange; + fModifierName = aCopy.fModifierName; + fModifierFlag = aCopy.fModifierFlag; fTerminatorName = aCopy.fTerminatorName; fTerminatorFlag = aCopy.fTerminatorFlag; fTrajectoryName = aCopy.fTrajectoryName; @@ -134,6 +140,8 @@ namespace Kassiopeia KSDictionary< KSStep >::AddComponent( &KSStep::GetDiscreteSecondaries, "discrete_secondaries" ) + KSDictionary< KSStep >::AddComponent( &KSStep::GetDiscreteEnergyChange, "discrete_energy_change" ) + KSDictionary< KSStep >::AddComponent( &KSStep::GetDiscreteMomentumChange, "discrete_momentum_change" ) + + KSDictionary< KSStep >::AddComponent( &KSStep::GetModifierName, "modifier_name" ) + + KSDictionary< KSStep >::AddComponent( &KSStep::GetModifierFlag, "modifier_flag" ) + KSDictionary< KSStep >::AddComponent( &KSStep::GetTerminatorName, "terminator_name" ) + KSDictionary< KSStep >::AddComponent( &KSStep::GetTerminatorFlag, "terminator_flag" ) + KSDictionary< KSStep >::AddComponent( &KSStep::GetTrajectoryName, "trajectory_name" ) + diff --git a/Kassiopeia/Terminators/Include/KSTermTrapped.h b/Kassiopeia/Terminators/Include/KSTermTrapped.h index b711941c5..0116e9649 100644 --- a/Kassiopeia/Terminators/Include/KSTermTrapped.h +++ b/Kassiopeia/Terminators/Include/KSTermTrapped.h @@ -18,7 +18,7 @@ namespace Kassiopeia KSTermTrapped* Clone() const; virtual ~KSTermTrapped(); - K_SET_GET(unsigned int, MaxTurns) + K_SET_GET(int, MaxTurns) public: void CalculateTermination( const KSParticle& anInitialParticle, bool& aFlag ); @@ -29,7 +29,7 @@ namespace Kassiopeia virtual void DeactivateComponent(); private: - unsigned int fCurrentTurns; + int fCurrentTurns; double fCurrentDotProduct; }; diff --git a/Kassiopeia/Terminators/Source/KSTermTrapped.cxx b/Kassiopeia/Terminators/Source/KSTermTrapped.cxx index 146cf9b22..0e594781d 100644 --- a/Kassiopeia/Terminators/Source/KSTermTrapped.cxx +++ b/Kassiopeia/Terminators/Source/KSTermTrapped.cxx @@ -41,6 +41,9 @@ namespace Kassiopeia void KSTermTrapped::CalculateTermination( const KSParticle& anInitialParticle, bool& aFlag ) { + if (fMaxTurns < 0) + termmsg( eError ) << "negative maximal number of turns defined in Trapped terminator <" << this->GetName() << ">" << eom; + double DotProduct = anInitialParticle.GetMagneticField().Dot( anInitialParticle.GetMomentum() ); if( DotProduct * fCurrentDotProduct < 0. ) diff --git a/Kassiopeia/Trajectories/Source/KSTrajTermPropagation.cxx b/Kassiopeia/Trajectories/Source/KSTrajTermPropagation.cxx index 437e43534..a2fb37ab3 100644 --- a/Kassiopeia/Trajectories/Source/KSTrajTermPropagation.cxx +++ b/Kassiopeia/Trajectories/Source/KSTrajTermPropagation.cxx @@ -118,6 +118,63 @@ namespace Kassiopeia return; } + // void KSTrajTermPropagation::Differentiate(double /*aTime*/, const KSTrajExactSpinParticle& aParticle, KSTrajExactSpinDerivative& aDerivative ) const + // { + // double TempSN = std::sqrt( aParticle.GetSpin().MagnitudeSquared() - aParticle.GetSpin0() * aParticle.GetSpin0() ); + // + // KThreeVector tVelocity = fDirection * aParticle.GetVelocity(); + // + // KThreeVector MagneticMoment = aParticle.GetGyromagneticRatio() * aParticle.GetSpin() / aParticle.GetSpin().Magnitude() * aParticle.GetSpinMagnitude() * KConst::Hbar(); + // KThreeMatrix MagneticGradient = aParticle.GetMagneticGradient(); + // //double F1 = -MagneticMoment.X() * MagneticGradient[8] + MagneticMoment.Z() * MagneticGradient[2] - MagneticMoment.X() * MagneticGradient[4] + MagneticMoment.Y() * MagneticGradient[1]; + // //double F2 = -MagneticMoment.Y() * MagneticGradient[0] + MagneticMoment.X() * MagneticGradient[3] - MagneticMoment.Y() * MagneticGradient[8] + MagneticMoment.Z() * MagneticGradient[5]; + // //double F3 = -MagneticMoment.Z() * MagneticGradient[4] + MagneticMoment.Y() * MagneticGradient[7] - MagneticMoment.Z() * MagneticGradient[0] + MagneticMoment.X() * MagneticGradient[6]; + // double F1 = MagneticMoment.X() * MagneticGradient[0] + MagneticMoment.Y() * MagneticGradient[1] + MagneticMoment.Z() * MagneticGradient[2]; + // double F2 = MagneticMoment.X() * MagneticGradient[3] + MagneticMoment.Y() * MagneticGradient[4] + MagneticMoment.Z() * MagneticGradient[5]; + // double F3 = MagneticMoment.X() * MagneticGradient[6] + MagneticMoment.Y() * MagneticGradient[7] + MagneticMoment.Z() * MagneticGradient[8]; + // KThreeVector DipoleForce ( F1, F2, F3 ); + // + // KThreeVector tForce = aParticle.GetCharge() * (aParticle.GetElectricField() + tVelocity.Cross( aParticle.GetMagneticField() )) + DipoleForce; + // + // double SFU; + // { + // // FU + // double Temp0 = aParticle.GetLorentzFactor() * aParticle.GetElectricField().Dot( aParticle.GetVelocity() ); + // double Temp1 = aParticle.GetLorentzFactor() * ( aParticle.GetElectricField().X() * KConst::C() + aParticle.GetMagneticField().Z() * aParticle.GetVelocity().Y() * KConst::C() - aParticle.GetMagneticField().Y() * aParticle.GetVelocity().Z() * KConst::C() ); + // double Temp2 = aParticle.GetLorentzFactor() * ( aParticle.GetElectricField().Y() * KConst::C() - aParticle.GetMagneticField().Z() * aParticle.GetVelocity().X() * KConst::C() + aParticle.GetMagneticField().X() * aParticle.GetVelocity().Z() * KConst::C() ); + // double Temp3 = aParticle.GetLorentzFactor() * ( aParticle.GetElectricField().Z() * KConst::C() + aParticle.GetMagneticField().Y() * aParticle.GetVelocity().X() * KConst::C() - aParticle.GetMagneticField().X() * aParticle.GetVelocity().Y() * KConst::C() ); + // + // // SFU + // SFU = Temp0 * aParticle.GetSpin0() - Temp1 * aParticle.GetSpin().X() - Temp2 * aParticle.GetSpin().Y() - Temp3 * aParticle.GetSpin().Z(); + // } + // + // // FS + // double FS0 = aParticle.GetElectricField().Dot( aParticle.GetSpin() ); + // double Temp1 = aParticle.GetElectricField().X() * aParticle.GetSpin0() + aParticle.GetMagneticField().Z() * aParticle.GetSpin().Y() * KConst::C() - aParticle.GetMagneticField().Y() * aParticle.GetSpin().Z() * KConst::C(); + // double Temp2 = aParticle.GetElectricField().Y() * aParticle.GetSpin0() - aParticle.GetMagneticField().Z() * aParticle.GetSpin().X() * KConst::C() + aParticle.GetMagneticField().X() * aParticle.GetSpin().Z() * KConst::C(); + // double Temp3 = aParticle.GetElectricField().Z() * aParticle.GetSpin0() + aParticle.GetMagneticField().Y() * aParticle.GetSpin().X() * KConst::C() - aParticle.GetMagneticField().X() * aParticle.GetSpin().Y() * KConst::C(); + // KThreeVector FS ( Temp1, Temp2, Temp3 ); + // + // double SDU; + // { + // // dU/dtau + // double DU0 = aParticle.GetLorentzFactor() / aParticle.GetMass() / KConst::C() * aParticle.GetVelocity().Dot( tForce ); + // KThreeVector DU = aParticle.GetLorentzFactor() / aParticle.GetMass() * tForce; + // // SdU/dtau + // SDU = aParticle.GetSpin0() * DU0 - aParticle.GetSpin().Dot(DU); + // } + // + // double tOmega0 = -aParticle.GetGyromagneticRatio() / KConst::C() * ( FS0 + aParticle.GetLorentzFactor() / KConst::C() * SFU ) - aParticle.GetLorentzFactor() / KConst::C() * SDU; + // KThreeVector tOmega = -aParticle.GetGyromagneticRatio() / KConst::C() * ( FS - aParticle.GetLorentzFactor() * aParticle.GetVelocity() / KConst::C() / KConst::C() * SFU ) + aParticle.GetLorentzFactor() * aParticle.GetVelocity() / KConst::C() / KConst::C() * SDU; + // + // aDerivative.AddToVelocity( tVelocity ); + // aDerivative.AddToForce( tForce / TempSN ); + // aDerivative.AddToOmega0( tOmega0 / TempSN ); + // aDerivative.AddToOmega( tOmega / TempSN ); + // + // return; + // } + void KSTrajTermPropagation::Differentiate(double /*aTime*/, const KSTrajAdiabaticParticle& aParticle, KSTrajAdiabaticDerivative& aDerivative ) const { double tLongVelocity = fDirection * aParticle.GetLongVelocity(); @@ -169,9 +226,12 @@ namespace Kassiopeia KThreeVector tVelocity = fDirection * aParticle.GetVelocity(); KThreeVector tForce = aParticle.GetCharge() * (aParticle.GetElectricField() + tVelocity.Cross( aParticle.GetMagneticField() )) - + aParticle.GetGyromagneticRatio() * aParticle.GetSpinMagnitude() * KConst::Hbar() * aParticle.GetAlignedSpin() * GradBMagnitude; - double tMDot = 0; - double tPhiDot = - aParticle.GetGyromagneticRatio() * aParticle.GetMagneticField().Magnitude() - aParticle.GetVelocity().Dot( A ); + + aParticle.GetGyromagneticRatio() * aParticle.GetSpinMagnitude() * KConst::Hbar() * aParticle.GetAlignedSpin() * GradBMagnitude + + aParticle.GetMagneticField().Magnitude() * aParticle.GetGyromagneticRatio() * aParticle.GetSpinMagnitude() * KConst::Hbar() * sqrt( 1 - aParticle.GetAlignedSpin() * aParticle.GetAlignedSpin() ) * ( GradBDirection * c ); + double tMDot = aParticle.GetGyromagneticRatio() * aParticle.GetSpinMagnitude() * KConst::Hbar() * sqrt( 1 - aParticle.GetAlignedSpin() * aParticle.GetAlignedSpin() ) * tVelocity * GradBDirection * c; + double tPhiDot = - aParticle.GetGyromagneticRatio() * aParticle.GetMagneticField().Magnitude() - aParticle.GetVelocity().Dot( A ) + - aParticle.GetAlignedSpin() / sqrt( 1 - aParticle.GetAlignedSpin() * aParticle.GetAlignedSpin() ) * ( aParticle.GetVelocity() * GradBDirection * a ); + aDerivative.AddToVelocity( tVelocity ); aDerivative.AddToForce( tForce ); aDerivative.AddToMDot( tMDot ); diff --git a/Kassiopeia/Visualization/Include/KSROOTTrackPainter.h b/Kassiopeia/Visualization/Include/KSROOTTrackPainter.h index a10c081ab..2792a6893 100644 --- a/Kassiopeia/Visualization/Include/KSROOTTrackPainter.h +++ b/Kassiopeia/Visualization/Include/KSROOTTrackPainter.h @@ -16,12 +16,13 @@ using katrin::KROOTPainter; namespace Kassiopeia { + class KSReadFileROOT; class KSROOTTrackPainter : public KROOTPainter { public: - KSROOTTrackPainter(); + KSROOTTrackPainter(); ~KSROOTTrackPainter(); virtual void Render(); @@ -40,7 +41,7 @@ namespace Kassiopeia typedef enum { - eColorFix, eColorStep, eColorTrack + eColorFix, eColorStep, eColorTrack } ColorMode; typedef enum @@ -54,7 +55,7 @@ namespace Kassiopeia } PlotMode; private: - void CreateColors(); + void CreateColors( KSReadFileROOT& aReader ); private: ;K_SET( std::string, Path ); @@ -63,10 +64,10 @@ namespace Kassiopeia ;K_SET( std::string, YAxis ); ;K_SET( std::string, StepOutputGroupName ); ;K_SET( std::string, PositionName ); - ;K_SET( std::string, TrackOutputGroupName ); - ;K_SET( std::string, ColorVariable ); - ;K_SET( ColorMode, ColorMode ); - ;K_SET( ColorPalette, ColorPalette ); + ;K_SET( std::string, TrackOutputGroupName ); + ;K_SET( std::string, ColorVariable ); + ;K_SET( ColorMode, ColorMode ); + ;K_SET( ColorPalette, ColorPalette ); ;K_SET( std::string, DrawOptions ); ;K_SET( PlotMode, PlotMode ); ;K_SET( bool, AxialMirror ); @@ -78,8 +79,8 @@ namespace Kassiopeia inline void KSROOTTrackPainter::AddBaseColor(TColor aColor, double aFraction = -1.0 ) { - vismsg( eNormal ) <<"ROOTTrackPainter adding color " < ( aColor, aFraction) ); + vismsg( eNormal ) <<"ROOTTrackPainter adding color " < ( aColor, aFraction) ); } } diff --git a/Kassiopeia/Visualization/Source/KSROOTTrackPainter.cxx b/Kassiopeia/Visualization/Source/KSROOTTrackPainter.cxx index 529c7c8e9..191698b9a 100644 --- a/Kassiopeia/Visualization/Source/KSROOTTrackPainter.cxx +++ b/Kassiopeia/Visualization/Source/KSROOTTrackPainter.cxx @@ -37,9 +37,6 @@ namespace Kassiopeia void KSROOTTrackPainter::Render() { - CreateColors(); - vector::iterator tColorIterator = fColorVector.begin(); - fMultigraph = new TMultiGraph(); KRootFile* tRootFile = KRootFile::CreateOutputRootFile( fBase ); @@ -57,177 +54,192 @@ namespace Kassiopeia tReader.OpenFile( tRootFile ); + CreateColors( tReader ); + vector::iterator tColorIterator = fColorVector.begin(); + KSReadRunROOT& tRunReader = tReader.GetRun(); KSReadEventROOT& tEventReader = tReader.GetEvent(); KSReadTrackROOT& tTrackReader = tReader.GetTrack(); KSReadStepROOT& tStepReader = tReader.GetStep(); - if ( fPlotMode == ePlotStep ) - { - KSReadObjectROOT& tStepGroup = tStepReader.GetObject( fStepOutputGroupName ); - KSThreeVector& tPosition = tStepGroup.Get< KSThreeVector >( fPositionName ); - - for( tRunReader = 0; tRunReader <= tRunReader.GetLastRunIndex(); tRunReader++ ) - { - vismsg( eDebug ) << "Analyzing run <" << tRunReader.GetRunIndex() << "> with events from <" << tRunReader.GetFirstEventIndex() << "> to <"<"<< eom; - for( tEventReader = tRunReader.GetFirstEventIndex(); tEventReader <= tRunReader.GetLastEventIndex(); tEventReader++ ) - { - vismsg( eDebug ) << "Analyzing event <" << tEventReader.GetEventIndex() << "> with tracks from <" << tEventReader.GetFirstTrackIndex() << "> to <"<"<< eom; - for( tTrackReader = tEventReader.GetFirstTrackIndex(); tTrackReader <= tEventReader.GetLastTrackIndex(); tTrackReader++ ) - { - vismsg( eDebug ) << "Analyzing track <" << tTrackReader.GetTrackIndex() << "> with steps from <" << tTrackReader.GetFirstStepIndex() << "> to <"<"<< eom; + if ( fPlotMode == ePlotStep ) + { + KSReadObjectROOT& tStepGroup = tStepReader.GetObject( fStepOutputGroupName ); + KSThreeVector& tPosition = tStepGroup.Get< KSThreeVector >( fPositionName ); + + for( tRunReader = 0; tRunReader <= tRunReader.GetLastRunIndex(); tRunReader++ ) + { + vismsg( eDebug ) << "Analyzing run <" << tRunReader.GetRunIndex() << "> with events from <" << tRunReader.GetFirstEventIndex() << "> to <"<"<< eom; + for( tEventReader = tRunReader.GetFirstEventIndex(); tEventReader <= tRunReader.GetLastEventIndex(); tEventReader++ ) + { + vismsg( eDebug ) << "Analyzing event <" << tEventReader.GetEventIndex() << "> with tracks from <" << tEventReader.GetFirstTrackIndex() << "> to <"<"<< eom; + for( tTrackReader = tEventReader.GetFirstTrackIndex(); tTrackReader <= tEventReader.GetLastTrackIndex(); tTrackReader++ ) + { + vismsg( eDebug ) << "Analyzing track <" << tTrackReader.GetTrackIndex() << "> with steps from <" << tTrackReader.GetFirstStepIndex() << "> to <"<"<< eom; TGraph* myGraph = NULL; - if ( fColorMode == eColorTrack || fColorMode == eColorFix ) - { - myGraph = new TGraph(); - if ( tColorIterator == fColorVector.end() ) - { - vismsg( eError ) <<"color vector has to less entries, something is wrong!"<SetLineColor( *tColorIterator ); - tColorIterator++; - } - - for( tStepReader = tTrackReader.GetFirstStepIndex(); tStepReader <= tTrackReader.GetLastStepIndex(); tStepReader++ ) - { - if( tStepGroup.Valid() ) - { + if ( fColorMode == eColorTrack || fColorMode == eColorFix ) + { + myGraph = new TGraph(); + if ( tColorIterator == fColorVector.end() ) + { + vismsg( eError ) <<"color vector has to less entries, something is wrong!"<SetLineColor( *tColorIterator ); + tColorIterator++; + } + + for( tStepReader = tTrackReader.GetFirstStepIndex(); tStepReader <= tTrackReader.GetLastStepIndex(); tStepReader++ ) + { + if( tStepGroup.Valid() ) + { double tXValue = 0.; - if( fXAxis == string( "x" ) || fXAxis == string( "X" ) ) - { - tXValue = tPosition.Value().X(); - } - if( fXAxis == string( "y" ) || fXAxis == string( "Y" ) ) - { - tXValue = tPosition.Value().Y(); - } - if( fXAxis == string( "z" ) || fXAxis == string( "Z" ) ) - { - tXValue = tPosition.Value().Z(); - } + if( fXAxis == string( "x" ) || fXAxis == string( "X" ) ) + { + tXValue = tPosition.Value().X(); + } + if( fXAxis == string( "y" ) || fXAxis == string( "Y" ) ) + { + tXValue = tPosition.Value().Y(); + } + if( fXAxis == string( "z" ) || fXAxis == string( "Z" ) ) + { + tXValue = tPosition.Value().Z(); + } double tYValue = 0.; - if( fYAxis == string( "x" ) || fYAxis == string( "X" ) ) - { - tYValue = tPosition.Value().X(); - } - if( fYAxis == string( "y" ) || fYAxis == string( "Y" ) ) - { - tYValue = tPosition.Value().Y(); - } - if( fYAxis == string( "z" ) || fYAxis == string( "Z" ) ) - { - tYValue = tPosition.Value().Z(); - } - if( fYAxis == string( "r" ) || fYAxis == string( "R" ) ) - { - tYValue = tPosition.Value().Perp(); - } - - if ( fColorMode == eColorStep ) - { - //create one graph for each point (one graph can only have one color) - myGraph = new TGraph(); - myGraph->SetPoint( myGraph->GetN(), tXValue, tYValue ); - if ( tColorIterator == fColorVector.end() ) - { - vismsg( eError ) <<"color vector has to less entries, something is wrong!"<SetMarkerColor( *tColorIterator ); - fMultigraph->Add( myGraph ); - tColorIterator++; - } - if ( fColorMode == eColorTrack || fColorMode == eColorFix ) - { - myGraph->SetPoint( myGraph->GetN(), tXValue, tYValue ); - } - } - } - - if ( fColorMode == eColorTrack || fColorMode == eColorFix ) - { - fMultigraph->Add( myGraph ); - - //if axial mirror is set, another graph is created with the same points, put y has a changed sign - if ( fAxialMirror ) - { - TGraph* myMirroredGraph = new TGraph(); - myMirroredGraph->SetLineColor( myGraph->GetLineColor() ); - double tX,tY; - for ( int tIndex = 0; tIndex < myGraph->GetN(); tIndex++ ) - { - myGraph->GetPoint( tIndex, tX, tY ); - myMirroredGraph->SetPoint( tIndex, tX, -1.0*tY ); - } - fMultigraph->Add( myMirroredGraph ); - } - } - } - } - } + if( fYAxis == string( "x" ) || fYAxis == string( "X" ) ) + { + tYValue = tPosition.Value().X(); + } + if( fYAxis == string( "y" ) || fYAxis == string( "Y" ) ) + { + tYValue = tPosition.Value().Y(); + } + if( fYAxis == string( "z" ) || fYAxis == string( "Z" ) ) + { + tYValue = tPosition.Value().Z(); + } + if( fYAxis == string( "r" ) || fYAxis == string( "R" ) ) + { + tYValue = tPosition.Value().Perp(); + } + + if ( fColorMode == eColorStep ) + { + //create one graph for each point (one graph can only have one color) + myGraph = new TGraph(); + myGraph->SetPoint( myGraph->GetN(), tXValue, tYValue ); + if ( tColorIterator == fColorVector.end() ) + { + vismsg( eError ) <<"color vector has to less entries, something is wrong!"<SetMarkerColor( *tColorIterator ); + tColorIterator++; + if (myGraph->GetN() > 0) + { + fMultigraph->Add( myGraph ); + } + } + if ( fColorMode == eColorTrack || fColorMode == eColorFix ) + { + myGraph->SetPoint( myGraph->GetN(), tXValue, tYValue ); + } + } + } + + if ( fColorMode == eColorTrack || fColorMode == eColorFix ) + { + if (myGraph->GetN() > 0) + { + fMultigraph->Add( myGraph ); + } + + //if axial mirror is set, another graph is created with the same points, put y has a changed sign + if ( fAxialMirror ) + { + TGraph* myMirroredGraph = new TGraph(); + myMirroredGraph->SetLineColor( myGraph->GetLineColor() ); + double tX,tY; + for ( int tIndex = 0; tIndex < myGraph->GetN(); tIndex++ ) + { + myGraph->GetPoint( tIndex, tX, tY ); + myMirroredGraph->SetPoint( tIndex, tX, -1.0*tY ); + } + if (myMirroredGraph->GetN() > 0) + { + fMultigraph->Add( myMirroredGraph ); + } + } + } + } + } + } } - if ( fPlotMode == ePlotTrack ) - { - KSReadObjectROOT& tTrackGroup = tTrackReader.GetObject( fTrackOutputGroupName ); - KSThreeVector& tPosition = tTrackGroup.Get< KSThreeVector >( fPositionName ); - for( tRunReader = 0; tRunReader <= tRunReader.GetLastRunIndex(); tRunReader++ ) - { - for( tEventReader = tRunReader.GetFirstEventIndex(); tEventReader <= tRunReader.GetLastEventIndex(); tEventReader++ ) - { - - for( tTrackReader = tEventReader.GetFirstTrackIndex(); tTrackReader <= tEventReader.GetLastTrackIndex(); tTrackReader++ ) - { - TGraph* myGraph; + if ( fPlotMode == ePlotTrack ) + { + KSReadObjectROOT& tTrackGroup = tTrackReader.GetObject( fTrackOutputGroupName ); + KSThreeVector& tPosition = tTrackGroup.Get< KSThreeVector >( fPositionName ); + for( tRunReader = 0; tRunReader <= tRunReader.GetLastRunIndex(); tRunReader++ ) + { + for( tEventReader = tRunReader.GetFirstEventIndex(); tEventReader <= tRunReader.GetLastEventIndex(); tEventReader++ ) + { + + for( tTrackReader = tEventReader.GetFirstTrackIndex(); tTrackReader <= tEventReader.GetLastTrackIndex(); tTrackReader++ ) + { + TGraph* myGraph; myGraph = new TGraph(); - if ( fColorMode == eColorTrack || fColorMode == eColorFix ) - { - if ( tColorIterator == fColorVector.end() ) - { - vismsg( eError ) <<"color vector has to less entries, something is wrong!"<SetMarkerColor( *tColorIterator ); - tColorIterator++; - } + if ( fColorMode == eColorTrack || fColorMode == eColorFix ) + { + if ( tColorIterator == fColorVector.end() ) + { + vismsg( eError ) <<"color vector has to less entries, something is wrong!"<SetMarkerColor( *tColorIterator ); + tColorIterator++; + } double tXValue = 0.; - if( fXAxis == string( "x" ) || fXAxis == string( "X" ) ) - { - tXValue = tPosition.Value().X(); - } - if( fXAxis == string( "y" ) || fXAxis == string( "Y" ) ) - { - tXValue = tPosition.Value().Y(); - } - if( fXAxis == string( "z" ) || fXAxis == string( "Z" ) ) - { - tXValue = tPosition.Value().Z(); - } + if( fXAxis == string( "x" ) || fXAxis == string( "X" ) ) + { + tXValue = tPosition.Value().X(); + } + if( fXAxis == string( "y" ) || fXAxis == string( "Y" ) ) + { + tXValue = tPosition.Value().Y(); + } + if( fXAxis == string( "z" ) || fXAxis == string( "Z" ) ) + { + tXValue = tPosition.Value().Z(); + } double tYValue = 0.; - if( fYAxis == string( "x" ) || fYAxis == string( "X" ) ) - { - tYValue = tPosition.Value().X(); - } - if( fYAxis == string( "y" ) || fYAxis == string( "Y" ) ) - { - tYValue = tPosition.Value().Y(); - } - if( fYAxis == string( "z" ) || fYAxis == string( "Z" ) ) - { - tYValue = tPosition.Value().Z(); - } - if( fYAxis == string( "r" ) || fYAxis == string( "R" ) ) - { - tYValue = tPosition.Value().Perp(); - } - - myGraph->SetPoint( myGraph->GetN(), tXValue, tYValue ); - fMultigraph->Add( myGraph ); - } - - } - } - } + if( fYAxis == string( "x" ) || fYAxis == string( "X" ) ) + { + tYValue = tPosition.Value().X(); + } + if( fYAxis == string( "y" ) || fYAxis == string( "Y" ) ) + { + tYValue = tPosition.Value().Y(); + } + if( fYAxis == string( "z" ) || fYAxis == string( "Z" ) ) + { + tYValue = tPosition.Value().Z(); + } + if( fYAxis == string( "r" ) || fYAxis == string( "R" ) ) + { + tYValue = tPosition.Value().Perp(); + } + + myGraph->SetPoint( myGraph->GetN(), tXValue, tYValue ); + if (myGraph->GetN() > 0) + { + fMultigraph->Add( myGraph ); + } + } + + } + } + } tReader.CloseFile(); delete tRootFile; @@ -237,23 +249,23 @@ namespace Kassiopeia void KSROOTTrackPainter::Display() { - if( fDisplayEnabled == true ) + if( (fDisplayEnabled == true) && (fMultigraph->GetListOfGraphs() != nullptr) ) { - if ( fPlotMode == ePlotStep ) - { - if ( fColorMode == eColorStep ) - { - fMultigraph->Draw( ( string("P") + fDrawOptions ).c_str() ); - } - else - { - fMultigraph->Draw( ( string("L") + fDrawOptions ).c_str() ); - } - } - if ( fPlotMode == ePlotTrack ) - { - fMultigraph->Draw( ( string("P") + fDrawOptions ).c_str() ); - } + if ( fPlotMode == ePlotStep ) + { + if ( fColorMode == eColorStep ) + { + fMultigraph->Draw( ( string("P") + fDrawOptions ).c_str() ); + } + else + { + fMultigraph->Draw( ( string("L") + fDrawOptions ).c_str() ); + } + } + if ( fPlotMode == ePlotTrack ) + { + fMultigraph->Draw( ( string("P") + fDrawOptions ).c_str() ); + } } return; @@ -268,263 +280,249 @@ namespace Kassiopeia return; } - void KSROOTTrackPainter::CreateColors() + void KSROOTTrackPainter::CreateColors( KSReadFileROOT& aReader ) { - KRootFile* tRootFile = KRootFile::CreateOutputRootFile( fBase ); - if( !fPath.empty() ) + KSReadRunROOT& tRunReader = aReader.GetRun(); + KSReadEventROOT& tEventReader = aReader.GetEvent(); + KSReadTrackROOT& tTrackReader = aReader.GetTrack(); + KSReadStepROOT& tStepReader = aReader.GetStep(); + + //getting number of tracks/steps in file + size_t tNumberOfTracks = 0; + size_t tNumberOfSteps = 0; + for( tRunReader = 0; tRunReader <= tRunReader.GetLastRunIndex(); tRunReader++ ) { - tRootFile->AddToPaths( fPath ); + for( tEventReader = tRunReader.GetFirstEventIndex(); tEventReader <= tRunReader.GetLastEventIndex(); tEventReader++ ) + { + for( tTrackReader = tEventReader.GetFirstTrackIndex(); tTrackReader <= tEventReader.GetLastTrackIndex(); tTrackReader++ ) + { + tNumberOfTracks++; + + for( tStepReader = tTrackReader.GetFirstStepIndex(); tStepReader <= tTrackReader.GetLastStepIndex(); tStepReader++ ) + { + tNumberOfSteps++; + } + } + } } - KSReadFileROOT tReader; - tReader.OpenFile( tRootFile ); + if ( fColorPalette == eColorFPDRings ) + { + while ( ( fColorVector.size() < tNumberOfTracks && fColorMode == eColorTrack ) + || ( fColorVector.size() < tNumberOfSteps && fColorMode == eColorStep ) ) + { + //rainbow scheme + fColorVector.push_back( kBlack ); + fColorVector.push_back( kViolet + 7 ); + fColorVector.push_back( kBlue + 2 ); + fColorVector.push_back( kAzure + 2 ); + fColorVector.push_back( kAzure + 10 ); + fColorVector.push_back( kTeal + 7 ); + fColorVector.push_back( kGreen + 1); + fColorVector.push_back( kSpring - 3 ); + fColorVector.push_back( kSpring + 10 ); + fColorVector.push_back( kYellow ); + fColorVector.push_back( kOrange - 3 ); + fColorVector.push_back( kOrange + 7 ); + fColorVector.push_back( kRed ); + fColorVector.push_back( kRed + 2); + } + } - KSReadRunROOT& tRunReader = tReader.GetRun(); - KSReadEventROOT& tEventReader = tReader.GetEvent(); - KSReadTrackROOT& tTrackReader = tReader.GetTrack(); - KSReadStepROOT& tStepReader = tReader.GetStep(); + if ( fColorMode == eColorFix ) + { + Color_t tFixColor(kRed); + if ( fBaseColors.size() > 0 ) + { + TColor tTempColor; + tFixColor = tTempColor.GetColor(fBaseColors.at(0).first.GetRed(),fBaseColors.at(0).first.GetGreen(),fBaseColors.at(0).first.GetBlue()); + } + while ( fColorVector.size() < tNumberOfTracks ) + { + fColorVector.push_back( tFixColor ); + } + } - //getting number of tracks/steps in file - size_t tNumberOfTracks = 0; - size_t tNumberOfSteps = 0; - for( tRunReader = 0; tRunReader <= tRunReader.GetLastRunIndex(); tRunReader++ ) - { - for( tEventReader = tRunReader.GetFirstEventIndex(); tEventReader <= tRunReader.GetLastEventIndex(); tEventReader++ ) - { - for( tTrackReader = tEventReader.GetFirstTrackIndex(); tTrackReader <= tEventReader.GetLastTrackIndex(); tTrackReader++ ) - { - tNumberOfTracks++; - - for( tStepReader = tTrackReader.GetFirstStepIndex(); tStepReader <= tTrackReader.GetLastStepIndex(); tStepReader++ ) - { - tNumberOfSteps++; - } - } - } - } - - if ( fColorPalette == eColorFPDRings ) - { - while ( ( fColorVector.size() < tNumberOfTracks && fColorMode == eColorTrack ) - || ( fColorVector.size() < tNumberOfSteps && fColorMode == eColorStep ) ) - { - //rainbow scheme - fColorVector.push_back( kBlack ); - fColorVector.push_back( kViolet + 7 ); - fColorVector.push_back( kBlue + 2 ); - fColorVector.push_back( kAzure + 2 ); - fColorVector.push_back( kAzure + 10 ); - fColorVector.push_back( kTeal + 7 ); - fColorVector.push_back( kGreen + 1); - fColorVector.push_back( kSpring - 3 ); - fColorVector.push_back( kSpring + 10 ); - fColorVector.push_back( kYellow ); - fColorVector.push_back( kOrange - 3 ); - fColorVector.push_back( kOrange + 7 ); - fColorVector.push_back( kRed ); - fColorVector.push_back( kRed + 2); - } - } - - - if ( fColorMode == eColorFix ) - { - Color_t tFixColor(kRed); - if ( fBaseColors.size() > 0 ) - { - TColor tTempColor; - tFixColor = tTempColor.GetColor(fBaseColors.at(0).first.GetRed(),fBaseColors.at(0).first.GetGreen(),fBaseColors.at(0).first.GetBlue()); - } - while ( fColorVector.size() < tNumberOfTracks ) - { - fColorVector.push_back( tFixColor ); - } - } - - - - if ( fColorPalette == eColorCustom || fColorPalette == eColorDefault ) - { - - int tColorBins=100; - size_t tNumberBaseColors = fBaseColors.size(); - - double tRed[tNumberBaseColors]; - double tGreen[tNumberBaseColors]; - double tBlue[tNumberBaseColors]; - double tFraction[tNumberBaseColors]; - - for ( size_t tIndex = 0; tIndex < tNumberBaseColors; tIndex++ ) - { - tRed[tIndex] = fBaseColors.at( tIndex ).first.GetRed(); - tGreen[tIndex] = fBaseColors.at( tIndex ).first.GetGreen(); - tBlue[tIndex] = fBaseColors.at( tIndex ).first.GetBlue(); - tFraction[tIndex] = fBaseColors.at( tIndex ).second; - if ( tFraction[tIndex] == -1.0 ) - { - tFraction[tIndex] = tIndex / (double)(tNumberBaseColors - 1); - } - } - - int tMinColor = TColor::CreateGradientColorTable(tNumberBaseColors,tFraction,tRed,tGreen,tBlue,tColorBins); - int tMaxColor = tMinColor + tColorBins - 1; - - if ( fColorPalette == eColorDefault ) - { - tMinColor = 51; //purple - tMaxColor = 100; //red - } - - // int tPalette[tColorBins]; - // for ( int i = 0; iSetPalette( tColorBins, tPalette ); - - - double tColorVariableMax( -1.0 * std::numeric_limits< double >::max()); - double tColorVariableMin( std::numeric_limits< double >::max()); - - if ( fColorMode == eColorTrack ) - { - if ( tNumberOfTracks == 1 ) - { - fColorVector.push_back( tMaxColor ); - return; - } - //get track group and color variable - KSReadObjectROOT& tTrackGroup = tTrackReader.GetObject( fTrackOutputGroupName ); - - - //find min and max of color variable - for( tRunReader = 0; tRunReader <= tRunReader.GetLastRunIndex(); tRunReader++ ) - { - for( tEventReader = tRunReader.GetFirstEventIndex(); tEventReader <= tRunReader.GetLastEventIndex(); tEventReader++ ) - { - for( tTrackReader = tEventReader.GetFirstTrackIndex(); tTrackReader <= tEventReader.GetLastTrackIndex(); tTrackReader++ ) - { + if ( fColorPalette == eColorCustom || fColorPalette == eColorDefault ) + { + + int tColorBins=100; + size_t tNumberBaseColors = fBaseColors.size(); + + double tRed[tNumberBaseColors]; + double tGreen[tNumberBaseColors]; + double tBlue[tNumberBaseColors]; + double tFraction[tNumberBaseColors]; + + for ( size_t tIndex = 0; tIndex < tNumberBaseColors; tIndex++ ) + { + tRed[tIndex] = fBaseColors.at( tIndex ).first.GetRed(); + tGreen[tIndex] = fBaseColors.at( tIndex ).first.GetGreen(); + tBlue[tIndex] = fBaseColors.at( tIndex ).first.GetBlue(); + tFraction[tIndex] = fBaseColors.at( tIndex ).second; + if ( tFraction[tIndex] == -1.0 ) + { + tFraction[tIndex] = tIndex / (double)(tNumberBaseColors - 1); + } + } + + int tMinColor = TColor::CreateGradientColorTable(tNumberBaseColors,tFraction,tRed,tGreen,tBlue,tColorBins); + int tMaxColor = tMinColor + tColorBins - 1; + + if ( fColorPalette == eColorDefault ) + { + tMinColor = 51; //purple + tMaxColor = 100; //red + } + + // int tPalette[tColorBins]; + // for ( int i = 0; iSetPalette( tColorBins, tPalette ); + + + double tColorVariableMax( -1.0 * std::numeric_limits< double >::max()); + double tColorVariableMin( std::numeric_limits< double >::max()); + + if ( fColorMode == eColorTrack ) + { + if ( tNumberOfTracks == 1 ) + { + fColorVector.push_back( tMaxColor ); + return; + } + //get track group and color variable + KSReadObjectROOT& tTrackGroup = tTrackReader.GetObject( fTrackOutputGroupName ); + + //find min and max of color variable + for( tRunReader = 0; tRunReader <= tRunReader.GetLastRunIndex(); tRunReader++ ) + { + for( tEventReader = tRunReader.GetFirstEventIndex(); tEventReader <= tRunReader.GetLastEventIndex(); tEventReader++ ) + { + for( tTrackReader = tEventReader.GetFirstTrackIndex(); tTrackReader <= tEventReader.GetLastTrackIndex(); tTrackReader++ ) + { double tColorVariable = 0.; - if ( tTrackGroup.Exists< KSDouble >( fColorVariable ) ) - { - tColorVariable = tTrackGroup.Get< KSDouble >( fColorVariable ).Value(); - } - else if ( tTrackGroup.Exists< KSInt >( fColorVariable ) ) - { - tColorVariable = tTrackGroup.Get< KSInt >( fColorVariable ).Value(); - } - else if ( tTrackGroup.Exists< KSUInt >( fColorVariable ) ) - { - tColorVariable = tTrackGroup.Get< KSUInt >( fColorVariable ).Value(); - } - else - { - vismsg( eError ) <<"Color variable is of unsupported type"< tColorVariableMax ) - { - tColorVariableMax = tColorVariable; - } - if ( tColorVariable < tColorVariableMin ) - { - tColorVariableMin = tColorVariable; - } - } - } - } - vismsg( eNormal ) << "Range of track color variable is from < "< to < "<"<( fColorVariable ) ) + { + tColorVariable = tTrackGroup.Get< KSDouble >( fColorVariable ).Value(); + } + else if ( tTrackGroup.Exists< KSInt >( fColorVariable ) ) + { + tColorVariable = tTrackGroup.Get< KSInt >( fColorVariable ).Value(); + } + else if ( tTrackGroup.Exists< KSUInt >( fColorVariable ) ) + { + tColorVariable = tTrackGroup.Get< KSUInt >( fColorVariable ).Value(); + } + else + { + vismsg( eError ) <<"Color variable is of unsupported type"< tColorVariableMax ) + { + tColorVariableMax = tColorVariable; + } + if ( tColorVariable < tColorVariableMin ) + { + tColorVariableMin = tColorVariable; + } + } + } + } + vismsg( eInfo ) << "Range of track color variable is from < "< to < "<"<( fColorVariable ) ) - { - tColorVariable = tTrackGroup.Get< KSDouble >( fColorVariable ).Value(); - } - else if ( tTrackGroup.Exists< KSInt >( fColorVariable ) ) - { - tColorVariable = tTrackGroup.Get< KSInt >( fColorVariable ).Value(); - } - else if ( tTrackGroup.Exists< KSUInt >( fColorVariable ) ) - { - tColorVariable = tTrackGroup.Get< KSUInt >( fColorVariable ).Value(); - } - else - { - vismsg( eError ) <<"Color variable is of unsupported type"<( fColorVariable ) ) + { + tColorVariable = tTrackGroup.Get< KSDouble >( fColorVariable ).Value(); + } + else if ( tTrackGroup.Exists< KSInt >( fColorVariable ) ) + { + tColorVariable = tTrackGroup.Get< KSInt >( fColorVariable ).Value(); + } + else if ( tTrackGroup.Exists< KSUInt >( fColorVariable ) ) + { + tColorVariable = tTrackGroup.Get< KSUInt >( fColorVariable ).Value(); + } + else + { + vismsg( eError ) <<"Color variable is of unsupported type"<( fColorVariable ) ) - { - tColorVariable = tStepGroup.Get< KSDouble >( fColorVariable ).Value(); - } - else if ( tStepGroup.Exists< KSInt >( fColorVariable ) ) - { - tColorVariable = tStepGroup.Get< KSInt >( fColorVariable ).Value(); - } - else if ( tStepGroup.Exists< KSUInt >( fColorVariable ) ) - { - tColorVariable = tStepGroup.Get< KSUInt >( fColorVariable ).Value(); - } - else - { - vismsg( eError ) <<"Color variable is of unsupported type"< tColorVariableMax ) - { - tColorVariableMax = tColorVariable; - } - if ( tColorVariable < tColorVariableMin ) - { - tColorVariableMin = tColorVariable; - } - } - } - } - } - } - - vismsg( eNormal ) << "Range of step color variable is from < "< to < "<"<( fColorVariable ) ) + { + tColorVariable = tStepGroup.Get< KSDouble >( fColorVariable ).Value(); + } + else if ( tStepGroup.Exists< KSInt >( fColorVariable ) ) + { + tColorVariable = tStepGroup.Get< KSInt >( fColorVariable ).Value(); + } + else if ( tStepGroup.Exists< KSUInt >( fColorVariable ) ) + { + tColorVariable = tStepGroup.Get< KSUInt >( fColorVariable ).Value(); + } + else + { + vismsg( eError ) <<"Color variable is of unsupported type"< tColorVariableMax ) + { + tColorVariableMax = tColorVariable; + } + if ( tColorVariable < tColorVariableMin ) + { + tColorVariableMin = tColorVariable; + } + } + } + } + } + } + + vismsg( eInfo ) << "Range of step color variable is from < "< to < "<"<::max() ); TList* tGraphList = fMultigraph->GetListOfGraphs(); - for ( int tIndex = 0; tIndex < tGraphList->GetSize(); tIndex++ ) + if (tGraphList != nullptr) { - TGraph* tGraph = dynamic_cast ( tGraphList->At( tIndex ) ); - double* tX = tGraph->GetX(); - for ( int tIndexArray = 0; tIndexArray < tGraph->GetN(); tIndexArray++ ) - { - if ( tX[tIndexArray] < tMin ) - { - tMin = tX[tIndexArray]; - } - } + for ( int tIndex = 0; tIndex < tGraphList->GetSize(); tIndex++ ) + { + TGraph* tGraph = dynamic_cast ( tGraphList->At( tIndex ) ); + double* tX = tGraph->GetX(); + for ( int tIndexArray = 0; tIndexArray < tGraph->GetN(); tIndexArray++ ) + { + if ( tX[tIndexArray] < tMin ) + { + tMin = tX[tIndexArray]; + } + } + } } return tMin; } @@ -580,17 +578,20 @@ namespace Kassiopeia { double tMax( -1.0 * std::numeric_limits< double >::max() ); TList* tGraphList = fMultigraph->GetListOfGraphs(); - for ( int tIndex = 0; tIndex < tGraphList->GetSize(); tIndex++ ) + if (tGraphList != nullptr) { - TGraph* tGraph = dynamic_cast ( tGraphList->At( tIndex ) ); - double* tX = tGraph->GetX(); - for ( int tIndexArray = 0; tIndexArray < tGraph->GetN(); tIndexArray++ ) - { - if ( tX[tIndexArray] > tMax ) - { - tMax = tX[tIndexArray]; - } - } + for ( int tIndex = 0; tIndex < tGraphList->GetSize(); tIndex++ ) + { + TGraph* tGraph = dynamic_cast ( tGraphList->At( tIndex ) ); + double* tX = tGraph->GetX(); + for ( int tIndexArray = 0; tIndexArray < tGraph->GetN(); tIndexArray++ ) + { + if ( tX[tIndexArray] > tMax ) + { + tMax = tX[tIndexArray]; + } + } + } } return tMax; } @@ -599,17 +600,20 @@ namespace Kassiopeia { double tMin( std::numeric_limits< double >::max() ); TList* tGraphList = fMultigraph->GetListOfGraphs(); - for ( int tIndex = 0; tIndex < tGraphList->GetSize(); tIndex++ ) + if (tGraphList != nullptr) { - TGraph* tGraph = dynamic_cast ( tGraphList->At( tIndex ) ); - double* tY = tGraph->GetY(); - for ( int tIndexArray = 0; tIndexArray < tGraph->GetN(); tIndexArray++ ) - { - if ( tY[tIndexArray] < tMin ) - { - tMin = tY[tIndexArray]; - } - } + for ( int tIndex = 0; tIndex < tGraphList->GetSize(); tIndex++ ) + { + TGraph* tGraph = dynamic_cast ( tGraphList->At( tIndex ) ); + double* tY = tGraph->GetY(); + for ( int tIndexArray = 0; tIndexArray < tGraph->GetN(); tIndexArray++ ) + { + if ( tY[tIndexArray] < tMin ) + { + tMin = tY[tIndexArray]; + } + } + } } return tMin; } @@ -617,29 +621,32 @@ namespace Kassiopeia { double tMax( -1.0 * std::numeric_limits< double >::max() ); TList* tGraphList = fMultigraph->GetListOfGraphs(); - for ( int tIndex = 0; tIndex < tGraphList->GetSize(); tIndex++ ) + if (tGraphList != nullptr) { - TGraph* tGraph = dynamic_cast ( tGraphList->At( tIndex ) ); - double* tY = tGraph->GetY(); - for ( int tIndexArray = 0; tIndexArray < tGraph->GetN(); tIndexArray++ ) - { - if ( tY[tIndexArray] > tMax ) - { - tMax = tY[tIndexArray]; - } - } + for ( int tIndex = 0; tIndex < tGraphList->GetSize(); tIndex++ ) + { + TGraph* tGraph = dynamic_cast ( tGraphList->At( tIndex ) ); + double* tY = tGraph->GetY(); + for ( int tIndexArray = 0; tIndexArray < tGraph->GetN(); tIndexArray++ ) + { + if ( tY[tIndexArray] > tMax ) + { + tMax = tY[tIndexArray]; + } + } + } } return tMax; } std::string KSROOTTrackPainter::GetXAxisLabel() { - return fXAxis; + return fXAxis; } std::string KSROOTTrackPainter::GetYAxisLabel() { - return fYAxis; + return fYAxis; } } diff --git a/Kassiopeia/Writers/Source/KSWriteASCII.cxx b/Kassiopeia/Writers/Source/KSWriteASCII.cxx index 0be8ba802..228b703ac 100644 --- a/Kassiopeia/Writers/Source/KSWriteASCII.cxx +++ b/Kassiopeia/Writers/Source/KSWriteASCII.cxx @@ -2,765 +2,774 @@ #include "KSWritersMessage.h" #include "KSComponentGroup.h" +#ifdef Kassiopeia_USE_BOOST +//#include "KPathUtils.h" +//using katrin::KPathUtils; +#endif + using namespace std; namespace Kassiopeia { - const int KSWriteASCII::fBufferSize = 64000; - const int KSWriteASCII::fSplitLevel = 99; - const string KSWriteASCII::fLabel = string( "KASSIOPEIA_TREE_DATA" ); - - KSWriteASCII::Data::Objekt::Objekt(KSComponent* aComponent, string aType, int aPrecision) - { - fComponent = aComponent; - fType = aType; - fPrecision = aPrecision; - } - - string KSWriteASCII::Data::Objekt::getValue() { - - stringstream s; - s << std::setprecision(fPrecision); - if(fType== "string") - s << *(fComponent->As< string >()) << "\t"; - else if(fType == (string)"bool") - s << *(fComponent->As< bool >()) << "\t"; - else if(fType == (string)"unsigned char") - s << *(fComponent->As< unsigned char >()) << "\t"; - else if(fType ==(string) "char") - s << *(fComponent->As< char >()) << "\t"; - else if(fType ==(string) "unsigned short") - s << *(fComponent->As< unsigned short >()) << "\t"; - else if(fType == (string)"unsigned int") - s << *(fComponent->As< unsigned int >()) << "\t"; - else if(fType == (string)"unsigned long") - s << *(fComponent->As< unsigned long >()) << "\t"; - else if(fType ==(string) "long") - s << *(fComponent->As< long >()) << "\t"; - else if(fType ==(string) "int") - s << *(fComponent->As< int >()) << "\t"; - else if(fType == (string)"short") - s << *(fComponent->As< short >()) << "\t"; - else if(fType ==(string) "float") - s << *(fComponent->As< float >()) << "\t"; - else if(fType == (string)"double") - s << *(fComponent->As< double >()) << "\t"; - else if(fType == (string) "KThreeVector") - s << fComponent->As< KThreeVector >()->X() << "\t" << fComponent->As< KThreeVector >()->Y() << "\t" << fComponent->As< KThreeVector >()->Z() << "\t"; - else if(fType == (string)"KTwoVector") - s << fComponent->As< KTwoVector >()->X() << "\t" << fComponent->As< KTwoVector >()->Y() << "\t" ; - else - s << "\t" << "\t" ; - - return s.str(); - } - - KSWriteASCII::Data::Data( KSComponent* aComponent ) : - fLabel( "" ), - fType( "" ), + const int KSWriteASCII::fBufferSize = 64000; + const int KSWriteASCII::fSplitLevel = 99; + const string KSWriteASCII::fLabel = string( "KASSIOPEIA_TREE_DATA" ); + + KSWriteASCII::Data::Objekt::Objekt(KSComponent* aComponent, string aType, int aPrecision) + { + fComponent = aComponent; + fType = aType; + fPrecision = aPrecision; + } + + string KSWriteASCII::Data::Objekt::getValue() { + + stringstream s; + s << std::setprecision(fPrecision); + if(fType== "string") + s << *(fComponent->As< string >()) << "\t"; + else if(fType == (string)"bool") + s << *(fComponent->As< bool >()) << "\t"; + else if(fType == (string)"unsigned char") + s << *(fComponent->As< unsigned char >()) << "\t"; + else if(fType ==(string) "char") + s << *(fComponent->As< char >()) << "\t"; + else if(fType ==(string) "unsigned short") + s << *(fComponent->As< unsigned short >()) << "\t"; + else if(fType == (string)"unsigned int") + s << *(fComponent->As< unsigned int >()) << "\t"; + else if(fType == (string)"unsigned long") + s << *(fComponent->As< unsigned long >()) << "\t"; + else if(fType ==(string) "long") + s << *(fComponent->As< long >()) << "\t"; + else if(fType ==(string) "int") + s << *(fComponent->As< int >()) << "\t"; + else if(fType == (string)"short") + s << *(fComponent->As< short >()) << "\t"; + else if(fType ==(string) "float") + s << *(fComponent->As< float >()) << "\t"; + else if(fType == (string)"double") + s << *(fComponent->As< double >()) << "\t"; + else if(fType == (string) "KThreeVector") + s << fComponent->As< KThreeVector >()->X() << "\t" << fComponent->As< KThreeVector >()->Y() << "\t" << fComponent->As< KThreeVector >()->Z() << "\t"; + else if(fType == (string)"KTwoVector") + s << fComponent->As< KTwoVector >()->X() << "\t" << fComponent->As< KTwoVector >()->Y() << "\t" ; + else + s << "\t" << "\t" ; + + return s.str(); + } + + KSWriteASCII::Data::Data( KSComponent* aComponent ) : + fLabel( "" ), + fType( "" ), fWriter(), - fIndex( 0 ), - fLength( 0 ), - fComponents() - { - MakeTitle( aComponent, 0 ); - } - - KSWriteASCII::Data::Data( KSComponent* aComponent, KSWriteASCII* aWriter ) : - fLabel( "" ), - fType( "" ), - fIndex( 0 ), - fLength( 0 ), - fComponents() - { - fWriter = aWriter; - MakeTitle( aComponent, 0 ); - } - - KSWriteASCII::Data::~Data() { - - } - - void KSWriteASCII::Data::Start( const unsigned int& anIndex ) - { - fIndex = anIndex; - fLength = 0; - return; - } - - void KSWriteASCII::Data::Fill() - { - KSComponent* tComponent; - Objekt* tObjekt; - vector< KSComponent* >::iterator tIt; - - for( tIt = fComponents.begin(); tIt != fComponents.end(); tIt++ ) - { - tComponent = (*tIt); - tComponent->PullUpdate(); - } - - string str; - for (vector< Objekt* >::iterator tIt = fObjekts.begin(); tIt != fObjekts.end(); tIt++ ) - { - tObjekt = (*tIt); - str = string(tObjekt->getValue().c_str()); - - for ( std::string::iterator it=str.begin(); it!=str.end(); ++it) - fWriter->TextFile()->File()->put(*it); - } - for( tIt = fComponents.begin(); tIt != fComponents.end(); tIt++ ) - { - tComponent = (*tIt); - tComponent->PullDeupdate(); - } - - fLength++; - return; - } - - void KSWriteASCII::Data::MakeTitle( KSComponent* aComponent, int aTrack ) - { - wtrmsg_debug( "making title for object <" << aComponent->GetName() << ">" << eom ) - - KSComponentGroup* tComponentGroup = aComponent->As< KSComponentGroup >(); - if( tComponentGroup != NULL ) - { - wtrmsg_debug( " object <" << aComponent->GetName() << "> is a group" << eom ) - for( unsigned int tIndex = 0; tIndex < tComponentGroup->ComponentCount(); tIndex++ ) - MakeTitle( tComponentGroup->ComponentAt( tIndex ), aTrack ); - - return; - } - - string* tString = aComponent->As< string >(); - if( tString != NULL ) - { - wtrmsg_debug( " object <" << aComponent->GetName() << "> is a string" << eom ) - string* str = new string((aComponent->GetName() + '\t').c_str()); - - for ( std::string::iterator it=str->begin(); it!=str->end(); ++it) - fWriter->TextFile()->File()->put(*it); - - if (aTrack==0){ - Objekt* obj = new Objekt(aComponent, "string", fWriter->Precision()); - fObjekts.push_back(obj); - - fComponents.push_back( aComponent ); - } - - return; - } - - KTwoVector* tTwoVector = aComponent->As< KTwoVector >(); - if( tTwoVector != NULL ) - { - wtrmsg_debug( " object <" << aComponent->GetName() << "> is a two_vector" << eom ) - string* str = new string((aComponent->GetName() + string( "_x" ) + '\t' + aComponent->GetName() + string( "_y" ) + '\t').c_str()); - - for ( std::string::iterator it=str->begin(); it!=str->end(); ++it) - fWriter->TextFile()->File()->put(*it); - - if (aTrack==0){ - Objekt* obj = new Objekt(aComponent, "KTwoVector", fWriter->Precision()); - fObjekts.push_back(obj); - fComponents.push_back( aComponent ); - } - return; - } - - KThreeVector* tThreeVector = aComponent->As< KThreeVector >(); - if( tThreeVector != NULL ) - { - wtrmsg_debug( " object <" << aComponent->GetName() << "> is a three_vector" << eom ) - string* str = new string((aComponent->GetName() + string( "_x" ) + '\t' + aComponent->GetName() + string( "_y" ) + '\t' + aComponent->GetName() + string( "_z" ) + '\t').c_str()); - - for ( std::string::iterator it=str->begin(); it!=str->end(); ++it) - fWriter->TextFile()->File()->put(*it); - - if (aTrack==0){ - Objekt* obj = new Objekt(aComponent, "KThreeVector", fWriter->Precision()); - fObjekts.push_back(obj); - - fComponents.push_back( aComponent ); - } - return; - } - - bool* tBool = aComponent->As< bool >(); - if( tBool != NULL ) - { - wtrmsg_debug( " object <" << aComponent->GetName() << "> is a bool" << eom ) - string* str = new string((aComponent->GetName() + '\t').c_str()); - - for ( std::string::iterator it=str->begin(); it!=str->end(); ++it) - fWriter->TextFile()->File()->put(*it); - - if (aTrack==0){ - Objekt* obj = new Objekt(aComponent, "bool", fWriter->Precision()); - fObjekts.push_back(obj); - - fComponents.push_back( aComponent ); - } - return; - } - - unsigned char* tUChar = aComponent->As< unsigned char >(); - if( tUChar != NULL ) - { - wtrmsg_debug( " object <" << aComponent->GetName() << "> is an unsigned_char" << eom ) - string* str = new string((aComponent->GetName() + '\t').c_str()); - - for ( std::string::iterator it=str->begin(); it!=str->end(); ++it) - fWriter->TextFile()->File()->put(*it); - - if (aTrack==0){ - Objekt* obj = new Objekt(aComponent, "unsigned char", fWriter->Precision()); - fObjekts.push_back(obj); - - fComponents.push_back( aComponent ); - } - return; - } - - char* tChar = aComponent->As< char >(); - if( tChar != NULL ) - { - wtrmsg_debug( " object <" << aComponent->GetName() << "> is a char" << eom ) - string* str = new string((aComponent->GetName() + '\t').c_str()); - - for ( std::string::iterator it=str->begin(); it!=str->end(); ++it) - fWriter->TextFile()->File()->put(*it); - - if (aTrack==0){ - Objekt* obj = new Objekt(aComponent, "char", fWriter->Precision()); - fObjekts.push_back(obj); - - fComponents.push_back( aComponent ); - } - return; - } - - unsigned short* tUShort = aComponent->As< unsigned short >(); - if( tUShort != NULL ) - { - wtrmsg_debug( " object <" << aComponent->GetName() << "> is an unsigned_short" << eom ) - string* str = new string((aComponent->GetName() + '\t').c_str()); - - for ( std::string::iterator it=str->begin(); it!=str->end(); ++it) - fWriter->TextFile()->File()->put(*it); - - if (aTrack==0){ - Objekt* obj = new Objekt(aComponent, "unsigned short", fWriter->Precision()); - fObjekts.push_back(obj); - - fComponents.push_back( aComponent ); - } - return; - } - - short* tShort = aComponent->As< short >(); - if( tShort != NULL ) - { - wtrmsg_debug( " object <" << aComponent->GetName() << "> is a short" << eom ) - string* str = new string((aComponent->GetName() + '\t').c_str()); - - for ( std::string::iterator it=str->begin(); it!=str->end(); ++it) - fWriter->TextFile()->File()->put(*it); - - if (aTrack==0){ - Objekt* obj = new Objekt(aComponent, "short", fWriter->Precision()); - fObjekts.push_back(obj); - - fComponents.push_back( aComponent ); - } - return; - } - - unsigned int* tUInt = aComponent->As< unsigned int >(); - if( tUInt != NULL ) - { - wtrmsg_debug( " object <" << aComponent->GetName() << "> is a unsigned_int" << eom ) - string* str = new string((aComponent->GetName() + '\t').c_str()); - - for ( std::string::iterator it=str->begin(); it!=str->end(); ++it) - fWriter->TextFile()->File()->put(*it); - - if (aTrack==0){ - Objekt* obj = new Objekt(aComponent, "unsigned int", fWriter->Precision()); - fObjekts.push_back(obj); - - fComponents.push_back( aComponent ); - } - return; - } - - int* tInt = aComponent->As< int >(); - if( tInt != NULL ) - { - wtrmsg_debug( " object <" << aComponent->GetName() << "> is an int" << eom ) - string* str = new string((aComponent->GetName() + '\t').c_str()); - - for ( std::string::iterator it=str->begin(); it!=str->end(); ++it) - fWriter->TextFile()->File()->put(*it); - - if (aTrack==0){ - Objekt* obj = new Objekt(aComponent, "int", fWriter->Precision()); - fObjekts.push_back(obj); - - fComponents.push_back( aComponent ); - } - return; - } - - unsigned long* tULong = aComponent->As< unsigned long >(); - if( tULong != NULL ) - { - wtrmsg_debug( " object <" << aComponent->GetName() << "> is an unsigned_long" << eom ) - string* str = new string((aComponent->GetName() + '\t').c_str()); - - for ( std::string::iterator it=str->begin(); it!=str->end(); ++it) - fWriter->TextFile()->File()->put(*it); - - if (aTrack==0){ - Objekt* obj = new Objekt(aComponent, "unsigned long", fWriter->Precision()); - fObjekts.push_back(obj); - - fComponents.push_back( aComponent ); - } - return; - } - - long* tLong = aComponent->As< long >(); - if( tLong != NULL ) - { - wtrmsg_debug( " object <" << aComponent->GetName() << "> is a long" << eom ) - string* str = new string((aComponent->GetName() + '\t').c_str()); - - for ( std::string::iterator it=str->begin(); it!=str->end(); ++it) - fWriter->TextFile()->File()->put(*it); - - if (aTrack==0){ - Objekt* obj = new Objekt(aComponent, "long", fWriter->Precision()); - fObjekts.push_back(obj); - - fComponents.push_back( aComponent ); - } - return; - } - - float* tFloat = aComponent->As< float >(); - if( tFloat != NULL ) - { - wtrmsg_debug( " object <" << aComponent->GetName() << "> is a float" << eom ) - string* str = new string((aComponent->GetName() + '\t').c_str()); - - for ( std::string::iterator it=str->begin(); it!=str->end(); ++it) - fWriter->TextFile()->File()->put(*it); - - if (aTrack==0){ - Objekt* obj = new Objekt(aComponent, "float", fWriter->Precision()); - fObjekts.push_back(obj); - - fComponents.push_back( aComponent ); - } - return; - } - - double* tDouble = aComponent->As< double >(); - if( tDouble != NULL ) - { - wtrmsg_debug( " object <" << aComponent->GetName() << "> is a double" << eom ) - string* str = new string((aComponent->GetName() + '\t').c_str()); - - for ( std::string::iterator it=str->begin(); it!=str->end(); ++it) - fWriter->TextFile()->File()->put(*it); - - if (aTrack==0){ - Objekt* obj = new Objekt(aComponent, "double", fWriter->Precision()); - fObjekts.push_back(obj); - - fComponents.push_back( aComponent ); - } - return; - } - - wtrmsg( eError ) << "ASCII writer cannot add object <" << aComponent->GetName() << ">" << eom; - - return; - } - - KSWriteASCII::KSWriteASCII() : - fBase( "" ), - fPath( "" ), - fStepIteration( 1 ), - fStepIterationIndex( 0 ), - fTextFile( NULL ), - fRunComponents(), - fActiveRunComponents(), - fRunIndex( 0 ), - fRunFirstEventIndex( 0 ), - fRunLastEventIndex( 0 ), - fRunFirstTrackIndex( 0 ), - fRunLastTrackIndex( 0 ), - fRunFirstStepIndex( 0 ), - fRunLastStepIndex( 0 ), - fEventComponents(), - fActiveEventComponents(), - fEventIndex( 0 ), - fEventFirstTrackIndex( 0 ), - fEventLastTrackIndex( 0 ), - fEventFirstStepIndex( 0 ), - fEventLastStepIndex( 0 ), - fTrackComponents(), - fActiveTrackComponents(), - fTrackIndex( 0 ), - fTrackFirstStepIndex( 0 ), - fTrackLastStepIndex( 0 ), - fStepComponent( false ), - fStepComponents(), - fActiveStepComponents(), - fStepIndex( 0 ) - { - fPrecision = std::cout.precision(); - } - - KSWriteASCII::KSWriteASCII( const KSWriteASCII& aCopy ) : + fIndex( 0 ), + fLength( 0 ), + fComponents() + { + MakeTitle( aComponent, 0 ); + } + + KSWriteASCII::Data::Data( KSComponent* aComponent, KSWriteASCII* aWriter ) : + fLabel( "" ), + fType( "" ), + fIndex( 0 ), + fLength( 0 ), + fComponents() + { + fWriter = aWriter; + MakeTitle( aComponent, 0 ); + } + + KSWriteASCII::Data::~Data() { + + } + + void KSWriteASCII::Data::Start( const unsigned int& anIndex ) + { + fIndex = anIndex; + fLength = 0; + return; + } + + void KSWriteASCII::Data::Fill() + { + KSComponent* tComponent; + Objekt* tObjekt; + vector< KSComponent* >::iterator tIt; + + for( tIt = fComponents.begin(); tIt != fComponents.end(); tIt++ ) + { + tComponent = (*tIt); + tComponent->PullUpdate(); + } + + string str; + for (vector< Objekt* >::iterator tIt = fObjekts.begin(); tIt != fObjekts.end(); tIt++ ) + { + tObjekt = (*tIt); + str = string(tObjekt->getValue().c_str()); + + for ( std::string::iterator it=str.begin(); it!=str.end(); ++it) + fWriter->TextFile()->File()->put(*it); + } + for( tIt = fComponents.begin(); tIt != fComponents.end(); tIt++ ) + { + tComponent = (*tIt); + tComponent->PullDeupdate(); + } + + fLength++; + return; + } + + void KSWriteASCII::Data::MakeTitle( KSComponent* aComponent, int aTrack ) + { + wtrmsg_debug( "making title for object <" << aComponent->GetName() << ">" << eom ) + + KSComponentGroup* tComponentGroup = aComponent->As< KSComponentGroup >(); + if( tComponentGroup != NULL ) + { + wtrmsg_debug( " object <" << aComponent->GetName() << "> is a group" << eom ) + for( unsigned int tIndex = 0; tIndex < tComponentGroup->ComponentCount(); tIndex++ ) + MakeTitle( tComponentGroup->ComponentAt( tIndex ), aTrack ); + + return; + } + + string* tString = aComponent->As< string >(); + if( tString != NULL ) + { + wtrmsg_debug( " object <" << aComponent->GetName() << "> is a string" << eom ) + string* str = new string((aComponent->GetName() + '\t').c_str()); + + for ( std::string::iterator it=str->begin(); it!=str->end(); ++it) + fWriter->TextFile()->File()->put(*it); + + if (aTrack==0){ + Objekt* obj = new Objekt(aComponent, "string", fWriter->Precision()); + fObjekts.push_back(obj); + + fComponents.push_back( aComponent ); + } + + return; + } + + KTwoVector* tTwoVector = aComponent->As< KTwoVector >(); + if( tTwoVector != NULL ) + { + wtrmsg_debug( " object <" << aComponent->GetName() << "> is a two_vector" << eom ) + string* str = new string((aComponent->GetName() + string( "_x" ) + '\t' + aComponent->GetName() + string( "_y" ) + '\t').c_str()); + + for ( std::string::iterator it=str->begin(); it!=str->end(); ++it) + fWriter->TextFile()->File()->put(*it); + + if (aTrack==0){ + Objekt* obj = new Objekt(aComponent, "KTwoVector", fWriter->Precision()); + fObjekts.push_back(obj); + fComponents.push_back( aComponent ); + } + return; + } + + KThreeVector* tThreeVector = aComponent->As< KThreeVector >(); + if( tThreeVector != NULL ) + { + wtrmsg_debug( " object <" << aComponent->GetName() << "> is a three_vector" << eom ) + string* str = new string((aComponent->GetName() + string( "_x" ) + '\t' + aComponent->GetName() + string( "_y" ) + '\t' + aComponent->GetName() + string( "_z" ) + '\t').c_str()); + + for ( std::string::iterator it=str->begin(); it!=str->end(); ++it) + fWriter->TextFile()->File()->put(*it); + + if (aTrack==0){ + Objekt* obj = new Objekt(aComponent, "KThreeVector", fWriter->Precision()); + fObjekts.push_back(obj); + + fComponents.push_back( aComponent ); + } + return; + } + + bool* tBool = aComponent->As< bool >(); + if( tBool != NULL ) + { + wtrmsg_debug( " object <" << aComponent->GetName() << "> is a bool" << eom ) + string* str = new string((aComponent->GetName() + '\t').c_str()); + + for ( std::string::iterator it=str->begin(); it!=str->end(); ++it) + fWriter->TextFile()->File()->put(*it); + + if (aTrack==0){ + Objekt* obj = new Objekt(aComponent, "bool", fWriter->Precision()); + fObjekts.push_back(obj); + + fComponents.push_back( aComponent ); + } + return; + } + + unsigned char* tUChar = aComponent->As< unsigned char >(); + if( tUChar != NULL ) + { + wtrmsg_debug( " object <" << aComponent->GetName() << "> is an unsigned_char" << eom ) + string* str = new string((aComponent->GetName() + '\t').c_str()); + + for ( std::string::iterator it=str->begin(); it!=str->end(); ++it) + fWriter->TextFile()->File()->put(*it); + + if (aTrack==0){ + Objekt* obj = new Objekt(aComponent, "unsigned char", fWriter->Precision()); + fObjekts.push_back(obj); + + fComponents.push_back( aComponent ); + } + return; + } + + char* tChar = aComponent->As< char >(); + if( tChar != NULL ) + { + wtrmsg_debug( " object <" << aComponent->GetName() << "> is a char" << eom ) + string* str = new string((aComponent->GetName() + '\t').c_str()); + + for ( std::string::iterator it=str->begin(); it!=str->end(); ++it) + fWriter->TextFile()->File()->put(*it); + + if (aTrack==0){ + Objekt* obj = new Objekt(aComponent, "char", fWriter->Precision()); + fObjekts.push_back(obj); + + fComponents.push_back( aComponent ); + } + return; + } + + unsigned short* tUShort = aComponent->As< unsigned short >(); + if( tUShort != NULL ) + { + wtrmsg_debug( " object <" << aComponent->GetName() << "> is an unsigned_short" << eom ) + string* str = new string((aComponent->GetName() + '\t').c_str()); + + for ( std::string::iterator it=str->begin(); it!=str->end(); ++it) + fWriter->TextFile()->File()->put(*it); + + if (aTrack==0){ + Objekt* obj = new Objekt(aComponent, "unsigned short", fWriter->Precision()); + fObjekts.push_back(obj); + + fComponents.push_back( aComponent ); + } + return; + } + + short* tShort = aComponent->As< short >(); + if( tShort != NULL ) + { + wtrmsg_debug( " object <" << aComponent->GetName() << "> is a short" << eom ) + string* str = new string((aComponent->GetName() + '\t').c_str()); + + for ( std::string::iterator it=str->begin(); it!=str->end(); ++it) + fWriter->TextFile()->File()->put(*it); + + if (aTrack==0){ + Objekt* obj = new Objekt(aComponent, "short", fWriter->Precision()); + fObjekts.push_back(obj); + + fComponents.push_back( aComponent ); + } + return; + } + + unsigned int* tUInt = aComponent->As< unsigned int >(); + if( tUInt != NULL ) + { + wtrmsg_debug( " object <" << aComponent->GetName() << "> is a unsigned_int" << eom ) + string* str = new string((aComponent->GetName() + '\t').c_str()); + + for ( std::string::iterator it=str->begin(); it!=str->end(); ++it) + fWriter->TextFile()->File()->put(*it); + + if (aTrack==0){ + Objekt* obj = new Objekt(aComponent, "unsigned int", fWriter->Precision()); + fObjekts.push_back(obj); + + fComponents.push_back( aComponent ); + } + return; + } + + int* tInt = aComponent->As< int >(); + if( tInt != NULL ) + { + wtrmsg_debug( " object <" << aComponent->GetName() << "> is an int" << eom ) + string* str = new string((aComponent->GetName() + '\t').c_str()); + + for ( std::string::iterator it=str->begin(); it!=str->end(); ++it) + fWriter->TextFile()->File()->put(*it); + + if (aTrack==0){ + Objekt* obj = new Objekt(aComponent, "int", fWriter->Precision()); + fObjekts.push_back(obj); + + fComponents.push_back( aComponent ); + } + return; + } + + unsigned long* tULong = aComponent->As< unsigned long >(); + if( tULong != NULL ) + { + wtrmsg_debug( " object <" << aComponent->GetName() << "> is an unsigned_long" << eom ) + string* str = new string((aComponent->GetName() + '\t').c_str()); + + for ( std::string::iterator it=str->begin(); it!=str->end(); ++it) + fWriter->TextFile()->File()->put(*it); + + if (aTrack==0){ + Objekt* obj = new Objekt(aComponent, "unsigned long", fWriter->Precision()); + fObjekts.push_back(obj); + + fComponents.push_back( aComponent ); + } + return; + } + + long* tLong = aComponent->As< long >(); + if( tLong != NULL ) + { + wtrmsg_debug( " object <" << aComponent->GetName() << "> is a long" << eom ) + string* str = new string((aComponent->GetName() + '\t').c_str()); + + for ( std::string::iterator it=str->begin(); it!=str->end(); ++it) + fWriter->TextFile()->File()->put(*it); + + if (aTrack==0){ + Objekt* obj = new Objekt(aComponent, "long", fWriter->Precision()); + fObjekts.push_back(obj); + + fComponents.push_back( aComponent ); + } + return; + } + + float* tFloat = aComponent->As< float >(); + if( tFloat != NULL ) + { + wtrmsg_debug( " object <" << aComponent->GetName() << "> is a float" << eom ) + string* str = new string((aComponent->GetName() + '\t').c_str()); + + for ( std::string::iterator it=str->begin(); it!=str->end(); ++it) + fWriter->TextFile()->File()->put(*it); + + if (aTrack==0){ + Objekt* obj = new Objekt(aComponent, "float", fWriter->Precision()); + fObjekts.push_back(obj); + + fComponents.push_back( aComponent ); + } + return; + } + + double* tDouble = aComponent->As< double >(); + if( tDouble != NULL ) + { + wtrmsg_debug( " object <" << aComponent->GetName() << "> is a double" << eom ) + string* str = new string((aComponent->GetName() + '\t').c_str()); + + for ( std::string::iterator it=str->begin(); it!=str->end(); ++it) + fWriter->TextFile()->File()->put(*it); + + if (aTrack==0){ + Objekt* obj = new Objekt(aComponent, "double", fWriter->Precision()); + fObjekts.push_back(obj); + + fComponents.push_back( aComponent ); + } + return; + } + + wtrmsg( eError ) << "ASCII writer cannot add object <" << aComponent->GetName() << ">" << eom; + + return; + } + + KSWriteASCII::KSWriteASCII() : + fBase( "" ), + fPath( "" ), + fStepIteration( 1 ), + fStepIterationIndex( 0 ), + fTextFile( NULL ), + fRunComponents(), + fActiveRunComponents(), + fRunIndex( 0 ), + fRunFirstEventIndex( 0 ), + fRunLastEventIndex( 0 ), + fRunFirstTrackIndex( 0 ), + fRunLastTrackIndex( 0 ), + fRunFirstStepIndex( 0 ), + fRunLastStepIndex( 0 ), + fEventComponents(), + fActiveEventComponents(), + fEventIndex( 0 ), + fEventFirstTrackIndex( 0 ), + fEventLastTrackIndex( 0 ), + fEventFirstStepIndex( 0 ), + fEventLastStepIndex( 0 ), + fTrackComponents(), + fActiveTrackComponents(), + fTrackIndex( 0 ), + fTrackFirstStepIndex( 0 ), + fTrackLastStepIndex( 0 ), + fStepComponent( false ), + fStepComponents(), + fActiveStepComponents(), + fStepIndex( 0 ) + { + fPrecision = std::cout.precision(); + } + + KSWriteASCII::KSWriteASCII( const KSWriteASCII& aCopy ) : KSComponent(), - fBase( aCopy.fBase ), - fPath( aCopy.fPath ), - fStepIteration( aCopy.fStepIteration ), - fStepIterationIndex( 0 ), - fTextFile( NULL ), - fRunComponents(), - fActiveRunComponents(), - fRunIndex( 0 ), - fRunFirstEventIndex( 0 ), - fRunLastEventIndex( 0 ), - fRunFirstTrackIndex( 0 ), - fRunLastTrackIndex( 0 ), - fRunFirstStepIndex( 0 ), - fRunLastStepIndex( 0 ), - fEventComponents(), - fActiveEventComponents(), - fEventIndex( 0 ), - fEventFirstTrackIndex( 0 ), - fEventLastTrackIndex( 0 ), - fEventFirstStepIndex( 0 ), - fEventLastStepIndex( 0 ), - fTrackComponents(), - fActiveTrackComponents(), - fTrackIndex( 0 ), - fTrackFirstStepIndex( 0 ), - fTrackLastStepIndex( 0 ), - fStepComponent( false ), - fStepComponents(), - fActiveStepComponents(), - fStepIndex( 0 ) - { - fPrecision = aCopy.Precision(); - } - - KSWriteASCII* KSWriteASCII::Clone() const - { - return new KSWriteASCII( *this ); - } - - KSWriteASCII::~KSWriteASCII(){ - - } - - void KSWriteASCII::ExecuteRun() - { - wtrmsg_debug( "ASCII writer <" << fName << "> is filling a run" << eom ); - - if ( fEventIndex != 0 ) - fRunLastEventIndex = fEventIndex - 1; - - if ( fTrackIndex != 0 ) - fRunLastTrackIndex = fTrackIndex - 1; - - if ( fStepIndex != 0 ) - fRunLastStepIndex = fStepIndex - 1; - - for( ComponentIt tIt = fActiveRunComponents.begin(); tIt != fActiveRunComponents.end(); tIt++ ) - tIt->second->Fill(); - - fRunIndex++; - fRunFirstEventIndex = fEventIndex; - fRunFirstTrackIndex = fTrackIndex; - fRunFirstStepIndex = fStepIndex; - - return; - } - - void KSWriteASCII::ExecuteEvent() - { - wtrmsg_debug( "ASCII writer <" << fName << "> is filling an event" << eom ); - - if ( fTrackIndex != 0 ) - fEventLastTrackIndex = fTrackIndex - 1; - - if ( fStepIndex != 0 ) - fEventLastStepIndex = fStepIndex - 1; - - for( ComponentIt tIt = fActiveEventComponents.begin(); tIt != fActiveEventComponents.end(); tIt++ ) - tIt->second->Fill(); - - - fEventIndex++; - fEventFirstTrackIndex = fTrackIndex; - fEventFirstStepIndex = fStepIndex; - - return; - } - void KSWriteASCII::ExecuteTrack() - { - wtrmsg_debug( "ASCII writer <" << fName << "> is filling a track" << eom ); - - if ( fStepIndex != 0 ) - fTrackLastStepIndex = fStepIndex - 1; - - ComponentIt tIt; - - fTextFile->File()->put('\n'); - for( ComponentIt tIt = fActiveTrackComponents.begin(); tIt != fActiveTrackComponents.end(); tIt++ ) - tIt->second->Fill(); - - fTextFile->Close(); - delete fTextFile; - stringstream s; - s << fBase << "_Track" << fTrackIndex+1 << + ".txt"; - fTextFile = CreateOutputTextFile( s.str().c_str() ); - - - if( !fPath.empty() ) - fTextFile->AddToPaths( fPath ); - + fBase( aCopy.fBase ), + fPath( aCopy.fPath ), + fStepIteration( aCopy.fStepIteration ), + fStepIterationIndex( 0 ), + fTextFile( NULL ), + fRunComponents(), + fActiveRunComponents(), + fRunIndex( 0 ), + fRunFirstEventIndex( 0 ), + fRunLastEventIndex( 0 ), + fRunFirstTrackIndex( 0 ), + fRunLastTrackIndex( 0 ), + fRunFirstStepIndex( 0 ), + fRunLastStepIndex( 0 ), + fEventComponents(), + fActiveEventComponents(), + fEventIndex( 0 ), + fEventFirstTrackIndex( 0 ), + fEventLastTrackIndex( 0 ), + fEventFirstStepIndex( 0 ), + fEventLastStepIndex( 0 ), + fTrackComponents(), + fActiveTrackComponents(), + fTrackIndex( 0 ), + fTrackFirstStepIndex( 0 ), + fTrackLastStepIndex( 0 ), + fStepComponent( false ), + fStepComponents(), + fActiveStepComponents(), + fStepIndex( 0 ) + { + fPrecision = aCopy.Precision(); + } + + KSWriteASCII* KSWriteASCII::Clone() const + { + return new KSWriteASCII( *this ); + } + + KSWriteASCII::~KSWriteASCII(){ + + } + + void KSWriteASCII::ExecuteRun() + { + wtrmsg_debug( "ASCII writer <" << fName << "> is filling a run" << eom ); + + if ( fEventIndex != 0 ) + fRunLastEventIndex = fEventIndex - 1; + + if ( fTrackIndex != 0 ) + fRunLastTrackIndex = fTrackIndex - 1; + + if ( fStepIndex != 0 ) + fRunLastStepIndex = fStepIndex - 1; + + for( ComponentIt tIt = fActiveRunComponents.begin(); tIt != fActiveRunComponents.end(); tIt++ ) + tIt->second->Fill(); + + fRunIndex++; + fRunFirstEventIndex = fEventIndex; + fRunFirstTrackIndex = fTrackIndex; + fRunFirstStepIndex = fStepIndex; + + return; + } + + void KSWriteASCII::ExecuteEvent() + { + wtrmsg_debug( "ASCII writer <" << fName << "> is filling an event" << eom ); + + if ( fTrackIndex != 0 ) + fEventLastTrackIndex = fTrackIndex - 1; + + if ( fStepIndex != 0 ) + fEventLastStepIndex = fStepIndex - 1; + + for( ComponentIt tIt = fActiveEventComponents.begin(); tIt != fActiveEventComponents.end(); tIt++ ) + tIt->second->Fill(); + + + fEventIndex++; + fEventFirstTrackIndex = fTrackIndex; + fEventFirstStepIndex = fStepIndex; + + return; + } + void KSWriteASCII::ExecuteTrack() + { + wtrmsg_debug( "ASCII writer <" << fName << "> is filling a track" << eom ); + + if ( fStepIndex != 0 ) + fTrackLastStepIndex = fStepIndex - 1; + + ComponentIt tIt; + + fTextFile->File()->put('\n'); + for( ComponentIt tIt = fActiveTrackComponents.begin(); tIt != fActiveTrackComponents.end(); tIt++ ) + tIt->second->Fill(); + + fTextFile->Close(); + delete fTextFile; + stringstream s; + s << fBase << "_Track" << fTrackIndex+1 << + ".txt"; + fTextFile = CreateOutputTextFile( s.str().c_str() ); + + + if( !fPath.empty() ) + { +#ifdef Kassiopeia_USE_BOOST +// KPathUtils::MakeDirectory( fPath ); +#endif + fTextFile->AddToPaths( fPath ); + } - if( fTextFile->Open( KFile::eWrite ) == true ){ + if( fTextFile->Open( KFile::eWrite ) == true ){ - } + } - for( tIt = fTrackComponents.begin(); tIt != fTrackComponents.end(); tIt++ ) - tIt->second->MakeTitle(tIt->first,0); + for( tIt = fTrackComponents.begin(); tIt != fTrackComponents.end(); tIt++ ) + tIt->second->MakeTitle(tIt->first,0); - fTextFile->File()->put('\n'); - for( tIt = fStepComponents.begin(); tIt != fStepComponents.end(); tIt++ ) - tIt->second->MakeTitle(tIt->first, 1); + fTextFile->File()->put('\n'); + for( tIt = fStepComponents.begin(); tIt != fStepComponents.end(); tIt++ ) + tIt->second->MakeTitle(tIt->first, 1); - fTrackIndex++; - fTrackFirstStepIndex = fStepIndex; + fTrackIndex++; + fTrackFirstStepIndex = fStepIndex; - return; - } - void KSWriteASCII::ExecuteStep() - { - if ( fStepIterationIndex % fStepIteration != 0 ) - { - wtrmsg_debug( "ASCII writer <" << fName << "> is skipping a step because of step iteration value <"<" << eom ); - fStepIterationIndex++; - return; - } - fTextFile->File()->put('\n'); - if( fStepComponent == true ) - { - wtrmsg_debug( "ASCII writer <" << fName << "> is filling a step" << eom ); + return; + } + void KSWriteASCII::ExecuteStep() + { + if ( fStepIterationIndex % fStepIteration != 0 ) + { + wtrmsg_debug( "ASCII writer <" << fName << "> is skipping a step because of step iteration value <"<" << eom ); + fStepIterationIndex++; + return; + } + fTextFile->File()->put('\n'); + if( fStepComponent == true ) + { + wtrmsg_debug( "ASCII writer <" << fName << "> is filling a step" << eom ); - for( ComponentIt tIt = fActiveStepComponents.begin(); tIt != fActiveStepComponents.end(); tIt++ ) - tIt->second->Fill(); - } + for( ComponentIt tIt = fActiveStepComponents.begin(); tIt != fActiveStepComponents.end(); tIt++ ) + tIt->second->Fill(); + } - fStepIndex++; - fStepIterationIndex++; + fStepIndex++; + fStepIterationIndex++; - return; - } + return; + } - void KSWriteASCII::AddRunComponent( KSComponent* aComponent ) - { - ComponentIt tIt = fRunComponents.find( aComponent ); - if( tIt == fRunComponents.end() ) - { - wtrmsg_debug( "ASCII writer is making a new run output called <" << aComponent->GetName() << ">" << eom ); + void KSWriteASCII::AddRunComponent( KSComponent* aComponent ) + { + ComponentIt tIt = fRunComponents.find( aComponent ); + if( tIt == fRunComponents.end() ) + { + wtrmsg_debug( "ASCII writer is making a new run output called <" << aComponent->GetName() << ">" << eom ); - fKey = aComponent->GetName(); + fKey = aComponent->GetName(); - Data* tRunData = new Data( aComponent ,this); - tIt = fRunComponents.insert( ComponentEntry( aComponent, tRunData ) ).first; - } + Data* tRunData = new Data( aComponent ,this); + tIt = fRunComponents.insert( ComponentEntry( aComponent, tRunData ) ).first; + } - wtrmsg_debug( "ASCII writer is starting a run output called <" << aComponent->GetName() << ">" << eom ); + wtrmsg_debug( "ASCII writer is starting a run output called <" << aComponent->GetName() << ">" << eom ); - tIt->second->Start( fRunIndex ); - fActiveRunComponents.insert( *tIt ); + tIt->second->Start( fRunIndex ); + fActiveRunComponents.insert( *tIt ); - return; - } + return; + } - void KSWriteASCII::RemoveRunComponent( KSComponent* aComponent ) - { - ComponentIt tIt = fActiveRunComponents.find( aComponent ); - if( tIt == fActiveRunComponents.end() ) - { - wtrmsg( eError ) << "ASCII writer has no run output called <" << aComponent->GetName() << ">" << eom; - } + void KSWriteASCII::RemoveRunComponent( KSComponent* aComponent ) + { + ComponentIt tIt = fActiveRunComponents.find( aComponent ); + if( tIt == fActiveRunComponents.end() ) + { + wtrmsg( eError ) << "ASCII writer has no run output called <" << aComponent->GetName() << ">" << eom; + } - fActiveRunComponents.erase( tIt ); + fActiveRunComponents.erase( tIt ); - return; - } + return; + } - void KSWriteASCII::AddEventComponent( KSComponent* aComponent ) - { - ComponentIt tIt = fEventComponents.find( aComponent ); - if( tIt == fEventComponents.end() ) - { - wtrmsg_debug( "ASCII writer is making a new event output called <" << aComponent->GetName() << ">" << eom ); + void KSWriteASCII::AddEventComponent( KSComponent* aComponent ) + { + ComponentIt tIt = fEventComponents.find( aComponent ); + if( tIt == fEventComponents.end() ) + { + wtrmsg_debug( "ASCII writer is making a new event output called <" << aComponent->GetName() << ">" << eom ); - fKey = aComponent->GetName(); + fKey = aComponent->GetName(); - Data* tEventData = new Data( aComponent,this ); - tIt = fEventComponents.insert( ComponentEntry( aComponent, tEventData ) ).first; - } + Data* tEventData = new Data( aComponent,this ); + tIt = fEventComponents.insert( ComponentEntry( aComponent, tEventData ) ).first; + } - wtrmsg_debug( "ASCII writer is starting a event output called <" << aComponent->GetName() << ">" << eom ); + wtrmsg_debug( "ASCII writer is starting a event output called <" << aComponent->GetName() << ">" << eom ); - tIt->second->Start( fEventIndex ); - fActiveEventComponents.insert( *tIt ); + tIt->second->Start( fEventIndex ); + fActiveEventComponents.insert( *tIt ); - return; - } + return; + } - void KSWriteASCII::RemoveEventComponent( KSComponent* aComponent ) - { - ComponentIt tIt = fActiveEventComponents.find( aComponent ); - if( tIt == fActiveEventComponents.end() ) - { - wtrmsg( eError ) << "ASCII writer has no event output called <" << aComponent->GetName() << ">" << eom; - } + void KSWriteASCII::RemoveEventComponent( KSComponent* aComponent ) + { + ComponentIt tIt = fActiveEventComponents.find( aComponent ); + if( tIt == fActiveEventComponents.end() ) + { + wtrmsg( eError ) << "ASCII writer has no event output called <" << aComponent->GetName() << ">" << eom; + } - fActiveEventComponents.erase( tIt ); + fActiveEventComponents.erase( tIt ); - return; - } + return; + } - void KSWriteASCII::AddTrackComponent( KSComponent* aComponent ) - { + void KSWriteASCII::AddTrackComponent( KSComponent* aComponent ) + { - ComponentIt tIt = fTrackComponents.find( aComponent ); - if( tIt == fTrackComponents.end() ) - { - wtrmsg_debug( "ASCII writer is making a new track output called <" << aComponent->GetName() << ">" << eom ); + ComponentIt tIt = fTrackComponents.find( aComponent ); + if( tIt == fTrackComponents.end() ) + { + wtrmsg_debug( "ASCII writer is making a new track output called <" << aComponent->GetName() << ">" << eom ); - fKey = aComponent->GetName(); + fKey = aComponent->GetName(); - Data* tTrackData = new Data( aComponent,this ); - tIt = fTrackComponents.insert( ComponentEntry( aComponent, tTrackData ) ).first; - fTextFile->File()->put('\n'); - } + Data* tTrackData = new Data( aComponent,this ); + tIt = fTrackComponents.insert( ComponentEntry( aComponent, tTrackData ) ).first; + fTextFile->File()->put('\n'); + } - wtrmsg_debug( "ASCII writer is starting a track output called <" << aComponent->GetName() << ">" << eom ); + wtrmsg_debug( "ASCII writer is starting a track output called <" << aComponent->GetName() << ">" << eom ); - tIt->second->Start( fTrackIndex ); - fActiveTrackComponents.insert( *tIt ); + tIt->second->Start( fTrackIndex ); + fActiveTrackComponents.insert( *tIt ); - return; - } + return; + } - void KSWriteASCII::RemoveTrackComponent( KSComponent* aComponent ) - { - ComponentIt tIt = fActiveTrackComponents.find( aComponent ); - if( tIt == fActiveTrackComponents.end() ) - { - wtrmsg( eError ) << "ASCII writer has no track output called <" << aComponent->GetName() << ">" << eom; - } + void KSWriteASCII::RemoveTrackComponent( KSComponent* aComponent ) + { + ComponentIt tIt = fActiveTrackComponents.find( aComponent ); + if( tIt == fActiveTrackComponents.end() ) + { + wtrmsg( eError ) << "ASCII writer has no track output called <" << aComponent->GetName() << ">" << eom; + } - fActiveTrackComponents.erase( tIt ); + fActiveTrackComponents.erase( tIt ); - return; - } + return; + } - void KSWriteASCII::AddStepComponent( KSComponent* aComponent ) - { - if( fStepComponent == false ) - fStepComponent = true; + void KSWriteASCII::AddStepComponent( KSComponent* aComponent ) + { + if( fStepComponent == false ) + fStepComponent = true; - ComponentIt tIt = fStepComponents.find( aComponent ); - if( tIt == fStepComponents.end() ) - { - wtrmsg_debug( "ASCII writer is making a new step output called <" << aComponent->GetName() << ">" << eom ); + ComponentIt tIt = fStepComponents.find( aComponent ); + if( tIt == fStepComponents.end() ) + { + wtrmsg_debug( "ASCII writer is making a new step output called <" << aComponent->GetName() << ">" << eom ); - fKey = aComponent->GetName(); + fKey = aComponent->GetName(); - Data* tStepData = new Data( aComponent, this ); + Data* tStepData = new Data( aComponent, this ); - tIt = fStepComponents.insert( ComponentEntry( aComponent, tStepData ) ).first; - } + tIt = fStepComponents.insert( ComponentEntry( aComponent, tStepData ) ).first; + } - wtrmsg_debug( "ASCII writer is starting a step output called <" << aComponent->GetName() << ">" << eom ); + wtrmsg_debug( "ASCII writer is starting a step output called <" << aComponent->GetName() << ">" << eom ); - tIt->second->Start( fStepIndex ); + tIt->second->Start( fStepIndex ); - fActiveStepComponents.insert( *tIt ); + fActiveStepComponents.insert( *tIt ); - return; - } + return; + } - void KSWriteASCII::RemoveStepComponent( KSComponent* aComponent ) - { - ComponentIt tIt = fActiveStepComponents.find( aComponent ); - if( tIt == fActiveStepComponents.end() ) - { - wtrmsg( eError ) << "ASCII writer has no step output called <" << aComponent->GetName() << ">" << eom; - } + void KSWriteASCII::RemoveStepComponent( KSComponent* aComponent ) + { + ComponentIt tIt = fActiveStepComponents.find( aComponent ); + if( tIt == fActiveStepComponents.end() ) + { + wtrmsg( eError ) << "ASCII writer has no step output called <" << aComponent->GetName() << ">" << eom; + } - fActiveStepComponents.erase( tIt ); + fActiveStepComponents.erase( tIt ); - return; - } + return; + } - void KSWriteASCII::InitializeComponent() - { - wtrmsg_debug( "starting ASCII writer" << eom ); - stringstream s; - s << fBase << "_Track" << fTrackIndex << + ".txt"; - fTextFile = CreateOutputTextFile( s.str().c_str() ); + void KSWriteASCII::InitializeComponent() + { + wtrmsg_debug( "starting ASCII writer" << eom ); + stringstream s; + s << fBase << "_Track" << fTrackIndex << + ".txt"; + fTextFile = CreateOutputTextFile( s.str().c_str() ); - if( !fPath.empty() ) - fTextFile->AddToPaths( fPath ); + if( !fPath.empty() ) + fTextFile->AddToPaths( fPath ); - if( fTextFile->Open( KFile::eWrite ) == true ){ + if( fTextFile->Open( KFile::eWrite ) == true ){ - } + } - return; - } + return; + } - void KSWriteASCII::DeinitializeComponent() + void KSWriteASCII::DeinitializeComponent() - { - ComponentIt tIt; + { + ComponentIt tIt; - for( tIt = fTrackComponents.begin(); tIt != fTrackComponents.end(); tIt++ ) - delete tIt->second; + for( tIt = fTrackComponents.begin(); tIt != fTrackComponents.end(); tIt++ ) + delete tIt->second; - for( tIt = fStepComponents.begin(); tIt != fStepComponents.end(); tIt++ ) - delete tIt->second; + for( tIt = fStepComponents.begin(); tIt != fStepComponents.end(); tIt++ ) + delete tIt->second; - fTextFile->Close(); + fTextFile->Close(); - delete fTextFile; - return; - } + delete fTextFile; + return; + } STATICINT sKSWriteASCIIDict = - KSDictionary< KSWriteASCII >::AddCommand( &KSWriteASCII::AddRunComponent, &KSWriteASCII::RemoveRunComponent, "add_run_output", "remove_run_output" ) + - KSDictionary< KSWriteASCII >::AddCommand( &KSWriteASCII::AddEventComponent, &KSWriteASCII::RemoveEventComponent, "add_event_output", "remove_event_output" ) + - KSDictionary< KSWriteASCII >::AddCommand( &KSWriteASCII::AddTrackComponent, &KSWriteASCII::RemoveTrackComponent, "add_track_output", "remove_track_output" ) + - KSDictionary< KSWriteASCII >::AddCommand( &KSWriteASCII::AddStepComponent, &KSWriteASCII::RemoveStepComponent, "add_step_output", "remove_step_output" ); + KSDictionary< KSWriteASCII >::AddCommand( &KSWriteASCII::AddRunComponent, &KSWriteASCII::RemoveRunComponent, "add_run_output", "remove_run_output" ) + + KSDictionary< KSWriteASCII >::AddCommand( &KSWriteASCII::AddEventComponent, &KSWriteASCII::RemoveEventComponent, "add_event_output", "remove_event_output" ) + + KSDictionary< KSWriteASCII >::AddCommand( &KSWriteASCII::AddTrackComponent, &KSWriteASCII::RemoveTrackComponent, "add_track_output", "remove_track_output" ) + + KSDictionary< KSWriteASCII >::AddCommand( &KSWriteASCII::AddStepComponent, &KSWriteASCII::RemoveStepComponent, "add_step_output", "remove_step_output" ); } diff --git a/Kassiopeia/Writers/Source/KSWriteHDF5.cxx b/Kassiopeia/Writers/Source/KSWriteHDF5.cxx new file mode 100644 index 000000000..071d8a4f5 --- /dev/null +++ b/Kassiopeia/Writers/Source/KSWriteHDF5.cxx @@ -0,0 +1,527 @@ +#include "KSWriteHDF5.h" +#include "KSWritersMessage.h" +#include "KSComponentGroup.h" + +using namespace H5; +using namespace std; + +namespace Kassiopeia +{ + + //const int KSWriteHDF5::fBufferSize = 64000; + //const int KSWriteHDF5::fSplitLevel = 99; + //const string KSWriteHDF5::fLabel = string( "KASSIOPEIA_TREE_DATA" ); + + KSWriteHDF5::Data::Data( KSComponent* aComponent ) : + fStructure( NULL ), + fLabel( "" ), + fType( "" ), + fPresence( NULL ), + fIndex( 0 ), + fLength( 0 ), + fData( NULL ), + fFile( NULL ), + fComponents() + { + MakeDatasets( aComponent ); + } + + KSWriteHDF5::Data::Data( KSComponent* aComponent, hid_t* aFile ) : + fStructure( NULL ), + fLabel( "" ), + fType( "" ), + fPresence( NULL ), + fIndex( 0 ), + fLength( 0 ), + fData( NULL ), + fFile( aFile ), + fComponents() + { + MakeDatasets( aComponent ); + } + + KSWriteHDF5::Data::~Data() + { + //H5Sclose(...); + H5Dclose(fStructure); + H5Dclose(fPresence); + H5Dclose(fData); + H5Gclose(fGroup); + + //delete fStructure; + //delete fPresence; + //delete fData; + //delete fGroup; + } + + void KSWriteHDF5::Data::Start( const unsigned int& anIndex ) + { + fIndex = anIndex; + fLength = 0; + return; + } + void KSWriteHDF5::Data::Fill() + { + KSComponent* tComponent; + vector< KSComponent* >::iterator tIt; + + for( tIt = fComponents.begin(); tIt != fComponents.end(); tIt++ ) + { + tComponent = (*tIt); + tComponent->PullUpdate(); + } + + fData->Fill(); + + for( tIt = fComponents.begin(); tIt != fComponents.end(); tIt++ ) + { + tComponent = (*tIt); + tComponent->PullDeupdate(); + } + + fLength++; + return; + } + void KSWriteHDF5::Data::Stop() + { + fPresence->Fill(); + return; + } + + void KSWriteHDF5::Data::MakeDataSets( KSComponent* aComponent ) + { + string tName = aComponent->GetName(); + + string tStructureName = string("/") + tName + string( "/STRUCTURE" ); + hsize_t tStructureDims[2] = { 100, 100 }; + hid_t tStructureSpace = H5Screate_simple( 2, tStructureDims, NULL ); + fStructure = H5Dcreate2(fFile, tStructureName, H5T_NATIVE_CHAR, tStructureSpace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + fStructure + + + // Create the data space for the attribute. + DataSpace attr_dataspace = DataSpace (1, dims ); + + // Create a dataset attribute. + Attribute attribute = dataset.createAttribute( ATTR_NAME, PredType::STD_I32BE, + attr_dataspace); + + // Write the attribute data. + attribute.write( PredType::NATIVE_INT, attr_data); + + fStructure = new TTree( tStructureName.c_str(), tStructureName.c_str() ); + fStructure->Branch( "LABEL", &fLabel, fBufferSize, fSplitLevel ); + fStructure->Branch( "TYPE", &fType, fBufferSize, fSplitLevel ); + + string tPresenceName = tName + string( "_PRESENCE" ); + fPresence = new TTree( tPresenceName.c_str(), tPresenceName.c_str() ); + fPresence->Branch( "INDEX", &fIndex, fBufferSize, fSplitLevel ); + fPresence->Branch( "LENGTH", &fLength, fBufferSize, fSplitLevel ); + + string tDataName = tName + string( "_DATA" ); + fData = new TTree( tDataName.c_str(), tDataName.c_str() ); + + MakeBranches( aComponent ); + + return; + } + + + + + void KSWriteHDF5::ExecuteRun() + { + wtrmsg_debug( "HDF5 writer <" << fName << "> is filling a run" << eom ); + + if ( fEventIndex != 0 ) + { + fRunLastEventIndex = fEventIndex - 1; + } + if ( fTrackIndex != 0 ) + { + fRunLastTrackIndex = fTrackIndex - 1; + } + if ( fStepIndex != 0 ) + { + fRunLastStepIndex = fStepIndex - 1; + } + + for( ComponentIt tIt = fActiveRunComponents.begin(); tIt != fActiveRunComponents.end(); tIt++ ) + { + tIt->second->Fill(); + } + FillRun(); + + fRunIndex++; + fRunFirstEventIndex = fEventIndex; + fRunFirstTrackIndex = fTrackIndex; + fRunFirstStepIndex = fStepIndex; + + return; + } + void KSWriteHDF5::ExecuteEvent() + { + wtrmsg_debug( "HDF5 writer <" << fName << "> is filling an event" << eom ); + + if ( fTrackIndex != 0 ) + { + fEventLastTrackIndex = fTrackIndex - 1; + } + if ( fStepIndex != 0 ) + { + fEventLastStepIndex = fStepIndex - 1; + } + + for( ComponentIt tIt = fActiveEventComponents.begin(); tIt != fActiveEventComponents.end(); tIt++ ) + { + tIt->second->Fill(); + } + FillEvent(); + + fEventIndex++; + fEventFirstTrackIndex = fTrackIndex; + fEventFirstStepIndex = fStepIndex; + + return; + } + void KSWriteHDF5::ExecuteTrack() + { + wtrmsg_debug( "HDF5 writer <" << fName << "> is filling a track" << eom ); + + if ( fStepIndex != 0 ) + { + fTrackLastStepIndex = fStepIndex - 1; + } + + for( ComponentIt tIt = fActiveTrackComponents.begin(); tIt != fActiveTrackComponents.end(); tIt++ ) + { + tIt->second->Fill(); + } + FillTrack(); + + fTrackIndex++; + fTrackFirstStepIndex = fStepIndex; + + return; + } + void KSWriteHDF5::ExecuteStep() + { + if ( fStepIterationIndex % fStepIteration != 0 ) + { + wtrmsg_debug( "HDF5 writer <" << fName << "> is skipping a step because of step iteration value <"<" << eom ); + fStepIterationIndex++; + return; + } + + if( fStepComponent == true ) + { + wtrmsg_debug( "HDF5 writer <" << fName << "> is filling a step" << eom ); + + for( ComponentIt tIt = fActiveStepComponents.begin(); tIt != fActiveStepComponents.end(); tIt++ ) + { + tIt->second->Fill(); + } + FillStep(); + } + + fStepIndex++; + fStepIterationIndex++; + + return; + } + + void KSWriteHDF5::AddRunComponent( KSComponent* aComponent ) + { + ComponentIt tIt = fRunComponents.find( aComponent ); + if( tIt == fRunComponents.end() ) + { + wtrmsg_debug( "HDF5 writer is making a new run output called <" << aComponent->GetName() << ">" << eom ); + + fFile->File()->cd(); + fKey = aComponent->GetName(); + fRunKeys->Fill(); + + Data* tRunData = new Data( aComponent ); + tIt = fRunComponents.insert( ComponentEntry( aComponent, tRunData ) ).first; + } + + wtrmsg_debug( "HDF5 writer is starting a run output called <" << aComponent->GetName() << ">" << eom ); + + tIt->second->Start( fRunIndex ); + fActiveRunComponents.insert( *tIt ); + + return; + } + void KSWriteROOT::RemoveRunComponent( KSComponent* aComponent ) + { + ComponentIt tIt = fActiveRunComponents.find( aComponent ); + if( tIt == fActiveRunComponents.end() ) + { + wtrmsg( eError ) << "ROOT writer has no run output called <" << aComponent->GetName() << ">" << eom; + } + + wtrmsg_debug( "ROOT writer is stopping a run output called <" << aComponent->GetName() << ">" << eom ); + + tIt->second->Stop(); + fActiveRunComponents.erase( tIt ); + + return; + } + + void KSWriteROOT::AddEventComponent( KSComponent* aComponent ) + { + ComponentIt tIt = fEventComponents.find( aComponent ); + if( tIt == fEventComponents.end() ) + { + wtrmsg_debug( "ROOT writer is making a new event output called <" << aComponent->GetName() << ">" << eom ); + + fFile->File()->cd(); + fKey = aComponent->GetName(); + fEventKeys->Fill(); + + Data* tEventData = new Data( aComponent ); + tIt = fEventComponents.insert( ComponentEntry( aComponent, tEventData ) ).first; + } + + wtrmsg_debug( "ROOT writer is starting a event output called <" << aComponent->GetName() << ">" << eom ); + + tIt->second->Start( fEventIndex ); + fActiveEventComponents.insert( *tIt ); + + return; + } + void KSWriteROOT::RemoveEventComponent( KSComponent* aComponent ) + { + ComponentIt tIt = fActiveEventComponents.find( aComponent ); + if( tIt == fActiveEventComponents.end() ) + { + wtrmsg( eError ) << "ROOT writer has no event output called <" << aComponent->GetName() << ">" << eom; + } + + wtrmsg_debug( "ROOT writer is stopping a event output called <" << aComponent->GetName() << ">" << eom ); + + tIt->second->Stop(); + fActiveEventComponents.erase( tIt ); + + return; + } + + void KSWriteROOT::AddTrackComponent( KSComponent* aComponent ) + { + ComponentIt tIt = fTrackComponents.find( aComponent ); + if( tIt == fTrackComponents.end() ) + { + wtrmsg_debug( "ROOT writer is making a new track output called <" << aComponent->GetName() << ">" << eom ); + + fFile->File()->cd(); + fKey = aComponent->GetName(); + fTrackKeys->Fill(); + + Data* tTrackData = new Data( aComponent ); + tIt = fTrackComponents.insert( ComponentEntry( aComponent, tTrackData ) ).first; + } + + wtrmsg_debug( "ROOT writer is starting a track output called <" << aComponent->GetName() << ">" << eom ); + + tIt->second->Start( fTrackIndex ); + fActiveTrackComponents.insert( *tIt ); + + return; + } + void KSWriteROOT::RemoveTrackComponent( KSComponent* aComponent ) + { + ComponentIt tIt = fActiveTrackComponents.find( aComponent ); + if( tIt == fActiveTrackComponents.end() ) + { + wtrmsg( eError ) << "ROOT writer has no track output called <" << aComponent->GetName() << ">" << eom; + } + + wtrmsg_debug( "ROOT writer is stopping a track output called <" << aComponent->GetName() << ">" << eom ); + + tIt->second->Stop(); + fActiveTrackComponents.erase( tIt ); + + return; + } + + void KSWriteROOT::AddStepComponent( KSComponent* aComponent ) + { + if( fStepComponent == false ) + { + fStepComponent = true; + + const unsigned int tTempStepIndex = fStepIndex; + for( fStepIndex = 0; fStepIndex < tTempStepIndex; ++fStepIndex ) + { + fStepData->Fill(); + } + fStepIndex = tTempStepIndex; + } + + ComponentIt tIt = fStepComponents.find( aComponent ); + if( tIt == fStepComponents.end() ) + { + wtrmsg_debug( "ROOT writer is making a new step output called <" << aComponent->GetName() << ">" << eom ); + + fFile->File()->cd(); + fKey = aComponent->GetName(); + fStepKeys->Fill(); + + Data* tStepData = new Data( aComponent ); + tIt = fStepComponents.insert( ComponentEntry( aComponent, tStepData ) ).first; + } + + wtrmsg_debug( "ROOT writer is starting a step output called <" << aComponent->GetName() << ">" << eom ); + + tIt->second->Start( fStepIndex ); + fActiveStepComponents.insert( *tIt ); + + return; + } + void KSWriteROOT::RemoveStepComponent( KSComponent* aComponent ) + { + ComponentIt tIt = fActiveStepComponents.find( aComponent ); + if( tIt == fActiveStepComponents.end() ) + { + wtrmsg( eError ) << "ROOT writer has no step output called <" << aComponent->GetName() << ">" << eom; + } + + wtrmsg_debug( "ROOT writer is stopping a step output called <" << aComponent->GetName() << ">" << eom ); + + tIt->second->Stop(); + fActiveStepComponents.erase( tIt ); + + return; + } + + void KSWriteROOT::InitializeComponent() + { + wtrmsg_debug( "starting ROOT writer" << eom ); + + fFile = KRootFile::CreateOutputRootFile( fBase ); + if( !fPath.empty() ) + { + fFile->AddToPaths( fPath ); + } + + if( fFile->Open( KFile::eWrite ) == true ) + { + TObjString* tLabel = new TObjString( fLabel.c_str() ); + tLabel->Write( "LABEL", TObject::kOverwrite ); + fFile->File()->cd(); + TTree::SetBranchStyle( 1 ); + + fRunKeys = new TTree( "RUN_KEYS", "RUN_KEYS" ); + fRunKeys->Branch( "KEY", &fKey, fBufferSize, fSplitLevel ); + + fRunData = new TTree( "RUN_DATA", "RUN_DATA" ); + fRunData->Branch( "RUN_INDEX", &fRunIndex, fBufferSize, fSplitLevel ); + fRunData->Branch( "FIRST_EVENT_INDEX", &fRunFirstEventIndex, fBufferSize, fSplitLevel ); + fRunData->Branch( "LAST_EVENT_INDEX", &fRunLastEventIndex, fBufferSize, fSplitLevel ); + fRunData->Branch( "FIRST_TRACK_INDEX", &fRunFirstTrackIndex, fBufferSize, fSplitLevel ); + fRunData->Branch( "LAST_TRACK_INDEX", &fRunLastTrackIndex, fBufferSize, fSplitLevel ); + fRunData->Branch( "FIRST_STEP_INDEX", &fRunFirstStepIndex, fBufferSize, fSplitLevel ); + fRunData->Branch( "LAST_STEP_INDEX", &fRunLastStepIndex, fBufferSize, fSplitLevel ); + + fRunIndex = 0; + fRunFirstEventIndex = 0; + fRunLastEventIndex = 0; + fRunFirstTrackIndex = 0; + fRunLastTrackIndex = 0; + fRunFirstStepIndex = 0; + fRunLastStepIndex = 0; + + fEventKeys = new TTree( "EVENT_KEYS", "EVENT_KEYS" ); + fEventKeys->Branch( "KEY", &fKey, fBufferSize, fSplitLevel ); + + fEventData = new TTree( "EVENT_DATA", "EVENT_DATA" ); + fEventData->Branch( "EVENT_INDEX", &fEventIndex, fBufferSize, fSplitLevel ); + fEventData->Branch( "FIRST_TRACK_INDEX", &fEventFirstTrackIndex, fBufferSize, fSplitLevel ); + fEventData->Branch( "LAST_TRACK_INDEX", &fEventLastTrackIndex, fBufferSize, fSplitLevel ); + fEventData->Branch( "FIRST_STEP_INDEX", &fEventFirstStepIndex, fBufferSize, fSplitLevel ); + fEventData->Branch( "LAST_STEP_INDEX", &fEventLastStepIndex, fBufferSize, fSplitLevel ); + + fEventIndex = 0; + fEventFirstTrackIndex = 0; + fEventLastTrackIndex = 0; + fEventFirstStepIndex = 0; + fEventLastStepIndex = 0; + + fTrackKeys = new TTree( "TRACK_KEYS", "TRACK_KEYS" ); + fTrackKeys->Branch( "KEY", &fKey, fBufferSize, fSplitLevel ); + + fTrackData = new TTree( "TRACK_DATA", "TRACK_DATA" ); + fTrackData->Branch( "TRACK_INDEX", &fTrackIndex, fBufferSize, fSplitLevel ); + fTrackData->Branch( "FIRST_STEP_INDEX", &fTrackFirstStepIndex, fBufferSize, fSplitLevel ); + fTrackData->Branch( "LAST_STEP_INDEX", &fTrackLastStepIndex, fBufferSize, fSplitLevel ); + + fTrackIndex = 0; + fTrackFirstStepIndex = 0; + fTrackLastStepIndex = 0; + + fStepKeys = new TTree( "STEP_KEYS", "STEP_KEYS" ); + fStepKeys->Branch( "KEY", &fKey, fBufferSize, fSplitLevel ); + + fStepData = new TTree( "STEP_DATA", "STEP_DATA" ); + fStepData->Branch( "STEP_INDEX", &fStepIndex, fBufferSize, fSplitLevel ); + + fStepIndex = 0; + } + + return; + } + void KSWriteHDF5::DeinitializeComponent() + { + wtrmsg_debug( "stopping HDF5 writer" << eom ); + + if( (fFile != NULL) /* && (fFile->IsOpen() == true) */ ) + { + ComponentIt tIt; + + for( tIt = fActiveRunComponents.begin(); tIt != fActiveRunComponents.end(); tIt++ ) + { + tIt->second->Stop(); + } + + for( tIt = fActiveEventComponents.begin(); tIt != fActiveEventComponents.end(); tIt++ ) + { + tIt->second->Stop(); + } + + for( tIt = fActiveTrackComponents.begin(); tIt != fActiveTrackComponents.end(); tIt++ ) + { + tIt->second->Stop(); + } + + for( tIt = fActiveStepComponents.begin(); tIt != fActiveStepComponents.end(); tIt++ ) + { + tIt->second->Stop(); + } + + for( tIt = fRunComponents.begin(); tIt != fRunComponents.end(); tIt++ ) + { + delete tIt->second; + } + + for( tIt = fEventComponents.begin(); tIt != fEventComponents.end(); tIt++ ) + { + delete tIt->second; + } + + for( tIt = fTrackComponents.begin(); tIt != fTrackComponents.end(); tIt++ ) + { + delete tIt->second; + } + + for( tIt = fStepComponents.begin(); tIt != fStepComponents.end(); tIt++ ) + { + } + + H5Fclose(fFile); + delete fFile; + } + + return; + } + +} diff --git a/Kassiopeia/Writers/Source/KSWriteROOT.cxx b/Kassiopeia/Writers/Source/KSWriteROOT.cxx index 218544bd7..9df69b2b9 100644 --- a/Kassiopeia/Writers/Source/KSWriteROOT.cxx +++ b/Kassiopeia/Writers/Source/KSWriteROOT.cxx @@ -2,6 +2,11 @@ #include "KSWritersMessage.h" #include "KSComponentGroup.h" +#ifdef Kassiopeia_USE_BOOST +//#include "KPathUtils.h" +//using katrin::KPathUtils; +#endif + using namespace std; namespace Kassiopeia @@ -516,15 +521,15 @@ namespace Kassiopeia if ( fEventIndex != 0 ) { - fRunLastEventIndex = fEventIndex - 1; + fRunLastEventIndex = fEventIndex - 1; } if ( fTrackIndex != 0 ) { - fRunLastTrackIndex = fTrackIndex - 1; + fRunLastTrackIndex = fTrackIndex - 1; } if ( fStepIndex != 0 ) { - fRunLastStepIndex = fStepIndex - 1; + fRunLastStepIndex = fStepIndex - 1; } //check write condition @@ -562,11 +567,11 @@ namespace Kassiopeia if ( fTrackIndex != 0 ) { - fEventLastTrackIndex = fTrackIndex - 1; + fEventLastTrackIndex = fTrackIndex - 1; } if ( fStepIndex != 0 ) { - fEventLastStepIndex = fStepIndex - 1; + fEventLastStepIndex = fStepIndex - 1; } //check write condition @@ -602,9 +607,9 @@ namespace Kassiopeia wtrmsg_debug( "ROOT writer <" << fName << "> is filling a track" << eom ); if ( fStepIndex != 0 ) - { - fTrackLastStepIndex = fStepIndex - 1; - } + { + fTrackLastStepIndex = fStepIndex - 1; + } //check write condition bool tWriteCondition = true;; @@ -635,15 +640,15 @@ namespace Kassiopeia } void KSWriteROOT::ExecuteStep() { - if ( fStepIterationIndex % fStepIteration != 0 ) - { + if ( fStepIterationIndex % fStepIteration != 0 ) + { wtrmsg_debug( "ROOT writer <" << fName << "> is skipping a step because of step iteration value <"<" << eom ); - fStepIterationIndex++; - return; - } + fStepIterationIndex++; + return; + } - //check write condition - bool tWriteCondition = true;; + //check write condition + bool tWriteCondition = true;; for( int tIndex = 0; tIndex < fStepWriteConditions.End(); tIndex++ ) { bool tLocalFlag = true; @@ -846,6 +851,9 @@ namespace Kassiopeia fFile = KRootFile::CreateOutputRootFile( fBase ); if( !fPath.empty() ) { +#ifdef Kassiopeia_USE_BOOST +// KPathUtils::MakeDirectory( fPath ); +#endif fFile->AddToPaths( fPath ); } diff --git a/Kassiopeia/Writers/Source/KSWriteVTK.cxx b/Kassiopeia/Writers/Source/KSWriteVTK.cxx index fe1a6ddff..aa9781589 100644 --- a/Kassiopeia/Writers/Source/KSWriteVTK.cxx +++ b/Kassiopeia/Writers/Source/KSWriteVTK.cxx @@ -4,6 +4,11 @@ #include "KFile.h" +#ifdef Kassiopeia_USE_BOOST +//#include "KPathUtils.h" +//using katrin::KPathUtils; +#endif + using namespace std; namespace Kassiopeia @@ -372,15 +377,21 @@ namespace Kassiopeia { wtrmsg_debug( "stopping VTK writer" << eom ); - if( fBase.length() == 0 ) + if( fBase.empty() ) { fBase = GetName(); } - if( fPath.length() == 0 ) + if( fPath.empty() ) { fPath = OUTPUT_DEFAULT_DIR; } + else + { +#ifdef Kassiopeia_USE_BOOST +// KPathUtils::MakeDirectory( fPath ); +#endif + } vtkSmartPointer< vtkXMLPolyDataWriter > tStepWriter = vtkSmartPointer< vtkXMLPolyDataWriter >::New(); tStepWriter->SetFileName( (fPath + string( "/" ) + fBase + string( "Step.vtp" )).c_str() ); diff --git a/Kommon/Boost/CMakeLists.txt b/Kommon/Boost/CMakeLists.txt index f9f5dd406..88e63b9d9 100644 --- a/Kommon/Boost/CMakeLists.txt +++ b/Kommon/Boost/CMakeLists.txt @@ -3,10 +3,11 @@ kasper_internal_include_directories( Utility ) # headers set(KOMMON_BOOST_HEADER_FILES - Utility/KAccumulators.h - Utility/KFunctionCache.h - Utility/KStringUtils.h - Utility/KFastMath.h + Utility/KAccumulators.h + Utility/KFastMath.h + Utility/KFunctionCache.h + Utility/KPathUtils.h + Utility/KStringUtils.h ) # propagate path variable to parent scope diff --git a/Kommon/Boost/Utility/KPathUtils.h b/Kommon/Boost/Utility/KPathUtils.h new file mode 100644 index 000000000..bd26154b5 --- /dev/null +++ b/Kommon/Boost/Utility/KPathUtils.h @@ -0,0 +1,168 @@ +#ifndef KPATHUTILS_H_ +#define KPATHUTILS_H_ + +#include +#include +#include + +#include "KUtilityMessage.h" + +namespace katrin +{ + + class KPathUtils + { + public: + KPathUtils() = delete; + + static const std::string& AbsolutePath( const std::string& aPath ); + static const std::string& Directory( const std::string& aPath ); + static const std::string& FileName( const std::string& aPath ); + static const std::string& FileExtension( const std::string& aPath ); + static uintmax_t Size( const std::string& aPath ); + + static bool Exists( const std::string& aPath ); + static bool IsDirectory( const std::string& aPath ); + static bool IsSymlink( const std::string& aPath ); + static bool IsEmpty( const std::string& aPath ); + + static bool MakeDirectory( const std::string& aPath ); + + static std::vector< std::string > ListFiles( const std::string& aPath ); + static std::vector< std::string > ListFilesRecursive( const std::string& aPath ); + }; + + inline + const std::string& KPathUtils::AbsolutePath( const std::string& aPath ) + { + boost::filesystem::path tPath( aPath ); + return boost::filesystem::absolute( tPath ).string(); + } + + inline + const std::string& KPathUtils::Directory( const std::string& aPath ) + { + boost::filesystem::path tPath( aPath ); + return tPath.parent_path().string(); + } + + inline + const std::string& KPathUtils::FileName( const std::string& aPath ) + { + boost::filesystem::path tPath( aPath ); + return tPath.filename().string(); + } + + inline + const std::string& KPathUtils::FileExtension( const std::string& aPath ) + { + boost::filesystem::path tPath( aPath ); + return tPath.extension().string(); + } + + inline + uintmax_t KPathUtils::Size( const std::string& aPath ) + { + boost::filesystem::path tPath( aPath ); + return boost::filesystem::file_size( tPath ); + } + + inline + bool KPathUtils::Exists( const std::string& aPath ) + { + boost::filesystem::path tPath( aPath ); + return boost::filesystem::exists( tPath ); + } + + inline + bool KPathUtils::IsDirectory( const std::string& aPath ) + { + boost::filesystem::path tPath( aPath ); + return boost::filesystem::is_directory( tPath ); + } + + inline + bool KPathUtils::IsSymlink( const std::string& aPath ) + { + boost::filesystem::path tPath( aPath ); + return boost::filesystem::is_symlink( tPath ); + } + + inline + bool KPathUtils::IsEmpty( const std::string& aPath ) + { + boost::filesystem::path tPath( aPath ); + return boost::filesystem::is_empty( tPath ); + } + + inline + std::vector< std::string > KPathUtils::ListFiles( const std::string& aPath ) + { + std::vector tList; + + boost::filesystem::path tPath( aPath ); + if (! boost::filesystem::is_directory( tPath ) ) + { + utilmsg( eError ) << "cannot retrieve directory contents, <" << tPath.string() << "> is not a directory" << eom; + return tList; + } + + utilmsg_debug( "retrieving directory contents in <" << tPath.string() << ">" << eom ); + boost::filesystem::directory_iterator it( tPath ); + boost::filesystem::directory_iterator end; + for (; it != end; ++it) + { + tList.push_back( (*it).path().string() ); + } + return tList; + } + + inline + std::vector< std::string > KPathUtils::ListFilesRecursive( const std::string& aPath ) + { + std::vector tList; + + boost::filesystem::path tPath( aPath ); + if (! boost::filesystem::is_directory( tPath ) ) + { + utilmsg( eError ) << "cannot retrieve directory contents, <" << tPath.string() << "> is not a directory" << eom; + return tList; + } + + utilmsg_debug( "recursively retrieving directory contents in <" << tPath.string() << ">" << eom ); + boost::filesystem::recursive_directory_iterator it( tPath ); + boost::filesystem::recursive_directory_iterator end; + for (; it != end; ++it) + { + tList.push_back( (*it).path().string() ); + } + return tList; + } + + inline + bool KPathUtils::MakeDirectory( const std::string& aPath ) + { + boost::filesystem::path tPath( aPath ); + if ( tPath.empty() ) + { + return false; + } + + if( boost::filesystem::exists( tPath ) ) + { + if ( ! boost::filesystem::is_directory( tPath ) ) + { + utilmsg( eError ) << "cannot create directory, <" << tPath.string() << "> is an existing file" << eom; + return false; + } + utilmsg_debug( "not creating directory, <" << tPath.string() << "> already exists" << eom ); + return true; + } + + utilmsg_debug( "creating directory <" << tPath.string() << ">" << eom ); + return boost::filesystem::create_directory( tPath ); + } + +} + +#endif diff --git a/Kommon/CMakeLists.txt b/Kommon/CMakeLists.txt index 3e16b31f8..641fd9dcf 100644 --- a/Kommon/CMakeLists.txt +++ b/Kommon/CMakeLists.txt @@ -1,15 +1,17 @@ -cmake_minimum_required( VERSION 2.8.6 ) +cmake_minimum_required( VERSION ${CMAKE_MINIMUM_VERSION} ) -project( Kommon ) -set( CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake ${PROJECT_SOURCE_DIR}/GoogleTest/cmake ) -include( KasperDefaults ) - -# version +# Kommon version set( MODULE_VERSION_MAJOR 1 ) -set( MODULE_VERSION_MINOR 1 ) +set( MODULE_VERSION_MINOR 2 ) set( MODULE_VERSION_PATCH 0 ) set( MODULE_VERSION "${MODULE_VERSION_MAJOR}.${MODULE_VERSION_MINOR}.${MODULE_VERSION_PATCH}" ) +#project( Kommon VERSION ${MODULE_VERSION} ) +project( Kommon ) + +#set( CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake ${PROJECT_SOURCE_DIR}/GoogleTest/cmake ) +include( KasperDefaults ) + # compiler requirements kasper_require_cpp11() kasper_require_gcc_version(4.6) @@ -33,7 +35,7 @@ set(LOG4CXX_FOUND FALSE) if(Kommon_USE_Log4CXX) find_package( Log4CXX ) - + if( LOG4CXX_FOUND ) set(LOGGER_CONFIGURATION "${Kommon_CONFIG_INSTALL_DIR}/log4cxx.properties" ) set_source_files_properties(Core/Logging/KLogger.cxx PROPERTIES COMPILE_DEFINITIONS @@ -53,11 +55,11 @@ add_subdirectory( cmake ) add_subdirectory( Core ) add_subdirectory( Documentation ) - if( KASPER_USE_BOOST ) - find_package( Boost 1.42.0 REQUIRED ) + find_package( Boost 1.43.0 COMPONENTS filesystem REQUIRED ) kasper_external_include_directories( ${Boost_INCLUDE_DIR} ) - add_subdirectory( Boost ) + list(APPEND EXTERNAL_LIBRARIES ${Boost_LIBRARIES} ) + add_subdirectory( Boost ) endif() if( KASPER_USE_ROOT ) @@ -65,14 +67,14 @@ if( KASPER_USE_ROOT ) kasper_external_include_directories( ${ROOT_INCLUDE_DIR} ) add_definitions( -DKommon_USE_ROOT ) list(APPEND EXTERNAL_LIBRARIES ${ROOT_LIBRARIES} ) - add_subdirectory( Root ) + add_subdirectory( Root ) endif() if( KASPER_USE_GSL ) find_package( GSL REQUIRED ) kasper_external_include_directories( ${GSL_INCLUDE_DIRS} ) list(APPEND EXTERNAL_LIBRARIES ${GSL_LIBRARIES} ) - add_subdirectory( Gsl ) + add_subdirectory( Gsl ) endif() if( KASPER_USE_TBB ) diff --git a/Kommon/Core/Initialization/KConditionProcessor.cc b/Kommon/Core/Initialization/KConditionProcessor.cc index d78f4c82d..d1bcebd64 100644 --- a/Kommon/Core/Initialization/KConditionProcessor.cc +++ b/Kommon/Core/Initialization/KConditionProcessor.cc @@ -12,13 +12,14 @@ namespace katrin KProcessor(), fElementState( eElementInactive ), fAttributeState( eAttributeInactive ), + fProcessorState( eIfCondition ), fNest( 0 ), fCondition( false ), fIfTokens(), + fElseTokens(), fNewParent( NULL ), fOldParent( NULL ) { - } KConditionProcessor::~KConditionProcessor() @@ -32,12 +33,13 @@ namespace katrin if( aToken->GetValue() == string( "if" ) ) { fNest++; - + if( fNest == 1 ) { fOldParent = this->fParent; fNewParent = this->GetFirstParent(); fElementState = eActive; + fProcessorState = eIfCondition; return; } } @@ -48,12 +50,33 @@ namespace katrin if( fElementState == eElementComplete ) { + if( aToken->GetValue() == string( "else" ) ) + { + fNest++; + + if( fNest == 2 ) + { + //fOldParent = this->fParent; + //fNewParent = this->GetFirstParent(); + fElementState = eElseActive; + fProcessorState = eElseCondition; + return; + } + } if( aToken->GetValue() == string( "if" ) ) { fNest++; } - fIfTokens.push_back( aToken->Clone() ); + + if( fProcessorState == eIfCondition ) + { + fIfTokens.push_back( aToken->Clone() ); + } + else if( fProcessorState == eElseCondition ) + { + fElseTokens.push_back( aToken->Clone() ); + } return; } @@ -82,10 +105,16 @@ namespace katrin return; } - if( fElementState == eElementComplete ) { - fIfTokens.push_back( aToken->Clone() ); + if( fProcessorState == eIfCondition ) + { + fIfTokens.push_back( aToken->Clone() ); + } + else if( fProcessorState == eElseCondition ) + { + fElseTokens.push_back( aToken->Clone() ); + } return; } @@ -129,7 +158,14 @@ namespace katrin if( fElementState == eElementComplete ) { - fIfTokens.push_back( aToken->Clone() ); + if( fProcessorState == eIfCondition ) + { + fIfTokens.push_back( aToken->Clone() ); + } + else if( fProcessorState == eElseCondition ) + { + fElseTokens.push_back( aToken->Clone() ); + } return; } @@ -155,7 +191,14 @@ namespace katrin if( fElementState == eElementComplete ) { - fIfTokens.push_back( aToken->Clone() ); + if( fProcessorState == eIfCondition ) + { + fIfTokens.push_back( aToken->Clone() ); + } + else if( fProcessorState == eElseCondition ) + { + fElseTokens.push_back( aToken->Clone() ); + } return; } @@ -170,7 +213,7 @@ namespace katrin return; } - if( fElementState == eActive ) + if( fElementState == eActive || fElementState == eElseActive ) { //hijack the token stream Remove(); @@ -181,7 +224,14 @@ namespace katrin if( fElementState == eElementComplete ) { - fIfTokens.push_back( aToken->Clone() ); + if( fProcessorState == eIfCondition ) + { + fIfTokens.push_back( aToken->Clone() ); + } + else if( fProcessorState == eElseCondition ) + { + fElseTokens.push_back( aToken->Clone() ); + } return; } @@ -198,7 +248,14 @@ namespace katrin if( fElementState == eElementComplete ) { - fIfTokens.push_back( aToken->Clone() ); + if( fProcessorState == eIfCondition ) + { + fIfTokens.push_back( aToken->Clone() ); + } + else if( fProcessorState == eElseCondition ) + { + fElseTokens.push_back( aToken->Clone() ); + } return; } @@ -227,15 +284,16 @@ namespace katrin Remove(); InsertAfter( fOldParent ); - //copy the state into stack variables and reset (otherwise nesting is not possible) TokenVector tIfTokens = fIfTokens; + TokenVector tElseTokens = fElseTokens; bool tCondition = fCondition; //reset the object fNest = 0; fCondition = false; fIfTokens.clear(); + fElseTokens.clear(); fNewParent = NULL; fOldParent = NULL; fElementState = eElementInactive; @@ -245,24 +303,48 @@ namespace katrin if ( tCondition == true ) { - for( TokenIt It = tIfTokens.begin(); It != tIfTokens.end(); It++ ) - { - tToken = (*It)->Clone(); - Dispatch( tToken ); - delete tToken; - } + for( TokenIt It = tIfTokens.begin(); It != tIfTokens.end(); It++ ) + { + tToken = (*It)->Clone(); + Dispatch( tToken ); + delete tToken; + } + } + else { + for( TokenIt It = tElseTokens.begin(); It != tElseTokens.end(); It++ ) + { + tToken = (*It)->Clone(); + Dispatch( tToken ); + delete tToken; + } } - //delete the old tokens (made with new during collection) - for( TokenIt It = tIfTokens.begin(); It != tIfTokens.end(); It++ ) - { - delete *It; - } + //delete the old tokens (made with new during collection) + for( TokenIt It = tIfTokens.begin(); It != tIfTokens.end(); It++ ) + { + delete *It; + } + for( TokenIt It = tElseTokens.begin(); It != tElseTokens.end(); It++ ) + { + delete *It; + } return; } } - fIfTokens.push_back( aToken->Clone() ); + if( aToken->GetValue() == string( "else" ) ) + { + fNest--; + } + + if( fProcessorState == eIfCondition ) + { + fIfTokens.push_back( aToken->Clone() ); + } + else if( fProcessorState == eElseCondition ) + { + fElseTokens.push_back( aToken->Clone() ); + } return; } diff --git a/Kommon/Core/Initialization/KConditionProcessor.hh b/Kommon/Core/Initialization/KConditionProcessor.hh index 8edb66da9..adaee88e0 100644 --- a/Kommon/Core/Initialization/KConditionProcessor.hh +++ b/Kommon/Core/Initialization/KConditionProcessor.hh @@ -35,19 +35,26 @@ namespace katrin typedef enum { - eElementInactive, eActive, eElementComplete + eElementInactive, eActive, eElseActive, eElementComplete = -1 } ElementState; ElementState fElementState; typedef enum { - eAttributeInactive, eCondition, eAttributeComplete + eAttributeInactive, eCondition, eAttributeComplete = -1 } AttributeState; AttributeState fAttributeState; + typedef enum + { + eIfCondition, eElseCondition + } ProcessorState; + ProcessorState fProcessorState; + unsigned int fNest; bool fCondition; TokenVector fIfTokens; + TokenVector fElseTokens; KProcessor* fNewParent; KProcessor* fOldParent; }; diff --git a/Kommon/Core/Initialization/KIncludeProcessor.cc b/Kommon/Core/Initialization/KIncludeProcessor.cc index ab2052049..aca6ff6fe 100644 --- a/Kommon/Core/Initialization/KIncludeProcessor.cc +++ b/Kommon/Core/Initialization/KIncludeProcessor.cc @@ -23,7 +23,8 @@ namespace katrin fAttributeState( eAttributeInactive ), fNames(), fPaths(), - fBases() + fBases(), + fIncludedPaths() { } @@ -217,7 +218,7 @@ namespace katrin vector::const_iterator It; - initmsg << "unable to open file with names <"; + initmsg( eError ) << "unable to open file with names <"; It = fNames.begin(); while( It != fNames.end() ) { @@ -250,7 +251,7 @@ namespace katrin initmsg << ","; } } - initmsg( eError ) << ">" << eom; + initmsg << ">" << eom; } fElementState = eElementInactive; @@ -258,12 +259,24 @@ namespace katrin fPaths.clear(); fBases.clear(); - KXMLTokenizer* aNewTokenizer = new KXMLTokenizer(); - aNewTokenizer->InsertBefore( GetFirstParent() ); - aNewTokenizer->ProcessFile( aFile ); - aNewTokenizer->Remove(); + std::string tFileName = aFile->GetName(); + if ( std::find( fIncludedPaths.begin(), fIncludedPaths.end(), tFileName ) != fIncludedPaths.end() ) + { + initmsg( eWarning ) << "skipping file <" << tFileName << "> since it was already included" << eom; + } + else + { + initmsg( eInfo ) << "including file <" << tFileName << ">" << eom; + fIncludedPaths.push_back( tFileName ); + + KXMLTokenizer* aNewTokenizer = new KXMLTokenizer(); + aNewTokenizer->InsertBefore( GetFirstParent() ); + aNewTokenizer->ProcessFile( aFile ); + aNewTokenizer->Remove(); + + delete aNewTokenizer; + } - delete aNewTokenizer; delete aFile; } diff --git a/Kommon/Core/Initialization/KIncludeProcessor.hh b/Kommon/Core/Initialization/KIncludeProcessor.hh index 7ea6173f0..29e368438 100644 --- a/Kommon/Core/Initialization/KIncludeProcessor.hh +++ b/Kommon/Core/Initialization/KIncludeProcessor.hh @@ -45,6 +45,8 @@ namespace katrin std::vector< std::string > fBases; std::vector< std::string > fDefaultPaths; + + std::vector< std::string > fIncludedPaths; }; } diff --git a/Kommon/Core/Initialization/KPrintProcessor.cc b/Kommon/Core/Initialization/KPrintProcessor.cc index d5e79abdf..6140f468f 100644 --- a/Kommon/Core/Initialization/KPrintProcessor.cc +++ b/Kommon/Core/Initialization/KPrintProcessor.cc @@ -12,6 +12,7 @@ namespace katrin KProcessor(), fElementState( eElementInactive ), fAttributeState( eAttributeInactive ), + fMessageType( eNormal ), fName( "" ), fValue( "" ) { @@ -28,6 +29,19 @@ namespace katrin if( aToken->GetValue() == string( "print" ) ) { fElementState = eElementActive; + fMessageType = eNormal; + return; + } + if( aToken->GetValue() == string( "warning" ) ) + { + fElementState = eElementActive; + fMessageType = eWarning; + return; + } + if( aToken->GetValue() == string( "error" ) ) + { + fElementState = eElementActive; + fMessageType = eError; return; } @@ -155,10 +169,28 @@ namespace katrin if( fElementState == eElementComplete ) { - initmsg( eNormal ) << "value of <" << fName << "> is <" << fValue << ">" << eom; + if (fName.empty()) + { + initmsg( fMessageType ) << fValue; + } + else + { + initmsg( fMessageType ) << "value of <" << fName << "> is <" << fValue << ">"; + } + + if (fMessageType == eError) + { + initmsg( fMessageType ) << ret << "in path <" << aToken->GetPath() << "> in file <" << aToken->GetFile() << "> at line <" << aToken->GetLine() << ">, column <" << aToken->GetColumn() << ">" << eom; + } + else + { + initmsg( fMessageType ) << eom; + } + fName.clear(); fValue.clear(); fElementState = eElementInactive; + fMessageType = eNormal; return; } diff --git a/Kommon/Core/Initialization/KPrintProcessor.hh b/Kommon/Core/Initialization/KPrintProcessor.hh index 15711661e..9161544fa 100644 --- a/Kommon/Core/Initialization/KPrintProcessor.hh +++ b/Kommon/Core/Initialization/KPrintProcessor.hh @@ -37,6 +37,7 @@ namespace katrin ElementState fElementState; AttributeState fAttributeState; + KMessageSeverity fMessageType; std::string fName; std::string fValue; diff --git a/Kommon/Core/Initialization/KToken.hh b/Kommon/Core/Initialization/KToken.hh index 75c395422..d27182330 100644 --- a/Kommon/Core/Initialization/KToken.hh +++ b/Kommon/Core/Initialization/KToken.hh @@ -3,6 +3,7 @@ #include "KInitializationMessage.hh" +#include #include #include @@ -19,6 +20,12 @@ namespace katrin virtual KToken* Clone() = 0; public: + template< class OutputT > + inline const std::vector AsVector() const; + + template< class OutputT > + inline const std::pair AsPair() const; + void SetValue( const std::string& aValue ); const std::string& GetValue() const; @@ -64,7 +71,10 @@ namespace katrin template<> inline bool KToken::GetValue< bool >() const { - if ( fValue == std::string("0") + if ( fValue == std::string("0") || fValue == std::string("") + || fValue == std::string("null") || fValue == std::string("Null") || fValue == std::string("NULL") + || fValue == std::string("nan") || fValue == std::string("NaN") || fValue == std::string("NAN") + || fValue == std::string("none") || fValue == std::string("None") || fValue == std::string("None") || fValue == std::string("false") || fValue == std::string("False") || fValue == std::string("FALSE") || fValue == std::string("no") || fValue == std::string("No") || fValue == std::string("NO") ) { @@ -73,6 +83,78 @@ namespace katrin return true; } + /* KToken string conversion specializations */ + + template< class OutputT > + inline const std::vector KToken::AsVector() const + { + return KStringUtils::Split(fValue, ";, |/"); + } + + template< class OutputT > + inline const std::pair KToken::AsPair() const + { + std::vector tmp; + size_t n = KStringUtils::Split(fValue, ";, |/", tmp); + if (n != 2) + { + initmsg( eWarning ) << "error processing token <" << fValue << "> as a pair of double values, replaced with zeros." << ret; + initmsg( eWarning ) << "in path <" << fPath << "> in file <" << fFile << "> at line <" << fLine << "> at column <" << fColumn << ">" << eom; + return std::make_pair(0, 0); + } + return std::make_pair(tmp[0], tmp[1]); + } + + template<> + inline int8_t KToken::GetValue() const + { + const int helper = KToken::GetValue(); + return (helper >= -128 && helper <= 127) ? helper : 0; + } + + template<> + inline uint8_t KToken::GetValue() const + { + const int helper = KToken::GetValue(); + return (helper >= 0 && helper <= 255) ? helper : 0; + } + + template<> + inline std::vector KToken::GetValue< std::vector >() const + { + return AsVector(); + } + + template<> + inline std::vector KToken::GetValue< std::vector >() const + { + return AsVector(); + } + + template<> + inline std::vector KToken::GetValue< std::vector >() const + { + return AsVector(); + } + + template<> + inline std::pair KToken::GetValue< std::pair >() const + { + return AsPair(); + } + + template<> + inline std::pair KToken::GetValue< std::pair >() const + { + return AsPair(); + } + + template<> + inline std::pair KToken::GetValue< std::pair >() const + { + return AsPair(); + } + template<> inline std::string KToken::GetValue< std::string >() const { diff --git a/Kommon/Core/Initialization/KVariableProcessor.cc b/Kommon/Core/Initialization/KVariableProcessor.cc index b1803c27f..c0e692f6a 100644 --- a/Kommon/Core/Initialization/KVariableProcessor.cc +++ b/Kommon/Core/Initialization/KVariableProcessor.cc @@ -9,6 +9,7 @@ namespace katrin const string KVariableProcessor::fStartBracket = "["; const string KVariableProcessor::fEndBracket = "]"; const string KVariableProcessor::fNameValueSeparator = ":"; + const string KVariableProcessor::fAppendValueSeparator = " "; KVariableProcessor::KVariableProcessor() : KProcessor(), @@ -37,6 +38,18 @@ namespace katrin KVariableProcessor::~KVariableProcessor() { + for ( auto & tRefCount : fRefCountMap ) + { + if ( tRefCount.second > 0 ) + { + initmsg_debug( "variable <" << tRefCount.first << "> was referenced " << tRefCount.second << " times" << eom ); + } + else + { + initmsg( eInfo ) << "variable <" << tRefCount.first << "> was not referenced anywhere" << eom; + } + } + delete fExternalMap; delete fGlobalMap; delete fLocalMap; @@ -62,6 +75,8 @@ namespace katrin { if( fElementState == eElementInactive ) { + initmsg_debug( "variable processor found token <" << aToken->GetValue() << ">" << eom) + if( aToken->GetValue() == string( "define" ) ) { fElementState = eActiveLocalDefine; @@ -80,6 +95,24 @@ namespace katrin return; } + if( aToken->GetValue() == string( "redefine" ) ) + { + fElementState = eActiveLocalRedefine; + return; + } + + if( aToken->GetValue() == string( "global_redefine" ) ) + { + fElementState = eActiveGlobalRedefine; + return; + } + + if( aToken->GetValue() == string( "external_redefine" ) ) + { + fElementState = eActiveExternalRedefine; + return; + } + if( aToken->GetValue() == string( "undefine" ) ) { fElementState = eActiveLocalUndefine; @@ -98,6 +131,24 @@ namespace katrin return; } + if( aToken->GetValue() == string( "append" ) ) + { + fElementState = eActiveLocalAppend; + return; + } + + if( aToken->GetValue() == string( "global_append" ) ) + { + fElementState = eActiveGlobalAppend; + return; + } + + if( aToken->GetValue() == string( "external_append" ) ) + { + fElementState = eActiveExternalAppend; + return; + } + KProcessor::ProcessToken( aToken ); return; } @@ -109,7 +160,7 @@ namespace katrin void KVariableProcessor::ProcessToken( KBeginAttributeToken* aToken ) { - if( (fElementState == eActiveLocalDefine) || (fElementState == eActiveGlobalDefine) || (fElementState == eActiveExternalDefine) ) + if( (fElementState == eActiveLocalDefine) || (fElementState == eActiveGlobalDefine) || (fElementState == eActiveExternalDefine) || (fElementState == eActiveLocalRedefine) || (fElementState == eActiveGlobalRedefine) || (fElementState == eActiveExternalRedefine) || (fElementState == eActiveLocalAppend) || (fElementState == eActiveGlobalAppend) || (fElementState == eActiveExternalAppend) ) { if( aToken->GetValue() == "name" ) { @@ -146,6 +197,7 @@ namespace katrin return; } + if( (fElementState == eActiveLocalUndefine) || (fElementState == eActiveGlobalUndefine) || (fElementState == eActiveExternalUndefine) ) { if( aToken->GetValue() == "name" ) @@ -182,7 +234,7 @@ namespace katrin return; } - if( (fElementState == eActiveLocalDefine) || (fElementState == eActiveGlobalDefine) || (fElementState == eActiveExternalDefine) || (fElementState == eActiveLocalUndefine) || (fElementState == eActiveGlobalUndefine) || (fElementState == eActiveExternalUndefine) ) + if( (fElementState == eActiveLocalDefine) || (fElementState == eActiveGlobalDefine) || (fElementState == eActiveExternalDefine) || (fElementState == eActiveLocalRedefine) || (fElementState == eActiveGlobalRedefine) || (fElementState == eActiveExternalRedefine) || (fElementState == eActiveLocalUndefine) || (fElementState == eActiveGlobalUndefine) || (fElementState == eActiveExternalUndefine) || (fElementState == eActiveLocalAppend) || (fElementState == eActiveGlobalAppend) || (fElementState == eActiveExternalAppend) ) { if( fAttributeState == eActiveName ) { @@ -211,7 +263,7 @@ namespace katrin return; } - if( (fElementState == eActiveLocalDefine) || (fElementState == eActiveGlobalDefine) || (fElementState == eActiveExternalDefine) || (fElementState == eActiveLocalUndefine) || (fElementState == eActiveGlobalUndefine) || (fElementState == eActiveExternalUndefine) ) + if( (fElementState == eActiveLocalDefine) || (fElementState == eActiveGlobalDefine) || (fElementState == eActiveExternalDefine) || (fElementState == eActiveLocalRedefine) || (fElementState == eActiveGlobalRedefine) || (fElementState == eActiveExternalRedefine) || (fElementState == eActiveLocalUndefine) || (fElementState == eActiveGlobalUndefine) || (fElementState == eActiveExternalUndefine) || (fElementState == eActiveLocalAppend) || (fElementState == eActiveGlobalAppend) || (fElementState == eActiveExternalAppend) ) { if( fAttributeState == eAttributeComplete ) { @@ -233,6 +285,8 @@ namespace katrin KToolbox& toolbox = KToolbox::GetInstance(); + // define + if( fElementState == eActiveLocalDefine ) { if( toolbox.Get(fName) == nullptr ) @@ -246,7 +300,9 @@ namespace katrin VariableIt FileIt = fLocalMap->find( fName ); if( FileIt == fLocalMap->end() ) { + initmsg_debug( "creation of local variable <" << fName << "> with new value <" << fValue << ">" << eom ); fLocalMap->insert( VariableEntry( fName, fValue ) ); + //fRefCountMap[fName] = 0; } else { @@ -292,8 +348,9 @@ namespace katrin VariableIt GlobalIt = fGlobalMap->find( fName ); if( GlobalIt == fGlobalMap->end() ) { - + initmsg_debug( "creation of global variable <" << fName << "> with new value <" << fValue << ">" << eom ); fGlobalMap->insert( VariableEntry( fName, fValue ) ); + fRefCountMap[fName] = 0; } else { @@ -338,11 +395,13 @@ namespace katrin VariableIt ExternalIt = fExternalMap->find( fName ); if( ExternalIt == fExternalMap->end() ) { + initmsg_debug( "creation of external variable <" << fName << "> with new value <" << fValue << ">" << eom ); fExternalMap->insert( VariableEntry( fName, fValue ) ); + fRefCountMap[fName] = 0; } else { - initmsg( eNormal ) << "external variable <" << ExternalIt->first << "> with default value <" << fValue << "> overridden with user value <" << ExternalIt->second << ">" << eom; + initmsg( eInfo ) << "external variable <" << ExternalIt->first << "> with default value <" << fValue << "> overridden with user value <" << ExternalIt->second << ">" << eom; } } else @@ -369,11 +428,130 @@ namespace katrin return; } + // redefine + + if( fElementState == eActiveLocalRedefine ) + { + VariableIt LocalIt = fLocalMap->find( fName ); + if( LocalIt != fLocalMap->end() ) + { + initmsg_debug( "redefinition of local variable <" << fName << "> with new value <" << fValue << ">, old value was <" << LocalIt->second << ">" << eom ); + LocalIt->second = fValue; + } + else + { + VariableIt ExternalIt = fExternalMap->find( fName ); + if( ExternalIt != fExternalMap->end() ) + { + initmsg( eError ) << "tried to locally redefine external variable with name <" << fName << ">" << ret; + initmsg( eError ) << "in path <" << aToken->GetPath() << "> in file <" << aToken->GetFile() << "> at line <" << aToken->GetLine() << ">, column <" << aToken->GetColumn() << ">" << eom; + } + else + { + VariableIt GlobalIt = fGlobalMap->find( fName ); + if( GlobalIt != fGlobalMap->end() ) + { + initmsg( eError ) << "tried to locally redefine global variable with name <" << fName << ">" << ret; + initmsg( eError ) << "in path <" << aToken->GetPath() << "> in file <" << aToken->GetFile() << "> at line <" << aToken->GetLine() << ">, column <" << aToken->GetColumn() << ">" << eom; + } + else + { + initmsg( eError ) << "variable with name <" << fName << "> is not defined in this file" << ret; + initmsg( eError ) << "in path <" << aToken->GetPath() << "> in file <" << aToken->GetFile() << "> at line <" << aToken->GetLine() << ">, column <" << aToken->GetColumn() << ">" << eom; + } + } + } + + fElementState = eElementComplete; + fName.clear(); + fValue.clear(); + return; + } + + if( fElementState == eActiveGlobalRedefine ) + { + VariableIt GlobalIt = fGlobalMap->find( fName ); + if( GlobalIt != fGlobalMap->end() ) + { + initmsg_debug( "redefinition of global variable <" << fName << "> with new value <" << fValue << ">, old value was <" << GlobalIt->second << ">" << eom ); + GlobalIt->second = fValue; + } + else + { + VariableIt ExternalIt = fExternalMap->find( fName ); + if( ExternalIt != fExternalMap->end() ) + { + initmsg( eError ) << "tried to globally redefine external variable with name <" << fName << ">" << ret; + initmsg( eError ) << "in path <" << aToken->GetPath() << "> in file <" << aToken->GetFile() << "> at line <" << aToken->GetLine() << ">, column <" << aToken->GetColumn() << ">" << eom; + } + else + { + VariableIt LocalIt = fLocalMap->find( fName ); + if( LocalIt != fLocalMap->end() ) + { + initmsg( eError ) << "tried to globally redefine local variable with name <" << fName << ">" << ret; + initmsg( eError ) << "in path <" << aToken->GetPath() << "> in file <" << aToken->GetFile() << "> at line <" << aToken->GetLine() << ">, column <" << aToken->GetColumn() << ">" << eom; + } + else + { + initmsg( eError ) << "variable with name <" << fName << "> is not defined" << ret; + initmsg( eError ) << "in path <" << aToken->GetPath() << "> in file <" << aToken->GetFile() << "> at line <" << aToken->GetLine() << ">, column <" << aToken->GetColumn() << ">" << eom; + } + } + } + + fElementState = eElementComplete; + fName.clear(); + fValue.clear(); + return; + } + + if( fElementState == eActiveExternalRedefine ) + { + VariableIt ExternalIt = fExternalMap->find( fName ); + if( ExternalIt != fExternalMap->end() ) + { + initmsg_debug( "redefinition of external variable <" << fName << "> with new value <" << fValue << ">, old value was <" << ExternalIt->second << ">" << eom ); + ExternalIt->second = fValue; + } + else + { + VariableIt GlobalIt = fGlobalMap->find( fName ); + if( GlobalIt != fGlobalMap->end() ) + { + initmsg( eError ) << "tried to externally redefine global variable with name <" << fName << ">" << ret; + initmsg( eError ) << "in path <" << aToken->GetPath() << "> in file <" << aToken->GetFile() << "> at line <" << aToken->GetLine() << ">, column <" << aToken->GetColumn() << ">" << eom; + } + else + { + VariableIt LocalIt = fLocalMap->find( fName ); + if( LocalIt != fLocalMap->end() ) + { + initmsg( eError ) << "tried to externally redefine local variable with name <" << fName << ">" << ret; + initmsg( eError ) << "in path <" << aToken->GetPath() << "> in file <" << aToken->GetFile() << "> at line <" << aToken->GetLine() << ">, column <" << aToken->GetColumn() << ">" << eom; + } + else + { + initmsg( eError ) << "variable with name <" << fName << "> is not defined" << ret; + initmsg( eError ) << "in path <" << aToken->GetPath() << "> in file <" << aToken->GetFile() << "> at line <" << aToken->GetLine() << ">, column <" << aToken->GetColumn() << ">" << eom; + } + } + } + + fElementState = eElementComplete; + fName.clear(); + fValue.clear(); + return; + } + + // undefine + if( fElementState == eActiveLocalUndefine ) { VariableIt LocalIt = fLocalMap->find( fName ); if( LocalIt != fLocalMap->end() ) { + initmsg_debug( "deletion of local variable <" << fName << "> with current value <" << LocalIt->second << ">" << eom ); fLocalMap->erase( LocalIt ); } else @@ -411,6 +589,7 @@ namespace katrin VariableIt GlobalIt = fGlobalMap->find( fName ); if( GlobalIt != fGlobalMap->end() ) { + initmsg_debug( "deletion of global variable <" << fName << "> with current value <" << GlobalIt->second << ">" << eom ); fGlobalMap->erase( GlobalIt ); } else @@ -448,6 +627,7 @@ namespace katrin VariableIt ExternalIt = fExternalMap->find( fName ); if( ExternalIt != fExternalMap->end() ) { + initmsg_debug( "deletion of external variable <" << fName << "> with current value <" << ExternalIt->second << ">" << eom ); fExternalMap->erase( ExternalIt ); } else @@ -480,6 +660,122 @@ namespace katrin return; } + // append + + if( fElementState == eActiveLocalAppend ) + { + VariableIt LocalIt = fLocalMap->find( fName ); + if( LocalIt != fLocalMap->end() ) + { + initmsg_debug( "redefinition of local variable <" << fName << "> by appending value <" << fValue << ">, old value was <" << LocalIt->second << ">" << eom ); + LocalIt->second += string(LocalIt->second.empty() ? "" : fAppendValueSeparator) + fValue; + } + else + { + VariableIt ExternalIt = fExternalMap->find( fName ); + if( ExternalIt != fExternalMap->end() ) + { + initmsg( eError ) << "tried to locally append to external variable with name <" << fName << ">" << ret; + initmsg( eError ) << "in path <" << aToken->GetPath() << "> in file <" << aToken->GetFile() << "> at line <" << aToken->GetLine() << ">, column <" << aToken->GetColumn() << ">" << eom; + } + else + { + VariableIt GlobalIt = fGlobalMap->find( fName ); + if( GlobalIt != fGlobalMap->end() ) + { + initmsg( eError ) << "tried to locally append to global variable with name <" << fName << ">" << ret; + initmsg( eError ) << "in path <" << aToken->GetPath() << "> in file <" << aToken->GetFile() << "> at line <" << aToken->GetLine() << ">, column <" << aToken->GetColumn() << ">" << eom; + } + else + { + initmsg( eError ) << "variable with name <" << fName << "> is not defined in this file" << ret; + initmsg( eError ) << "in path <" << aToken->GetPath() << "> in file <" << aToken->GetFile() << "> at line <" << aToken->GetLine() << ">, column <" << aToken->GetColumn() << ">" << eom; + } + } + } + + fElementState = eElementComplete; + fName.clear(); + fValue.clear(); + return; + } + + if( fElementState == eActiveGlobalAppend ) + { + VariableIt GlobalIt = fGlobalMap->find( fName ); + if( GlobalIt != fGlobalMap->end() ) + { + initmsg_debug( "redefinition of global variable <" << fName << "> by appending value <" << fValue << ">, old value was <" << GlobalIt->second << ">" << eom ); + GlobalIt->second += string(GlobalIt->second.empty() ? "" : fAppendValueSeparator) + fValue; + } + else + { + VariableIt ExternalIt = fExternalMap->find( fName ); + if( ExternalIt != fExternalMap->end() ) + { + initmsg( eError ) << "tried to globally append to external variable with name <" << fName << ">" << ret; + initmsg( eError ) << "in path <" << aToken->GetPath() << "> in file <" << aToken->GetFile() << "> at line <" << aToken->GetLine() << ">, column <" << aToken->GetColumn() << ">" << eom; + } + else + { + VariableIt LocalIt = fLocalMap->find( fName ); + if( LocalIt != fLocalMap->end() ) + { + initmsg( eError ) << "tried to globally append to local variable with name <" << fName << ">" << ret; + initmsg( eError ) << "in path <" << aToken->GetPath() << "> in file <" << aToken->GetFile() << "> at line <" << aToken->GetLine() << ">, column <" << aToken->GetColumn() << ">" << eom; + } + else + { + initmsg( eError ) << "variable with name <" << fName << "> is not defined" << ret; + initmsg( eError ) << "in path <" << aToken->GetPath() << "> in file <" << aToken->GetFile() << "> at line <" << aToken->GetLine() << ">, column <" << aToken->GetColumn() << ">" << eom; + } + } + } + + fElementState = eElementComplete; + fName.clear(); + fValue.clear(); + return; + } + + if( fElementState == eActiveExternalAppend ) + { + VariableIt ExternalIt = fExternalMap->find( fName ); + if( ExternalIt != fExternalMap->end() ) + { + initmsg_debug( "redefinition of external variable <" << fName << "> by appending value <" << fValue << ">, old value was <" << ExternalIt->second << ">" << eom ); + ExternalIt->second += string(ExternalIt->second.empty() ? "" : fAppendValueSeparator) + fValue; + } + else + { + VariableIt GlobalIt = fGlobalMap->find( fName ); + if( GlobalIt != fGlobalMap->end() ) + { + initmsg( eError ) << "tried to externally append to global variable with name <" << fName << ">" << ret; + initmsg( eError ) << "in path <" << aToken->GetPath() << "> in file <" << aToken->GetFile() << "> at line <" << aToken->GetLine() << ">, column <" << aToken->GetColumn() << ">" << eom; + } + else + { + VariableIt LocalIt = fLocalMap->find( fName ); + if( LocalIt != fLocalMap->end() ) + { + initmsg( eError ) << "tried to externally append to local variable with name <" << fName << ">" << ret; + initmsg( eError ) << "in path <" << aToken->GetPath() << "> in file <" << aToken->GetFile() << "> at line <" << aToken->GetLine() << ">, column <" << aToken->GetColumn() << ">" << eom; + } + else + { + initmsg( eError ) << "variable with name <" << fName << "> is not defined" << ret; + initmsg( eError ) << "in path <" << aToken->GetPath() << "> in file <" << aToken->GetFile() << "> at line <" << aToken->GetLine() << ">, column <" << aToken->GetColumn() << ">" << eom; + } + } + } + + fElementState = eElementComplete; + fName.clear(); + fValue.clear(); + return; + } + return; } @@ -588,10 +884,10 @@ namespace katrin } else { - VariableIt ExternalVariable = fExternalMap->find( tVarName ); if( ExternalVariable != fExternalMap->end() ) { + fRefCountMap[tVarName]++; tBuffer = ExternalVariable->second; } else @@ -599,14 +895,16 @@ namespace katrin VariableIt GlobalVariable = fGlobalMap->find( tVarName ); if( GlobalVariable != fGlobalMap->end() ) { + fRefCountMap[tVarName]++; tBuffer = GlobalVariable->second; } else { - VariableIt FileVariable = fLocalMap->find( tVarName ); - if( FileVariable != fLocalMap->end() ) + VariableIt LocalVariable = fLocalMap->find( tVarName ); + if( LocalVariable != fLocalMap->end() ) { - tBuffer = FileVariable->second; + //fRefCountMap[tVarName]++; + tBuffer = LocalVariable->second; } else if ( tNameValueSepPos != string::npos ) { diff --git a/Kommon/Core/Initialization/KVariableProcessor.hh b/Kommon/Core/Initialization/KVariableProcessor.hh index abc4f1a16..af55bcbf3 100644 --- a/Kommon/Core/Initialization/KVariableProcessor.hh +++ b/Kommon/Core/Initialization/KVariableProcessor.hh @@ -18,6 +18,9 @@ namespace katrin typedef VariableMap::iterator VariableIt; typedef VariableMap::const_iterator VariableCIt; + typedef std::map< std::string, std::uint32_t > ReferenceCountMap; + typedef ReferenceCountMap::value_type ReferenceCountEntry; + public: KVariableProcessor(); KVariableProcessor( const VariableMap& anExternalMap ); @@ -38,11 +41,18 @@ namespace katrin typedef enum { - eElementInactive, eActiveLocalDefine, eActiveGlobalDefine, eActiveExternalDefine, eActiveLocalUndefine, eActiveGlobalUndefine, eActiveExternalUndefine, eElementComplete + /* 0 */ eElementInactive, + /* 1 */ eActiveLocalDefine,eActiveGlobalDefine, eActiveExternalDefine, + /* 4 */ eActiveLocalRedefine, eActiveGlobalRedefine, eActiveExternalRedefine, + /* 7 */ eActiveLocalUndefine, eActiveGlobalUndefine, eActiveExternalUndefine, + /* 10 */ eActiveLocalAppend, eActiveGlobalAppend, eActiveExternalAppend, + /* -1 */ eElementComplete = -1 } ElementState; typedef enum { - eAttributeInactive, eActiveName, eActiveValue, eAttributeComplete + /* 0 */ eAttributeInactive, + /* 1 */ eActiveName, eActiveValue, + /* -1 */ eAttributeComplete = -1 } AttributeState; ElementState fElementState; @@ -50,6 +60,7 @@ namespace katrin std::string fName; std::string fValue; + ReferenceCountMap fRefCountMap; // need only one instance since variable names are unique VariableMap* fExternalMap; VariableMap* fGlobalMap; VariableMap* fLocalMap; @@ -58,6 +69,7 @@ namespace katrin static const std::string fStartBracket; static const std::string fEndBracket; static const std::string fNameValueSeparator; + static const std::string fAppendValueSeparator; }; } diff --git a/Kommon/Core/Initialization/KXMLTokenizer.cc b/Kommon/Core/Initialization/KXMLTokenizer.cc index 6627cbeeb..c4f84f68b 100644 --- a/Kommon/Core/Initialization/KXMLTokenizer.cc +++ b/Kommon/Core/Initialization/KXMLTokenizer.cc @@ -76,7 +76,7 @@ namespace katrin void KXMLTokenizer::ParseBegin() { - initmsg_debug( "in begin" << eom ); + //initmsg_debug( "in begin" << eom ); ProcessToken( fBeginParsing ); fState = &KXMLTokenizer::ParseBeginFile; @@ -85,7 +85,7 @@ namespace katrin } void KXMLTokenizer::ParseBeginFile() { - initmsg_debug( "in beginfile" << eom ); + //initmsg_debug( "in beginfile" << eom ); //if file does not open then bail, otherwise go on if( fFile->Open( KFile::eRead ) == false ) @@ -139,7 +139,7 @@ namespace katrin } void KXMLTokenizer::ParseElementBeginName() { - initmsg_debug( "in elementbeginname: current character is <" << fChar << ">" << eom ) + //initmsg_debug( "in elementbeginname: current character is <" << fChar << ">" << eom ) //if at name, append char to name, then recurse if( AtOneOf( fNameChars ) ) @@ -220,7 +220,7 @@ namespace katrin } void KXMLTokenizer::ParseElementHeader() { - initmsg_debug( "in elementheader: current character is <" << fChar << ">" << eom ) + //initmsg_debug( "in elementheader: current character is <" << fChar << ">" << eom ) //if at whitespace, then recurse if( AtOneOf( fWhiteSpaceChars ) ) @@ -291,7 +291,7 @@ namespace katrin } void KXMLTokenizer::ParseElementData() { - initmsg_debug( "in elementvalue: current character is <" << fChar << ">" << eom ) + //initmsg_debug( "in elementvalue: current character is <" << fChar << ">" << eom ) //if at whitespace or value, then append character to value, recurse if( AtOneOf( fWhiteSpaceChars ) || AtOneOf( fValueChars ) ) @@ -386,7 +386,7 @@ namespace katrin } void KXMLTokenizer::ParseElementEndName() { - initmsg_debug( "in endelementname: current character is <" << fChar << ">" << eom ) + //initmsg_debug( "in endelementname: current character is <" << fChar << ">" << eom ) //if at name, then append char to name, then recurse if( AtOneOf( fNameChars ) ) @@ -433,7 +433,7 @@ namespace katrin } void KXMLTokenizer::ParseAttributeName() { - initmsg_debug( "in attributename: current character is <" << fChar << ">" << eom ) + //initmsg_debug( "in attributename: current character is <" << fChar << ">" << eom ) //if at name, then append char to name buffer, then recurse if( AtOneOf( fNameChars ) ) @@ -473,7 +473,7 @@ namespace katrin } void KXMLTokenizer::ParseAttributeValue() { - initmsg_debug( "in attributevalue; current character is <" << fChar << ">" << eom ) + //initmsg_debug( "in attributevalue; current character is <" << fChar << ">" << eom ) //if at whitespace or value, then append char to value, then recurse if( AtOneOf( fWhiteSpaceChars ) || AtOneOf( fValueChars ) ) @@ -519,7 +519,7 @@ namespace katrin } void KXMLTokenizer::ParseEndFile() { - initmsg_debug( "in endfile" << eom ); + //initmsg_debug( "in endfile" << eom ); //if at whitespace, then append char to value, then recurse if( fFile->Close() == false ) @@ -547,7 +547,7 @@ namespace katrin } void KXMLTokenizer::ParseEnd() { - initmsg_debug( "in end: current file name is <" << fFile->GetName() << ">" << eom ) + //initmsg_debug( "in end: current file name is <" << fFile->GetName() << ">" << eom ) ProcessToken( fEndParsing ); fState = &KXMLTokenizer::ParseEnd; @@ -555,7 +555,7 @@ namespace katrin } void KXMLTokenizer::ParseComment() { - initmsg_debug( "in comment: current character is <" << fChar << ">" << eom ) + //initmsg_debug( "in comment: current character is <" << fChar << ">" << eom ) //if at "-->" then prepare comment, then revert to old state if( AtExactly( fCommentEnd ) ) @@ -636,7 +636,7 @@ namespace katrin } //increment the iterator - initmsg_debug( "popping the iterator" << eom ) + //initmsg_debug( "popping the iterator" << eom ) fChar = fFile->File()->get(); //make sure that incrementing didn't put the iterator at the end @@ -692,24 +692,24 @@ namespace katrin while( tIter != aString.end() ) { //grab a character - initmsg_debug( "file character is <" << fChar << ">, comparison character is <" << *tIter << ">" << eom ) + //initmsg_debug( "file character is <" << fChar << ">, comparison character is <" << *tIter << ">" << eom ) //if that puts us at the end, try to go back and return false if( AtEnd() ) { - initmsg_debug( "hit the end" << eom ) + //initmsg_debug( "hit the end" << eom ) tMatched = false; break; } //if a mismatch is found, try to go back and return false if( fChar != *tIter ) { - initmsg_debug( "<" << fChar << "> seriously does not match <" << *tIter << ">" << eom ) + //initmsg_debug( "<" << fChar << "> seriously does not match <" << *tIter << ">" << eom ) tMatched = false; break; } - initmsg_debug( "popping the iterator" << eom ) + //initmsg_debug( "popping the iterator" << eom ) fChar = fFile->File()->get(); tIter++; @@ -718,7 +718,7 @@ namespace katrin //go back while( tIter != aString.begin() ) { - initmsg_debug( "unpopping the iterator" << eom ) + //initmsg_debug( "unpopping the iterator" << eom ) fFile->File()->unget(); tIter--; diff --git a/Kommon/Core/Utility/KConst.h b/Kommon/Core/Utility/KConst.h index 9453ee40c..9ca00fc72 100644 --- a/Kommon/Core/Utility/KConst.h +++ b/Kommon/Core/Utility/KConst.h @@ -204,7 +204,7 @@ class KConst } //Mass values for H2+, H3+, H-, D-, T2+, and He+ from NIST Chemistry WebBook, NIST Standard Reference Database Number 69, http://webbook.nist.gov/chemistry/ - + constexpr static double M_H2Plus_kg() { return 2.01533 * AtomicMassUnit_kg(); @@ -234,7 +234,7 @@ class KConst { return 1.00849 * AtomicMassUnit_eV(); } - + constexpr static double M_HePlus_kg() { return 4.002053 * AtomicMassUnit_kg(); @@ -254,15 +254,15 @@ class KConst { return 2.0146503577 * AtomicMassUnit_eV(); } - + constexpr static double M_T_kg() { - return 3.01604928178 * AtomicMassUnit_kg(); + return 3.0160495 * AtomicMassUnit_kg(); } //!< tritium atom mass in kg constexpr static double M_T_eV() { - return 3.01604928178 * AtomicMassUnit_eV(); + return 3.0160495 * AtomicMassUnit_eV(); } //!< tritium atom mass in eV/c^2 constexpr static double M_T2_kg() @@ -284,12 +284,12 @@ class KConst { return 6.0315499755 * AtomicMassUnit_eV(); } - + constexpr static double M_3He_kg() { - return 3.01602932243 * AtomicMassUnit_kg(); + return 3.0160293 * AtomicMassUnit_kg(); } - + constexpr static double M_3He_eV() { return 3.01602932243 * AtomicMassUnit_eV(); @@ -301,7 +301,7 @@ class KConst { return 4.002603254 * AtomicMassUnit_kg(); } //!< 4He mass in kg - + constexpr static double M_4He_eV() { return 4.002603254 * AtomicMassUnit_eV(); @@ -313,13 +313,13 @@ class KConst return 15.43; //eV //Value from NIST Chemistry WebBook: http://webbook.nist.gov/cgi/cbook.cgi?ID=C1333740&Mask=20 } - + constexpr static double BindingEnergy_He() { return 24.587387; //eV //Value from NIST Basic Atomic Spectroscopic Data Handbook: http://physics.nist.gov/PhysRefData/Handbook/Tables/heliumtable1.htm } - + constexpr static double Viscosity() { return 2.425E-6; diff --git a/Kommon/Core/Utility/KMessage.cxx b/Kommon/Core/Utility/KMessage.cxx index 39fc86a23..19ac07333 100644 --- a/Kommon/Core/Utility/KMessage.cxx +++ b/Kommon/Core/Utility/KMessage.cxx @@ -16,23 +16,27 @@ namespace katrin fSystemPrefix( aPrefix ), fSystemSuffix( aSuffix ), - fErrorColorPrefix( "\33[31;1m" ), + fErrorColorPrefix( "\33[31;1m" ), // bold red fErrorColorSuffix( "\33[0m" ), fErrorDescription( "ERROR" ), - fWarningColorPrefix( "\33[33;1m" ), + fWarningColorPrefix( "\33[33;1m" ), // bold yellow fWarningColorSuffix( "\33[0m" ), fWarningDescription( "WARNING" ), - fNormalColorPrefix( "\33[32;1m" ), + fNormalColorPrefix( "\33[32;1m" ), // bold green fNormalColorSuffix( "\33[0m" ), fNormalDescription( "NORMAL" ), - fDebugColorPrefix( "\33[36;1m" ), + fInfoColorPrefix( "\33[34;1m" ), // bold blue + fInfoColorSuffix( "\33[0m" ), + fInfoDescription( "INFO" ), + + fDebugColorPrefix( "\33[36;1m" ), // bold cyan fDebugColorSuffix( "\33[0m" ), fDebugDescription( "DEBUG" ), - fDefaultColorPrefix( "\33[37;1m" ), + fDefaultColorPrefix( "\33[37;1m" ), // bold white fDefaultColorSuffix( "\33[0m" ), fDefaultDescription( "UNKNOWN" ), @@ -99,6 +103,12 @@ namespace katrin fColorSuffix = &KMessage::fNormalColorSuffix; break; + case eInfo : + fColorPrefix = &KMessage::fInfoColorPrefix; + fDescription = &KMessage::fInfoDescription; + fColorSuffix = &KMessage::fInfoColorSuffix; + break; + case eDebug : fColorPrefix = &KMessage::fDebugColorPrefix; fDescription = &KMessage::fDebugDescription; @@ -219,11 +229,11 @@ namespace katrin { KMessageTable::KMessageTable() : fMessageMap(), - fFormat( cout.flags() ), - fPrecision( cout.precision() ), + fFormat( cerr.flags() ), + fPrecision( cerr.precision() ), fTerminalVerbosity( eNormal ), - fTerminalStream( &cout ), - fLogVerbosity( eNormal ), + fTerminalStream( &cerr ), + fLogVerbosity( eInfo ), fLogStream( NULL ) { } diff --git a/Kommon/Core/Utility/KMessage.h b/Kommon/Core/Utility/KMessage.h index 7229c49fc..f5598bb4c 100644 --- a/Kommon/Core/Utility/KMessage.h +++ b/Kommon/Core/Utility/KMessage.h @@ -36,7 +36,8 @@ namespace katrin static const KMessageSeverity eError = 0; static const KMessageSeverity eWarning = 1; static const KMessageSeverity eNormal = 2; - static const KMessageSeverity eDebug = 3; + static const KMessageSeverity eInfo = 3; + static const KMessageSeverity eDebug = 4; static const KMessageNewline ret = KMessageNewline(); static const KMessageOverline rret = KMessageOverline(); static const KMessageNewlineEnd eom = KMessageNewlineEnd(); @@ -108,6 +109,10 @@ namespace katrin std::string fNormalColorSuffix; std::string fNormalDescription; + std::string fInfoColorPrefix; + std::string fInfoColorSuffix; + std::string fInfoDescription; + std::string fDebugColorPrefix; std::string fDebugColorSuffix; std::string fDebugDescription; @@ -274,6 +279,7 @@ namespace xNAMESPACE\ };\ \ using katrin::eDebug;\ + using katrin::eInfo;\ using katrin::eNormal;\ using katrin::eWarning;\ using katrin::eError;\ diff --git a/Kommon/Core/Utility/KMessageBuilder.h b/Kommon/Core/Utility/KMessageBuilder.h index 7c442e8e9..502e9a9d6 100644 --- a/Kommon/Core/Utility/KMessageBuilder.h +++ b/Kommon/Core/Utility/KMessageBuilder.h @@ -50,6 +50,11 @@ namespace katrin fObject->fTerminalVerbosity = eNormal; return true; } + if( aContainer->AsReference< std::string >() == std::string( "info" ) ) + { + fObject->fTerminalVerbosity = eInfo; + return true; + } if( aContainer->AsReference< std::string >() == std::string( "debug" ) ) { fObject->fTerminalVerbosity = eDebug; @@ -74,6 +79,11 @@ namespace katrin fObject->fLogVerbosity = eNormal; return true; } + if( aContainer->AsReference< std::string >() == std::string( "info" ) ) + { + fObject->fLogVerbosity = eInfo; + return true; + } if( aContainer->AsReference< std::string >() == std::string( "debug" ) ) { fObject->fLogVerbosity = eDebug; @@ -133,6 +143,11 @@ namespace katrin fObject->SetTerminalVerbosity( eNormal ); return true; } + if( anAttribute->AsReference< std::string >() == std::string( "info" ) ) + { + fObject->SetTerminalVerbosity( eInfo ); + return true; + } if( anAttribute->AsReference< std::string >() == std::string( "debug" ) ) { fObject->SetTerminalVerbosity( eDebug ); @@ -157,6 +172,11 @@ namespace katrin fObject->SetLogVerbosity( eNormal ); return true; } + if( anAttribute->AsReference< std::string >() == std::string( "info" ) ) + { + fObject->SetLogVerbosity( eInfo ); + return true; + } if( anAttribute->AsReference< std::string >() == std::string( "debug" ) ) { fObject->SetLogVerbosity( eDebug ); @@ -213,11 +233,11 @@ namespace katrin KMessageData* tMessageData = anElement->AsPointer< KMessageData >(); if ( tMessageData->fKey == std::string("all")) { - KMessageTable::GetInstance().SetTerminalVerbosity( tMessageData->fTerminalVerbosity ); - KMessageTable::GetInstance().SetLogVerbosity( tMessageData->fLogVerbosity ); - KMessageTable::GetInstance().SetFormat( tMessageData->fFormat ); - KMessageTable::GetInstance().SetPrecision( tMessageData->fPrecision ); - return true; + KMessageTable::GetInstance().SetTerminalVerbosity( tMessageData->fTerminalVerbosity ); + KMessageTable::GetInstance().SetLogVerbosity( tMessageData->fLogVerbosity ); + KMessageTable::GetInstance().SetFormat( tMessageData->fFormat ); + KMessageTable::GetInstance().SetPrecision( tMessageData->fPrecision ); + return true; } KMessage* tMessage = KMessageTable::GetInstance().Get( tMessageData->fKey ); if( tMessage != NULL ) diff --git a/Kommon/Root/Utility/KROOTWindow.cxx b/Kommon/Root/Utility/KROOTWindow.cxx index 6442f7592..fa73c069f 100644 --- a/Kommon/Root/Utility/KROOTWindow.cxx +++ b/Kommon/Root/Utility/KROOTWindow.cxx @@ -3,57 +3,66 @@ #include "KROOTPad.h" #include "KUtilityMessage.h" +#ifdef KASPER_USE_BOOST +//#include "KPathUtils.h" +//using katrin::KPathUtils; +#endif + #include #include #include +#include using namespace std; namespace katrin { - KROOTWindow::KROOTWindow() : - fPainters(), - fPads(), - fFrame( 0 ), - fApplication( 0 ), - fCanvas( 0 ), - fCanvasWidth( 1000 ), - fCanvasHeight( 600 ), - fActive( true ), - fWriteEnabled( false ), - fPath( "" ) + KROOTWindow::KROOTWindow() : + fPainters(), + fPads(), + fFrame( 0 ), + fApplication( 0 ), + fCanvas( 0 ), + fCanvasWidth( 1000 ), + fCanvasHeight( 600 ), + fActive( true ), + fWriteEnabled( false ), + fPath( "" ) { } - KROOTWindow::~KROOTWindow() + KROOTWindow::~KROOTWindow() { return; } void KROOTWindow::Render() { - utilmsg( eNormal ) <<"KROOTWindow starts to render!"<SetPadBottomMargin(0.1); -// gStyle->SetPadRightMargin(0.1); -// gStyle->SetPadLeftMargin(0.1); -// gStyle->SetPadTopMargin(0.1); +// gStyle->SetPadRightMargin(0.1); +// gStyle->SetPadLeftMargin(0.1); +// gStyle->SetPadTopMargin(0.1); gStyle->SetTitleX( 0.5 ); gStyle->SetTitleAlign( 23 ); gStyle->SetTitleSize( 0.08 , "t" ); - if ( gApplication ) - { - fApplication = gApplication; - } - else - { - fApplication = new TApplication("My ROOT Application", 0, 0 ); - } + if ( gApplication ) + { + fApplication = gApplication; + } + else + { + fApplication = new TApplication("My ROOT Application", 0, 0 ); + } + + TQObject::Connect("TCanvas", "Closed()", "TApplication", fApplication, "Terminate()"); + TQObject::Connect("TPad", "Closed()", "TApplication", fApplication, "Terminate()"); + fCanvas = new TCanvas( fName.c_str(), fName.c_str() , 10, 10, fCanvasWidth, fCanvasHeight); - fCanvas->Connect("Closed()", "TApplication", fApplication, "Terminate()"); double tXMin(std::numeric_limits::max()); double tXMax(-1.0*std::numeric_limits::max()); @@ -64,58 +73,58 @@ namespace katrin PainterIt tIt; if ( fPainters.size() > 0 ) { - for( tIt = fPainters.begin(); tIt != fPainters.end(); tIt++ ) - { - (*tIt)->Render(); - double tLocalXMin = (*tIt)->GetXMin(); - if ( tLocalXMin < tXMin ) tXMin = tLocalXMin; - double tLocalXMax = (*tIt)->GetXMax(); - if ( tLocalXMax > tXMax ) tXMax = tLocalXMax; - double tLocalYMin = (*tIt)->GetYMin(); - if ( tLocalYMin < tYMin ) tYMin = tLocalYMin; - double tLocalYMax = (*tIt)->GetYMax(); - if ( tLocalYMax > tYMax ) tYMax = tLocalYMax; - } - - utilmsg_debug( "XMin: "<SetStats(0); - - //take axis label of last painter - KROOTPainter* tLastPainter = fPainters.at( fPainters.size() - 1 ); - if ( tLastPainter ) - { - fFrame->GetXaxis()->SetTitle( tLastPainter->GetXAxisLabel().c_str() ); - fFrame->GetYaxis()->SetTitle( tLastPainter->GetYAxisLabel().c_str() ); - } - fFrame->GetXaxis()->SetTitleSize( 0.05 ); - fFrame->GetXaxis()->SetTitleOffset( 1.0 ); - fFrame->GetXaxis()->SetLabelSize( 0.05 ); - fFrame->GetYaxis()->SetTitleSize( 0.05 ); - fFrame->GetYaxis()->SetTitleOffset( 1.0 ); - fFrame->GetYaxis()->SetLabelSize( 0.05 ); + for( tIt = fPainters.begin(); tIt != fPainters.end(); tIt++ ) + { + (*tIt)->Render(); + double tLocalXMin = (*tIt)->GetXMin(); + if ( tLocalXMin < tXMin ) tXMin = tLocalXMin; + double tLocalXMax = (*tIt)->GetXMax(); + if ( tLocalXMax > tXMax ) tXMax = tLocalXMax; + double tLocalYMin = (*tIt)->GetYMin(); + if ( tLocalYMin < tYMin ) tYMin = tLocalYMin; + double tLocalYMax = (*tIt)->GetYMax(); + if ( tLocalYMax > tYMax ) tYMax = tLocalYMax; + } + + utilmsg_debug( "XMin: "<SetStats(0); + + //take axis label of last painter + KROOTPainter* tLastPainter = fPainters.at( fPainters.size() - 1 ); + if ( tLastPainter ) + { + fFrame->GetXaxis()->SetTitle( tLastPainter->GetXAxisLabel().c_str() ); + fFrame->GetYaxis()->SetTitle( tLastPainter->GetYAxisLabel().c_str() ); + } + fFrame->GetXaxis()->SetTitleSize( 0.05 ); + fFrame->GetXaxis()->SetTitleOffset( 1.0 ); + fFrame->GetXaxis()->SetLabelSize( 0.05 ); + fFrame->GetYaxis()->SetTitleSize( 0.05 ); + fFrame->GetYaxis()->SetTitleOffset( 1.0 ); + fFrame->GetYaxis()->SetLabelSize( 0.05 ); } @@ -133,13 +142,13 @@ namespace katrin void KROOTWindow::Display() { - utilmsg( eNormal ) <<"KROOTWindow starts to display!"<cd(); - if ( fFrame ) - { - fFrame->Draw( "axis" ); - } + fCanvas->cd(); + if ( fFrame ) + { + fFrame->Draw( "axis" ); + } /* display painters */ PainterIt tIt; @@ -152,33 +161,37 @@ namespace katrin PadIt tPadIt; for( tPadIt = fPads.begin(); tPadIt != fPads.end(); tPadIt++ ) { - fCanvas->cd(); + fCanvas->cd(); (*tPadIt)->Display(); } - utilmsg( eNormal ) <<"KROOTWindow finished to display!"<SaveAs( tOutputStringRoot.c_str() ); fCanvas->SaveAs( tOutputStringPNG.c_str() ); - } + } /* write painters */ PainterIt tIt; @@ -196,7 +209,11 @@ namespace katrin if ( fActive ) { - fApplication->Run(); + if (! fApplication->IsRunning() ) + { + utilmsg( eNormal ) <<"KROOTWindow starting the TApplication!"<Run(true); + } } return; @@ -204,19 +221,19 @@ namespace katrin void KROOTWindow::AddPainter( KPainter* aPainter ) { - KROOTPainter* tPainter = dynamic_cast< KROOTPainter* >( aPainter ); + KROOTPainter* tPainter = dynamic_cast< KROOTPainter* >( aPainter ); if( tPainter != NULL ) { fPainters.push_back( tPainter ); - tPainter->SetWindow( this ); - return; + tPainter->SetWindow( this ); + return; } utilmsg( eError ) << "cannot add non-root painter <" << aPainter->GetName() << "> to root window <" << GetName() << ">" << eom; return; } void KROOTWindow::RemovePainter( KPainter* aPainter ) { - KROOTPainter* tPainter = dynamic_cast< KROOTPainter* >( aPainter ); + KROOTPainter* tPainter = dynamic_cast< KROOTPainter* >( aPainter ); if( tPainter != NULL ) { PainterIt tIt; @@ -224,9 +241,9 @@ namespace katrin { if ( (*tIt) == tPainter ) { - fPainters.erase( tIt ); - tPainter->ClearWindow( this ); - return; + fPainters.erase( tIt ); + tPainter->ClearWindow( this ); + return; } } utilmsg( eError ) << "cannot remove root painter <" << tPainter->GetName() << "> from root window <" << GetName() << ">" << eom; @@ -237,19 +254,19 @@ namespace katrin void KROOTWindow::AddWindow( KWindow* aWindow ) { - KROOTPad* tPad = dynamic_cast< KROOTPad* >( aWindow ); + KROOTPad* tPad = dynamic_cast< KROOTPad* >( aWindow ); if( tPad != NULL ) { fPads.push_back( tPad ); tPad->SetWindow( this ); - return; + return; } utilmsg( eError ) << "cannot add <" << aWindow->GetName() << "> to root window <" << GetName() << ">" << eom; return; } void KROOTWindow::RemoveWindow( KWindow* aWindow ) { - KROOTPad* tPad = dynamic_cast< KROOTPad* >( aWindow ); + KROOTPad* tPad = dynamic_cast< KROOTPad* >( aWindow ); if( tPad != NULL ) { PadIt tIt; @@ -257,9 +274,9 @@ namespace katrin { if ( (*tIt) == tPad ) { - fPads.erase( tIt ); - tPad->ClearWindow( this ); - return; + fPads.erase( tIt ); + tPad->ClearWindow( this ); + return; } } utilmsg( eError ) << "cannot remove root pad <" << tPad->GetName() << "> from root window <" << GetName() << ">" << eom; @@ -269,8 +286,8 @@ namespace katrin } TPad* KROOTWindow::GetPad() - { - return fCanvas; - } + { + return fCanvas; + } } diff --git a/Kommon/cmake/KasperDefaults.cmake b/Kommon/cmake/KasperDefaults.cmake index fad084463..03ce14dcc 100644 --- a/Kommon/cmake/KasperDefaults.cmake +++ b/Kommon/cmake/KasperDefaults.cmake @@ -88,6 +88,22 @@ file(RELATIVE_PATH REL_INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_DIR}" "${INCLUDE_INS file(RELATIVE_PATH REL_MODULE_INSTALL_DIR "${CMAKE_INSTALL_DIR}" "${MODULE_INSTALL_DIR}") set_property(GLOBAL PROPERTY MODULE_TARGETS) +if( MODULE_VERSION ) + set( ${PROJECT_NAME}_VERSION_MAJOR ${MODULE_VERSION_MAJOR} ) + set( ${PROJECT_NAME}_VERSION_MINOR ${MODULE_VERSION_MINOR} ) + set( ${PROJECT_NAME}_VERSION_PATCH ${MODULE_VERSION_PATCH} ) + set( ${PROJECT_NAME}_VERSION ${MODULE_VERSION_MAJOR}.${MODULE_VERSION_MINOR}.${MODULE_VERSION_PATCH} ) + math( EXPR ${PROJECT_NAME}_VERSION_NUMERICAL "10000*${MODULE_VERSION_MAJOR}+100*${MODULE_VERSION_MINOR}+${MODULE_VERSION_PATCH}" ) + + add_definitions( -D${PROJECT_NAME}_VERSION_MAJOR=${${PROJECT_NAME}_VERSION_MAJOR} ) + add_definitions( -D${PROJECT_NAME}_VERSION_MINOR=${${PROJECT_NAME}_VERSION_MINOR} ) + add_definitions( -D${PROJECT_NAME}_VERSION_PATCH=${${PROJECT_NAME}_VERSION_PATCH} ) + add_definitions( -D${PROJECT_NAME}_VERSION="${${PROJECT_NAME}_VERSION}" ) + add_definitions( -D${PROJECT_NAME}_VERSION_NUMERICAL=${${PROJECT_NAME}_VERSION_NUMERICAL} ) + + message(STATUS "Kasper module enabled: ${PROJECT_NAME} v${${PROJECT_NAME}_VERSION}" ) +endif() + find_package (Doxygen) find_package (Sphinx) diff --git a/Kommon/kasperenv.sh b/Kommon/kasperenv.sh index c25d75fe3..4f25fc575 100755 --- a/Kommon/kasperenv.sh +++ b/Kommon/kasperenv.sh @@ -35,10 +35,10 @@ fi export KASPERSYS -if [ -d $KASPERSYS/cache/KEMField/ ] ; then - touch $KASPERSYS/cache/KEMField/.test && KEMFIELD_CACHE=$KASPERSYS/cache/KEMField +if [ -w $KASPERSYS/cache/KEMField/ ] ; then + KEMFIELD_CACHE=$KASPERSYS/cache/KEMField else - echo "Directory $KASPERSYS/cache/KEMField/ does not exist, setting KEMField cache to $HOME/.cache/KEMField" + echo "Directory $KASPERSYS/cache/KEMField/ does not exist or is not writeable, setting KEMField cache to $HOME/.cache/KEMField" KEMFIELD_CACHE=$HOME/.cache/KEMField fi diff --git a/README.md b/README.md index c6ef0ff14..2d2d26372 100644 --- a/README.md +++ b/README.md @@ -114,4 +114,4 @@ Kassiopeia: Simulation of electric and magnetic fields and particle tracking Primary email contacts: Kasper development list: katrin-kasper@lists.kit.edu Nikolaus Trost: nikolaus.trost(at)kit.edu - Noah Oblath: nsoblath@mit.edu + Nicholas Buzinsky: buzinsky@mit.edu