Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Karsa Zoltán István
/
politopok
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
664a5bf9
authored
Jan 24, 2023
by
Zoltan Karsa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
instabil
parent
1e55b867
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
2 deletions
+41
-2
.gitignore
+2
-0
epgpu.cu
+39
-2
No files found.
.gitignore
View file @
664a5bf9
...
@@ -49,3 +49,4 @@ coverage.xml
...
@@ -49,3 +49,4 @@ coverage.xml
# Sphinx documentation
# Sphinx documentation
docs/_build/
docs/_build/
.vscode/
\ No newline at end of file
epgpu.cu
View file @
664a5bf9
...
@@ -60,8 +60,14 @@ __device__ inline mat3 operator*(const mat3& left, const mat3& right) {
...
@@ -60,8 +60,14 @@ __device__ inline mat3 operator*(const mat3& left, const mat3& right) {
return result;
return result;
}
}
__device__ inline double signeddistance(const vec3& planeNN, const vec3& planeP, const vec3& Q) {
vec3 PQ = - planeP;
return dot(PQ, planeNN);
}
__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) {
// ABC oldalon
// ABC oldalon
int cnt = 0;
vec3 A(0, 0, 0), B(0, 0, 1.0);
vec3 A(0, 0, 0), B(0, 0, 1.0);
vec3 planeN = normalize(cross(B, C));
vec3 planeN = normalize(cross(B, C));
double distance = dot(planeN, C);
double distance = dot(planeN, C);
...
@@ -69,6 +75,37 @@ __device__ inline int stabil_ep(const vec3& S, const vec3& C, const vec3& D) {
...
@@ -69,6 +75,37 @@ __device__ inline int stabil_ep(const vec3& S, const vec3& C, const vec3& D) {
double t = -(distance + dot(S, planeN)) / rate;
double t = -(distance + dot(S, planeN)) / rate;
vec3 projABC = S + t*planeN;
vec3 projABC = S + t*planeN;
return cnt;
}
__device__ inline bool instabil_ell(const vec3& S, const vec3& X, const vec3& A, const vec3& B, const vec3& C) {
vec3 planeN = normalize(X - S);
double signDistanceA = signeddistance(planeN, X, A);
double signDistanceB = signeddistance(planeN, X, B);
double signDistanceC = signeddistance(planeN, X, C);
if (signDistanceA <= 0.0 && signDistanceB <= 0.0 && signDistanceC <= 0.0)
return true;
if (signDistanceA > 0.0 && signDistanceB > 0.0 && signDistanceC > 0.0)
return true;
return false;
}
__device__ inline int instabil_ep(const vec3& S, const vec3& C, const vec3& D) {
int cnt = 0;
vec3 A(0, 0, 0), B(0, 0, 1.0);
// D CSUCSNAL
if (instabil_ell(S, D, A, B, C))
cnt++;
// A CSUCSNAL
if (instabil_ell(S, A, D, B, C))
cnt++;
// B CSUCSNAL
if (instabil_ell(S, B, A, D, C))
cnt++;
// C CSUCSNAL
if (instabil_ell(S, C, A, B, D))
cnt++;
return cnt;
}
}
__device__ void ABC_oldal(int v, int w, double* Cx_arr, double* Cy_arr,
__device__ void ABC_oldal(int v, int w, double* Cx_arr, double* Cy_arr,
...
@@ -89,8 +126,8 @@ __device__ void ABC_oldal(int v, int w, double* Cx_arr, double* Cy_arr,
...
@@ -89,8 +126,8 @@ __device__ void ABC_oldal(int v, int w, double* Cx_arr, double* Cy_arr,
for (double k = 0; k < w + 1; k++)
for (double k = 0; k < w + 1; k++)
{
{
vec3 Sv = K + L*k;
vec3 Sv = K + L*k;
int S =
0
;
int S =
stabil_ep(Sv, C, D)
;
int U =
0
;
int U =
instabil_ep(Sv, C, D)
;
int H = 0;
int H = 0;
egysulyi_mtx[pos*16+S*4+U] = 1;
egysulyi_mtx[pos*16+S*4+U] = 1;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment