www.mooseframework.org
GeometrySphere.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* DO NOT MODIFY THIS HEADER */
3 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
4 /* */
5 /* (c) 2010 Battelle Energy Alliance, LLC */
6 /* ALL RIGHTS RESERVED */
7 /* */
8 /* Prepared by Battelle Energy Alliance, LLC */
9 /* Under Contract No. DE-AC07-05ID14517 */
10 /* With the U. S. Department of Energy */
11 /* */
12 /* See COPYRIGHT for full restrictions */
13 /****************************************************************/
14 
15 #include "GeometrySphere.h"
16 
17 template <>
20 {
22  params.addClassDescription("Snap nodes to the surface of a sphere on adaptivity");
23  params.addParam<Point>("center", "Sphere center");
24  params.addParam<Real>("radius", "Sphere radius");
25  return params;
26 }
27 
29  : GeometryBase(parameters), _center(getParam<Point>("center")), _radius(getParam<Real>("radius"))
30 {
31 }
32 
33 void
35 {
36  const Point o = node - _center;
37  const Real r = o.norm();
38  node = o * _radius / r + _center;
39 }
virtual void snapNode(Node &node)
Override this method in derived classes to implement a specific geometry.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
InputParameters validParams< GeometrySphere >()
GeometrySphere(const InputParameters &parameters)
InputParameters validParams< GeometryBase >()
Definition: GeometryBase.C:21
const Point _center
const Real _radius
void addClassDescription(const std::string &doc_string)
This method adds a description of the class that will be displayed in the input file syntax dump...
void addParam(const std::string &name, const S &value, const std::string &doc_string)
These methods add an option parameter and a documentation string to the InputParameters object...
Base class for userobjects that snap nodes to a defined geometry when adaptivity happens.
Definition: GeometryBase.h:29