IFEM 90A354
HasGravityBase.h
Go to the documentation of this file.
1// $Id$
2//==============================================================================
12//==============================================================================
13
14#ifndef _HAS_GRAVITY_BASE_H
15#define _HAS_GRAVITY_BASE_H
16
17#include "IntegrandBase.h"
18#include "Vec3.h"
19
20
26{
27protected:
29 explicit HasGravityBase(unsigned char n = 0) : IntegrandBase(n) {}
30
31public:
33 virtual bool parse(const tinyxml2::XMLElement* elem);
34
36 void setGravity(double gx, double gy = 0.0, double gz = 0.0)
37 { gravity.x = gx; gravity.y = gy; gravity.z = gz; }
39 void setGravity(const Vec3& g) { gravity = g; }
40
42 const Vec3& getGravity() const { return gravity; }
43
44protected:
46};
47
48#endif
Base classes representing FEM integrands.
Representation of a point in 3D space with some basic operations.
Base class representing a FEM integrand with gravity terms.
Definition HasGravityBase.h:26
void setGravity(double gx, double gy=0.0, double gz=0.0)
Defines the gravitation vector.
Definition HasGravityBase.h:36
void setGravity(const Vec3 &g)
Defines the gravitation vector.
Definition HasGravityBase.h:39
HasGravityBase(unsigned char n=0)
The default constructor is protected to allow sub-classes only.
Definition HasGravityBase.h:29
const Vec3 & getGravity() const
Returns the gravitation vector.
Definition HasGravityBase.h:42
virtual bool parse(const tinyxml2::XMLElement *elem)
Parses a data section from an XML-element.
Definition HasGravityBase.C:20
Vec3 gravity
Gravitation vector.
Definition HasGravityBase.h:45
Base class representing a system level integrated quantity.
Definition IntegrandBase.h:42
Simple class for representing a point in 3D space.
Definition Vec3.h:27
Real & x
Reference to X-component.
Definition Vec3.h:31
Real & z
Reference to Z-component.
Definition Vec3.h:33
Real & y
Reference to Y-component.
Definition Vec3.h:32