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

Merging basis into dev #36

Merged
merged 80 commits into from
Aug 3, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
9ee4957
- Changed tree structure of the project. Instead of having 'include' …
GabrielePisciotta Mar 1, 2018
0a5e0ce
Update CMakeLists: minimum version 3.8
GabrielePisciotta Mar 1, 2018
07f6f63
Update CMakeLists.txt
GabrielePisciotta Mar 1, 2018
ddb20c1
created ContinuousBase file
AndreaIdini Mar 7, 2018
86a06df
Stub of Continuous Base
AndreaIdini Mar 7, 2018
c3b93ee
Added Continuous.cpp and stub (no compil)
AndreaIdini Mar 7, 2018
fe3cef6
corrected assignation of coordinate
AndreaIdini Mar 7, 2018
307285b
Conditional compilation of tests under Windows.
GabrielePisciotta Mar 9, 2018
0d88c3f
Simplified DiscreteBasis class
AndreaIdini Mar 9, 2018
5f03c7c
Continuous and Discrete Basis as subclass of Basis instead of viceversa
AndreaIdini Mar 9, 2018
a139cd1
Merge remote-tracking branch 'origin/dev-basis' into dev-basis
GabrielePisciotta Mar 9, 2018
4991e5e
Now arguments are also private fields of basis. Refactoring.
GabrielePisciotta Mar 15, 2018
ee186b3
Potential with Base. PotentialBuilder has now setBase()
GabrielePisciotta Mar 15, 2018
b1bd237
Modified ContinuousBase constructor
AndreaIdini Mar 23, 2018
70d3d68
Modified Readme and CMake
AndreaIdini Mar 23, 2018
0dc1b50
Debugging
AndreaIdini Mar 24, 2018
e7255a8
Recovered CMake from Gabriele
AndreaIdini Mar 24, 2018
ba4b107
Fixed Compilation Issues with g++-7
AndreaIdini Mar 24, 2018
71b22b4
Removed version Cmake 3.8 requirements (wasn't working and wasn't com…
AndreaIdini Mar 25, 2018
17795e4
Base implemented and test
AndreaIdini Mar 25, 2018
85dd6a2
Base implemented HO calc, still vector problems
AndreaIdini Mar 25, 2018
5e12e39
Basis Fixed and implemented in tests
AndreaIdini Mar 25, 2018
d203207
Corrected DiscreteBase step
AndreaIdini Apr 10, 2018
c2519c0
Corrected Base in Potential constructor
AndreaIdini Apr 10, 2018
fb844e2
edited readme
AndreaIdini Apr 10, 2018
ce948b4
Merge pull request #25 from AndreaIdini/dev-basis
AndreaIdini Apr 10, 2018
d0715f6
introduced Base as singleton, changed CMake minimum version to 3.5
AndreaIdini Apr 27, 2018
741c28c
Better implementation of Singleton constructor
AndreaIdini Apr 27, 2018
e3f9ad2
updated DiscreteBase tests
AndreaIdini Jul 17, 2018
0759d5a
updated readme
AndreaIdini Jul 17, 2018
43ca784
Merge branch 'dev-basis' of github.com:AndreaIdini/Schroedinger into …
AndreaIdini Jul 17, 2018
2f1c870
progress towards Basis implementation: singleton constructor
AndreaIdini Jul 19, 2018
89cf0e5
Update CONTRIBUTING.md
GabrielePisciotta Jul 19, 2018
4a2cde8
implemented ContBasis Export with auto
AndreaIdini Jul 19, 2018
65bf52c
Base constructor in Base.cpp file
AndreaIdini Jul 19, 2018
3b50fad
Merge pull request #31 from Scienza/CONTRIBUTING
AndreaIdini Jul 19, 2018
ddbe9e7
BaseType enum is now public, moved out from Base the definition of Co…
GabrielePisciotta Jul 19, 2018
faa53f8
Triggering CircleCI
GabrielePisciotta Jul 20, 2018
243197a
Change CircleCI configuration
GabrielePisciotta Jul 20, 2018
e7e24f9
Update config.yml
GabrielePisciotta Jul 20, 2018
dcacf69
Update CMakeLists.txt
GabrielePisciotta Jul 20, 2018
eb8f1e5
Implemented multiple dimension in discretebase / continuousbase, star…
GabrielePisciotta Jul 22, 2018
72640a2
Fix for Dimension (checking for CircleCI output msg)
GabrielePisciotta Jul 22, 2018
ad0e960
Fixing
GabrielePisciotta Jul 22, 2018
7800ed3
Fixing
GabrielePisciotta Jul 22, 2018
aa51fe7
Fixing
GabrielePisciotta Jul 22, 2018
bf6b71c
fixing
GabrielePisciotta Jul 22, 2018
1dda8ad
Fixing: overloaded < operator to make comparison between IDs
GabrielePisciotta Jul 22, 2018
63d4919
Implemented BasisManager with Builder for Basis (and dimensions) crea…
GabrielePisciotta Jul 22, 2018
da15523
On Windows (Intel Compilers) it's all ok, but on CircleCI (linux + gc…
GabrielePisciotta Jul 22, 2018
5f397ef
Fix
GabrielePisciotta Jul 22, 2018
3a04d6b
Fix in DiscreteBase (quantum_numbers inserting), new main.cpp with ex…
GabrielePisciotta Jul 23, 2018
30468e7
first try to extract continuousbasis vector
AndreaIdini Jul 23, 2018
f7b9ee9
Removed <Dimension> and refactored. Changed the test, Base/Continuous…
GabrielePisciotta Jul 25, 2018
f7689fa
Merge pull request #33 from Scienza/dev-basis-BasisManager-and-multip…
AndreaIdini Jul 25, 2018
54a11a4
updated installing procedure
AndreaIdini Jul 25, 2018
77c61d5
Update README.md
GabrielePisciotta Jul 25, 2018
1bc5793
Added default base in BasisManager and test if it's a singleton
GabrielePisciotta Jul 25, 2018
6deacf3
Merge branch 'dev-basis-BasisManager-and-multiple-dimensions' into de…
GabrielePisciotta Jul 25, 2018
93e6b2d
Implemented "selected base" and added test to check if it's a singleton
GabrielePisciotta Jul 25, 2018
9b99c50
added factory methods (not working on my mac)
AndreaIdini Jul 27, 2018
644a356
solving git conflicts
AndreaIdini Jul 27, 2018
430b1fe
corrected BasisManager Factory methods
AndreaIdini Jul 28, 2018
c189683
corrected main
AndreaIdini Jul 28, 2018
247cf00
Fox CircleCI build shield
GabrielePisciotta Jul 28, 2018
5ee1774
added custom basis type
AndreaIdini Jul 29, 2018
569614c
used build()
AndreaIdini Jul 29, 2018
230a020
Merge branch 'dev-basis' of github.com:AndreaIdini/Schroedinger into …
AndreaIdini Jul 29, 2018
32a44ad
added factory methods directly in build()
AndreaIdini Jul 29, 2018
530fc2e
passing all tests gloriously
AndreaIdini Jul 29, 2018
9f124da
substituted BaseType with basePreset
AndreaIdini Jul 29, 2018
98770aa
deleted old factory methods
AndreaIdini Jul 29, 2018
0d21628
stub of inizializer class
AndreaIdini Jul 29, 2018
244f042
Introduced Initializer class on the basis of Dimension class. cf. 63d…
AndreaIdini Jul 30, 2018
08c295a
Building Initializer class, SphericalInitializer constructor to be made
AndreaIdini Jul 30, 2018
90f8960
added initializers and few factory methods
AndreaIdini Aug 1, 2018
6dccbc5
Update README.md
GabrielePisciotta Aug 2, 2018
4da1c9f
Update README.md
GabrielePisciotta Aug 2, 2018
c87aa65
Refactoring
GabrielePisciotta Aug 3, 2018
d8c777f
Add *.md and LICENSE to gitignore
GabrielePisciotta Aug 3, 2018
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
Prev Previous commit
Next Next commit
Simplified DiscreteBasis class
  • Loading branch information
AndreaIdini committed Mar 9, 2018
commit 0d88c3f353a21e57e427e23ae4ca23091a7af4a1
2 changes: 1 addition & 1 deletion src/Basis/Base.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ enum base_type { discrete, continuous };

class Base {
protected:

// About coords: maybe should not exist in this manner. It's better to evaluate at run-time.
// Instead of a vector of coords it's better to have a vector of Dimensions, where Dimensions are structs
// with parameters related to basis type.
std::vector< std::vector<double> > coords;

public:
Potential *potential;
Expand Down
6 changes: 3 additions & 3 deletions src/Basis/ContinuousBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ ContinuousBase::ContinuousBase(double starting, double end, std::vector<double>

// Due to the fact that Basis->coords is vector<double>
// here's the conversion from vector<int> to vector<double>
this->coords.reserve(nbox);
for(std::vector<double>::size_type i = 0; i < coords.size(); i++)
this->coords[i][0] = starting + mesh[0] * i;
this->coord.reserve(nbox);
for(std::vector<double>::size_type i = 0; i < coord.size(); i++)
this->coord[i] = starting + mesh[0] * i;

}
2 changes: 2 additions & 0 deletions src/Basis/ContinuousBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ class ContinuousBase : public Base {
public:
ContinuousBase(double, double, std::vector<double>, unsigned int);

std::vector<double> coord;

// void combine() {} // @TODO implement
// void change(base_type t) {} // @TODO implement
// void set_potential() {} // @TODO implement
Expand Down
25 changes: 15 additions & 10 deletions src/Basis/DiscreteBase.cpp
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
#include "DiscreteBase.h"

DiscreteBase::DiscreteBase(std::vector< std::vector<int> > dimensions, Potential potential)
DiscreteBase::DiscreteBase(int start, int end, int step)
{
if (dimensions.size() == 0)
throw std::invalid_argument("Empty dimensions vector given.");

// Due to the fact that Basis->coords is vector<double>
// here's the conversion from vector<int> to vector<double>
this->coords.reserve(dimensions.size());
for(auto&& dimension : dimensions) {
this->coords.emplace_back(dimension.begin(), dimension.end());
//if not integer division of the basis
if((start-end)/step % 1 !=0)
throw std::invalid_argument("invalid discrete basis given (check interval and step).");

unsigned int base_value = (start-end)/step;
if (base_value == 0)
throw std::invalid_argument("Empty dimensions basis given.");

this->quantum_numbers.reserve(base_value);

int j=0;
for(int i = start; i < end; i++ ) {
this->quantum_numbers[j] = i;
j++;
}
this->potential = &potential;
}
14 changes: 7 additions & 7 deletions src/Basis/DiscreteBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@
#include "Base.h"

class DiscreteBase : public Base {
public:
DiscreteBase(std::vector< std::vector<int> > dimensions, Potential potential);
private:
DiscreteBase(int, int, int);
std::vector<int> quantum_numbers;


void combine() {} // @TODO implement
void change(base_type t) {} // @TODO implement
void set_potential() {} // @TODO implement

class Builder {
private:
std::vector< std::vector<int> > dimensions;
Potential potential;
// private:
// std::vector<int> quantum_numbers;
public:
Builder addDimension(int min_value, int max_value, int step);
Builder addPotential(Potential p);
Builder addQuantumNumbers(int min_value, int max_value, int step);
DiscreteBase build();
};
};
Expand Down