Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Kirill Terekhov
INMOST
Commits
0d6da2b1
Commit
0d6da2b1
authored
Oct 10, 2016
by
ahmadabushaikha
Browse files
Some features
Tetrahedral mesh in GridGen. RT0 tetrahedral mixed hybred in ADMFD example.
parent
b0eff6aa
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Examples/ADMFD/main.cpp
View file @
0d6da2b1
This diff is collapsed.
Click to expand it.
Examples/GridGen/main.cpp
View file @
0d6da2b1
...
...
@@ -82,6 +82,50 @@ void CreateNWPrismElements(Mesh *m, ElementArray<Node> verts)
m
->
CreateCell
(
verts
,
sw_face_nodes
,
sw_num_nodes
,
5
);
// Create south-west prismatic cell
}
/* (4)*-------*(6)
/|\ /|
/ \ / |
/ | \ / |
(5)*-------*(7)|
| | | |
| | |
| | | |
|(0)*- -|- -*(2)
| / \ | /
| | /
|/ \|/
(1)*-------*(3) */
void
CreateNWTetElements
(
Mesh
*
m
,
ElementArray
<
Node
>
verts
)
{
// Define prism faces assuming verts are numerated in the way presented above
const
INMOST_DATA_INTEGER_TYPE
ne_face_nodes1
[
12
]
=
{
0
,
1
,
5
,
5
,
1
,
3
,
1
,
0
,
3
,
3
,
0
,
5
};
const
INMOST_DATA_INTEGER_TYPE
ne_num_nodes1
[
4
]
=
{
3
,
3
,
3
,
3
};
const
INMOST_DATA_INTEGER_TYPE
ne_face_nodes2
[
12
]
=
{
0
,
3
,
5
,
0
,
7
,
3
,
5
,
3
,
7
,
0
,
5
,
7
};
const
INMOST_DATA_INTEGER_TYPE
ne_num_nodes2
[
4
]
=
{
3
,
3
,
3
,
3
};
const
INMOST_DATA_INTEGER_TYPE
ne_face_nodes3
[
12
]
=
{
0
,
7
,
5
,
4
,
5
,
7
,
0
,
5
,
4
,
0
,
4
,
7
};
const
INMOST_DATA_INTEGER_TYPE
ne_num_nodes3
[
4
]
=
{
3
,
3
,
3
,
3
};
const
INMOST_DATA_INTEGER_TYPE
sw_face_nodes1
[
12
]
=
{
0
,
3
,
7
,
2
,
7
,
3
,
0
,
7
,
2
,
0
,
2
,
3
};
const
INMOST_DATA_INTEGER_TYPE
sw_num_nodes1
[
4
]
=
{
3
,
3
,
3
,
3
};
const
INMOST_DATA_INTEGER_TYPE
sw_face_nodes2
[
12
]
=
{
0
,
7
,
4
,
0
,
2
,
7
,
2
,
4
,
7
,
0
,
4
,
2
};
const
INMOST_DATA_INTEGER_TYPE
sw_num_nodes2
[
4
]
=
{
3
,
3
,
3
,
3
};
const
INMOST_DATA_INTEGER_TYPE
sw_face_nodes3
[
12
]
=
{
4
,
6
,
2
,
6
,
7
,
2
,
4
,
7
,
6
,
4
,
2
,
7
};
const
INMOST_DATA_INTEGER_TYPE
sw_num_nodes3
[
4
]
=
{
3
,
3
,
3
,
3
};
m
->
CreateCell
(
verts
,
ne_face_nodes1
,
ne_num_nodes1
,
4
);
// Create north-east prismatic cell
m
->
CreateCell
(
verts
,
ne_face_nodes2
,
ne_num_nodes2
,
4
);
// Create north-east prismatic cell
m
->
CreateCell
(
verts
,
ne_face_nodes3
,
ne_num_nodes3
,
4
);
// Create north-east prismatic cell
m
->
CreateCell
(
verts
,
sw_face_nodes1
,
sw_num_nodes1
,
4
);
// Create south-west prismatic cell
m
->
CreateCell
(
verts
,
sw_face_nodes2
,
sw_num_nodes2
,
4
);
// Create south-west prismatic cell
m
->
CreateCell
(
verts
,
sw_face_nodes3
,
sw_num_nodes3
,
4
);
// Create south-west prismatic cell
}
Mesh
*
ParallelGenerator
(
INMOST_MPI_Comm
comm
,
int
ng
,
int
nx
,
int
ny
,
int
nz
)
{
int
procs_per_axis
[
3
]
=
{
1
,
1
,
1
};
...
...
@@ -175,7 +219,11 @@ Mesh * ParallelGenerator(INMOST_MPI_Comm comm, int ng, int nx, int ny, int nz)
verts
.
push_back
(
newverts
[
V_ID
(
i
-
0
,
j
-
0
,
k
-
0
)]);
// 7 /* | | / */
/* |/ |/ */
// Create cells based on parameter ng /* (1)*-------*(3) */
if
(
ng
==
4
)
// Create cubic cell
if
(
ng
==
5
)
{
CreateNWTetElements
(
m
,
verts
);
}
else
if
(
ng
==
4
)
// Create cubic cell
{
CreateCubeElement
(
m
,
verts
);
}
...
...
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