Free Electron
Stratum.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 __terrain_Stratum_h__
8 #define __terrain_Stratum_h__
9 namespace fe
10 {
11 namespace ext
12 {
13 
14 /**************************************************************************//**
15  @brief Stratum RecordView
16 
17  @ingroup terrain
18 *//***************************************************************************/
19 class FE_DL_EXPORT Stratum: public Recordable
20 {
21  public:
22  Functor<I32> serial;
23  Functor<I32> phase;
24  Functor<Real> density;
25  Functor<Real> offset;
26  Functor<Real> scale;
27  Functor< sp<RecordGroup> > dataRG;
28 
29  Stratum(void) { setName("Stratum"); }
30 virtual void addFunctors(void)
31  {
33 
34  add(serial, FE_USE(":SN"));
35  add(phase, FE_SPEC("surf:phase",
36  "Bounded solid, liquid, or gas"));
37  add(density, FE_SPEC("surf:density",
38  "Mass per volume"));
39  add(offset, FE_SPEC("surf:offset",
40  "Vertical displacement"));
41  add(scale, FE_SPEC("surf:scale",
42  "Vertical amplification"));
43  add(dataRG, FE_SPEC("surf:datagroup",
44  "arbitrary surface elements"));
45  }
46 virtual void initializeRecord(void)
47  {
49 
50  phase()=StratumI::e_gas;
51  density()=1.0f;
52  offset()=0.0f;
53  scale()=1.0f;
54 
55  // replaced if loaded
56  dataRG.createAndSetRecordGroup();
57  }
58 };
59 
60 } /* namespace ext */
61 } /* namespace fe */
62 
63 #endif /* __terrain_Stratum_h__ */
void createAndSetRecordGroup(void)
Create a RecordGroup for the attribute.
Definition: RecordView.h:258
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: Stratum.h:30
virtual void addFunctors(void)
Called at instantiation to add functors.
Definition: Recordable.h:31
virtual void initializeRecord(void)
Called at instantiation to initialize attributes.
Definition: Recordable.h:37
Stratum RecordView.
Definition: Stratum.h:19
Recordable RecordView.
Definition: Recordable.h:23
virtual void initializeRecord(void)
Called at instantiation to initialize attributes.
Definition: Stratum.h:46