BornAgain  1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
RippleCosineNet Class Reference

Description

Definition at line 25 of file RippleCosineNet.h.

Inheritance diagram for RippleCosineNet:
[legend]
Collaboration diagram for RippleCosineNet:
[legend]

Public Member Functions

 RippleCosineNet (double length, double width, double height)
 
 ~RippleCosineNet () override
 
virtual std::vector< R3 > vertices () const
 Retrieves a list of the vertices constituting this concrete shape. More...
 

Static Public Attributes

static const size_t N_Circle = 24
 

Protected Attributes

std::vector< R3 > m_vertices
 List of vertices initialized during construction. More...
 

Constructor & Destructor Documentation

◆ RippleCosineNet()

RippleCosineNet::RippleCosineNet ( double  length,
double  width,
double  height 
)

Definition at line 19 of file RippleCosineNet.cpp.

20 {
21  size_t n_y = IShape3D::N_Circle + 1;
22  double y_step = width / (IShape3D::N_Circle);
23  m_vertices.resize(2 * n_y);
24  for (size_t i = 0; i < n_y; ++i) {
25  double y = i * y_step - width / 2.0;
26  double z = height * (1.0 + std::cos(2.0 * M_PI * y / width)) / 2.0;
27  m_vertices[i] = R3(length / 2.0, y, z);
28  m_vertices[n_y + i] = R3(-length / 2.0, y, z);
29  }
30 }
#define M_PI
Definition: Constants.h:44
std::vector< R3 > m_vertices
List of vertices initialized during construction.
Definition: IShape3D.h:42
static const size_t N_Circle
Definition: IShape3D.h:38

References M_PI, IShape3D::m_vertices, and IShape3D::N_Circle.

◆ ~RippleCosineNet()

RippleCosineNet::~RippleCosineNet ( )
overridedefault

Member Function Documentation

◆ vertices()

std::vector< R3 > IShape3D::vertices ( ) const
virtualinherited

Retrieves a list of the vertices constituting this concrete shape.

Definition at line 23 of file IShape3D.cpp.

24 {
25  return m_vertices;
26 }

References IShape3D::m_vertices.

Member Data Documentation

◆ m_vertices

std::vector<R3> IShape3D::m_vertices
protectedinherited

◆ N_Circle

const size_t IShape3D::N_Circle = 24
staticinherited

The documentation for this class was generated from the following files: