| 299 | |
| 300 | |
| 301 | void NumProcTestJS::LaplaceTiming() |
| 302 | { |
| 303 | cout << "laplace timing" << endl; |
| 304 | const MeshAccess & ma = pde.GetMeshAccess(); |
| 305 | |
| 306 | clock_t starttime, endtime; |
| 307 | starttime = clock(); |
| 308 | |
| 309 | LaplaceIntegrator<2,FE_Trig1> lpi (new ConstantCoefficientFunction(1)); |
| 310 | ElasticityIntegrator<2> eli (new ConstantCoefficientFunction(1), |
| 311 | new ConstantCoefficientFunction(0.2)); |
| 312 | |
| 313 | SourceIntegrator<2> source (new ConstantCoefficientFunction(1)); |
| 314 | |
| 315 | |
| 316 | // BlockBilinearFormIntegrator<LaplaceIntegrator<2> > blpi(lpi, 3); |
| 317 | // BlockBilinearFormIntegrator<LaplaceIntegrator<2,FE_Trig1> > blpi(lpi, 3); |
| 318 | |
| 319 | BilinearFormIntegrator * bfi = &lpi; |
| 320 | LinearFormIntegrator * lfi = &source; |
| 321 | |
| 322 | /* |
| 323 | ElasticityIntegrator eli (2, new ConstantCoefficientFunction(1), |
| 324 | new ConstantCoefficientFunction(0.2)); |
| 325 | */ |
| 326 | FE_Trig1 trig; |
| 327 | ElementTransformation eltrans; |
| 328 | // DenseMatrix elmat(trig.GetNDof()); |
| 329 | LocalHeap locheap (100000); |
| 330 | |
| 331 | int n = 1000000; |
| 332 | |
| 333 | ngbla::FlatMatrix<double> elmat; |
| 334 | ngbla::FlatVector<double> elvec(3, locheap); |
| 335 | |
| 336 | |
| 337 | void * heapp = locheap.GetPointer(); |
| 338 | |
| 339 | for (int i = 1; i <= n; i++) |
| 340 | { |
| 341 | locheap.CleanUp(heapp); |
| 342 | ma.GetElementTransformation (1, eltrans, locheap); |
| 343 | bfi->CalcElementMatrix(trig, eltrans, elmat, locheap); |
| 344 | // elvec.Assign (lfi->CalcElementVector (trig, eltrans, locheap)); |
| 345 | // AssembleLaplace2 (eltrans, elmat, &locheap); |
| 346 | } |
| 347 | |
| 348 | cout << "elmat = " << elmat << endl; |
| 349 | cout << "elvec = " << elvec << endl; |
| 350 | |
| 351 | endtime = clock(); |
| 352 | cout << "sec per 1E6 els = " << 1e6 / n * double(endtime - starttime)/CLOCKS_PER_SEC << endl; |
| 353 | |
| 354 | /* |
| 355 | Laplace, trig1: 169000 |
| 356 | Laplace, tet1: 141000 |
| 357 | |
| 358 | Elast, trig1: 103000 |
nothing calls this directly
no test coverage detected