BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
Material.cpp File Reference
Include dependency graph for Material.cpp:

Go to the source code of this file.

Functions

std::ostream & operator<< (std::ostream &ostr, const Material &m)
 
bool operator== (const Material &left, const Material &right)
 
bool operator!= (const Material &left, const Material &right)
 

Detailed Description

Implements and implements class Material.

Homepage:\n http://www.bornagainproject.org
License:\n GNU General Public License v3 or higher (see COPYING)
Authors
Scientific Computing Group at MLZ (see CITATION, AUTHORS)

Definition in file Material.cpp.

Function Documentation

◆ operator<<()

std::ostream& operator<< ( std::ostream &  ostr,
const Material m 
)

Definition at line 110 of file Material.cpp.

111 {
112  m.m_material_impl->print(ostr);
113  return ostr;
114 }
std::unique_ptr< BaseMaterialImpl > m_material_impl
Definition: Material.h:97

◆ operator==()

bool operator== ( const Material left,
const Material right 
)

Comparison operator for material wrapper (equality check)

Definition at line 116 of file Material.cpp.

117 {
118  if (left.getName() != right.getName())
119  return false;
120  if (left.magnetization() != right.magnetization())
121  return false;
122  if (left.materialData() != right.materialData())
123  return false;
124  if (left.typeID() != right.typeID())
125  return false;
126  return true;
127 }
kvector_t magnetization() const
Get the magnetization (in A/m)
Definition: Material.cpp:79
std::string getName() const
Returns the name of material.
Definition: Material.cpp:69
MATERIAL_TYPES typeID() const
Returns the type of underlying material implementation.
Definition: Material.cpp:74
complex_t materialData() const
Returns underlying material data.
Definition: Material.cpp:84

References Material::getName(), Material::magnetization(), Material::materialData(), and Material::typeID().

Here is the call graph for this function:

◆ operator!=()

bool operator!= ( const Material left,
const Material right 
)

Comparison operator for material wrapper (inequality check)

Definition at line 129 of file Material.cpp.

130 {
131  return !(left == right);
132 }