Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix true vacuum at high temperature #161

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
cmake_minimum_required(VERSION 3.23)
project(
BSMPT
VERSION 3.0.5
VERSION 3.0.9
LANGUAGES C CXX
DESCRIPTION
"BSMPT - Beyond the Standard Model Phase Transitions : A C++ package for the computation of the EWPT in BSM models"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ SPDX-FileCopyrightText: 2021 Philipp Basler, Margarete Mühlleitner and Jonas M
SPDX-License-Identifier: GPL-3.0-or-later
-->

Program: BSMPT version 3.0.5
Program: BSMPT version 3.0.9

Released by: Philipp Basler, Lisa Biermann, Margarete Mühlleitner, Jonas Müller, Rui Santos and João Viana

Expand Down
1 change: 1 addition & 0 deletions include/BSMPT/minimum_tracer/minimum_tracer.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <BSMPT/utility/asciiplotter/asciiplotter.h>
#include <BSMPT/utility/utility.h>
#include <Eigen/Dense> // Eigenvalues matrix
#include <algorithm> // std::swap
#include <chrono>
#include <cmath> // std::pow
#include <memory> // for shared_ptr
Expand Down
6 changes: 6 additions & 0 deletions src/minimum_tracer/minimum_tracer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2401,6 +2401,12 @@
PhasesList[i].id = i;
}

// impose that true vacuum at T = Tthigh has id = 0.
for (auto &phase : PhasesList)
if ((phase.T_high == T_high) and

Check notice

Code scanning / CodeQL

Equality test on floating-point values Note

Equality checks on floating point values can yield unexpected results.
(phase.Get(T_high).potential < PhasesList[0].Get(T_high).potential))
std::swap(PhasesList[0], phase);

Check warning on line 2408 in src/minimum_tracer/minimum_tracer.cpp

View check run for this annotation

Codecov / codecov/patch

src/minimum_tracer/minimum_tracer.cpp#L2408

Added line #L2408 was not covered by tests
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure this works? You are swapping an iterator with a reference here.
Maybe use an iterator based for loop and use iterator_swap

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or maybe easier:
You could use min_element with a compare function to get the position of the required element and then use iterator_swap just once.
With this there would only be one swap


// identify coexisiting phase regions
setCoexRegion(UseMultiStepPTMode); // can flip status_vacuum to error code

Expand Down