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

Develop #6

Open
wants to merge 45 commits into
base: rutile
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
69a5360
openmpi and gcc bug fix
jacksonross1024 Mar 6, 2023
c4f4c89
Merge pull request #95 from jacksonross1024/develop
richard-evans Mar 8, 2023
bfdef86
Bugfix: Fixed output of grain coordinates for only a single grain
Mar 8, 2023
829872b
Bugfix: Grain material output now outputs the correct number of colum…
Mar 8, 2023
2b7c164
Added angle control to exchange stiffness program
richard-evans May 2, 2023
340a37c
Added flag to enable FMR fields when frequency or fmr field strength …
richard-evans May 2, 2023
436055d
Bugfix: fixed colouring for colour wheel due to incorrect angle calcu…
richard-evans May 2, 2023
9ed9dfc
Bugfix: fixed calculation of magnetisation statistics with checkpointing
richard-evans May 4, 2023
1c388a7
Added implementation of sticks into vdc for improved visualisation in…
richard-evans Apr 25, 2023
7a7bbc6
Feature: added susceptibility and specific heat statistics to checkpo…
richard-evans May 11, 2023
cef946d
Bugfix: Moved inline functions to anonymous namespaces to avoid undef…
richard-evans May 12, 2023
8d2e771
Added an optional --output-file command line argument, to specify the…
a-naden May 25, 2023
0ffedf6
Merge pull request #96 from a-naden/develop
a-naden May 26, 2023
547bd3a
Added functionality to output voronoi vertices for future data analysis
richard-evans Jun 14, 2023
73a3345
Implemented grain number data analysis in vdc. Fixed text output to u…
richard-evans Jun 14, 2023
a40baf9
Merge branch 'develop' of https://github.com/richard-evans/vampire in…
richard-evans Jun 14, 2023
13621b8
Bugfix: fixed error in mask calculation for grain magnetisation stati…
richard-evans Jun 30, 2023
fb89b4c
Added <cstdint> libraries
InsomniacVegan Jul 11, 2023
feb1121
Updated version number to 7.0.0 and updated developer list
richard-evans Jul 16, 2023
1c05f1a
Refactor: Updates to starting banner
richard-evans Jul 18, 2023
b8f4f8e
Feature: Added scripts folder and script to list vampire input parame…
richard-evans Jul 19, 2023
ed2f071
Fix parallel computation of spin accumulation
am1808 Jul 22, 2023
e7ce726
Merge pull request #97 from InsomniacVegan/develop
richard-evans Oct 2, 2023
5939541
Added grain statistics calculation to GPU vampire
Oct 2, 2023
413fb22
Added spin temperature statistics and four-spin exchange
marastr Oct 18, 2023
c2ed4c7
Merge branch 'release' into develop
Oct 19, 2023
6126306
Feature: Added implementation of field pulse simulation to pulse a sy…
richard-evans Nov 21, 2023
fd9de81
Bugfix - set correct equilibration field during field pulse simulation
richard-evans Nov 27, 2023
2953025
Bugfix: Increased number of atoms allowed for unit cell files to 100,…
richard-evans Jan 12, 2024
7098fba
Manual: Added default parameters for system size parameters.
richard-evans Jan 12, 2024
b7a38db
Manual: Changed LaTeX formatting for easier reading.
richard-evans Jan 12, 2024
260f28d
Bugfix: Added using::std to enable standard fixed-width variables on …
richard-evans Jan 12, 2024
b3eff87
Bugfix: Removed unused variables creating compiler warnings
richard-evans Jan 12, 2024
8080a13
Bugfix: fixed incorrect ordering of variables with category class con…
richard-evans Jan 12, 2024
30d3c48
Bugfix: Fixed bitwise comparison for bool
richard-evans Jan 12, 2024
d683be9
Bugfix: Added missing grain function in case statement for grain spin…
richard-evans Jan 12, 2024
223adfd
Manual: Updated to reflect removed dipole parameters
richard-evans Jan 12, 2024
62c15c1
Bugfix: Added missing header file
richard-evans Jan 12, 2024
9235956
Bugfix: Added missing header files
richard-evans Jan 12, 2024
b0cdade
Merge remote-tracking branch 'refs/remotes/origin/develop' into develop
richard-evans Feb 6, 2024
6ebb043
Added wrapper function with support for long messages (>2^32) of char…
richard-evans Feb 19, 2024
e38fe60
Bugfix: Added enhanced interaction range for parallel calculations fo…
richard-evans Mar 5, 2024
2d63c0e
Fixed compiler warnings for g++ and llvm compilers
richard-evans Jan 7, 2025
5959dbf
merge latest release changes into develop
richard-evans Jan 7, 2025
5a859af
Fixed ordering of category class initialisation
richard-evans Jan 7, 2025
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
5 changes: 5 additions & 0 deletions hdr/atoms.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,14 @@

