diff --git a/src/tomboulides.cpp b/src/tomboulides.cpp index f8cce032c..ea1ee45b0 100644 --- a/src/tomboulides.cpp +++ b/src/tomboulides.cpp @@ -1122,12 +1122,30 @@ void Tomboulides::computeDissipation(Averaging &average, const int iter) { tmpR1_.Add(-1.0, u_vec_); // gradient of u' - Up_gf_->SetFromTrueDofs(tmpR1_); - // vectorGrad3D(*epsi_gf_, *Up_gf_, *gradU_gf_, *gradV_gf_, *gradW_gf_); + setScalarFromVector(tmpR1_, 0, &tmpR0_); + G_op_->Mult(tmpR0_, gradU_); + setScalarFromVector(tmpR1_, 1, &tmpR0_); + G_op_->Mult(tmpR0_, gradV_); + if (dim_ == 3) { + setScalarFromVector(tmpR1_, 2, &tmpR0_); + G_op_->Mult(tmpR0_, gradW_); + } + + Mv_inv_->Mult(gradU_, tmpR1_); + gradU_ = tmpR1_; + Mv_inv_->Mult(gradV_, tmpR1_); + gradV_ = tmpR1_; + if (dim_ == 3) { + Mv_inv_->Mult(gradW_, tmpR1_); + gradW_ = tmpR1_; + } - ComputeCurl3D(*Up_gf_, *gradU_gf_); - ComputeCurl3D(*Up_gf_, *gradV_gf_); - ComputeCurl3D(*Up_gf_, *gradW_gf_); + gradU_gf_->SetFromTrueDofs(gradU_); + gradV_gf_->SetFromTrueDofs(gradV_); + if (dim_ == 3) gradW_gf_->SetFromTrueDofs(gradW_); + + // Up_gf_->SetFromTrueDofs(tmpR1_); + // vectorGrad3D(*epsi_gf_, *Up_gf_, *gradU_gf_, *gradV_gf_, *gradW_gf_); // const double *dmu = (*thermo_interface_->viscosity).HostRead(); const double *dmu = mu_total_gf_->HostRead(); @@ -1149,8 +1167,10 @@ void Tomboulides::computeDissipation(Averaging &average, const int iter) { for (int dir = 0; dir < dim_; dir++) { gradUp(1, dir) = dGradV[dof + dir * Sdof]; } - for (int dir = 0; dir < dim_; dir++) { - gradUp(2, dir) = dGradW[dof + dir * Sdof]; + if (dim_ == 3) { + for (int dir = 0; dir < dim_; dir++) { + gradUp(2, dir) = dGradW[dof + dir * Sdof]; + } } for (int i = 0; i < dim_; i++) { diff --git a/src/utils.cpp b/src/utils.cpp index 4d346f1ce..7313dc824 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -895,10 +895,6 @@ void scalarGrad3D(ParGridFunction &u, ParGridFunction &gu) { } } - // NOTE: this block seems to be broken in that the averages - // at partition bdr's becomes too small - // either zpv is too high at bdrs or gu is not summing properly - /* // Count the zones globally. gcomm.Reduce(zones_per_vdof, GroupCommunicator::Sum); gcomm.Bcast(zones_per_vdof); @@ -906,7 +902,6 @@ void scalarGrad3D(ParGridFunction &u, ParGridFunction &gu) { // Accumulate for all vdofs. gcomm.Reduce(gu.GetData(), GroupCommunicator::Sum); gcomm.Bcast(gu.GetData()); - */ // Compute means. for (int dir = 0; dir < dim; dir++) {