Skip to content

Commit

Permalink
Create specialized RealVectorValue method of fetchDoFValues in MooseV…
Browse files Browse the repository at this point in the history
…ariableData.

Refs idaholab#13913
  • Loading branch information
cticenhour committed Aug 21, 2019
1 parent 8b2b00d commit 7925f7c
Showing 1 changed file with 105 additions and 0 deletions.
105 changes: 105 additions & 0 deletions framework/src/variables/MooseVariableData.C
Expand Up @@ -2228,6 +2228,111 @@ MooseVariableData<OutputType>::fetchDoFValues()
}
}

template <>
void
MooseVariableData<RealVectorValue>::fetchDoFValues()
{
bool is_transient = _subproblem.isTransient();

auto n = _dof_indices.size();
libmesh_assert(n);

_dof_values.resize(n);
_sys.currentSolution()->get(_dof_indices, &_dof_values[0]);

if (is_transient)
{
if (_need_u_old || _need_grad_old || _need_second_old || _need_curl_old || _need_dof_values_old)
{
_dof_values_old.resize(n);
_sys.solutionOld().get(_dof_indices, &_dof_values_old[0]);
}
if (_need_u_older || _need_grad_older || _need_second_older || _need_dof_values_older)
{
_dof_values_older.resize(n);
_sys.solutionOlder().get(_dof_indices, &_dof_values_older[0]);
}
if (_need_u_dot || _need_grad_dot || _need_dof_values_dot)
{
libmesh_assert(_sys.solutionUDot());
_dof_values_dot.resize(n);
_sys.solutionUDot()->get(_dof_indices, &_dof_values_dot[0]);
}
if (_need_u_dotdot || _need_grad_dotdot || _need_dof_values_dotdot)
{
libmesh_assert(_sys.solutionUDotDot());
_dof_values_dotdot.resize(n);
_sys.solutionUDotDot()->get(_dof_indices, &_dof_values_dotdot[0]);
}
if (_need_u_dot_old || _need_dof_values_dot_old)
{
libmesh_assert(_sys.solutionUDotOld());
_dof_values_dot_old.resize(n);
_sys.solutionUDotOld()->get(_dof_indices, &_dof_values_dot_old[0]);
}
if (_need_u_dotdot_old || _need_dof_values_dotdot_old)
{
libmesh_assert(_sys.solutionUDotDotOld());
_dof_values_dotdot_old.resize(n);
_sys.solutionUDotDotOld()->get(_dof_indices, &_dof_values_dotdot_old[0]);
}
}

if (_need_u_previous_nl || _need_grad_previous_nl || _need_second_previous_nl ||
_need_dof_values_previous_nl)
{
_dof_values_previous_nl.resize(n);
_sys.solutionPreviousNewton()->get(_dof_indices, &_dof_values_previous_nl[0]);
}

if (_sys.subproblem().safeAccessTaggedVectors())
{
auto & active_coupleable_vector_tags =
_sys.subproblem().getActiveFEVariableCoupleableVectorTags(_tid);
for (auto tag : active_coupleable_vector_tags)
if (_need_vector_tag_u[tag] || _need_vector_tag_dof_u[tag])
if (_sys.hasVector(tag) && _sys.getVector(tag).closed())
{
auto & vec = _sys.getVector(tag);
_vector_tags_dof_u[tag].resize(n);
vec.get(_dof_indices, &_vector_tags_dof_u[tag][0]);
}
}

if (_sys.subproblem().safeAccessTaggedMatrices())
{
auto & active_coupleable_matrix_tags =
_sys.subproblem().getActiveFEVariableCoupleableMatrixTags(_tid);
for (auto tag : active_coupleable_matrix_tags)
{
_matrix_tags_dof_u[tag].resize(n);
if (_need_matrix_tag_dof_u[tag] || _need_matrix_tag_u[tag])
if (_sys.hasMatrix(tag) && _sys.matrixTagActive(tag) && _sys.getMatrix(tag).closed())
{
auto & mat = _sys.getMatrix(tag);
for (unsigned i = 0; i < n; i++)
{
Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
_matrix_tags_dof_u[tag][i] = mat(_dof_indices[i], _dof_indices[i]);
}
}
}
}

if (_need_du_dot_du || _need_dof_du_dot_du)
{
_dof_du_dot_du.resize(n);
for (decltype(n) i = 0; i < n; ++i)
_dof_du_dot_du[i] = _sys.duDotDuTempl<RealVectorValue>()(i);
}
if (_need_du_dotdot_du || _need_dof_du_dotdot_du)
{
_dof_du_dotdot_du.resize(n);
for (decltype(n) i = 0; i < n; ++i)
_dof_du_dotdot_du[i] = _sys.duDotDotDuTempl<RealVectorValue>()(i);
}
}

template <>
void
MooseVariableData<RealEigenVector>::fetchDoFValues()
Expand Down

0 comments on commit 7925f7c

Please sign in to comment.