Free Electron
GridScalarField.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 __spatial_GridScalarField_h__
8 #define __spatial_GridScalarField_h__
9 
10 #include "fe/plugin.h"
11 #include "spatial/ScalarFieldI.h"
12 #include "Space.h"
13 
14 namespace fe
15 {
16 namespace ext
17 {
18 
19 
20 /** A ScalarFieldI implementation using a Continuum (grid of points) */
21 class FE_DL_EXPORT GridScalarField :
22  virtual public ScalarFieldI,
23  public Initialize<GridScalarField>
24 {
25  public:
26 typedef Continuum<Real> t_continuum;
27 
28  GridScalarField(void);
29 virtual ~GridScalarField(void);
30 
31  void initialize(void);
32 
33  // AS ScalarFieldI
34 virtual Real sample( const SpatialVector &a_location);
35 virtual void gradient( SpatialVector &a_gradient,
36  const SpatialVector &a_location);
37 virtual void radialSet( const SpatialVector &a_location,
38  const SpatialVector &a_radius,
39  Real a_value);
40 virtual Real volume( void);
41 virtual void set( Real a_value);
42 virtual void set( const SpatialVector &a_location,
43  Real a_value);
44 virtual void add( const SpatialVector &a_location,
45  Real a_value);
46 virtual sp<SpaceI> space( void);
47 
48  void create( const sp<SpaceI> &a_space,
49  const Vector3i &a_count,
50  Real a_default = 0.0);
51 
52  t_continuum &continuum(void);
53 
54  private:
55  bool getIndex(t_continuum::t_index &a_index,
56  const SpatialVector &a_loc);
57 
58 
59  private:
60  t_continuum m_continuum;
61  Real m_volume;
62 };
63 
64 } /* namespace ext */
65 } /* namespace fe */
66 
67 #endif /* __spatial_GridScalarField_h__ */
68 
kernel
Definition: namespace.dox:3
Per-class participation in the Initialized <> mechanism.
Definition: Initialized.h:117
A ScalarFieldI implementation using a Continuum (grid of points)
Definition: GridScalarField.h:21
Scalar Field.
Definition: ScalarFieldI.h:18