| 1651 | } |
| 1652 | |
| 1653 | void GridFunctionCoefficientFunction :: |
| 1654 | Evaluate (const SIMD_BaseMappedIntegrationRule & ir, |
| 1655 | BareSliceMatrix<SIMD<double>> bvalues) const |
| 1656 | { |
| 1657 | // if (gf -> GetLevelUpdated() < gf->GetFESpace()->GetMeshAccess()->GetNLevels()) |
| 1658 | if (gf -> GetLevelUpdated() < gf->GetMeshAccess()->GetNLevels()) |
| 1659 | { |
| 1660 | bvalues.AddSize(Dimension(), ir.Size()) = 0.0; |
| 1661 | return; |
| 1662 | } |
| 1663 | |
| 1664 | ProxyUserData * ud = (ProxyUserData*)ir.GetTransformation().userdata; |
| 1665 | if (ud) |
| 1666 | { |
| 1667 | if (ud->HasMemory(this) && ud->Computed(this)) |
| 1668 | { |
| 1669 | bvalues.AddSize(Dimension(), ir.Size()) = ud->GetAMemory(this); |
| 1670 | return; |
| 1671 | } |
| 1672 | } |
| 1673 | |
| 1674 | |
| 1675 | |
| 1676 | LocalHeapMem<100000> lh2("GridFunctionCoefficientFunction - Evaluate 3c"); |
| 1677 | // static Timer timer ("GFCoeffFunc::Eval-vec", NoTracing); |
| 1678 | // RegionTimer reg (timer); |
| 1679 | auto values = bvalues.AddSize(Dimension(), ir.Size()); |
| 1680 | const ElementTransformation & trafo = ir.GetTransformation(); |
| 1681 | |
| 1682 | int elnr = trafo.GetElementNr(); |
| 1683 | VorB vb = trafo.VB(); |
| 1684 | ElementId ei(vb, elnr); |
| 1685 | |
| 1686 | if (!trafo.BelongsToMesh ((void*)(fes->GetMeshAccess().get()))) |
| 1687 | { |
| 1688 | throw ExceptionNOSIMD ("SIMD - evaluation not available for different meshes"); |
| 1689 | // for (int i = 0; i < ir.Size(); i++) |
| 1690 | // Evaluate (ir[i], values.Row(i)); |
| 1691 | return; |
| 1692 | } |
| 1693 | |
| 1694 | if (!fes->DefinedOn(vb,trafo.GetElementIndex())) |
| 1695 | { |
| 1696 | values = 0.0; |
| 1697 | return; |
| 1698 | } |
| 1699 | |
| 1700 | const FiniteElement & fel = fes->GetFE (ei, lh2); |
| 1701 | int dim = fes->GetDimension(); |
| 1702 | |
| 1703 | ArrayMem<int, 50> dnums; |
| 1704 | fes->GetDofNrs (ei, dnums); |
| 1705 | |
| 1706 | VectorMem<50> elu(dnums.Size()*dim); |
| 1707 | |
| 1708 | gf->GetElementVector (comp, dnums, elu); |
| 1709 | fes->TransformVec (ei, elu, TRANSFORM_SOL); |
| 1710 | /* |
nothing calls this directly
no test coverage detected