Skip to content

Commit

Permalink
v3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Serban Lepadatu authored and Serban Lepadatu committed Dec 18, 2020
1 parent 1c533a8 commit 156ca4f
Show file tree
Hide file tree
Showing 352 changed files with 19,717 additions and 8,822 deletions.
11 changes: 3 additions & 8 deletions Boris.sln
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "BorisLib", "BorisLib", "{7A
ProjectSection(SolutionItems) = preProject
BorisLib\BLib_Conversions.h = BorisLib\BLib_Conversions.h
BorisLib\BLib_CurveFitting.h = BorisLib\BLib_CurveFitting.h
BorisLib\BLib_FFT.h = BorisLib\BLib_FFT.h
BorisLib\BLib_Funcs.h = BorisLib\BLib_Funcs.h
BorisLib\BLib_Network.h = BorisLib\BLib_Network.h
BorisLib\BLib_OmpReduction.h = BorisLib\BLib_OmpReduction.h
Expand All @@ -31,14 +30,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "BorisLib", "BorisLib", "{7A
BorisLib\CurveFitting_SOT.h = BorisLib\CurveFitting_SOT.h
BorisLib\CurveFitting_SOTSTT.h = BorisLib\CurveFitting_SOTSTT.h
BorisLib\CurveFitting_STT.h = BorisLib\CurveFitting_STT.h
BorisLib\FFT.h = BorisLib\FFT.h
BorisLib\FFT_mng.h = BorisLib\FFT_mng.h
BorisLib\FFT_R2.h = BorisLib\FFT_R2.h
BorisLib\FFT_R4.h = BorisLib\FFT_R4.h
BorisLib\FFT_shuf.h = BorisLib\FFT_shuf.h
BorisLib\FFT_SR.h = BorisLib\FFT_SR.h
BorisLib\Funcs_Algorithms.h = BorisLib\Funcs_Algorithms.h
BorisLib\Funcs_Algorithms_base.h = BorisLib\Funcs_Algorithms_base.h
BorisLib\Funcs_Aux_base.h = BorisLib\Funcs_Aux_base.h
BorisLib\Funcs_Aux_Linux.h = BorisLib\Funcs_Aux_Linux.h
BorisLib\Funcs_Aux_Windows.h = BorisLib\Funcs_Aux_Windows.h
Expand Down Expand Up @@ -82,6 +74,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "BorisLib", "BorisLib", "{7A
BorisLib\VEC_mng.h = BorisLib\VEC_mng.h
BorisLib\VEC_nprops.h = BorisLib\VEC_nprops.h
BorisLib\VEC_oper.h = BorisLib\VEC_oper.h
BorisLib\VEC_shapedef.h = BorisLib\VEC_shapedef.h
BorisLib\VEC_shapemask.h = BorisLib\VEC_shapemask.h
BorisLib\VEC_trans.h = BorisLib\VEC_trans.h
BorisLib\VEC_TransferFuncs.h = BorisLib\VEC_TransferFuncs.h
BorisLib\VEC_VC.h = BorisLib\VEC_VC.h
Expand All @@ -101,6 +95,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "BorisLib", "BorisLib", "{7A
BorisLib\VEC_VC_nprops.h = BorisLib\VEC_VC_nprops.h
BorisLib\VEC_VC_oper.h = BorisLib\VEC_VC_oper.h
BorisLib\VEC_VC_shape.h = BorisLib\VEC_VC_shape.h
BorisLib\VEC_VC_shapemask.h = BorisLib\VEC_VC_shapemask.h
BorisLib\VEC_VC_Solve.h = BorisLib\VEC_VC_Solve.h
BorisLib\VEC_VC_Voronoi.h = BorisLib\VEC_VC_Voronoi.h
BorisLib\VEC_Voronoi.h = BorisLib\VEC_Voronoi.h
Expand Down
4 changes: 2 additions & 2 deletions Boris/Anisotropy.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "BorisLib.h"
#include "Modules.h"

using namespace std;


class Mesh;

Expand All @@ -13,7 +13,7 @@ class Mesh;

