www.mooseframework.org
Public Member Functions | List of all members
LevelSetMeshRefinementTransfer Class Reference

Copies the refinement marker from the master to the sub-application. More...

#include <LevelSetMeshRefinementTransfer.h>

Inheritance diagram for LevelSetMeshRefinementTransfer:
[legend]

Public Member Functions

 LevelSetMeshRefinementTransfer (const InputParameters &parameters)
 
virtual void initialSetup () override
 
virtual void execute () override
 

Detailed Description

Copies the refinement marker from the master to the sub-application.

Definition at line 24 of file LevelSetMeshRefinementTransfer.h.

Constructor & Destructor Documentation

◆ LevelSetMeshRefinementTransfer()

LevelSetMeshRefinementTransfer::LevelSetMeshRefinementTransfer ( const InputParameters &  parameters)

Definition at line 41 of file LevelSetMeshRefinementTransfer.C.

42  : MultiAppCopyTransfer(parameters)
43 {
44 }

Member Function Documentation

◆ execute()

void LevelSetMeshRefinementTransfer::execute ( )
overridevirtual

Definition at line 66 of file LevelSetMeshRefinementTransfer.C.

67 {
68  if (_current_execute_flag == LevelSet::EXEC_COMPUTE_MARKERS)
69  MultiAppCopyTransfer::execute();
70 
71  else if (_current_execute_flag == LevelSet::EXEC_ADAPT_MESH)
72  {
73  for (unsigned int i = 0; i < _multi_app->numGlobalApps(); i++)
74  if (_multi_app->hasLocalApp(i))
75  {
76  FEProblemBase & to_problem = _multi_app->appProblemBase(i);
77  Adaptivity & adapt = to_problem.adaptivity();
78  adapt.setAdaptivityOn(true);
79  to_problem.adaptMesh();
80  adapt.setAdaptivityOn(false);
81  }
82  }
83 }
const ExecFlagType EXEC_ADAPT_MESH
const ExecFlagType EXEC_COMPUTE_MARKERS

◆ initialSetup()

void LevelSetMeshRefinementTransfer::initialSetup ( )
overridevirtual

Definition at line 47 of file LevelSetMeshRefinementTransfer.C.

48 {
49  FEProblemBase & from_problem = _multi_app->problemBase();
50  for (unsigned int i = 0; i < _multi_app->numGlobalApps(); i++)
51  if (_multi_app->hasLocalApp(i))
52  {
53  FEProblemBase & to_problem = _multi_app->appProblemBase(i);
54  MooseVariable & to_var = to_problem.getStandardVariable(0, _to_var_name);
55  Adaptivity & adapt = to_problem.adaptivity();
56  adapt.setMarkerVariableName(to_var.name());
57  adapt.setCyclesPerStep(from_problem.adaptivity().getCyclesPerStep());
58  adapt.init(1, 0);
59  adapt.setUseNewSystem();
60  adapt.setMaxHLevel(from_problem.adaptivity().getMaxHLevel());
61  adapt.setAdaptivityOn(false);
62  }
63 }

The documentation for this class was generated from the following files: