Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-tectonic
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
podlesny
dune-tectonic
Commits
f37f2ec0
Commit
f37f2ec0
authored
4 years ago
by
podlesny
Browse files
Options
Downloads
Patches
Plain Diff
currently not used, next step: remove mygrids
parent
74dce30f
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dune/tectonic/problem-data/grid/mygrids.cc
+54
-76
54 additions, 76 deletions
dune/tectonic/problem-data/grid/mygrids.cc
dune/tectonic/problem-data/grid/mygrids.hh
+15
-4
15 additions, 4 deletions
dune/tectonic/problem-data/grid/mygrids.hh
with
69 additions
and
80 deletions
dune/tectonic/problem-data/grid/mygrids.cc
+
54
−
76
View file @
f37f2ec0
...
...
@@ -10,9 +10,62 @@
#include
"simplexmanager.hh"
// -------------------------------------------------
// GridsConstructor
// -------------------------------------------------
template
<
class
Grid
>
GridsConstructor
<
Grid
>::
GridsConstructor
(
const
std
::
vector
<
std
::
shared_ptr
<
CuboidGeometry
<
typename
Grid
::
ctype
>>>&
cuboidGeometries
)
:
cuboidGeometries_
(
cuboidGeometries
)
{
size_t
const
gridCount
=
cuboidGeometries_
.
size
();
grids_
.
resize
(
gridCount
);
gridFactories_
.
resize
(
gridCount
);
buildGrids
();
}
template
<
class
Grid
>
std
::
vector
<
std
::
shared_ptr
<
Grid
>>&
GridsConstructor
<
Grid
>::
getGrids
()
{
return
grids
;
}
template
<
class
Grid
>
template
<
class
GridView
>
MyFaces
<
GridView
>
GridsConstructor
<
Grid
>::
constructFaces
(
GridView
const
&
gridView
,
const
CuboidGeometry
<
typename
Grid
::
ctype
>&
cuboidGeometry
)
{
return
MyFaces
<
GridView
>
(
gridView
,
cuboidGeometry
);
}
// Fix: 3D case (still Elias code)
template
<
class
Grid
>
GridsConstructor
<
Grid
>::
GridsConstructor
(
const
std
::
vector
<
std
::
shared_ptr
<
CuboidGeometry
<
typename
Grid
::
ctype
>>>&
cuboidGeometries_
)
:
cuboidGeometries
(
cuboidGeometries_
)
template
<
class
Grid
>
std
::
vector
<
std
::
shared_ptr
<
Grid
>>&
GridsConstructor
<
Grid
>::
getGrids
()
{
return
grids
;
}
template
<
class
Grid
>
template
<
class
GridView
>
MyFaces
<
GridView
>
GridsConstructor
<
Grid
>::
constructFaces
(
GridView
const
&
gridView
,
const
CuboidGeometry
<
typename
Grid
::
ctype
>&
cuboidGeometry
)
{
return
MyFaces
<
GridView
>
(
gridView
,
cuboidGeometry
);
}
// -------------------------------------------------
// UniformGridsContructor
// -------------------------------------------------
template
<
class
Grid
>
UniformGridsConstructor
<
Grid
>::
UniformGridsContructor
(
const
std
::
vector
<
std
::
shared_ptr
<
CuboidGeometry
<
typename
Grid
::
ctype
>>>&
cuboidGeometries_
)
:
cuboidGeometries
(
cuboidGeometries_
)
{
size_t
const
gridCount
=
cuboidGeometries
.
size
();
grids
.
resize
(
gridCount
);
...
...
@@ -90,7 +143,7 @@ template <class Grid> GridsConstructor<Grid>::GridsConstructor(const std::vector
}
template
<
class
Grid
>
std
::
vector
<
std
::
shared_ptr
<
Grid
>>&
GridsCon
s
tructor
<
Grid
>::
getGrids
()
{
std
::
vector
<
std
::
shared_ptr
<
Grid
>>&
Uniform
GridsContructor
<
Grid
>::
getGrids
()
{
return
grids
;
}
...
...
@@ -101,81 +154,6 @@ MyFaces<GridView> GridsConstructor<Grid>::constructFaces(
return
MyFaces
<
GridView
>
(
gridView
,
cuboidGeometry
);
}
template
<
class
GridView
>
template
<
class
Vector
>
bool
MyFaces
<
GridView
>::
xyCollinear
(
Vector
const
&
a
,
Vector
const
&
b
,
Vector
const
&
c
)
{
return
isClose2
((
b
[
0
]
-
a
[
0
])
*
(
c
[
1
]
-
a
[
1
]),
(
b
[
1
]
-
a
[
1
])
*
(
c
[
0
]
-
a
[
0
]));
}
template
<
class
GridView
>
template
<
class
Vector
>
bool
MyFaces
<
GridView
>::
xyBoxed
(
Vector
const
&
v1
,
Vector
const
&
v2
,
Vector
const
&
x
)
{
auto
const
minmax0
=
std
::
minmax
(
v1
[
0
],
v2
[
0
]);
auto
const
minmax1
=
std
::
minmax
(
v1
[
1
],
v2
[
1
]);
if
(
minmax0
.
first
-
1e-14
*
cuboidGeometry
.
lengthScale
()
>
x
[
0
]
or
x
[
0
]
>
minmax0
.
second
+
1e-14
*
cuboidGeometry
.
lengthScale
())
return
false
;
if
(
minmax1
.
first
-
1e-14
*
cuboidGeometry
.
lengthScale
()
>
x
[
1
]
or
x
[
1
]
>
minmax1
.
second
+
1e-14
*
cuboidGeometry
.
lengthScale
())
return
false
;
return
true
;
}
template
<
class
GridView
>
template
<
class
Vector
>
bool
MyFaces
<
GridView
>::
xyBetween
(
Vector
const
&
v1
,
Vector
const
&
v2
,
Vector
const
&
x
)
{
return
xyCollinear
(
v1
,
v2
,
x
)
&&
xyBoxed
(
v1
,
v2
,
x
);
}
template
<
class
GridView
>
MyFaces
<
GridView
>::
MyFaces
(
GridView
const
&
gridView
,
const
CuboidGeometry
<
typename
GridView
::
ctype
>&
cuboidGeometry_
)
:
#if MY_DIM == 3
lower
(
gridView
),
right
(
gridView
),
upper
(
gridView
),
left
(
gridView
),
front
(
gridView
),
back
(
gridView
),
#else
lower
(
gridView
),
right
(
gridView
),
upper
(
gridView
),
left
(
gridView
),
#endif
cuboidGeometry
(
cuboidGeometry_
)
{
lower
.
insertFacesByProperty
([
&
](
typename
GridView
::
Intersection
const
&
in
)
{
return
xyBetween
(
cuboidGeometry
.
lowerLeft
(),
cuboidGeometry
.
lowerRight
(),
in
.
geometry
().
center
());
});
right
.
insertFacesByProperty
([
&
](
typename
GridView
::
Intersection
const
&
in
)
{
return
xyBetween
(
cuboidGeometry
.
lowerRight
(),
cuboidGeometry
.
upperRight
(),
in
.
geometry
().
center
());
});
upper
.
insertFacesByProperty
([
&
](
typename
GridView
::
Intersection
const
&
in
)
{
return
xyBetween
(
cuboidGeometry
.
upperLeft
(),
cuboidGeometry
.
upperRight
(),
in
.
geometry
().
center
());
});
left
.
insertFacesByProperty
([
&
](
typename
GridView
::
Intersection
const
&
in
)
{
return
xyBetween
(
cuboidGeometry
.
lowerLeft
(),
cuboidGeometry
.
upperLeft
(),
in
.
geometry
().
center
());
});
#if MY_DIM == 3
front
.
insertFacesByProperty
([
&
](
typename
GridView
::
Intersection
const
&
in
)
{
return
isClose
(
cuboidGeometry
.
depth
()
/
2.0
,
in
.
geometry
().
center
()[
2
]);
});
back
.
insertFacesByProperty
([
&
](
typename
GridView
::
Intersection
const
&
in
)
{
return
isClose
(
-
cuboidGeometry
.
depth
()
/
2.0
,
in
.
geometry
().
center
()[
2
]);
});
#endif
}
double
computeAdmissibleDiameter
(
double
distance
,
double
smallestDiameter
,
double
lengthScale
)
{
return
(
distance
/
0.0125
/
lengthScale
+
1.0
)
*
smallestDiameter
;
...
...
This diff is collapsed.
Click to expand it.
dune/tectonic/problem-data/grid/mygrids.hh
+
15
−
4
View file @
f37f2ec0
...
...
@@ -44,11 +44,11 @@ template <class GridView> struct MyFaces {
bool
xyBetween
(
Vector
const
&
v1
,
Vector
const
&
v2
,
Vector
const
&
x
);
};
template
<
class
Grid
>
class
GridsConstructor
{
public:
GridsConstructor
(
const
std
::
vector
<
std
::
shared_ptr
<
CuboidGeometry
<
typename
Grid
::
ctype
>>>&
cuboidGeometries_
);
std
::
vector
<
std
::
shared_ptr
<
Grid
>>&
getGrids
();
template
<
class
Grid
>
class
CuboidGridConstructor
:
public
GridConstructor
<
Grid
>
{
public:
CuboidGridConstructor
(
const
CuboidGeometry
<
typename
Grid
::
ctype
>&
cuboidGeometry
);
template
<
class
GridView
>
MyFaces
<
GridView
>
constructFaces
(
const
GridView
&
gridView
,
const
CuboidGeometry
<
typename
Grid
::
ctype
>&
cuboidGeometry
);
...
...
@@ -59,12 +59,23 @@ template <class Grid> class GridsConstructor {
std
::
vector
<
std
::
shared_ptr
<
Grid
>>
grids
;
};
template
<
class
Grid
>
class
UniformGridsConstructor
:
public
GridsConstructor
<
Grid
>
{
public:
UniformGridsConstructor
(
const
std
::
vector
<
std
::
shared_ptr
<
CuboidGeometry
<
typename
Grid
::
ctype
>>>&
cuboidGeometries_
);
};
double
computeAdmissibleDiameter
(
double
distance
,
double
smallestDiameter
,
double
lengthScale
);
template
<
class
Grid
,
class
LocalVector
>
void
refine
(
Grid
&
grid
,
ConvexPolyhedron
<
LocalVector
>
const
&
weakPatch
,
double
smallestDiameter
,
double
lengthScale
);
template
<
class
Grid
>
void
refine
(
Grid
&
grid
,
size_t
uniformRefinements
);
#endif
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