Free Electron
tireAS.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 __tire_tireAS_h__
8 #define __tire_tireAS_h__
9 
10 namespace fe
11 {
12 namespace ext
13 {
14 
15 #define AsConstruct(AS) \
16  AS(void) {} \
17  AS(::fe::Record &r){ if(r.isValid()) { bind(r.layout()->scope()); }}\
18  AS(::fe::sp<::fe::Scope> a_spScope){ bind(a_spScope); }
19 
20 
21 /// @brief Tire Model
23  : public AsNamed, public Initialize<AsTireModel>
24 {
25  public:
26  AsConstruct(AsTireModel);
27  void initialize(void)
28  {
29  add(component, FE_USE("tire:component"));
30  }
31  Accessor<String> component;
32 };
33 
34 
35 /// @brief Tire
36 class AsTire
37  : public AsNamed, public Initialize<AsTire>
38 {
39  public:
40  AsConstruct(AsTire);
41  void initialize(void)
42  {
43  add(model, FE_USE("tire:model"));
44  }
45  Accessor<String> model;
46 };
47 
48 /// @brief Run Time Single Contact Tire Model
50  : public AsTire, public Initialize<AsTireLive>
51 {
52  public:
53  AsConstruct(AsTireLive);
54  void initialize(void)
55  {
56  add(force, FE_USE("sim:force"));
57  add(moment, FE_USE("tire:moment"));
58  add(transform, FE_USE("spc:transform"));
59  add(radius, FE_USE("tire:radius"));
60  add(width, FE_USE("tire:width"));
61  add(velocity, FE_USE("spc:velocity"));
62  add(angular_velocity, FE_USE("tire:angular_velocity"));
63  add(contact_radius, FE_USE("tire:contact_radius"));
64  add(inclination, FE_USE("tire:inclination"));
65  add(patch, FE_USE("tire:patch"));
66  add(spTireI, FE_USE("tire:spTireI"));
67 
68  add(inv_transform, FE_USE("spc:inv_transform"));
69  add(inv_patch, FE_USE("tire:inv_patch"));
70  }
71 
72  Accessor<t_moa_v3> force;
73  Accessor<t_moa_v3> moment;
74  Accessor<t_moa_real> radius;
76  Accessor<t_moa_xform> transform;
77  Accessor<t_moa_v3> velocity;
78  Accessor<t_moa_v3> angular_velocity;
79  Accessor<t_moa_real> contact_radius;
80  Accessor<t_moa_real> inclination;
82  Accessor< sp<TireI> > spTireI;
83 
84  Accessor<t_moa_xform> inv_transform;
85  Accessor<t_moa_xform> inv_patch;
86 };
87 
88 /// @brief Rig to Tire mount
89 class AsMount
90  : public AccessorSet, public Initialize<AsMount>
91 {
92  public:
93  AsConstruct(AsMount);
94  void initialize(void)
95  {
96  add(tire, FE_USE("mount:tire"));
97  add(rig, FE_USE("mount:rig"));
98  add(transform_inv, FE_USE("spc:transform_inv"));
99  }
100 
101  Accessor<String> tire;
102  Accessor<String> rig;
103  Accessor<t_moa_xform> transform_inv;
104 };
105 
106 /// @brief
107 class AsParticlesMount
108  : public AccessorSet, public Initialize<AsParticlesMount>
109 {
110  public:
111  AsConstruct(AsParticlesMount);
112  void initialize(void)
113  {
114  add(tire, FE_USE("mount:tire"));
115  add(p0, FE_USE("mount:p0"));
116  add(p1, FE_USE("mount:p1"));
117  add(p2, FE_USE("mount:p2"));
118  add(transform_inv, FE_USE("spc:transform_inv"));
119  add(location, FE_USE("mount:at"));
120  add(inclination, FE_USE("tire:inclination"));
121  }
122 
123  Accessor<String> tire;
127  Accessor<t_moa_xform> transform_inv;
128  Accessor<t_moa_v3> location;
129  Accessor<t_moa_real> inclination;
130 };
131 
132 /// @brief
133 class AsRigParticlesMount
134  : public AsParticlesMount, public Initialize<AsRigParticlesMount>
135 {
136  public:
137  AsConstruct(AsRigParticlesMount);
138  void initialize(void)
139  {
140  add(rig, FE_USE("mount:rig"));
141  }
142 
143  Accessor<String> rig;
144 };
145 
146 /// @brief Ground
147 class AsGround
148  : public AccessorSet, public Initialize<AsGround>
149 {
150  public:
151  AsConstruct(AsGround);
152  void initialize(void)
153  {
154  add(height, FE_USE("ground:height"));
155  }
156 
157  Accessor<t_moa_real> height;
158 };
159 
160 
161 /// @brief Tire Test Rig
162 class AsRig
163  : public AsNamed, public Initialize<AsRig>
164 {
165  public:
166  AsConstruct(AsRig);
167  void initialize(void)
168  {
169  add(inclination, FE_USE("rig:inclination"));
170  add(location, FE_USE("rig:location"));
171  add(load, FE_USE("rig:load"));
172  add(pitch, FE_USE("rig:pitch"));
173 
174  add(alpha, FE_USE("rig:alpha"));
175  add(velocity, FE_USE("rig:velocity"));
176  add(kappa, FE_USE("rig:kappa"));
177  add(free_wheel, FE_USE("rig:free_wheel"));
178  add(incline_floor, FE_USE("rig:incline_floor"));
179  add(solve_extract, FE_USE("rig:solve_extract"));
180 
181  add(structure, FE_USE("rig:structure"));
182  add(root, FE_USE("rig:root"));
183 
184  add(floor, FE_USE("rig:floor"));
185  }
186 
187  Accessor<t_moa_real> inclination;
188  Accessor<t_moa_v3> location;
190  Accessor<t_moa_real> pitch;
191 
192  Accessor<t_moa_real> alpha;
193  Accessor<t_moa_real> velocity;
194  Accessor<t_moa_real> kappa;
195  Accessor<bool> free_wheel;
196  Accessor<bool> incline_floor;
197  Accessor<bool> solve_extract;
198 
199  Accessor< sp<RecordGroup> > structure;
200  Accessor< Record > root;
201 
203 };
204 
205 /// @brief Tire Test Rig Live
207  : public AsRig, public Initialize<AsRigLive>
208 {
209  public:
210  AsConstruct(AsRigLive);
211  void initialize(void)
212  {
213  add(alpha_frequency, FE_USE("rig:alphaFrequency"));
214  add(pnt_velocity, FE_USE("rig:pnt_velocity"));
215  add(force_accum, FE_USE("sim:force_accum"));
216  add(moment_accum, FE_USE("sim:moment_accum"));
217  add(force, FE_USE("sim:force"));
218  add(moment, FE_USE("sim:moment"));
219  }
220 
221  Accessor<t_moa_real> alpha_frequency;
222  Accessor<t_moa_v3> pnt_velocity;
223  Accessor<t_accum_v3> force_accum;
224  Accessor<t_accum_v3> moment_accum;
225  Accessor<t_moa_v3> force;
226  Accessor<t_moa_v3> moment;
227 };
228 
229 /// @brief
230 class AsSoft
231  : public AsNamed, public Initialize<AsSoft>
232 {
233  public:
234  AsConstruct(AsSoft);
235  void initialize(void)
236  {
237  add(solve_extract, FE_USE("soft:solve_extract"));
238  add(structure, FE_USE("soft:structure"));
239  }
240 
241  Accessor<bool> solve_extract;
242 
243  Accessor< sp<RecordGroup> > structure;
244 };
245 
246 #if 1
247 class AsLocatorRigBinding
248  : public AccessorSet, public Initialize<AsLocatorRigBinding>
249 {
250  public:
251  AsConstruct(AsLocatorRigBinding);
252  void initialize(void)
253  {
254  add(rig, FE_USE("moa:rig"));
255  add(locator, FE_USE("moa:locator"));
256  }
257 
259  Accessor<WeakRecord> locator;
260 };
261 
262 class AsLocatorFromPoints
263  : public AsLocator, public Initialize<AsLocatorFromPoints>
264 {
265  public:
266  AsConstruct(AsLocatorFromPoints);
267  void initialize(void)
268  {
269  add(p0, FE_USE("mount:p0"));
270  add(p1, FE_USE("mount:p1"));
271  add(p2, FE_USE("mount:p2"));
272  }
276 };
277 
278 class AsForceLocator
279  : public AsLocator, public Initialize<AsForceLocator>
280 {
281  public:
282  AsConstruct(AsForceLocator);
283  void initialize(void)
284  {
285  add(force, FE_USE("sim:force"));
286  add(moment, FE_USE("sim:moment"));
287  add(velocity, FE_USE("spc:velocity"));
288  }
289  Accessor<t_moa_v3> force;
290  Accessor<t_moa_v3> moment;
291  Accessor<t_moa_v3> velocity;
292 };
293 
294 
295 class AsLocatorFromEuler
296  : public AsLocator, public Initialize<AsLocatorFromEuler>
297 {
298  public:
299  AsConstruct(AsLocatorFromEuler);
300  void initialize(void)
301  {
302  add(location, FE_USE("spc:at"));
303  add(zyx, FE_USE("frame:zyx"));
304  }
305  Accessor<t_moa_v3> location;
306  Accessor<t_moa_v3> zyx;
307 };
308 
309 
310 /// This contact data model is such that there is no memory lifecycling.
311 /// Contacts pre-exist, and are filled in by a system
313  : public AccessorSet, public Initialize<AsContact>
314 {
315  public:
316  AsConstruct(AsContact);
317  void initialize(void)
318  {
319  add(transform, FE_USE("contact:transform"));
320  }
321 
322  Accessor<t_moa_xform> transform;
323 
324  t_moa_v3 &contact(const WeakRecord &a_r)
325  { return transform(a_r).translation(); }
326  t_moa_v3 &normal(const WeakRecord &a_r)
327  { return transform(a_r).up(); }
328  t_moa_v3 &tangent(const WeakRecord &a_r)
329  { return transform(a_r).direction(); }
330  t_moa_v3 &binormal(const WeakRecord &a_r)
331  { return transform(a_r).left(); }
332 };
333 
334 class AsContactLive
335  : public AsContact, public Initialize<AsContactLive>
336 {
337  public:
338  AsConstruct(AsContactLive);
339  void initialize(void)
340  {
341  add(velocity, FE_USE("contact:velocity"));
342  add(slide, FE_USE("contact:slide"));
343  }
344 
345  Accessor<t_moa_v3> velocity;
346  Accessor<t_moa_v2> slide;
347 };
348 
349 class AsSurface
350  : public AccessorSet, public Initialize<AsSurface>
351 {
352  public:
353  AsConstruct(AsSurface);
354  void initialize(void)
355  {
356  add(transform, FE_USE("spc:transform"));
357  add(velocity, FE_USE("spc:velocity"));
358  }
359  Accessor<t_moa_xform> transform;
360  Accessor<t_moa_v3> velocity;
361 
362 };
363 
364 class AsSurfacePlane
365  : public AsSurface, public Initialize<AsSurfacePlane>
366 {
367  public:
368  AsConstruct(AsSurfacePlane);
369  void initialize(void)
370  {
371  add(is, FE_USE("is:plane"));
372  }
373  Accessor<void> is;
374 
375 };
376 
377 class AsSurfaceLive
378  : public AsSurface, public Initialize<AsSurfaceLive>
379 {
380  public:
381  AsConstruct(AsSurfaceLive);
382  void initialize(void)
383  {
384  add(spSurfaceI, FE_USE("tire:spSurfaceI"));
385  }
386  Accessor< sp<SurfaceI> > spSurfaceI;
387 
388 };
389 
390 #endif
391 
392 } /* namespace ext */
393 } /* namespace fe */
394 
395 #endif /* __tire_tireAS_h__ */
396 
Tire Test Rig.
Definition: tireAS.h:162
Tire Test Rig Live.
Definition: tireAS.h:206
Set of accessors.
Definition: AccessorSet.h:18
Tire.
Definition: tireAS.h:36
Tire Model.
Definition: tireAS.h:22
kernel
Definition: namespace.dox:3
Ground.
Definition: tireAS.h:147
This contact data model is such that there is no memory lifecycling.
Definition: tireAS.h:312
Per-class participation in the Initialized <> mechanism.
Definition: Initialized.h:117
Run Time Single Contact Tire Model.
Definition: tireAS.h:49
Named Records.
Definition: datatoolAS.h:134
Something with a location in simulation.
Definition: moaAS.h:216
Non-persistent reference to an instance of a Layout.
Definition: WeakRecordSB.h:17
Rig to Tire mount.
Definition: tireAS.h:89