Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
VirtualFluids
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
iRMB
VirtualFluids
Commits
31edec76
Commit
31edec76
authored
7 years ago
by
Soeren Peters
Browse files
Options
Downloads
Patches
Plain Diff
- clean up
parent
06942dea
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/GridGenerator/grid/GridInterface.cu
+22
-16
22 additions, 16 deletions
src/GridGenerator/grid/GridInterface.cu
src/GridGenerator/grid/GridInterface.cuh
+7
-2
7 additions, 2 deletions
src/GridGenerator/grid/GridInterface.cuh
with
29 additions
and
18 deletions
src/GridGenerator/grid/GridInterface.cu
+
22
−
16
View file @
31edec76
...
...
@@ -4,10 +4,25 @@
#include
"NodeValues.h"
#include
"utilities/math/CudaMath.cuh"
GridInterface
::
GridInterface
(
const
Grid
*
fineGrid
)
{
uint
sizeCF
=
fineGrid
->
nx
*
fineGrid
->
ny
+
fineGrid
->
ny
*
fineGrid
->
nz
+
fineGrid
->
nx
*
fineGrid
->
nz
;
const
uint
sizeCF
=
fineGrid
->
nx
*
fineGrid
->
ny
+
fineGrid
->
ny
*
fineGrid
->
nz
+
fineGrid
->
nx
*
fineGrid
->
nz
;
initalCoarseToFine
(
sizeCF
,
fineGrid
);
initalFineToCoarse
(
sizeCF
,
fineGrid
);
}
GridInterface
::~
GridInterface
()
{
delete
[]
cf
.
coarse
;
delete
[]
cf
.
fine
;
delete
[]
fc
.
coarse
;
delete
[]
fc
.
fine
;
}
void
GridInterface
::
initalCoarseToFine
(
const
uint
sizeCF
,
const
Grid
*
fineGrid
)
{
cf
.
coarse
=
new
uint
[
sizeCF
];
cf
.
fine
=
new
uint
[
sizeCF
];
...
...
@@ -21,33 +36,25 @@ GridInterface::GridInterface(const Grid* fineGrid)
cf
.
coarseEntry
=
CFC
;
cf
.
fineEntry
=
CFF
;
}
void
GridInterface
::
initalFineToCoarse
(
const
uint
sizeCF
,
const
Grid
*
fineGrid
)
{
fc
.
coarse
=
new
uint
[
sizeCF
];
fc
.
fine
=
new
uint
[
sizeCF
];
fc
.
startCoarseX
=
cf
.
startCoarseX
+
4
*
fineGrid
->
delta
;
fc
.
startCoarseY
=
cf
.
startCoarseY
+
4
*
fineGrid
->
delta
;
fc
.
startCoarseZ
=
cf
.
startCoarseZ
+
4
*
fineGrid
->
delta
;
fc
.
endCoarseX
=
cf
.
endCoarseX
-
2
*
fineGrid
->
delta
;
fc
.
endCoarseY
=
cf
.
endCoarseY
-
2
*
fineGrid
->
delta
;
fc
.
endCoarseZ
=
cf
.
endCoarseZ
-
2
*
fineGrid
->
delta
;
fc
.
coarseEntry
=
FCC
;
fc
.
fineEntry
=
FCF
;
}
GridInterface
::~
GridInterface
()
{
delete
[]
cf
.
coarse
;
delete
[]
cf
.
fine
;
delete
[]
fc
.
coarse
;
delete
[]
fc
.
fine
;
}
void
GridInterface
::
findCF
(
const
uint
&
index
,
const
Grid
*
coarseGrid
,
const
Grid
*
fineGrid
)
{
findInterface
(
cf
,
1
,
index
,
coarseGrid
,
fineGrid
);
...
...
@@ -58,8 +65,7 @@ void GridInterface::findFC(const uint& index, const Grid* coarseGrid, const Grid
findInterface
(
fc
,
-
1
,
index
,
coarseGrid
,
fineGrid
);
}
void
GridInterface
::
findInterface
(
Interface
&
interface
,
const
int
&
factor
,
const
uint
&
index
,
const
Grid
*
coarseGrid
,
const
Grid
*
fineGrid
)
const
void
GridInterface
::
findInterface
(
Interface
&
interface
,
const
int
&
factor
,
const
uint
&
index
,
const
Grid
*
coarseGrid
,
const
Grid
*
fineGrid
)
{
real
x
,
y
,
z
;
coarseGrid
->
transIndexToCoords
(
index
,
x
,
y
,
z
);
...
...
@@ -97,7 +103,7 @@ bool GridInterface::isOnInterface(Interface& interface, const real& x, const rea
return
isOnXYPlanes
||
isOnXZPlanes
||
isOnYZPlanes
;
}
uint
GridInterface
::
getIndexOnFinerGrid
(
const
int
&
factor
,
const
Grid
*
fineGrid
,
const
real
&
x
,
const
real
&
y
,
const
real
&
z
)
const
uint
GridInterface
::
getIndexOnFinerGrid
(
const
int
&
factor
,
const
Grid
*
fineGrid
,
const
real
&
x
,
const
real
&
y
,
const
real
&
z
)
{
const
real
xFine
=
x
+
factor
*
(
fineGrid
->
delta
*
0.5
);
const
real
yFine
=
y
+
factor
*
(
fineGrid
->
delta
*
0.5
);
...
...
This diff is collapsed.
Click to expand it.
src/GridGenerator/grid/GridInterface.cuh
+
7
−
2
View file @
31edec76
...
...
@@ -10,7 +10,9 @@ class GridInterface
{
public:
VF_PUBLIC
GridInterface
(
const
Grid
*
finerGrid
);
VF_PUBLIC
~
GridInterface
();
void
VF_PUBLIC
findCF
(
const
uint
&
index
,
const
Grid
*
coarseGrid
,
const
Grid
*
fineGrid
);
void
VF_PUBLIC
findFC
(
const
uint
&
index
,
const
Grid
*
coarseGrid
,
const
Grid
*
fineGrid
);
...
...
@@ -30,9 +32,12 @@ private:
char
coarseEntry
,
fineEntry
;
}
fc
,
cf
;
void
findInterface
(
Interface
&
interface
,
const
int
&
factor
,
const
uint
&
index
,
const
Grid
*
coarseGrid
,
const
Grid
*
fineGrid
)
const
;
void
initalCoarseToFine
(
uint
sizeCF
,
const
Grid
*
fineGrid
);
void
initalFineToCoarse
(
uint
sizeCF
,
const
Grid
*
fineGrid
);
static
void
findInterface
(
Interface
&
interface
,
const
int
&
factor
,
const
uint
&
index
,
const
Grid
*
coarseGrid
,
const
Grid
*
fineGrid
);
static
bool
isOnInterface
(
Interface
&
interface
,
const
real
&
x
,
const
real
&
y
,
const
real
&
z
);
uint
getIndexOnFinerGrid
(
const
int
&
factor
,
const
Grid
*
fineGrid
,
const
real
&
x
,
const
real
&
y
,
const
real
&
z
)
const
;
static
uint
getIndexOnFinerGrid
(
const
int
&
factor
,
const
Grid
*
fineGrid
,
const
real
&
x
,
const
real
&
y
,
const
real
&
z
);
};
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment