Skip to content

Commit 7716ab5

Browse files
author
shiyi
committed
Merge branch 'feature/issue-442-integrator-class' of github.com:Eleven7825/svMultiPhysics into feature/issue-442-integrator-class
Please enter a commit message to explain why this merge is necessary,
2 parents 3b23497 + 7bd5223 commit 7716ab5

File tree

11 files changed

+16
-73
lines changed

11 files changed

+16
-73
lines changed

.github/actions/test-macos/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ runs:
4949
run: |
5050
git lfs pull
5151
cd tests
52-
conda run -n svmultiphysics pytest -rPv --durations=0
52+
conda run -n svmultiphysics pytest -v -rfEP --durations=0
5353
5454
- name: Run unit tests
5555
shell: bash

.github/actions/test-ubuntu/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ runs:
5353
git config --global --add safe.directory /__w/svMultiPhysics/svMultiPhysics
5454
git lfs pull
5555
cd tests
56-
conda run -n svmultiphysics pytest -rPv --durations=0
56+
conda run -n svmultiphysics pytest -v -rfEP --durations=0
5757
5858
- name: Run unit tests
5959
shell: bash

Code/Source/solver/Array.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55

66
// b o o l //
77

8-
template<>
9-
bool Array<bool>::show_index_check_message = true;
10-
118
template<>
129
int Array<bool>::id = 0;
1310

@@ -28,9 +25,6 @@ bool Array<bool>::write_enabled = false;
2825

2926
// d o u b l e //
3027

31-
template<>
32-
bool Array<double>::show_index_check_message = true;
33-
3428
template<>
3529
int Array<double>::id = 0;
3630

@@ -63,9 +57,6 @@ bool Array<double>::write_enabled = false;
6357

6458
// i n t //
6559

66-
template<>
67-
bool Array<int>::show_index_check_message = true;
68-
6960
template<>
7061
int Array<int>::id = 0;
7162

Code/Source/solver/Array.h

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ class Array
3131
static int id;
3232
static int num_allocated;
3333
static int active;
34-
static bool show_index_check_message;
3534
static double memory_in_use;
3635
static double memory_returned;
3736
static void memory(const std::string& prefix="");
@@ -945,14 +944,7 @@ class Array
945944
}
946945

