mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-25 21:40:33 +05:00
parallel getminmax
This commit is contained in:
parent
b5d914880a
commit
c68278cd67
@ -2380,6 +2380,9 @@ namespace netgen
|
||||
void VisualSceneSolution ::
|
||||
GetMinMax (int funcnr, int comp, double & minv, double & maxv) const
|
||||
{
|
||||
static int timer1 = NgProfiler::CreateTimer ("getminmax, vol");
|
||||
static int timer2 = NgProfiler::CreateTimer ("getminmax, surf");
|
||||
|
||||
#ifdef PARALLEL
|
||||
if (id == 0)
|
||||
{
|
||||
@ -2403,10 +2406,14 @@ namespace netgen
|
||||
|
||||
if (sol->draw_volume)
|
||||
{
|
||||
NgProfiler::RegionTimer reg1 (timer1);
|
||||
|
||||
int ne = mesh->GetNE();
|
||||
for (int i = 0; i < ne; i++)
|
||||
#pragma omp parallel for
|
||||
for (int i = 0; i < ne; i++)
|
||||
{
|
||||
bool considerElem = GetValue (sol, i, 0.333, 0.333, 0.333, comp, val);
|
||||
#pragma omp critical(getminmaxvol)
|
||||
if (considerElem)
|
||||
{
|
||||
if (val > maxv || !hasit) maxv = val;
|
||||
@ -2417,6 +2424,8 @@ namespace netgen
|
||||
}
|
||||
if (sol->draw_surface)
|
||||
{
|
||||
NgProfiler::RegionTimer reg2 (timer2);
|
||||
|
||||
int nse = mesh->GetNSE();
|
||||
for (int i = 0; i < nse; i++)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user