Line data Source code
1 : /**********************************************************************/ 2 : /* DO NOT MODIFY THIS HEADER */ 3 : /* MAGPIE - Mesoscale Atomistic Glue Program for Integrated Execution */ 4 : /* */ 5 : /* Copyright 2017 Battelle Energy Alliance, LLC */ 6 : /* ALL RIGHTS RESERVED */ 7 : /**********************************************************************/ 8 : 9 : #include "MyTRIMRunBase.h" 10 : #include "MooseMesh.h" 11 : 12 : InputParameters 13 250 : MyTRIMRunBase::validParams() 14 : { 15 250 : InputParameters params = GeneralUserObject::validParams(); 16 500 : params.addRequiredParam<UserObjectName>("rasterizer", 17 : "MyTRIMRasterizer object to provide material data"); 18 : 19 : // we run this object once a timestep 20 250 : params.set<ExecFlagEnum>("execute_on") = EXEC_TIMESTEP_BEGIN; 21 250 : params.suppressParameter<ExecFlagEnum>("execute_on"); 22 : 23 250 : return params; 24 0 : } 25 : 26 125 : MyTRIMRunBase::MyTRIMRunBase(const InputParameters & parameters) 27 : : GeneralUserObject(parameters), 28 125 : _rasterizer(getUserObject<MyTRIMRasterizer>("rasterizer")), 29 125 : _trim_parameters(_rasterizer.getTrimParameters()), 30 125 : _nvars(_trim_parameters.nVars()), 31 125 : _pka_list(_rasterizer.getPKAList()), 32 125 : _mesh(_subproblem.mesh()), 33 250 : _dim(_mesh.dimension()) 34 : { 35 125 : if (_mesh.isDistributedMesh()) 36 0 : mooseError("MyTRIM runs currently require serial meshes."); 37 : 38 125 : if (_dim < 2 || _dim > 3) 39 0 : mooseError("TRIM simulation works in 2D or 3D only."); 40 : 41 125 : if (_dim == 2) 42 : { 43 : // make sure all nodes lie in the xy-plane 44 55 : const auto nd_end = _mesh.getMesh().nodes_end(); 45 171180 : for (auto nd = _mesh.getMesh().nodes_begin(); nd != nd_end; ++nd) 46 85535 : if ((**nd)(2) != 0.0) 47 0 : mooseError("Two dimensional meshes must lie in the z=0 plane."); 48 : } 49 125 : }