Free Electron
solveAS.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 __solve_solveAS_h__
8 #define __solve_solveAS_h__
9 
10 namespace fe
11 {
12 namespace ext
13 {
14 
15 class FE_DL_EXPORT AsBodyPoint :
16  public AccessorSet,
17  public Initialize<AsBodyPoint>
18 {
19  public:
20  void initialize(void)
21  {
22  add(locator, FE_USE("bdy:locator0"));
23  add(body, FE_USE("bdy:body"));
24  add(offset, FE_USE("bdy:offset"));
25  add(active, FE_USE("bdy:active"));
26  }
27  /// locator for authoring a body point
28  Accessor<Record> locator;
29  /// body record
30  Accessor<WeakRecord> body;
31  /// transform relative to body
32  Accessor<SpatialVector> offset;
33  /// active
34  Accessor<bool> active;
35 };
36 
37 /// clear signal
38 class AsClear
39  : public AccessorSet, public Initialize<AsClear>
40 {
41  public:
42  void initialize(void)
43  {
44  add( dataset, FE_USE("group"));
45  add( is, FE_USE("sim:clear"));
46  add( dfdx, FE_USE("sim:dfdx"));
47  add( dfdv, FE_USE("sim:dfdv"));
48  add( timestep, FE_USE("sim:timestep"));
49  }
50  /// dataset to accumulate force on
52  Accessor<void> is;
55  Accessor<Real> timestep;
56 };
57 
58 /// accumulate signal
60  : public AccessorSet, public Initialize<AsAccumulate>
61 {
62  public:
63  void initialize(void)
64  {
65  add( dataset, FE_USE("group"));
66  add( is, FE_USE("sim:accumulate"));
67  add( timestep, FE_USE("sim:timestep"));
68  add( dfdx, FE_USE("sim:dfdx"));
69  add( dfdv, FE_USE("sim:dfdv"));
70  }
71  /// dataset to accumulate force on
73  Accessor<void> is;
74  Accessor<Real> timestep;
77 };
78 
79 /// validate signal
81  : public AccessorSet, public Initialize<AsValidate>
82 {
83  public:
84  void initialize(void)
85  {
86  add( dataset, FE_USE("group"));
87  add( timestep, FE_USE("sim:timestep"));
88  add( valid, FE_USE("sim:valid"));
89  }
90  /// dataset to accumulate force on
92  Accessor<Real> timestep;
93  Accessor<bool> valid;
94 };
95 
96 /// update state signal
97 class AsUpdate
98  : public AccessorSet, public Initialize<AsUpdate>
99 {
100  public:
101  void initialize(void)
102  {
103  add( dataset, FE_USE("group"));
104  add( timestep, FE_USE("sim:timestep"));
105  add( is, FE_USE("sim:update"));
106  }
107  Accessor<sp<RecordGroup> > dataset;
108  Accessor<Real> timestep;
109  Accessor<void> is;
110 };
111 
112 class AsSolverParticle
113  : public AccessorSet, public Initialize<AsSolverParticle>
114 {
115  public:
116  void initialize(void)
117  {
118  add( index, FE_USE("sim:index"));
119  add( prevVelocity, FE_USE("sim:prevVelocity"));
120  add( prevLocation, FE_USE("sim:prevLocation"));
121  add( externalForce, FE_USE("sim:externalForce"));
122  }
123  Accessor<int> index;
124  Accessor<SpatialVector> prevVelocity;
125  Accessor<SpatialVector> prevLocation;
126  Accessor<SpatialVector> externalForce;
127 };
128 
129 class AsSolverParticle1D
130  : public AccessorSet, public Initialize<AsSolverParticle1D>
131 {
132  public:
133  void initialize(void)
134  {
135  add( index, FE_USE("sim:index"));
136  add( prevVelocity, FE_USE("sim:prevVelocity1d"));
137  add( prevLocation, FE_USE("sim:prevLocation1d"));
138  add( externalForce, FE_USE("sim:externalForce1d"));
139  }
140  Accessor<int> index;
141  Accessor<Real> prevVelocity;
142  Accessor<Real> prevLocation;
143  Accessor<Real> externalForce;
144 };
145 
146 
147 class AsRK2
148  : public AccessorSet, public Initialize<AsRK2>
149 {
150  public:
151  void initialize(void)
152  {
153  add( f0, FE_USE("rk2:forceTemp"));
154  add( v0, FE_USE("rk2:velocityTemp"));
155  add( l0, FE_USE("rk2:locationTemp"));
156  }
160 };
161 
162 class AsForceFilter
163  : public AccessorSet, public Initialize<AsForceFilter>
164 {
165  public:
166  void initialize(void)
167  {
168  add( impulse, FE_USE("sim:impulse"));
169  add( cap, FE_USE("sim:forceCap"));
170  add( bleed, FE_USE("sim:impulseBleed"));
171  }
172  Accessor<SpatialVector> impulse;
173  Accessor<Real> cap;
174  Accessor<Real> bleed;
175 };
176 
177 class AsLineConstrained
178  : public AccessorSet, public Initialize<AsLineConstrained>
179 {
180  public:
181  void initialize(void)
182  {
183  add( direction, FE_USE("sim:direction"));
184  }
185  Accessor<SpatialVector> direction;
186 };
187 
188 class AsPlaneConstrained
189  : public AccessorSet, public Initialize<AsPlaneConstrained>
190 {
191  public:
192  void initialize(void)
193  {
194  add( normal, FE_USE("spc:normal"));
195  }
197 };
198 
199 
200 } /* namespace ext */
201 } /* namespace fe */
202 
203 #endif /* __solve_solveAS_h__ */
204 
Set of accessors.
Definition: AccessorSet.h:18
kernel
Definition: namespace.dox:3
Per-class participation in the Initialized <> mechanism.
Definition: Initialized.h:117
clear signal
Definition: solveAS.h:38
The main data access class for the data system.
Definition: Accessor.h:128
Accessor< sp< RecordGroup > > dataset
dataset to accumulate force on
Definition: solveAS.h:91
validate signal
Definition: solveAS.h:80
Accessor< sp< RecordGroup > > dataset
dataset to accumulate force on
Definition: solveAS.h:51
update state signal
Definition: solveAS.h:97
Accessor< sp< RecordGroup > > dataset
dataset to accumulate force on
Definition: solveAS.h:72
accumulate signal
Definition: solveAS.h:59