Skip to content

Commit

Permalink
Clean up some tests
Browse files Browse the repository at this point in the history
remove parameter from Mortar base
Add flags to compute only rows of R and J
Add tensor mechanics case to check the row assembly
Verify that tests run correctly
  • Loading branch information
ttruster committed Jan 11, 2023
2 parents 06c2d09 + a77fef9 commit 3afaf21
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 14 deletions.
2 changes: 0 additions & 2 deletions framework/include/base/Assembly.h
Original file line number Diff line number Diff line change
Expand Up @@ -1741,7 +1741,6 @@ class Assembly
const std::set<TagID> & vector_tags,
Real scaling_factor);

#ifdef MOOSE_GLOBAL_AD_INDEXING
/**
* Process the value and \p derivatives() data of a vector of \p ADReals. When using global
* indexing, this method simply caches the value (residual) for the provided \p vector_tags and
Expand All @@ -1754,7 +1753,6 @@ class Assembly
const std::set<TagID> & vector_tags,
const std::set<TagID> & matrix_tags,
Real scaling_factor);
#endif

/**
* Process the \p derivatives() data of a vector of \p ADReals. When using global indexing, this
Expand Down
10 changes: 10 additions & 0 deletions framework/src/base/Assembly.C
Original file line number Diff line number Diff line change
Expand Up @@ -4827,6 +4827,16 @@ Assembly::processResidualsAndJacobian(const std::vector<ADReal> & residuals,
for (const auto j : index_range(column_indices))
cacheJacobian(row_indices[i], column_indices[j], element_matrix(i, j), matrix_tags);
}
#else
void
Assembly::processResidualsAndJacobian(const std::vector<ADReal> &,
const std::vector<dof_id_type> &,
const std::set<TagID> &,
const std::set<TagID> &,
const Real)
{
mooseError("Assembly::processResidualsAndJacobian is only supported for global AD indexing");
}
#endif

template void coordTransformFactor<Point, Real>(const SubProblem & s,
Expand Down
11 changes: 0 additions & 11 deletions framework/src/kernels/ADKernelScalarBase.C
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ ADKernelScalarBase::ADKernelScalarBase(const InputParameters & parameters)
#ifndef MOOSE_GLOBAL_AD_INDEXING
mooseError("ADKernelScalarBase only supported for global AD indexing");
#endif
#ifndef MOOSE_SPARSE_AD
mooseError("ADKernelScalarBase assembly only supported for non-sparse AD");
#endif
}

void
Expand Down Expand Up @@ -84,9 +81,6 @@ ADKernelScalarBase::computeJacobian()
if (_compute_field_residuals)
ADKernel::computeJacobian();

#ifndef MOOSE_SPARSE_AD
mooseError("ADKernelScalarBase assembly only supported for non-sparse AD");
#else
if (_compute_scalar_residuals)
{
computeScalarResidualsForJacobian();
Expand All @@ -96,7 +90,6 @@ ADKernelScalarBase::computeJacobian()
_matrix_tags,
_kappa_var_ptr->scalingFactor());
}
#endif
}

void
Expand All @@ -118,9 +111,6 @@ ADKernelScalarBase::computeResidualAndJacobian()
if (_compute_field_residuals)
ADKernel::computeResidualAndJacobian();

#ifndef MOOSE_SPARSE_AD
mooseError("ADKernelScalarBase assembly only supported for non-sparse AD");
#else
if (_compute_scalar_residuals)
{
computeScalarResidualsForJacobian();
Expand All @@ -130,7 +120,6 @@ ADKernelScalarBase::computeResidualAndJacobian()
_matrix_tags,
_kappa_var_ptr->scalingFactor());
}
#endif
}

void
Expand Down
2 changes: 1 addition & 1 deletion libmesh
Submodule libmesh updated 185 files

0 comments on commit 3afaf21

Please sign in to comment.