947946
void check_index(const int row, const int col) const
948-
{
949-
if (show_index_check_message) {
950-
std::cout << "[Array] **********************************" << std::endl;
951-
std::cout << "[Array] WARNING: Index checking is enabled " << std::endl;
952-
std::cout << "[Array] **********************************" << std::endl;
953-
show_index_check_message = false;
954-
}
955-
947+
{
956948
if (data_ == nullptr) {
957949
//throw std::runtime_error(+"Accessing null data in Array.");
958950
return;

Code/Source/solver/Array3.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
#include "Array3.h"
55
#include "utils.h"
66

7-
template<>
8-
bool Array3<double>::show_index_check_message = true;
9-
107
template<>
118
double Array3<double>::memory_in_use = 0;
129

@@ -38,9 +35,6 @@ void Array3<double>::stats(const std::string& prefix)
3835
// int //
3936
//--------------------------//
4037

41-
template<>
42-
bool Array3<int>::show_index_check_message = true;
43-
4438
template<>
4539
double Array3<int>::memory_in_use = 0;
4640

Code/Source/solver/Array3.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ class Array3
2727

2828
static int num_allocated;
2929
static int active;
30-
static bool show_index_check_message;
3130
static double memory_in_use;
3231
static double memory_returned;
3332
static bool write_enabled;
@@ -105,13 +104,6 @@ class Array3
105104

106105
void check_index(const int i, const int j, const int k) const
107106
{
108-
if (show_index_check_message) {
109-
std::cout << "[Array3] **********************************" << std::endl;
110-
std::cout << "[Array3] WARNING: Index checking is enabled " << std::endl;
111-
std::cout << "[Array3] **********************************" << std::endl;
112-
show_index_check_message = false;
113-
}
114-
115107
if (data_ == nullptr) {
116108
throw std::runtime_error(+"Accessing null data in Array3.");
117109
}

Code/Source/solver/Tensor4.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,3 @@
22
// SPDX-License-Identifier: BSD-3-Clause
33

44
#include "Tensor4.h"
5-
6-
template<>
7-
bool Tensor4<double>::show_index_check_message = true;
8-

Code/Source/solver/Tensor4.h

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
// SPDX-FileCopyrightText: Copyright (c) Stanford University, The Regents of the University of California, and others.
22
// SPDX-License-Identifier: BSD-3-Clause
33

4-
#ifndef TENSOR4_H
5-
#define TENSOR4_H
4+
#ifndef TENSOR4_H
5+
#define TENSOR4_H
66

77
#include <cstring>
88
#include <iostream>
99

10+
#include "Vector.h"
11+
1012
#ifdef ENABLE_ARRAY_INDEX_CHECKING
1113
#define Tensor4_check_enabled
1214
#endif
1315

1416
/// @brief The Tensor4 template class implements a simple interface to 4th order tensors.
1517
//
1618
template<typename T>
17-
class Tensor4
19+
class Tensor4
1820
{
19-
static bool show_index_check_message;
20-
2121
public:
2222
std::string name_ = "";
2323
int ni_ = 0;
@@ -175,14 +175,7 @@ class Tensor4
175175
//
176176
void check_index(const int i, const int j, const int k, const int l) const
177177
{
178-
if (show_index_check_message) {
179-
std::cout << "[Tensor4] **********************************" << std::endl;
180-
std::cout << "[Tensor4] WARNING: Index checking is enabled " << std::endl;
181-
std::cout << "[Tensor4] **********************************" << std::endl;
182-
show_index_check_message = false;
183-
}
184-
185-
if (data_ == nullptr) {
178+
if (data_ == nullptr) {
186179
throw std::runtime_error(name_+"Accessing null data in Tensor4.");
187180
}
188181
if ((i < 0) || (i >= ni_) || (j < 0) || (j >= nj_) || (k < 0) || (k >= nk_) || (l < 0) || (l >= nl_)) {

Code/Source/solver/Vector.cpp

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
#include "Array.h"
55
#include "utils.h"
66

7-
template<>
8-
bool Vector<double>::show_index_check_message = true;
9-
107
template<>
118
double Vector<double>::memory_in_use = 0;
129

@@ -38,9 +35,6 @@ void Vector<double>::stats(const std::string& prefix)
3835
// int //
3936
//------//
4037

41-
template<>
42-
bool Vector<int>::show_index_check_message = true;
43-
4438
template<>
4539
double Vector<int>::memory_in_use = 0;
4640

@@ -68,10 +62,7 @@ void Vector<int>::stats(const std::string& prefix)
6862
utils::print_stats("Vector<int>", prefix, num_allocated, active);
6963
}
7064

71-
// Vector<Vector<double>>
72-
73-
template<>
74-
bool Vector<Vector<double>>::show_index_check_message = true;
65+
// Vector<Vector<double>>
7566

7667
template<>
7768
double Vector<Vector<double>>::memory_in_use = 0;
@@ -89,8 +80,6 @@ template<>
8980
bool Vector<Vector<double>>::write_enabled = false;
9081

9182
// float //
92-
template<>
93-
bool Vector<float>::show_index_check_message = true;
9483

9584
template<>
9685
double Vector<float>::memory_in_use = 0;

Code/Source/solver/Vector.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ class Vector
2929
static double memory_in_use;
3030
static double memory_returned;
3131
static bool write_enabled;
32-
static bool show_index_check_message;
3332
static void memory(const std::string& prefix="");
3433
static void stats(const std::string& prefix="");
3534

@@ -575,13 +574,6 @@ class Vector
575574

576575
void check_index(const int i) const
577576
{
578-
if (show_index_check_message) {
579-
std::cout << "[Vector] **********************************" << std::endl;
580-
std::cout << "[Vector] WARNING: Index checking is enabled " << std::endl;
581-
std::cout << "[Vector] **********************************" << std::endl;
582-
show_index_check_message = false;
583-
}
584-
585577
if (data_ == nullptr) {
586578
std::cout << "[Vector] WARNING: Accessing null data in Vector at " << i << std::endl;
587579
return;

0 commit comments

Comments
 (0)