private GreenTensor CalculateGreenTensorAtoOSiteElectric(ObservationSite site) { var plan = _plansCreater.CreateForAnomalyToObservationSites(site); var transceiver = TranceiverUtils.CreateAnomalyToObservation(Model.Anomaly, site); var scalarCalculator = GreenScalarCalculator.NewAtoOElectricCalculator(Logger, Model); var scalars = scalarCalculator.Calculate(plan, transceiver); var calc = new AtoOSiteGreenTensorCalculator(Logger, Model, MemoryProvider); var segments = ScalarSegments.AllocateAndConvert(MemoryProvider, plan, scalars); var gt = calc.CalculateAtoOElectric(segments, site, MemoryLayoutOrder.AlongLateral); segments.Dispose(); return(gt); }
private GreenTensor CalculateGreenTensorElectric(SourceLayer layer, ObservationLevel level) { var plan = _plansCreater.CreateForSourceToObservation(layer, level); var transceiver = TranceiverUtils.CreateSourceToObservations(SourceThickness, layer, level); var scalarCalculator = GreenScalarCalculator.NewAtoOElectricCalculator(Logger, Model); var scalars = scalarCalculator.Calculate(plan, transceiver); using (var segments = ScalarSegments.AllocateAndConvert(MemoryProvider, plan, scalars)) { var tensorPlan = new TensorPlan(_templateTensorPlan, layer, level); _gtc.ResetKnots(); var gt = _gtc.CalculateAtoOElectric(segments, MemoryLayoutOrder.AlongVertical, tensorPlan); PerformGreenTensorFft(gt); return(gt); } }
private unsafe GreenTensor CalculateGreenTensorAtoOLevelElectric(ObservationLevel level) { using (Solver.Profiler?.StartAuto(ProfilerEvent.AtoOGreenCalc)) { var plan = _plansCreater.CreateForAnomalyToObservationLevels(level); var transceiver = TranceiverUtils.CreateAnomalyToObservation(Model.Anomaly, level); var scalarCalculator = GreenScalarCalculator.NewAtoOElectricCalculator(Logger, Model); var scalars = scalarCalculator.Calculate(plan, transceiver); using (var segments = ScalarSegments.AllocateAndConvert(MemoryProvider, plan, scalars)) { var tensorPlan = new TensorPlan(_templateTensorPlan, level); _gtc.ResetKnots(); var gt = _gtc.CalculateAtoOElectric(segments, MemoryLayoutOrder.AlongVertical, tensorPlan); PerformGreenTensorFft(gt); return(gt); } } }
private GreenTensor CalculateSymmGreenTensorAtoA() { _plan.SetOnlySymm(); var trcSymm = TranceiverUtils.CreateAnomalyToAnomalySymm(Model.Anomaly); MemoryUtils.PrintMemoryReport("Before scalars SYM", Logger, MemoryProvider); var scalarsSymm = CalculateScalars(_plan, trcSymm.ToArray()); MemoryUtils.PrintMemoryReport("After scalars SYM", Logger, MemoryProvider); using (Profiler?.StartAuto(ProfilerEvent.GreenTensorAtoA)) { GreenTensor tensor; using (Profiler?.StartAuto(ProfilerEvent.GreenTensorAtoACalc)) { MemoryUtils.PrintMemoryReport("Before tensors SYM", Logger, MemoryProvider); tensor = _tensorCalc.CalculateSymmAtoA(scalarsSymm, MemoryLayoutOrder.AlongVertical, _mirroringX); MemoryUtils.PrintMemoryReport("After tensors SYM", Logger, MemoryProvider); scalarsSymm.Dispose(); MemoryUtils.PrintMemoryReport("after SCAl Dispose SYM", Logger, MemoryProvider); } PopulateForFft(tensor, MemoryLayoutOrder.AlongVertical, _totalNxLength, true); if (_mirroringX) { AddMinusToXy(tensor); } using (Profiler?.StartAuto(ProfilerEvent.GreenTensorAtoAFft)) { PerformFftSymm(tensor, MemoryLayoutOrder.AlongVertical); } return(tensor); } }