Skip to content

Commit

Permalink
Undo optimization attempt (idaholab#22563)
Browse files Browse the repository at this point in the history
  • Loading branch information
dschwen committed Feb 22, 2023
1 parent eec7e74 commit 989ca5a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
3 changes: 0 additions & 3 deletions framework/include/loops/ComputeElemAuxVarsThread.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,5 @@ class ComputeElemAuxVarsThread : public ThreadedElementLoop<ConstElemRange>

bool _need_materials;

const std::vector<std::shared_ptr<AuxKernelType>> * _active_kernels;
bool _has_active_kernels;

static Threads::spin_mutex writable_variable_mutex;
};
9 changes: 4 additions & 5 deletions framework/src/loops/ComputeElemAuxVarsThread.C
Original file line number Diff line number Diff line change
Expand Up @@ -94,17 +94,16 @@ ComputeElemAuxVarsThread<AuxKernelType>::subdomainChanged()
_fe_problem.prepareMaterials(_subdomain, _tid);
_fe_problem.setActiveFEVariableCoupleableMatrixTags(needed_fe_var_matrix_tags, _tid);
_fe_problem.setActiveFEVariableCoupleableVectorTags(needed_fe_var_vector_tags, _tid);

_active_kernels = &_aux_kernels.getActiveBlockObjects(_subdomain, _tid);
_has_active_kernels = _aux_kernels.hasActiveBlockObjects(_subdomain, _tid);
}

template <typename AuxKernelType>
void
ComputeElemAuxVarsThread<AuxKernelType>::onElement(const Elem * elem)
{
if (_has_active_kernels)
if (_aux_kernels.hasActiveBlockObjects(_subdomain, _tid))
{
const std::vector<std::shared_ptr<AuxKernelType>> & kernels =
_aux_kernels.getActiveBlockObjects(_subdomain, _tid);
_fe_problem.prepare(elem, _tid);
_fe_problem.reinitElem(elem, _tid);

Expand All @@ -115,7 +114,7 @@ ComputeElemAuxVarsThread<AuxKernelType>::onElement(const Elem * elem)
if (_need_materials)
_fe_problem.reinitMaterials(elem->subdomain_id(), _tid);

for (const auto & aux : *_active_kernels)
for (const auto & aux : kernels)
{
aux->compute();

Expand Down
2 changes: 1 addition & 1 deletion framework/src/userobject/PointwiseRenormalizeVector.C
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ PointwiseRenormalizeVector::PointwiseRenormalizeVector(const InputParameters & p
if (first_var->feType() != var.feType())
paramError("v", "All supplied variables must be of the same order and family.");
// check block restriction for consistency
if (!first_var->hasBlocks(var.blocks()) || !var.hasBlocks(first_var->blocks()))
if (!first_var->hasBlocks(var.blockIDs()) || !var.hasBlocks(first_var->blockIDs()))
paramError("v", "All supplied variables must have the same block restriction.");
}

Expand Down

0 comments on commit 989ca5a

Please sign in to comment.