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
85169267
Commit
85169267
authored
3 years ago
by
podlesny
Browse files
Options
Downloads
Patches
Plain Diff
make weakening patches settable from cfg file
parent
60b28899
Branches
2016-PippingKornhuberRosenauOncken
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dune/tectonic/factories/strikeslipfactory.cc
+48
-3
48 additions, 3 deletions
dune/tectonic/factories/strikeslipfactory.cc
dune/tectonic/factories/strikeslipfactory.hh
+2
-0
2 additions, 0 deletions
dune/tectonic/factories/strikeslipfactory.hh
with
50 additions
and
3 deletions
dune/tectonic/factories/strikeslipfactory.cc
+
48
−
3
View file @
85169267
...
@@ -2,6 +2,9 @@
...
@@ -2,6 +2,9 @@
#include
"config.h"
#include
"config.h"
#endif
#endif
#include
<vector>
#include
<regex>
#include
<dune/fufem/geometry/convexpolyhedron.hh>
#include
<dune/fufem/geometry/convexpolyhedron.hh>
#include
<dune/contact/projections/normalprojection.hh>
#include
<dune/contact/projections/normalprojection.hh>
...
@@ -14,6 +17,34 @@
...
@@ -14,6 +17,34 @@
#include
"strikeslipfactory.hh"
#include
"strikeslipfactory.hh"
template
<
class
HostGridType
,
class
VectorTEMPLATE
>
std
::
vector
<
double
>
StrikeSlipFactory
<
HostGridType
,
VectorTEMPLATE
>::
parsePatchString
(
const
std
::
string
&
patch_str
)
{
std
::
vector
<
double
>
res
;
std
::
string
str
=
patch_str
;
std
::
regex
my_regex
(
"[0-9]+
\\
.[0-9]+"
);
double
lower
=
0.0
;
std
::
smatch
match
;
while
(
std
::
regex_search
(
str
,
match
,
my_regex
))
{
double
newVal
=
atof
(
match
[
0
].
str
().
c_str
());
if
(
newVal
<=
lower
)
{
DUNE_THROW
(
Dune
::
Exception
,
"Invalid patches object in .cfg file: Interval boundaries are expected in ascending order."
);
}
lower
=
newVal
;
res
.
push_back
(
newVal
);
str
=
match
.
suffix
();
}
if
(
res
.
size
()
%
2
!=
0
)
{
DUNE_THROW
(
Dune
::
Exception
,
"Invalid patches object in .cfg file: An even number of doubles representing a sequence of intervals is expected."
);
}
return
res
;
}
template
<
class
HostGridType
,
class
VectorTEMPLATE
>
template
<
class
HostGridType
,
class
VectorTEMPLATE
>
void
StrikeSlipFactory
<
HostGridType
,
VectorTEMPLATE
>::
setBodies
()
{
void
StrikeSlipFactory
<
HostGridType
,
VectorTEMPLATE
>::
setBodies
()
{
// set up cuboid geometries
// set up cuboid geometries
...
@@ -35,10 +66,24 @@ void StrikeSlipFactory<HostGridType, VectorTEMPLATE>::setBodies() {
...
@@ -35,10 +66,24 @@ void StrikeSlipFactory<HostGridType, VectorTEMPLATE>::setBodies() {
//triangleGeometries_[1]->addWeakeningPatch(frictionParset, origins[1], {origins[1][0] + lengths[1], origins[1][1], 0});
//triangleGeometries_[1]->addWeakeningPatch(frictionParset, origins[1], {origins[1][0] + lengths[1], origins[1][1], 0});
#elif MY_DIM == 2
#elif MY_DIM == 2
triangleGeometries_
[
0
]
=
std
::
make_shared
<
TriangleGeometry
>
(
origin
,
lengths
[
0
],
heights
[
0
]);
triangleGeometries_
[
0
]
=
std
::
make_shared
<
TriangleGeometry
>
(
origin
,
lengths
[
0
],
heights
[
0
]);
triangleGeometries_
[
0
]
->
addWeakeningPatch
(
frictionParset
,
triangleGeometries_
[
0
]
->
A
(),
triangleGeometries_
[
0
]
->
C
());
triangleGeometries_
[
1
]
=
std
::
make_shared
<
TriangleGeometry
>
(
triangleGeometries_
[
0
]
->
C
(),
-
lengths
[
1
],
-
heights
[
1
]);
triangleGeometries_
[
1
]
=
std
::
make_shared
<
TriangleGeometry
>
(
triangleGeometries_
[
0
]
->
C
(),
-
lengths
[
1
],
-
heights
[
1
]);
triangleGeometries_
[
1
]
->
addWeakeningPatch
(
frictionParset
,
triangleGeometries_
[
1
]
->
A
(),
triangleGeometries_
[
1
]
->
C
());
// parse weakening patches
using
Patches
=
std
::
vector
<
std
::
array
<
double
,
2
>
>
;
std
::
string
patches_str
=
this
->
parset_
.
template
get
<
std
::
string
>(
"boundary.friction.weakening.patches"
);
auto
patches
=
parsePatchString
(
patches_str
);
for
(
size_t
i
=
0
;
i
<
patches
.
size
();
i
++
)
{
auto
start1
=
triangleGeometries_
[
1
]
->
C
()
+
patches
[
i
]
*
(
triangleGeometries_
[
1
]
->
A
()
-
triangleGeometries_
[
1
]
->
C
());
auto
end1
=
triangleGeometries_
[
1
]
->
C
()
+
patches
[
i
+
1
]
*
(
triangleGeometries_
[
1
]
->
A
()
-
triangleGeometries_
[
1
]
->
C
());
triangleGeometries_
[
1
]
->
addWeakeningPatch
(
frictionParset
,
start1
,
end1
);
auto
start0
=
triangleGeometries_
[
0
]
->
A
()
+
patches
[
i
]
*
(
triangleGeometries_
[
0
]
->
C
()
-
triangleGeometries_
[
0
]
->
A
());
auto
end0
=
triangleGeometries_
[
0
]
->
A
()
+
patches
[
i
+
1
]
*
(
triangleGeometries_
[
0
]
->
C
()
-
triangleGeometries_
[
0
]
->
A
());
triangleGeometries_
[
0
]
->
addWeakeningPatch
(
frictionParset
,
start0
,
end0
);
i
++
;
}
#else
#else
#error CuboidGeometry only supports 2D and 3D!"
#error CuboidGeometry only supports 2D and 3D!"
#endif
#endif
...
...
This diff is collapsed.
Click to expand it.
dune/tectonic/factories/strikeslipfactory.hh
+
2
−
0
View file @
85169267
...
@@ -81,6 +81,8 @@ template <class HostGridType, class VectorType> class StrikeSlipFactory : public
...
@@ -81,6 +81,8 @@ template <class HostGridType, class VectorType> class StrikeSlipFactory : public
return
{
0
,
0
,
1
};
return
{
0
,
0
,
1
};
#endif
#endif
}
}
std
::
vector
<
double
>
parsePatchString
(
const
std
::
string
&
patch_str
);
};
};
#endif
#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