www.mooseframework.org
Public Member Functions | Protected Attributes | List of all members
InclinedNoDisplacementBCAction Class Reference

#include <InclinedNoDisplacementBCAction.h>

Inheritance diagram for InclinedNoDisplacementBCAction:
[legend]

Public Member Functions

 InclinedNoDisplacementBCAction (const InputParameters &params)
 
virtual void act () override
 

Protected Attributes

std::vector< VariableName > _displacements
 displacement variables More...
 
unsigned int _ndisp
 number of displacement variables More...
 
std::vector< AuxVariableName > _save_in
 auxvariables to save residuals More...
 

Detailed Description

Definition at line 15 of file InclinedNoDisplacementBCAction.h.

Constructor & Destructor Documentation

◆ InclinedNoDisplacementBCAction()

InclinedNoDisplacementBCAction::InclinedNoDisplacementBCAction ( const InputParameters &  params)

Definition at line 36 of file InclinedNoDisplacementBCAction.C.

37  : Action(params),
38  _displacements(getParam<std::vector<VariableName>>("displacements")),
39  _ndisp(_displacements.size()),
40  _save_in(getParam<std::vector<AuxVariableName>>("save_in"))
41 {
42  if (_ndisp == 1)
43  mooseError("InclinedNoDisplacementBC is specific to 2D and 3D models.");
44 
45  if (_save_in.size() != 0 && _save_in.size() != _ndisp)
46  mooseError("Number of save_in variables should equal to the number of displacement variables ",
47  _displacements.size());
48 }
std::vector< VariableName > _displacements
displacement variables
unsigned int _ndisp
number of displacement variables
std::vector< AuxVariableName > _save_in
auxvariables to save residuals

Member Function Documentation

◆ act()

void InclinedNoDisplacementBCAction::act ( )
overridevirtual

Definition at line 51 of file InclinedNoDisplacementBCAction.C.

52 {
53  const std::string kernel_name = "PenaltyInclinedNoDisplacementBC";
54 
55  // Create pressure BCs
56  for (unsigned int i = 0; i < _ndisp; ++i)
57  {
58  // Create unique kernel name for each of the components
59  std::string unique_kernel_name = kernel_name + "_" + _name + "_" + Moose::stringify(i);
60 
61  InputParameters params = _factory.getValidParams(kernel_name);
62  params.applyParameters(parameters());
63  params.set<bool>("use_displaced_mesh") = false;
64  params.set<unsigned int>("component") = i;
65  params.set<NonlinearVariableName>("variable") = _displacements[i];
66 
67  if (_save_in.size() == _ndisp)
68  params.set<std::vector<AuxVariableName>>("save_in") = {_save_in[i]};
69 
70  _problem->addBoundaryCondition(kernel_name, unique_kernel_name, params);
71  }
72 }
std::vector< VariableName > _displacements
displacement variables
unsigned int _ndisp
number of displacement variables
std::vector< AuxVariableName > _save_in
auxvariables to save residuals

Member Data Documentation

◆ _displacements

std::vector<VariableName> InclinedNoDisplacementBCAction::_displacements
protected

displacement variables

Definition at line 24 of file InclinedNoDisplacementBCAction.h.

Referenced by act(), and InclinedNoDisplacementBCAction().

◆ _ndisp

unsigned int InclinedNoDisplacementBCAction::_ndisp
protected

number of displacement variables

Definition at line 27 of file InclinedNoDisplacementBCAction.h.

Referenced by act(), and InclinedNoDisplacementBCAction().

◆ _save_in

std::vector<AuxVariableName> InclinedNoDisplacementBCAction::_save_in
protected

auxvariables to save residuals

Definition at line 30 of file InclinedNoDisplacementBCAction.h.

Referenced by act(), and InclinedNoDisplacementBCAction().


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