Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-faultnetworks
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
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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-faultnetworks
Commits
7a2df5fc
Commit
7a2df5fc
authored
4 years ago
by
podlesny
Browse files
Options
Downloads
Patches
Plain Diff
.
parent
a5889017
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dune/faultnetworks/faultfactories/rockfaultfactory.hh
+30
-55
30 additions, 55 deletions
dune/faultnetworks/faultfactories/rockfaultfactory.hh
with
30 additions
and
55 deletions
dune/faultnetworks/faultfactories/rockfaultfactory.hh
+
30
−
55
View file @
7a2df5fc
...
...
@@ -70,7 +70,7 @@ protected:
using
FaceMapper
=
typename
Dune
::
MultipleCodimMultipleGeomTypeMapper
<
GV
,
FaceMapperLayout
>
;
using
Rock
=
Rock
<
ctype
>
;
using
My
Rock
=
Rock
<
ctype
>
;
const
std
::
shared_ptr
<
GridType
>
grid_
;
const
int
level_
;
...
...
@@ -95,7 +95,7 @@ protected:
std
::
vector
<
int
>
coarseToLevelVertex_
;
const
LevelRockFaultFactory
&
coarseLevelFactory_
;
std
::
vector
<
Rock
>
rocks_
;
std
::
vector
<
My
Rock
>
rocks_
;
std
::
vector
<
std
::
shared_ptr
<
FaultInterface
<
GV
>>>&
faults_
;
private
:
...
...
@@ -363,73 +363,30 @@ private:
auto
searchDof
(
const
ID
&
IDs
,
const
std
::
set
<
size_t
>&
separatingDofs
,
size_t
dim
,
int
dir
)
{
auto
candidatIDs
=
IDs
;
size_t
count
=
0
;
int
lastDof
=
-
1
;
bool
keepSearching
=
true
;
if
(
dir
>
0
)
{
while
(
lastDof
<
0
)
{
candidatIDs
[
dim
]
=
IDs
[
dim
]
-
count
;
candidatIDs
[
dim
]
++
;
auto
dof
=
IDsToDof_
[
candidatIDs
];
if
(
separatingDofs
.
count
(
dof
))
{
lastDof
=
dof
;
}
candidatIDs
[
dim
]
=
IDs
[
dim
]
+
count
;
dof
=
IDsToDof_
[
candidatIDs
];
if
(
separatingDofs
.
count
(
dof
))
{
lastDof
=
dof
;
}
count
++
;
}
while
(
keepSearching
)
{
candidatIDs
[
dim
]
=
IDs
[
dim
]
+
count
;
auto
dof
=
IDsToDof_
[
candidatIDs
];
if
(
separatingDofs
.
count
(
dof
))
{
lastDof
=
dof
;
}
else
{
keepSearching
=
false
;
}
count
++
;
}
}
else
{
while
(
lastDof
<
0
)
{
candidatIDs
[
dim
]
=
IDs
[
dim
]
+
count
;
auto
dof
=
IDsToDof_
[
candidatIDs
];
if
(
separatingDofs
.
count
(
dof
))
{
lastDof
=
dof
;
}
candidatIDs
[
dim
]
=
IDs
[
dim
]
-
count
;
dof
=
IDsToDof_
[
candidatIDs
];
if
(
separatingDofs
.
count
(
dof
))
{
lastDof
=
dof
;
}
count
++
;
}
while
(
keepSearching
)
{
candidatIDs
[
dim
]
=
IDs
[
dim
]
-
count
;
candidatIDs
[
dim
]
--
;
auto
dof
=
IDsToDof_
[
candidatIDs
];
if
(
separatingDofs
.
count
(
dof
))
{
lastDof
=
dof
;
}
else
{
keepSearching
=
false
;
}
count
++
;
}
}
return
lastDof
;
}
void
createRock
(
Rock
&
rock
,
const
Coords
&
center
,
const
std
::
set
<
size_t
>&
separatingDofs
,
void
createRock
(
My
Rock
&
rock
,
const
Coords
&
center
,
const
std
::
set
<
size_t
>&
separatingDofs
,
const
std
::
set
<
size_t
>&
xFaultDofs
,
bool
xFaultBottom
,
const
std
::
set
<
size_t
>&
yFaultDofs
,
bool
yFaultRight
)
{
...
...
@@ -438,10 +395,28 @@ private:
const
ID
centerIDs
=
{
computeID
(
center
(),
0
),
computeID
(
center
(),
1
)};
size_t
left
,
right
,
top
,
bottom
=
0
;
if
(
xFaultBottom
)
{
top
=
searchDof
(
centerIDs
,
separatingDofs
,
1
,
1
);
bottom
=
searchDof
(
centerIDs
,
xFaultDofs
,
1
,
-
1
);
}
else
{
top
=
searchDof
(
centerIDs
,
xFaultDofs
,
1
,
1
);
bottom
=
searchDof
(
centerIDs
,
separatingDofs
,
1
,
-
1
);
}
if
(
yFaultRight
)
{
left
=
searchDof
(
centerIDs
,
separatingDofs
,
0
,
-
1
);
right
=
searchDof
(
centerIDs
,
yFaultDofs
,
0
,
1
);
}
else
{
left
=
searchDof
(
centerIDs
,
yFaultDofs
,
0
,
-
1
);
right
=
searchDof
(
centerIDs
,
separatingDofs
,
0
,
1
);
}
rock
.
set
(
left
,
right
,
top
,
bottom
,
center
);
}
void
prolong
(
const
Rock
&
rock
,
Rock
&
newRock
)
{
void
prolong
(
const
My
Rock
&
rock
,
My
Rock
&
newRock
)
{
newRock
.
level
=
rock
.
level
;
auto
newLeft
=
coarseToLevelVertex_
[
rock
.
left
()];
...
...
@@ -452,7 +427,7 @@ private:
newRock
.
set
(
newLeft
,
newRight
,
newTop
,
newBottom
,
rock
.
center
());
}
bool
randomSplit
(
const
Rock
&
rock
)
{
bool
randomSplit
(
const
My
Rock
&
rock
)
{
const
auto
&
center
=
rock
.
center
();
double
res
=
0.0
;
...
...
@@ -469,7 +444,7 @@ private:
return
100.0
*
res
>
prob
;
}
void
split
(
const
Rock
&
rock
,
const
std
::
set
<
size_t
>&
separatingDofs
)
{
void
split
(
const
My
Rock
&
rock
,
const
std
::
set
<
size_t
>&
separatingDofs
)
{
Rock
newRock
;
prolong
(
rock
,
newRock
);
...
...
@@ -506,22 +481,22 @@ private:
auto
top
=
vertexPositions_
[
newRock
.
top
];
auto
bottom
=
vertexPositions_
[
newRock
.
bottom
];
Rock
rock00
;
My
Rock
rock00
;
auto
center00
=
1.0
/
2
*
(
right
+
bottom
);
createRock
(
rock00
,
center00
,
separatingDofs
,
x2Fault
.
getInterfaceDofs
(),
0
,
y1Fault
.
getInterfaceDofs
(),
0
);
rocks_
.
push_back
(
rock00
);
Rock
rock01
;
My
Rock
rock01
;
auto
center01
=
1.0
/
2
*
(
left
+
bottom
);
createRock
(
rock01
,
center01
,
separatingDofs
,
x1Fault
.
getInterfaceDofs
(),
0
,
y1Fault
.
getInterfaceDofs
(),
1
);
rocks_
.
push_back
(
rock01
);
Rock
rock10
;
My
Rock
rock10
;
auto
center10
=
1.0
/
2
*
(
right
+
top
);
createRock
(
rock10
,
center10
,
separatingDofs
,
x2Fault
.
getInterfaceDofs
(),
1
,
y2Fault
.
getInterfaceDofs
(),
0
);
rocks_
.
push_back
(
rock10
);
Rock
rock11
;
My
Rock
rock11
;
auto
center11
=
1.0
/
2
*
(
left
+
top
);
createRock
(
rock11
,
center11
,
separatingDofs
,
x1Fault
.
getInterfaceDofs
(),
1
,
y2Fault
.
getInterfaceDofs
(),
1
);
rocks_
.
push_back
(
rock11
);
...
...
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