www.mooseframework.org
LevelSetProblem.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
7 
8 #include "LevelSetProblem.h"
9 #include "MultiAppTransfer.h"
10 
11 template <>
12 InputParameters
14 {
15  InputParameters params = validParams<FEProblem>();
16  params.addClassDescription("A specilized problem class that adds a custom call to "
17  "MultiAppTransfer execution to transfer adaptivity for the level set "
18  "reinitialization.");
19  return params;
20 }
21 
22 LevelSetProblem::LevelSetProblem(const InputParameters & parameters) : FEProblem(parameters) {}
23 
24 void
26 {
27  if (!_adaptivity.isAdaptivityDue())
28  return;
29 
30  unsigned int cycles_per_step = _adaptivity.getCyclesPerStep();
31  _cycles_completed = 0;
32  for (unsigned int i = 0; i < cycles_per_step; ++i)
33  {
34 
35  execMultiAppTransfers(EXEC_CUSTOM, MultiAppTransfer::TO_MULTIAPP);
36 
37  _console << "Adaptivity step " << i + 1 << " of " << cycles_per_step << '\n';
38  // Markers were already computed once by Executioner
39  if (_adaptivity.getRecomputeMarkersFlag() && i > 0)
40  computeMarkers();
41  if (_adaptivity.adaptMesh())
42  {
43  meshChanged();
44  _cycles_completed++;
45  }
46  else
47  {
48  _console << "Mesh unchanged, skipping remaining steps..." << std::endl;
49  return;
50  }
51 
52  // Show adaptivity progress
53  _console << std::flush;
54  }
55 }
LevelSetProblem(const InputParameters &parameters)
virtual void adaptMesh() override
InputParameters validParams< LevelSetProblem >()