Skip to content

Commit

Permalink
final calc
Browse files Browse the repository at this point in the history
  • Loading branch information
Baradun committed Feb 13, 2021
1 parent fb7fb22 commit 44db5cc
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 181 deletions.
Binary file modified main/main
Binary file not shown.
12 changes: 6 additions & 6 deletions main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class Methods
Matrix<double, 3, 3> A;
auto Y = v;
auto point = start;
while (point <= end)
while (point < end)
{

A = -step * (H0 + prof(point + step / 2.0, v0, n) * W);
Expand All @@ -94,7 +94,7 @@ class Methods
Matrix<complex<double>, 3, 3> A2;
Matrix<complex<double>, 3, 3> omega;
auto point = start;
while (point <= end)
while (point < end)
{
A1 = H0 + prof(point + c1 * step, v0, n) * W;
A2 = H0 + prof(point + c2 * step, v0, n) * W;
Expand Down Expand Up @@ -129,7 +129,7 @@ class Methods
Matrix<complex<double>, 3, 3> omega;

auto point = start;
while (point <= end)
while (point < end)
{
A1 = H0 + prof(point + c1 * step, v0, n) * W;
A2 = H0 + prof(point + c2 * step, v0, n) * W;
Expand Down Expand Up @@ -171,7 +171,7 @@ class Methods
Matrix<double, 3, 3> A1, A2;
auto Y = v;
auto point = start;
while (point <= end)
while (point < end)
{
A1 = H0 + prof(point + c1 * step, v0, n) * W;
A2 = H0 + prof(point + c2 * step, v0, n) * W;
Expand Down Expand Up @@ -210,7 +210,7 @@ class Methods
Matrix<double, 3, 3> A1, A2, A3, Y1, Y2, Y3;
auto Y = v;
auto point = start;
while (point <= end)
while (point < end)
{
A1 = H0 + prof(point + c1 * step, v0, n) * W;
A2 = H0 + prof(point + c2 * step, v0, n) * W;
Expand Down Expand Up @@ -398,7 +398,7 @@ int main(int argc, char *argv[])
if (mthd == "M4") v = test.M4();
if (mthd == "M6") v = test.M6();
if (mthd == "Cf4") v = test.Cf4();
if (mthd == "Cf_3") v = test.Cf4_3();
if (mthd == "Cf4_3") v = test.Cf4_3();

auto end_time = std::chrono::high_resolution_clock::now();
std::chrono::duration<double> time = (end_time - start_time);
Expand Down
172 changes: 0 additions & 172 deletions methods.json

This file was deleted.

27 changes: 24 additions & 3 deletions methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
base_dir = 'main/'
run_file = 'main'
log_files_dir = 'logs/'
runs = 1
params_file = 'methods.json'
runs = 10
cores = 12


def run(run_file, start, stop, step, method, output_file):
Expand All @@ -32,7 +34,7 @@ def get_list_process():
list_process = []

data = 0
with open('methods.json', 'r') as f:
with open(params_file, 'r') as f:
data = f.read()
data_json = json.loads(data)

Expand Down Expand Up @@ -91,7 +93,26 @@ def run_process(cores=4):
start_time = time.time()
print('start prgrm')

run_process()

log_files_dir = 'logs_0.1_0.15/'
params_file = 'methods_0.1_0.15.json'
run_process(cores=cores)

print('#'*80)
print('time = ', time.time() - start_time)
print('#'*80)

log_files_dir = 'logs_0.1_0.2/'
params_file = 'methods_0.1_0.2.json'
run_process(cores=cores)

print('#'*80)
print('time = ', time.time() - start_time)
print('#'*80)

log_files_dir = 'logs_0.1_0.25/'
params_file = 'methods_0.1_0.25.json'
run_process(cores=cores)

print("end prgrm")
print(time.time() - start_time)
Expand Down

0 comments on commit 44db5cc

Please sign in to comment.