| 7819 | |
| 7820 | |
| 7821 | void PrecomputeCacheCF (const Array<CoefficientFunction*> & cachecfs, BaseMappedIntegrationRule & mir, |
| 7822 | LocalHeap & lh) |
| 7823 | { |
| 7824 | // static Timer t("Precompute CacheCF"); |
| 7825 | // RegionTracer reg(TaskManager::GetThreadId(), t); |
| 7826 | |
| 7827 | auto & trafo = mir.GetTransformation(); |
| 7828 | ProxyUserData * ud = static_cast<ProxyUserData*> (trafo.userdata); |
| 7829 | if (!ud) throw Exception ("don't have a userdata"); |
| 7830 | |
| 7831 | new (&ud->caches) FlatArray<pair<const CoefficientFunction*, void*>> (cachecfs.Size(), lh); |
| 7832 | |
| 7833 | for (int i = 0; i < cachecfs.Size(); i++) |
| 7834 | { |
| 7835 | ud->caches[i].first = cachecfs[i]; |
| 7836 | // or complex ... |
| 7837 | if (cachecfs[i]->IsComplex()) |
| 7838 | { |
| 7839 | auto * mat = new (lh) FlatMatrix<Complex>(mir.Size(), cachecfs[i]->Dimension(), lh); |
| 7840 | static_cast<CacheCoefficientFunction*>(cachecfs[i])->Func() -> Evaluate (mir, *mat); |
| 7841 | ud->caches[i].second = mat; |
| 7842 | } |
| 7843 | else |
| 7844 | { |
| 7845 | auto * mat = new (lh) FlatMatrix<double>(mir.Size(), cachecfs[i]->Dimension(), lh); |
| 7846 | static_cast<CacheCoefficientFunction*>(cachecfs[i])->Func() -> Evaluate (mir, *mat); |
| 7847 | ud->caches[i].second = mat; |
| 7848 | } |
| 7849 | |
| 7850 | } |
| 7851 | |
| 7852 | } |
| 7853 | |
| 7854 | |
| 7855 |
no test coverage detected