Skip to content
Snippets Groups Projects
Commit 8db6321d authored by Mikhail Svechnikov's avatar Mikhail Svechnikov
Browse files

clang-format

parent 9c9b48bb
No related branches found
No related tags found
1 merge request!1705Not allow users to set external field, magnetization in fronting media and z-magnetization in layers
Pipeline #103156 passed
......@@ -56,7 +56,7 @@ private:
void addParameterItem(ParameterLabelItem* parent, DoubleProperty& d,
const QString& label = QString());
void addParameterItem(ParameterLabelItem* parent, VectorProperty& d);
void addMagnetizationNoZ(ParameterLabelItem *parent, VectorProperty &d);
void addMagnetizationNoZ(ParameterLabelItem* parent, VectorProperty& d);
ParameterContainerItem* parameterContainerItem();
bool allowMagneticFields() const;
......
......@@ -135,14 +135,16 @@ void LayerEditorUtil::addVectorToGrid(QGridLayout* m_gridLayout, int firstCol, V
vertically, addSpacer);
}
void LayerEditorUtil::addMagnetizationNoZToGrid(QGridLayout *m_gridLayout, int firstCol, VectorProperty &v, std::function<void (double, DoubleProperty &)> setNewValue, bool vertically, bool addSpacer)
void LayerEditorUtil::addMagnetizationNoZToGrid(
QGridLayout* m_gridLayout, int firstCol, VectorProperty& v,
std::function<void(double, DoubleProperty&)> setNewValue, bool vertically, bool addSpacer)
{
// Setting z-component is temporary disabled (see issue #654)
// When interaction with magnetic field in fronting medium is implemented,
// delete this method and use 'addVectorToGrid' instead
addMultiPropertyToGrid(m_gridLayout, firstCol, {&v.x(), &v.y()}, setNewValue,
vertically, addSpacer);
addMultiPropertyToGrid(m_gridLayout, firstCol, {&v.x(), &v.y()}, setNewValue, vertically,
addSpacer);
}
QLabel* LayerEditorUtil::createBoldLabel(const QString& text)
......@@ -261,4 +263,3 @@ QList<QColor> LayerEditorUtil::predefinedLayerColors()
return colors;
}
......@@ -65,8 +65,8 @@ void addVectorToGrid(QGridLayout* m_gridLayout, int firstCol, VectorProperty& v,
std::function<void(double, DoubleProperty&)> setNewValue, bool vertically,
bool addSpacer);
void addMagnetizationNoZToGrid(QGridLayout* m_gridLayout, int firstCol, VectorProperty& v,
std::function<void(double, DoubleProperty&)> setNewValue, bool vertically,
bool addSpacer);
std::function<void(double, DoubleProperty&)> setNewValue,
bool vertically, bool addSpacer);
QLabel* createBoldLabel(const QString& text);
......
......@@ -120,11 +120,12 @@ void MaterialInplaceForm::createWidgets()
};
// Processing z-magnetization is not implemented yet (see issue #654)
// LayerEditorUtil::addVectorToGrid(m_layout, col, material->magnetization(), setNewValue, true, false);
// When implemented, rm following lines and use 'addVectorToGrid'
// LayerEditorUtil::addVectorToGrid(m_layout, col, material->magnetization(), setNewValue, true,
// false); When implemented, rm following lines and use 'addVectorToGrid'
const LayerItem* layer_item = dynamic_cast<LayerItem*>(m_item);
if(layer_item && !layer_item->isTopLayer())
LayerEditorUtil::addMagnetizationNoZToGrid(m_layout, col, material->magnetization(), setNewValue, true, false);
if (layer_item && !layer_item->isTopLayer())
LayerEditorUtil::addMagnetizationNoZToGrid(m_layout, col, material->magnetization(),
setNewValue, true, false);
// -- Create UI for material selection button
auto* btn = new QPushButton("...", this);
......
......@@ -83,7 +83,7 @@ SpinMatrix Slice::polarizedReducedPotential(R3 k, double n_ref) const
void Slice::initBField(R3 h_field, double h_z)
{
// Temporary forbid z-magnetization in all layers (see issue #654)
if(m_material.magnetization().z() != 0)
if (m_material.magnetization().z() != 0)
throw std::runtime_error("Processing z-magnetization is not implemented yet.");
static constexpr double Magnetic_Permeability = 4e-7 * pi;
......
......@@ -51,11 +51,11 @@ void SliceStack::addNSlices(size_t n, double thickness, const Material& material
SliceStack SliceStack::setBField(const R3& externalField)
{
// Temporary forbid non-zero magnetization in fronting medium (see issue #654)
if(this->at(0).material().magnetization() != R3())
if (this->at(0).material().magnetization() != R3())
throw std::runtime_error("Processing fronting magnetization is not implemented yet.");
// Temporary forbid non-zero external field (see issue #654)
if(externalField != R3())
if (externalField != R3())
throw std::runtime_error("Processing external field is not implemented yet.");
if (this->empty())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment