| 62 | |
| 63 | template <class SCAL> |
| 64 | void CalcFluxProject (const S_GridFunction<SCAL> & u, |
| 65 | S_GridFunction<SCAL> & flux, |
| 66 | shared_ptr<BilinearFormIntegrator> bli, |
| 67 | bool applyd, const BitArray & domains, LocalHeap & clh) |
| 68 | { |
| 69 | static Timer timer("CalcFluxProject"); |
| 70 | RegionTimer reg (timer); |
| 71 | |
| 72 | auto fes = u.GetFESpace(); |
| 73 | auto fesflux = flux.GetFESpace(); |
| 74 | |
| 75 | shared_ptr<MeshAccess> ma = fesflux->GetMeshAccess(); |
| 76 | |
| 77 | BaseStatusHandler::PushStatus ("Post-processing"); |
| 78 | |
| 79 | |
| 80 | auto vb = bli->VB(); |
| 81 | |
| 82 | int ne = ma->GetNE(vb); |
| 83 | int dim = fes->GetDimension(); |
| 84 | int dimflux = fesflux->GetDimension(); |
| 85 | int dimfluxvec = bli->DimFlux(); |
| 86 | |
| 87 | shared_ptr<BilinearFormIntegrator> fluxbli = fesflux->GetIntegrator(vb); |
| 88 | shared_ptr<BilinearFormIntegrator> single_fluxbli = fluxbli; |
| 89 | if (dynamic_pointer_cast<BlockBilinearFormIntegrator> (single_fluxbli)) |
| 90 | single_fluxbli = dynamic_pointer_cast<BlockBilinearFormIntegrator> (single_fluxbli)->BlockPtr(); |
| 91 | |
| 92 | auto flux_evaluator = fesflux->GetEvaluator(vb); |
| 93 | if (!fluxbli) |
| 94 | { |
| 95 | cout << IM(5) << "make a symbolic integrator for CalcFluxProject" << endl; |
| 96 | auto single_evaluator = flux_evaluator; |
| 97 | if (dynamic_pointer_cast<BlockDifferentialOperator>(single_evaluator)) |
| 98 | single_evaluator = dynamic_pointer_cast<BlockDifferentialOperator>(single_evaluator)->BaseDiffOp(); |
| 99 | |
| 100 | auto trial = make_shared<ProxyFunction>(fesflux, false, false, single_evaluator, |
| 101 | nullptr, nullptr, nullptr, nullptr, nullptr); |
| 102 | auto test = make_shared<ProxyFunction>(fesflux, true, false, single_evaluator, |
| 103 | nullptr, nullptr, nullptr, nullptr, nullptr); |
| 104 | fluxbli = make_shared<SymbolicBilinearFormIntegrator> (InnerProduct(trial,test), vb, VOL); |
| 105 | single_fluxbli = fluxbli; |
| 106 | // throw Exception ("no integrator available"); |
| 107 | } |
| 108 | |
| 109 | Array<int> cnti(fesflux->GetNDof()); |
| 110 | cnti = 0; |
| 111 | |
| 112 | flux.GetVector() = 0.0; |
| 113 | |
| 114 | ProgressOutput progress (ma, "postprocessing element", ne); |
| 115 | |
| 116 | IterateElements |
| 117 | (*fesflux, vb, clh, |
| 118 | [&] (Ngs_Element ei, LocalHeap & lh) |
| 119 | { |
| 120 | HeapReset hr(lh); |
| 121 | progress.Update (); |
nothing calls this directly
no test coverage detected