class Anisotropy_Uniaxial :
public Modules,
public ProgramState<Anisotropy_Uniaxial, tuple<>, tuple<>>
public ProgramState<Anisotropy_Uniaxial, std::tuple<>, std::tuple<>>
{
private:

Expand Down
4 changes: 2 additions & 2 deletions Boris/AnisotropyCubi.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
#include "BorisLib.h"
#include "Modules.h"

using namespace std;


class Mesh;

#ifdef MODULE_COMPILATION_ANICUBI

class Anisotropy_Cubic :
public Modules,
public ProgramState<Anisotropy_Cubic, tuple<>, tuple<>>
public ProgramState<Anisotropy_Cubic, std::tuple<>, std::tuple<>>
{
private:

Expand Down
4 changes: 2 additions & 2 deletions Boris/Atom_Anisotropy.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "BorisLib.h"
#include "Modules.h"

using namespace std;


class Atom_Mesh;

Expand All @@ -13,7 +13,7 @@ class Atom_Mesh;

class Atom_Anisotropy_Uniaxial :
public Modules,
public ProgramState<Atom_Anisotropy_Uniaxial, tuple<>, tuple<>>
public ProgramState<Atom_Anisotropy_Uniaxial, std::tuple<>, std::tuple<>>
{
private:

Expand Down
4 changes: 2 additions & 2 deletions Boris/Atom_AnisotropyCubi.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
#include "BorisLib.h"
#include "Modules.h"

using namespace std;


class Atom_Mesh;

#if defined(MODULE_COMPILATION_ANICUBI) && ATOMISTIC == 1

class Atom_Anisotropy_Cubic :
public Modules,
public ProgramState<Atom_Anisotropy_Cubic, tuple<>, tuple<>>
public ProgramState<Atom_Anisotropy_Cubic, std::tuple<>, std::tuple<>>
{
private:

Expand Down
4 changes: 2 additions & 2 deletions Boris/Atom_DMExchange.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "BorisLib.h"
#include "Modules.h"

using namespace std;


class Atom_Mesh;

Expand All @@ -13,7 +13,7 @@ class Atom_Mesh;

class Atom_DMExchange :
public Modules,
public ProgramState<Atom_DMExchange, tuple<>, tuple<>>
public ProgramState<Atom_DMExchange, std::tuple<>, std::tuple<>>
{
private:

Expand Down
4 changes: 2 additions & 2 deletions Boris/Atom_Demag.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "Modules.h"
#include "DemagBase.h"

using namespace std;


class Atom_Mesh;

Expand All @@ -21,7 +21,7 @@ class Atom_Demag :
public Modules,
public DemagBase,
public Convolution<Atom_Demag, DemagKernel>,
public ProgramState<Atom_Demag, tuple<INT3>, tuple<>>
public ProgramState<Atom_Demag, std::tuple<INT3>, std::tuple<>>
{

#if COMPILECUDA == 1
Expand Down
4 changes: 2 additions & 2 deletions Boris/Atom_Demag_N.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "BorisLib.h"
#include "Modules.h"

using namespace std;


class Atom_Mesh;

Expand All @@ -15,7 +15,7 @@ class Atom_Mesh;

class Atom_Demag_N :
public Modules,
public ProgramState<Atom_Demag_N, tuple<>, tuple<>>
public ProgramState<Atom_Demag_N, std::tuple<>, std::tuple<>>
{

private:
Expand Down
4 changes: 2 additions & 2 deletions Boris/Atom_DiffEq_Common.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ typedef DBL3(Atom_DifferentialEquation::*Atom_Equation)(int idx);

class Atom_ODECommon :
public ProgramState<Atom_ODECommon,
tuple<
std::tuple<
int, int,
double, double,
double, double, int, int,
Expand All @@ -33,7 +33,7 @@ class Atom_ODECommon :
double, double, double, double, double, double,
int,
bool, bool, double, double>,
tuple<>>,
std::tuple<>>,
public ODECommon_Base
{
friend ODECommon_Base;
Expand Down
4 changes: 2 additions & 2 deletions Boris/Atom_DipoleDipole.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "Modules.h"
#include "DemagBase.h"

using namespace std;


class Atom_Mesh;

Expand All @@ -21,7 +21,7 @@ class Atom_DipoleDipole :
public Modules,
public DemagBase,
public Convolution<Atom_DipoleDipole, DipoleDipoleKernel>,
public ProgramState<Atom_DipoleDipole, tuple<INT3>, tuple<>>
public ProgramState<Atom_DipoleDipole, std::tuple<INT3>, std::tuple<>>
{

#if COMPILECUDA == 1
Expand Down
4 changes: 2 additions & 2 deletions Boris/Atom_Exchange.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "BorisLib.h"
#include "Modules.h"

using namespace std;


class Atom_Mesh;

Expand All @@ -13,7 +13,7 @@ class Atom_Mesh;

class Atom_Exchange :
public Modules,
public ProgramState<Atom_Exchange, tuple<>, tuple<>>
public ProgramState<Atom_Exchange, std::tuple<>, std::tuple<>>
{
private:

Expand Down
10 changes: 5 additions & 5 deletions Boris/Atom_Heat.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class SuperMesh;
class Atom_Heat :
public virtual Modules,
public HeatBase,
public ProgramState<Atom_Heat, tuple<int, double, double, bool, bool, bool, bool, bool, bool, TEquation<double, double, double, double>>, tuple<>>
public ProgramState<Atom_Heat, std::tuple<int, double, double, bool, bool, bool, bool, bool, bool, TEquation<double, double, double, double>>, std::tuple<>>
{

#if COMPILECUDA == 1
Expand Down Expand Up @@ -127,10 +127,10 @@ class Atom_Heat :
void SetBaseTemperature(double Temperature) {}

//set insulating mesh sides flags. literal can be "x", "-x", "y", "-y", "z", "-z"
void SetInsulatingSides(string literal, bool status) {}
void SetInsulatingSides(std::string literal, bool status) {}

//Set Q_equation text equation object
BError SetQEquation(string equation_string, int step) { return BError(); }
BError SetQEquation(std::string equation_string, int step) { return BError(); }

//set temperature solver type
BError Set_TMType(TMTYPE_ tmtype_ = TMTYPE_DEFAULT) { return BError(); }
Expand All @@ -142,9 +142,9 @@ class Atom_Heat :
double GetAlphaBoundary(void) { return 0.0; }

//get status of insulating side. literal can be "x", "-x", "y", "-y", "z", "-z"
bool GetInsulatingSide(string literal) { return true; }
bool GetInsulatingSide(std::string literal) { return true; }
//get all at once
vector<bool> GetInsulatingSides(void) { return {}; }
std::vector<bool> GetInsulatingSides(void) { return {}; }

//get the set temperature model type
int Get_TMType(void) { return 0; }
Expand Down
4 changes: 2 additions & 2 deletions Boris/Atom_MOptical.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "BorisLib.h"
#include "Modules.h"

using namespace std;


class Atom_Mesh;

Expand All @@ -13,7 +13,7 @@ class Atom_Mesh;

class Atom_MOptical :
public Modules,
public ProgramState<Atom_MOptical, tuple<>, tuple<>>
public ProgramState<Atom_MOptical, std::tuple<>, std::tuple<>>
{

#if COMPILECUDA == 1
Expand Down
59 changes: 46 additions & 13 deletions Boris/Atom_Mesh.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,10 @@ class Atom_Mesh :
//use parallel Monte-Carlo algorithms?
bool mc_parallel = true;

// Constrained MONTE-CARLO DATA

//use constrained Monte-Carlo?
bool mc_constrain = false;

//Constrained Monte-Carlo direction
DBL3 cmc_n = DBL3(1.0, 0.0, 0.0);

public:

Expand Down Expand Up @@ -220,13 +219,10 @@ class Atom_Mesh :
void Set_MonteCarlo_Serial(bool status) { mc_parallel = !status; }
bool Get_MonteCarlo_Serial(void) { return !mc_parallel; }

void Set_MonteCarlo_Constrained(DBL3 cmc_n_)
{
if (cmc_n_.IsNull()) mc_constrain = false;
else { mc_constrain = true; cmc_n = cmc_n_; }
}
bool Get_MonteCarlo_Constrained(void) { return mc_constrain; }
DBL3 Get_MonteCarlo_Constrained_Direction(void) { return cmc_n; }

virtual void Set_MonteCarlo_Constrained(DBL3 cmc_n_) = 0;
virtual DBL3 Get_MonteCarlo_Constrained_Direction(void) = 0;

//----------------------------------- MODULES CONTROL (implement MeshBase) : Atom_MeshModules.cpp

Expand Down Expand Up @@ -288,7 +284,7 @@ class Atom_Mesh :
PhysQ FetchOnScreenPhysicalQuantity(double detail_level = 0.0, bool getBackground = false);

//save the quantity currently displayed on screen in an ovf2 file using the specified format
BError SaveOnScreenPhysicalQuantity(string fileName, string ovf2_dataType);
BError SaveOnScreenPhysicalQuantity(std::string fileName, std::string ovf2_dataType);

//Before calling a run of GetDisplayedMeshValue, make sure to call PrepareDisplayedMeshValue : this calculates and stores in displayVEC storage and quantities which don't have memory allocated directly, but require computation and temporary storage.
void PrepareDisplayedMeshValue(void);
Expand Down Expand Up @@ -426,7 +422,7 @@ class Atom_Mesh :
BError copy_mesh_data(MeshBase& copy_this);

//mask cells using bitmap image : white -> empty cells. black -> keep values. Apply mask up to given z depth number of cells depending on grayscale value (zDepth, all if 0).
BError applymask(double zDepth_m, string fileName, function<vector<unsigned char>(string, INT2)>& bitmap_loader);
BError applymask(double zDepth_m, std::string fileName, std::function<std::vector<unsigned char>(std::string, INT2)>& bitmap_loader);

//set cells to empty in given rectangle (delete by setting entries to zero). The rectangle is relative to this mesh.
BError delrect(Rect rectangle);
Expand All @@ -435,18 +431,48 @@ class Atom_Mesh :
BError setrect(Rect rectangle);

//roughen mesh sides (side = "x", "y", "z", "-x", "-y", or "-z") to given depth (same units as h) with prng instantiated with given seed.
BError RoughenMeshSides(string side, double depth, int seed);
BError RoughenMeshSides(std::string side, double depth, int seed);

//Roughen mesh top and bottom surfaces using a jagged pattern to given depth and peak spacing (same units as h) with prng instantiated with given seed.
//Rough both top and bottom if sides is empty, else it should be either -z or z.
BError RoughenMeshSurfaces_Jagged(double depth, double spacing, int seed, string sides);
BError RoughenMeshSurfaces_Jagged(double depth, double spacing, int seed, std::string sides);

//Generate Voronoi 2D grains in xy plane (boundaries between Voronoi cells set to empty) at given average spacing with prng instantiated with given seed.
BError GenerateGrains2D(double spacing, int seed);

//Generate Voronoi 3D grains (boundaries between Voronoi cells set to empty) at given average spacing with prng instantiated with given seed.
BError GenerateGrains3D(double spacing, int seed);

//Advanced mesh shape control methods

//Disk with dimensions (x, y diameters, thickness), centre position relative to mesh, rotation angles, number of repetitions along x, y, z (1, 1, 1 for no repetitions), displacement values if repetitions used
//Method: or (add shape) / not (delete shape) / xor (add and delete overlaps)
BError shape_disk(MeshShape shape);

//rectangle shape
BError shape_rect(MeshShape shape);

//triangle shape
BError shape_triangle(MeshShape shape);

//prolate ellipsoid
BError shape_ellipsoid(MeshShape shape);

//pyramid
BError shape_pyramid(MeshShape shape);

//tetrahedron
BError shape_tetrahedron(MeshShape shape);

//cone
BError shape_cone(MeshShape shape);

//torus
BError shape_torus(MeshShape shape);

//general shape setting function, can set composite shape using combination of the above elementary shapes
BError shape_set(std::vector<MeshShape> shapes);

//----------------------------------- METHODS REDEFINED IN SOME IMPLEMENTATIONS (virtual here - with exceptions)
};

Expand All @@ -466,6 +492,13 @@ BError Atom_Mesh::change_mesh_shape(Lambda& run_this, PType& ... params)

BError error(__FUNCTION__);

#if COMPILECUDA == 1
if (paMeshCUDA) {

error = paMeshCUDA->copy_shapes_to_cpu();
}
#endif

//Atomic moments
if (!shape_change_individual || (shape_change_individual && (displayedPhysicalQuantity == MESHDISPLAY_MOMENT)))
{
Expand Down
2 changes: 1 addition & 1 deletion Boris/Atom_MeshCUDA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ PhysQ Atom_MeshCUDA::FetchOnScreenPhysicalQuantity(double detail_level, bool get
}

//save the quantity currently displayed on screen in an ovf2 file using the specified format
BError Atom_MeshCUDA::SaveOnScreenPhysicalQuantity(string fileName, string ovf2_dataType)
BError Atom_MeshCUDA::SaveOnScreenPhysicalQuantity(std::string fileName, std::string ovf2_dataType)
{
BError error(__FUNCTION__);

Expand Down
Loading

0 comments on commit 156ca4f

Please sign in to comment.