| 41 | |
| 42 | template <typename MIR, typename T, ORDERING ORD> |
| 43 | void T_Evaluate (const MIR & mir, BareSliceMatrix<T,ORD> values) const |
| 44 | { |
| 45 | // static Timer t(string("FECF - T_Evaluate")+typeid(T).name()); |
| 46 | // RegionTracer reg(TaskManager::GetThreadId(), t); |
| 47 | |
| 48 | LocalHeapMem<10000> lh("fecoef::eval"); |
| 49 | auto tid = TaskManager::GetThreadId(); |
| 50 | [[maybe_unused]] auto fe = fes[tid]; |
| 51 | [[maybe_unused]] auto elvec = elvecs[tid]; |
| 52 | |
| 53 | if constexpr (is_same<MIR, BaseMappedIntegrationRule>::value && |
| 54 | is_same<T,double>::value) |
| 55 | { |
| 56 | diffop->Apply(*fe, mir, *elvec, Trans(values), lh); |
| 57 | } |
| 58 | if constexpr (is_same<MIR, BaseMappedIntegrationRule>::value && |
| 59 | is_same<T,AutoDiffDiff<1,double>>::value) |
| 60 | { |
| 61 | Matrix<> tmp(mir.Size(), Dimension()); |
| 62 | diffop->Apply(*fe, mir, *elvec, tmp, lh); |
| 63 | values.AddSize(mir.Size(), Dimension()) = Trans(tmp); |
| 64 | } |
| 65 | else if constexpr (is_same<MIR, SIMD_BaseMappedIntegrationRule>::value && |
| 66 | is_same<T,SIMD<double>>::value) |
| 67 | { |
| 68 | diffop->Apply(*fe, mir, *elvec, values); |
| 69 | } |
| 70 | else if constexpr (is_same<MIR, SIMD_BaseMappedIntegrationRule>::value && |
| 71 | is_same<T,AutoDiffDiff<1,SIMD<double>>>::value) |
| 72 | { |
| 73 | /* |
| 74 | BareSliceMatrix<SIMD<double>> hvalues(3*values.Dist(), &values(0).Value(), |
| 75 | DummySize(Dimension(), mir.Size())); |
| 76 | */ |
| 77 | BareSliceMatrix<SIMD<double>> hvalues(Dimension(), mir.Size(), 3*values.Dist(), &values(0).Value()); |
| 78 | |
| 79 | // Evaluate (ir, hvalues); |
| 80 | diffop->Apply(*fe, mir, *elvec, hvalues); |
| 81 | for (size_t i = 0; i < Dimension(); i++) |
| 82 | for (size_t j = mir.Size(); j-- > 0; ) |
| 83 | values(i,j) = hvalues(i,j); |
| 84 | |
| 85 | /* |
| 86 | Matrix<SIMD<double>> tmp(Dimension(), mir.Size()); |
| 87 | diffop->Apply(*fe, mir, *elvec, tmp); |
| 88 | values.AddSize(Dimension(), mir.Size()) = tmp; |
| 89 | */ |
| 90 | } |
| 91 | else |
| 92 | { |
| 93 | cout << "FECF, unhandled type: " << typeid(T).name() << endl; |
| 94 | } |
| 95 | } |
| 96 | |
| 97 | template <typename MIR, typename T, ORDERING ORD> |
| 98 | void T_Evaluate (const MIR & ir, |