| 181 | |
| 182 | template <typename MIR, typename T, ORDERING ORD> |
| 183 | void T_Evaluate_impl (const MIR & ir, BareSliceMatrix<T,ORD> values) const |
| 184 | { |
| 185 | // #ifdef FIRSTDRAFT |
| 186 | LocalHeapMem<2000000> lh("interpolate"); |
| 187 | |
| 188 | // static Timer t("interpolate"); |
| 189 | // RegionTracer reg(TaskManager::GetThreadId(), t); |
| 190 | |
| 191 | const ElementTransformation & trafo = ir.GetTransformation(); |
| 192 | // const MeshAccess & ma = *static_cast<const MeshAccess*> (trafo.GetMesh()); |
| 193 | ElementId ei = trafo.GetElementId(); |
| 194 | auto & fel = fes->GetFE(ei, lh); |
| 195 | // int dim = fes->GetDimension(); |
| 196 | int dim = func->Dimension(); |
| 197 | |
| 198 | |
| 199 | // cout << " eval for ei " << ei << endl; |
| 200 | // cout << " ndof = " << fel.GetNDof() << endl; |
| 201 | |
| 202 | // if (dim != 1) |
| 203 | // { throw Exception("Dim != 1 porbably does not work (yet)"); } |
| 204 | |
| 205 | /** func * dual_shape **/ |
| 206 | FlatVector<T> elflux(fel.GetNDof(), lh); |
| 207 | |
| 208 | FlatVector<T> elfluxadd(fel.GetNDof(), lh); elflux = 0; // non-SIMD version |
| 209 | for (auto el_vb : fes->GetDualShapeNodes(trafo.VB())) |
| 210 | { |
| 211 | if (el_vb == VOL) |
| 212 | { |
| 213 | IntegrationRule ir(fel.ElementType(), 2*fel.Order()+bonus_intorder); |
| 214 | auto & mir = trafo(ir, lh); |
| 215 | FlatMatrix<T> mflux(ir.Size(), dim, lh); |
| 216 | func->Evaluate (mir, mflux); |
| 217 | for (size_t j : Range(mir)) |
| 218 | mflux.Row(j) *= mir[j].GetWeight(); |
| 219 | dual_diffop -> ApplyTrans (fel, mir, mflux, elfluxadd, lh); |
| 220 | elflux += elfluxadd; |
| 221 | } |
| 222 | else |
| 223 | { |
| 224 | Facet2ElementTrafo f2el (fel.ElementType(), el_vb); |
| 225 | for (int locfnr : Range(f2el.GetNFacets())) |
| 226 | { |
| 227 | // SIMD does not work yet |
| 228 | // SIMD_IntegrationRule irfacet(f2el.FacetType(locfnr), 2 * fel.Order()); |
| 229 | IntegrationRule irfacet(f2el.FacetType(locfnr), 2*fel.Order()+bonus_intorder); |
| 230 | auto & irvol = f2el(locfnr, irfacet, lh); |
| 231 | auto & mir = trafo(irvol, lh); |
| 232 | mir.ComputeNormalsAndMeasure(fel.ElementType(), locfnr); |
| 233 | |
| 234 | // FlatMatrix<T,ORD> mflux(dim, irfacet.Size(), lh); |
| 235 | // func->Evaluate (mir, mflux); |
| 236 | // for (size_t j : Range(mir)) |
| 237 | // mflux.Col(j) *= mir[j].GetWeight(); |
| 238 | // SIMD only |
| 239 | // dual_diffop->AddTrans (fel, mir, mflux, elflux); |
| 240 | // NON-simd version |
nothing calls this directly
no test coverage detected