#include <string>
#include <vector>
#include <cstdint>

#include "exchange.hpp"

// Load standard forms of fixed-width types (needed for some compilers)
using std::uint64_t;
using std::int64_t;

// unit vector type
class uvec_t{
public:
Expand Down
6 changes: 5 additions & 1 deletion hdr/category.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ namespace cat{
double my;
double mz;

// energy and toque variables
// energy and torque variables
double torque;
double mean_torque;
double energy;
Expand All @@ -48,6 +48,10 @@ namespace cat{
double theta;
double phi;

// spin temperature variables
double spin_temp;
double mean_spin_temp;

// member functions
category_t(); /// constructor

Expand Down
6 changes: 6 additions & 0 deletions hdr/create_atoms_class.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@
#ifndef CREATE_ATOMS_CLASS_H_
#define CREATE_ATOMS_CLASS_H_

#include <cstdint>

// Load standard forms of fixed-width types (needed for some compilers)
using std::uint64_t;
using std::int64_t;

//namespace create{
namespace cs{

Expand Down
4 changes: 4 additions & 0 deletions hdr/demag.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
#include <vector>
#include <cstdint>

// Load standard forms of fixed-width types (needed for some compilers)
using std::uint64_t;
using std::int64_t;

namespace demag{

extern bool fast;
Expand Down
5 changes: 5 additions & 0 deletions hdr/dipole.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
// C++ standard library headers
#include <string>
#include <vector>
#include <cstdint>

// Load standard forms of fixed-width types (needed for some compilers)
using std::uint64_t;
using std::int64_t;

// Vampire headers
#include "dipole.hpp"
Expand Down
2 changes: 2 additions & 0 deletions hdr/exchange.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ class zten_t{
namespace exchange{

extern bool biquadratic; // flag to enable biquadratic exchange calculation
extern bool four_spin; // flag to enable four spin exchange calculation

//-----------------------------------------------------------------------------
// Function to initialise exchange module
Expand All @@ -95,6 +96,7 @@ namespace exchange{
//---------------------------------------------------------------------------
double single_spin_energy(const int atom, const double sx, const double sy, const double sz);
double single_spin_biquadratic_energy(const int atom, const double sx, const double sy, const double sz);
double single_spin_four_spin_energy(const int atom, const double sx, const double sy, const double sz);

//-----------------------------------------------------------------------------
// Function to calculate exchange fields for spins between start and end index
Expand Down
1 change: 1 addition & 0 deletions hdr/program.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ namespace program
extern void mm_A_calculation();
extern void exchange_stiffness();
extern void electrical_pulse();
extern void field_pulse();

// Sundry programs and diagnostics not under general release
extern int LLB_Boltzmann();
Expand Down
21 changes: 20 additions & 1 deletion hdr/sim.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,17 @@
#define SIM_H_

//Headers
#include <cstdint>
#include <fstream>
#include <stdint.h>
#include <string>
#include <valarray>
#include <vector>

// Load standard forms of fixed-width types (needed for some compilers)
using std::uint64_t;
using std::int64_t;

/// Enumerated lists for code readability
enum pump_functions_t {square=0, two_temperature, double_pump_two_temperature, double_pump_square};

Expand Down Expand Up @@ -200,13 +205,27 @@ namespace sim{
extern int LLGinit();

// Field and energy functions
extern double calculate_spin_energy(const int atom);
extern double calculate_spin_energy(const int atom);
extern double spin_applied_field_energy(const double, const double, const double);
extern double spin_magnetostatic_energy(const int, const double, const double, const double);

void calculate_spin_fields(const int start_index,const int end_index);
void calculate_external_fields(const int start_index,const int end_index);

//spin temperature
extern double compute_spin_temperature(const int start_index, // first atom for exchange interactions to be calculated
const int end_index,
const std::vector<int>& type_array, // type for atom
std::vector<double>& x_spin_array, // coord vectors for atoms
std::vector<double>& y_spin_array,
std::vector<double>& z_spin_array,
std::vector<double>& fields_array_x, // vectors for fields
std::vector<double>& fields_array_y,
std::vector<double>& fields_array_z,
std::vector<double>& mu_s_array);

extern double spin_temperature;

// LaGrange multiplier variables
extern double lagrange_lambda_x;
extern double lagrange_lambda_y;
Expand Down
5 changes: 5 additions & 0 deletions hdr/spintransport.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,18 @@
#define SPINTRANSPORT_H_

// C++ standard library headers
#include <cstdint>
#include <string>
#include <vector>

// Vampire headers
#include "create.hpp"
#include "spintransport.hpp"

// Load standard forms of fixed-width types (needed for some compilers)
using std::uint64_t;
using std::int64_t;

//--------------------------------------------------------------------------------
// Namespace for variables and functions for spintransport module
//--------------------------------------------------------------------------------
Expand Down
85 changes: 67 additions & 18 deletions hdr/stats.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ namespace stats
/// Statistics types
enum stat_t { atotal=0, mean=1};

/// Statistics output functions
//extern void output_energy(std::ostream&, enum energy_t, enum stat_t,bool header);

//-------------------------------------------------
// New statistics module functions and variables
//-------------------------------------------------
Expand Down Expand Up @@ -73,6 +70,10 @@ namespace stats
extern bool calculate_grain_torque;
extern bool calculate_material_torque;

extern bool calculate_system_spin_temp;
extern bool calculate_grain_spin_temp;
extern bool calculate_material_spin_temp;

extern bool calculate_system_specific_heat;
extern bool calculate_grain_specific_heat;
extern bool calculate_material_specific_heat;
Expand Down Expand Up @@ -174,6 +175,9 @@ namespace stats
void set_magnetization(std::vector<double>& magnetization, std::vector<double>& mean_magnetization, long counter);
void reset_magnetization_averages();
const std::vector<double>& get_magnetization();
void save_checkpoint(std::ofstream& chkfile);
void load_checkpoint(std::ifstream& chkfile, bool chk_continue);
const std::vector<double>& get_checkpoint_parameters(double& sum_mx, double& sum_my, double& sum_mz, double& sum_count);
std::string output_magnetization(bool header);
std::string output_normalized_magnetization(bool header);
std::string output_normalized_magnetization_length(bool header);
Expand Down Expand Up @@ -233,19 +237,58 @@ namespace stats

};

//----------------------------------
// Spin temperature class definition
//----------------------------------
class spin_temp_statistic_t{

public:
spin_temp_statistic_t (std::string n):initialized(false){
name = n;
};
bool is_initialized();
void set_mask(const int mask_size, std::vector<int> inmask, const std::vector<double>& mm);
void get_mask(std::vector<int>& out_mask);
void calculate_spin_temp(const std::vector<double>& sx, const std::vector<double>& sy, const std::vector<double>& sz,
const std::vector<double>& bxs, const std::vector<double>& bys, const std::vector<double>& bzs,
const std::vector<double>& bxe, const std::vector<double>& bye, const std::vector<double>& bze,
const std::vector<double>& mm);

void set_spin_temp(std::vector<double>& spin_temp, std::vector<double>& mean_spin_temp, long counter);
void reset_spin_temp_averages();
const std::vector<double>& get_spin_temp();
std::string output_spin_temp(bool header);
std::string output_mean_spin_temp(bool header);

private:
bool initialized;
int num_atoms;
int mask_size;
double mean_counter;
std::vector<int> mask;
std::vector<int> num_atoms_in_mask;
std::vector<double> spin_temp;
std::vector<double> mean_spin_temp;
std::vector<int> zero_list;
std::string name;

};

//----------------------------------
// Specific Heat Class definition
//----------------------------------
class specific_heat_statistic_t{

public:
specific_heat_statistic_t (std::string n):initialized(false){
name = n;
};
void initialize(energy_statistic_t& energy_statistic);
void calculate(const std::vector<double>& energy);
void reset_averages();
std::string output_mean_specific_heat(const double temperature,bool header);
specific_heat_statistic_t (std::string n):initialized(false){
name = n;
};
void initialize(energy_statistic_t& energy_statistic);
void calculate(const std::vector<double>& energy);
void save_checkpoint(std::ofstream& chkfile);
void load_checkpoint(std::ifstream& chkfile, bool chk_continue);
void reset_averages();
std::string output_mean_specific_heat(const double temperature,bool header);


private:
Expand All @@ -269,10 +312,12 @@ namespace stats
susceptibility_statistic_t (std::string n):initialized(false){
name = n;
};
void initialize(magnetization_statistic_t& mag_stat);
void calculate(const std::vector<double>& magnetization);
void reset_averages();
std::string output_mean_susceptibility(const double temperature,bool header);
void initialize(magnetization_statistic_t& mag_stat);
void calculate(const std::vector<double>& magnetization);
void save_checkpoint(std::ofstream& chkfile);
void load_checkpoint(std::ifstream& chkfile, bool chk_continue);
void reset_averages();
std::string output_mean_susceptibility(const double temperature,bool header);
//std::string output_mean_absolute_susceptibility();

private:
Expand Down Expand Up @@ -356,13 +401,17 @@ namespace stats
extern torque_statistic_t grain_torque;
extern torque_statistic_t material_torque;

extern specific_heat_statistic_t system_specific_heat;
extern spin_temp_statistic_t system_spin_temp;
extern spin_temp_statistic_t grain_spin_temp;
extern spin_temp_statistic_t material_spin_temp;

extern specific_heat_statistic_t system_specific_heat;
extern specific_heat_statistic_t grain_specific_heat;
extern specific_heat_statistic_t material_specific_heat;
extern specific_heat_statistic_t material_specific_heat;

extern susceptibility_statistic_t system_susceptibility;
extern susceptibility_statistic_t system_susceptibility;
extern susceptibility_statistic_t grain_susceptibility;
extern susceptibility_statistic_t material_susceptibility;
extern susceptibility_statistic_t material_susceptibility;

extern standard_deviation_statistic_t material_standard_deviation;

Expand Down
11 changes: 9 additions & 2 deletions hdr/vio.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#ifndef VIO_H_
#define VIO_H_

#include <cstdint>
#include <fstream>
#include <string>
#include <iostream>
Expand All @@ -44,6 +45,10 @@
#include <iomanip>
#include <vector>

// Load standard forms of fixed-width types (needed for some compilers)
using std::uint64_t;
using std::int64_t;

// Global Output Streams
extern std::ofstream zinfo;
extern std::ofstream zmag;
Expand Down Expand Up @@ -95,8 +100,8 @@ namespace vin{
extern void check_for_valid_vector(std::vector<double>& u, std::string word, int line, std::string prefix, std::string unit, std::string unit_type,
const std::vector<double>& range_min, const std::vector<double>& range_max, std::string input_file_type, std::string range_text);

extern void check_for_valid_bitsequence(std::vector<int>& u, std::string word, int line, std::string prefix, const int range_min,
const int range_max, std::string input_file_type, std::string range_text);
extern void check_for_valid_bitsequence(std::vector<int>& u, std::string word, int line, std::string prefix, const int range_min,
const int range_max, std::string input_file_type, std::string range_text);

extern std::vector<double> doubles_from_string(std::string value);
extern std::vector<int> integers_from_string(std::string value);
Expand Down Expand Up @@ -144,6 +149,8 @@ namespace vout{
extern int fw_size_int;
extern int max_header;

extern std::string output_file_name;

//class that creates an object which acts like an output
//stream but delivers fixed width output separated by
//tabs
Expand Down
5 changes: 5 additions & 0 deletions hdr/vmath.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@

#include <vector>
#include <cmath>
#include <cstdint>

// Load standard forms of fixed-width types (needed for some compilers)
using std::uint64_t;
using std::int64_t;

/// @namespace ns
/// @brief vmath namespace containing sundry math functions for vampire.
Expand Down
9 changes: 7 additions & 2 deletions hdr/vmpi.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
#include <string>
#include <vector>

// Load standard forms of fixed-width types (needed for some compilers)
using std::uint64_t;
using std::int64_t;

#ifdef MPICF
#include <mpi.h>
#endif
Expand Down Expand Up @@ -64,7 +68,7 @@ namespace vmpi{

extern bool replicated_data_staged; ///< Flag for staged system generation

extern char hostname[20]; ///< Hostname of local CPU
extern std::string hostname; ///< Hostname of local CPU
extern double min_dimensions[3]; ///< Minimum coordinates of system on local cpu
extern double max_dimensions[3]; ///< Maximum coordinates of system on local cpu

Expand Down Expand Up @@ -102,7 +106,7 @@ namespace vmpi{
extern void initialise(int argc, char *argv[]);
extern int hosts();
extern int finalise();
extern void geometric_decomposition(int, double []);
extern void geometric_decomposition(int, double [3]);
extern double SwapTimer(double, double&);

// functions for sending/receiving halo data
Expand All @@ -121,6 +125,7 @@ namespace vmpi{
extern void collate(std::vector<double>& input, std::vector<double>& output);
extern void counts_and_displacements(std::vector<double>& input, std::vector<double>& output, std::vector<int>& counts, std::vector<int>& displacements);
extern void fast_collate(std::vector<double>& input, std::vector<double>& output, std::vector<int>& counts, std::vector<int>& displacements);
extern void broadcast(std::vector<char>& message, int source_rank);

// function to seed random numbers in parallel
uint32_t parallel_rng_seed(int seed);
Expand Down
Loading