Free Electron
Particle.h
Go to the documentation of this file.
1 /* Copyright (C) 2003-2021 Free Electron Organization
2  Any use of this software requires a license. If a valid license
3  was not distributed with this file, visit freeelectron.org. */
4 
5 /** @file */
6 
7 #ifndef __element_Particle_h__
8 #define __element_Particle_h__
9 namespace fe
10 {
11 namespace ext
12 {
13 
14 /**************************************************************************//**
15  @brief Particle RecordView
16 
17  @ingroup element
18 *//***************************************************************************/
19 class FE_DL_EXPORT Particle: public Sphere
20 {
21  public:
22  Functor<SpatialVector> velocity;
24  Functor<SpatialVector> impulse;
25  Functor<F32> mass;
26  Functor<I32> serial;
27  Functor<I32> tempI32;
28 
29  Particle(void) { setName("Particle"); }
30 virtual void addFunctors(void)
31  {
33 
34  add(velocity, FE_SPEC("spc:velocity",
35  "Magnitude and direction of travel"));
36  add(force, FE_SPEC("sim:force",
37  "Accumulator of consistant proximal influence"));
38  add(impulse, FE_SPEC("sim:impulse",
39  "Accumulator of instantaneous proximal impact"));
40 
41  add(mass, FE_SPEC("sim:mass","Scalar of substance"));
42  add(serial, FE_USE(":SN"));
43  add(tempI32, FE_SPEC("node:tempI32","Reusable cache"));
44  }
45 virtual void initializeRecord(void)
46  {
48 
49  mass()=1.0f;
50  set(velocity());
51  set(force());
52  set(impulse());
53  tempI32()=0;
54  }
55 };
56 
57 } /* namespace ext */
58 } /* namespace fe */
59 
60 #endif /* __element_Particle_h__ */
virtual void addFunctors(void)
Called at instantiation to add functors.
Definition: Sphere.h:36
kernel
Definition: namespace.dox:3
Bound accessor in a RecordView.
Definition: RecordView.h:147
virtual void addFunctors(void)
Called at instantiation to add functors.
Definition: Particle.h:30
virtual void initializeRecord(void)
Called at instantiation to initialize attributes.
Definition: Particle.h:45
Particle RecordView.
Definition: Particle.h:19
virtual void initializeRecord(void)
Called at instantiation to initialize attributes.
Definition: Sphere.h:42
Sphere RecordView.
Definition: Sphere.h:28