/// <summary>
        /// Executes the post-processor
        /// </summary>
        /// <returns></returns>
        public SimulationOutput Run()
        {
            if (_virtualBoundaryType.IsSurfaceVirtualBoundary())
            {
                var photon = new Photon();
                if (_ispMCPostProcessor)
                {
                    foreach (var dp in _pMCDatabase.DataPoints)
                    {
                        photon.DP = dp.PhotonDataPoint;
                        photon.History.SubRegionInfoList = dp.CollisionInfo;
                        _detectorController.Tally(photon);
                    }
                }
                else // "standard" post-processor
                {
                    foreach (var dp in _photonDatabase.DataPoints)
                    {
                        photon.DP = dp;
                        _detectorController.Tally(photon);
                    }
                }
            }

            _detectorController.NormalizeDetectors(_databaseInput.N);

            var postProcessedOutput = new SimulationOutput(_databaseInput, _detectors);

            return(postProcessedOutput);
        }
示例#2
0
        /// <summary>
        /// Executes the post-processor
        /// </summary>
        /// <returns></returns>
        public SimulationOutput Run()
        {
            var stopwatch = System.Diagnostics.Stopwatch.StartNew();

            if (_virtualBoundaryType.IsSurfaceVirtualBoundary())
            {
                var photon = new Photon();
                if (_ispMCPostProcessor)
                {
                    foreach (var dp in _pMCDatabase.DataPoints)
                    {
                        photon.DP = dp.PhotonDataPoint;
                        photon.History.SubRegionInfoList = dp.CollisionInfo;
                        _detectorController.Tally(photon);
                    }
                }
                else // "standard" post-processor
                {
                    foreach (var dp in _photonDatabase.DataPoints)
                    {
                        photon.DP = dp;
                        _detectorController.Tally(photon);
                    }
                }
            }

            _detectorController.NormalizeDetectors(_databaseInput.N);

            var postProcessedOutput = new SimulationOutput(_databaseInput, _detectors);

            stopwatch.Stop();

            Console.WriteLine("Monte Carlo Post Processor complete (time ="
                              + stopwatch.ElapsedMilliseconds / 1000f + " seconds).\r");

            return(postProcessedOutput);
        }