Skip to content

Commit

Permalink
Leave all the hooks for DiracRunner with sources != 1 in strength. Ne…
Browse files Browse the repository at this point in the history
…eds update of DiracKernel (#396)
  • Loading branch information
Sebastian Schunert committed Aug 4, 2019
1 parent 644b303 commit c55b64a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion include/other/ThreadedRecoilDiracSourceLoop.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ struct ThreadedRecoilDiracSourceLoop::MyTRIMResult
unsigned int var,
ThreadedRecoilDiracSourceLoop::DefectType type,
dof_id_type elem_id,
Real weight = 1)
Real weight)
: _location(location), _var(var), _type(type), _elem_id(elem_id), _weight(weight)
{
}
Expand Down
2 changes: 1 addition & 1 deletion src/dirackernels/MyTRIMDiracSource.C
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ MyTRIMDiracSource::MyTRIMDiracSource(const InputParameters & parameters)
_defect(getParam<MooseEnum>("defect").getEnum<ThreadedRecoilLoopBase::DefectType>()),
_trim_parameters(_rasterizer.getTrimParameters())
{
if (getParam<bool>("drop_duplicate_points") == true)
if (getParam<bool>("drop_duplicate_points"))
mooseWarning("Explicitly setting drop_duplicate_points to true will cause overlapping defects "
"to be miscounted.");
}
Expand Down
5 changes: 3 additions & 2 deletions src/other/ThreadedRecoilDiracSourceLoop.C
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,15 @@ ThreadedRecoilDiracSourceLoop::addDefectToResult(const Point & p,
Real weight,
ThreadedRecoilDiracSourceLoop::DefectType type)
{
// TODO: if weight != 1, we need to add a fractional # of results
// TODO: if weight != 1, we need to insert a weight into the DiracKernel for each
// point. That is currently not possible so still throw error here.
if (weight != 1)
mooseError("Weight != 1 is currently not supported in ThreadedRecoilDiracSourceLoop. This "
"usually occurs when setting analytical_cutoff != 0.");

const Elem * elem = (*_pl)(p);
if (elem != nullptr && var < _nvars)
_result_list.push_back(MyTRIMResult(p, var, type, elem->id()));
_result_list.push_back(MyTRIMResult(p, var, type, elem->id(), weight));
}

void
Expand Down

0 comments on commit c55b64a

Please sign in to comment.