Commit b8455ea9 by Karsa Zoltán István

Merge branch 'szabalyos' into 'master'

Szabalyos, bogfix

See merge request !4
parents 08d6cac9 6ad6141f
...@@ -52,3 +52,4 @@ docs/_build/ ...@@ -52,3 +52,4 @@ docs/_build/
.vscode/ .vscode/
*.out *.out
*.full
...@@ -86,7 +86,7 @@ __device__ inline bool intriangle(const vec3& Q, const vec3& A, const vec3& B, c ...@@ -86,7 +86,7 @@ __device__ inline bool intriangle(const vec3& Q, const vec3& A, const vec3& B, c
__device__ inline int stabil_ep(const vec3& S, const vec3& C, const vec3& D) { __device__ inline int stabil_ep(const vec3& S, const vec3& C, const vec3& D) {
int cnt = 0; int cnt = 0;
vec3 A(0, 0, 0), B(0, 0, 1.0); vec3 A(0, 0, 0), B(1.0, 0, 0.0);
// ABC oldal: // ABC oldal:
vec3 planeNN = normalize(cross(B-A, C-A)); vec3 planeNN = normalize(cross(B-A, C-A));
vec3 P = intersection(planeNN, A, S); vec3 P = intersection(planeNN, A, S);
...@@ -128,7 +128,7 @@ __device__ inline bool instabil_ell(const vec3& S, const vec3& X, const vec3& A, ...@@ -128,7 +128,7 @@ __device__ inline bool instabil_ell(const vec3& S, const vec3& X, const vec3& A,
__device__ inline int instabil_ep(const vec3& S, const vec3& C, const vec3& D) { __device__ inline int instabil_ep(const vec3& S, const vec3& C, const vec3& D) {
int cnt = 0; int cnt = 0;
vec3 A(0, 0, 0), B(0, 0, 1.0); vec3 A(0, 0, 0), B(1.0, 0, 0.0);
// D CSUCSNAL // D CSUCSNAL
if (instabil_ell(S, D, A, B, C)) if (instabil_ell(S, D, A, B, C))
cnt++; cnt++;
...@@ -166,7 +166,7 @@ __device__ inline bool nyereg_ell(const vec3& S, const vec3& X1, const vec3& X2, ...@@ -166,7 +166,7 @@ __device__ inline bool nyereg_ell(const vec3& S, const vec3& X1, const vec3& X2,
__device__ inline int nyereg_ep(const vec3& S, const vec3& C, const vec3& D) { __device__ inline int nyereg_ep(const vec3& S, const vec3& C, const vec3& D) {
int cnt = 0; int cnt = 0;
vec3 A(0, 0, 0), B(0, 0, 1.0); vec3 A(0, 0, 0), B(1.0, 0.0, 0.0);
if (nyereg_ell(S, A, B, C, D)) if (nyereg_ell(S, A, B, C, D))
cnt++; cnt++;
...@@ -190,13 +190,13 @@ __device__ void ABC_oldal(int v, int w, const vec3& C, const vec3& D, char* egys ...@@ -190,13 +190,13 @@ __device__ void ABC_oldal(int v, int w, const vec3& C, const vec3& D, char* egys
vec3 AB(1.0/v, 0.0, 0.0); vec3 AB(1.0/v, 0.0, 0.0);
vec3 AC = C/v; vec3 AC = C/v;
for (double i = 0.0001; i < v; i++) for (double i = 0.0; i < v; i++)
{ {
for (double j = 0.0001; j < v; j++) for (double j = 0.0; j < v; j++)
{ {
vec3 K = i*AB + j * AC; vec3 K = i*AB + j * AC;
vec3 L = (D - K)/w; vec3 L = (D - K)/w;
for (double k = 0.0001; k < w; k++) for (double k = 0.0; k < w; k++)
{ {
vec3 Sv = K + L*k; vec3 Sv = K + L*k;
int S = stabil_ep(Sv, C, D); int S = stabil_ep(Sv, C, D);
...@@ -213,17 +213,17 @@ __device__ void ABC_oldal(int v, int w, const vec3& C, const vec3& D, char* egys ...@@ -213,17 +213,17 @@ __device__ void ABC_oldal(int v, int w, const vec3& C, const vec3& D, char* egys
__device__ void BCD_oldal(int v, int w, const vec3& C, const vec3& D, char* egysulyi_mtx) { __device__ void BCD_oldal(int v, int w, const vec3& C, const vec3& D, char* egysulyi_mtx) {
int pos = blockDim.x * blockIdx.x + threadIdx.x; int pos = blockDim.x * blockIdx.x + threadIdx.x;
vec3 A(0.0, 0.0, 0.0), B(0.0, 0.0, 1.0); vec3 A(0.0, 0.0, 0.0), B(1.0, 0.0, 0.0);
vec3 BC = (C - B) / v; vec3 BC = (C - B) / v;
vec3 BD = (D - B) / v; vec3 BD = (D - B) / v;
for (double i = 0.0001; i < v; i++) for (double i = 0.0; i < v; i++)
{ {
for (double j = 0.0001; j < v; j++) for (double j = 0.0; j < v; j++)
{ {
vec3 K = B + i * BC + j * BD; vec3 K = B + i * BC + j * BD;
vec3 L = (A - K)/w; vec3 L = (A - K)/w;
for (double k = 0.0001; k < w; k++) for (double k = 0.0; k < w; k++)
{ {
vec3 Sv = K + L*k; vec3 Sv = K + L*k;
int S = stabil_ep(Sv, C, D); int S = stabil_ep(Sv, C, D);
...@@ -240,17 +240,17 @@ __device__ void BCD_oldal(int v, int w, const vec3& C, const vec3& D, char* egys ...@@ -240,17 +240,17 @@ __device__ void BCD_oldal(int v, int w, const vec3& C, const vec3& D, char* egys
__device__ void CDA_oldal(int v, int w, const vec3& C, const vec3& D, char* egysulyi_mtx) { __device__ void CDA_oldal(int v, int w, const vec3& C, const vec3& D, char* egysulyi_mtx) {
int pos = blockDim.x * blockIdx.x + threadIdx.x; int pos = blockDim.x * blockIdx.x + threadIdx.x;
vec3 A(0.0, 0.0, 0.0), B(0.0, 0.0, 1.0); vec3 A(0.0, 0.0, 0.0), B(1.0, 0.0, 0.0);
vec3 CA = (A - C) / v; vec3 CA = (A - C) / v;
vec3 CD = (D - C) / v; vec3 CD = (D - C) / v;
for (double i = 0.0001; i < v; i++) for (double i = 0.0; i < v; i++)
{ {
for (double j = 0.0001; j < v; j++) for (double j = 0.0; j < v; j++)
{ {
vec3 K = C + i * CA + j * CD; vec3 K = C + i * CA + j * CD;
vec3 L = (B - K)/w; vec3 L = (B - K)/w;
for (double k = 0.0001; k < w; k++) for (double k = 0.0; k < w; k++)
{ {
vec3 Sv = K + L*k; vec3 Sv = K + L*k;
int S = stabil_ep(Sv, C, D); int S = stabil_ep(Sv, C, D);
...@@ -267,17 +267,17 @@ __device__ void CDA_oldal(int v, int w, const vec3& C, const vec3& D, char* egys ...@@ -267,17 +267,17 @@ __device__ void CDA_oldal(int v, int w, const vec3& C, const vec3& D, char* egys
__device__ void DAB_oldal(int v, int w, const vec3& C, const vec3& D, char* egysulyi_mtx) { __device__ void DAB_oldal(int v, int w, const vec3& C, const vec3& D, char* egysulyi_mtx) {
int pos = blockDim.x * blockIdx.x + threadIdx.x; int pos = blockDim.x * blockIdx.x + threadIdx.x;
vec3 A(0.0, 0.0, 0.0), B(0.0, 0.0, 1.0); vec3 A(0.0, 0.0, 0.0), B(1.0, 0.0, 0.0);
vec3 DA = (A - D) / v; vec3 DA = (A - D) / v;
vec3 DB = (B - D) / v; vec3 DB = (B - D) / v;
for (double i = 0.0001; i < v; i++) for (double i = 0.0; i < v; i++)
{ {
for (double j = 0.0001; j < v; j++) for (double j = 0.0; j < v; j++)
{ {
vec3 K = D + i * DA + j * DB; vec3 K = D + i * DA + j * DB;
vec3 L = (C - K)/w; vec3 L = (C - K)/w;
for (double k = 0.0001; k < w; k++) for (double k = 0.0; k < w; k++)
{ {
vec3 Sv = K + L*k; vec3 Sv = K + L*k;
int S = stabil_ep(Sv, C, D); int S = stabil_ep(Sv, C, D);
......
...@@ -98,7 +98,9 @@ def angles_alap(anglestopick, plot = False): ...@@ -98,7 +98,9 @@ def angles_alap(anglestopick, plot = False):
tCx = tCy / tgtA tCx = tCy / tgtA
Cx = cp.concatenate((hCx, tCx), axis=None) Cx = cp.concatenate((hCx, tCx), axis=None)
Cx = cp.append(Cx, [0.5], axis=False)
Cy = cp.concatenate((hCy, tCy), axis=None) Cy = cp.concatenate((hCy, tCy), axis=None)
Cy = cp.append(Cy, [cp.sqrt(3.0)/2.0], axis=False)
return Cx, Cy return Cx, Cy
...@@ -140,7 +142,10 @@ def angles_ratet(anglestopick, plot = False): ...@@ -140,7 +142,10 @@ def angles_ratet(anglestopick, plot = False):
sin = cp.sin(anglestopick) sin = cp.sin(anglestopick)
Dx = cp.outer(cp.full(anglestopick.size, 1.0, dtype=cp.float64), Ex).flatten() Dx = cp.outer(cp.full(anglestopick.size, 1.0, dtype=cp.float64), Ex).flatten()
Dx = cp.append(Dx, [0.5], axis=False)
Dy = cp.outer(cos, Ey).flatten() Dy = cp.outer(cos, Ey).flatten()
Dy = cp.append(Dy, [cp.sqrt(3.0)/6.0], axis=False)
Dz = cp.outer(sin, Ey).flatten() Dz = cp.outer(sin, Ey).flatten()
Dz = cp.append(Dz, [cp.sqrt(2.0/3.0)], axis=False)
return Dx, Dy, Dz return Dx, Dy, Dz
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment