Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
tools
frackit
Commits
110595e8
Commit
110595e8
authored
Jan 27, 2020
by
Dennis Gläser
Browse files
[example] improve network output
parent
70d59860
Changes
1
Hide whitespace changes
Inline
Side-by-side
examples/layers/example_layers.cc
View file @
110595e8
...
@@ -79,8 +79,8 @@ int main(int argc, char** argv)
...
@@ -79,8 +79,8 @@ int main(int argc, char** argv)
// sampler for disks (orientation 1)
// sampler for disks (orientation 1)
DiskSampler
diskSampler
(
makeUniformPointSampler
(
domainBBox
),
// sampler for disk center points
DiskSampler
diskSampler
(
makeUniformPointSampler
(
domainBBox
),
// sampler for disk center points
std
::
normal_distribution
<
ctype
>
(
2
0.0
,
6.5
),
// major axis length: mean value & standard deviation
std
::
normal_distribution
<
ctype
>
(
3
0.0
,
6.5
),
// major axis length: mean value & standard deviation
std
::
normal_distribution
<
ctype
>
(
15
.0
,
4.5
),
// minor axis length: mean value & standard deviation
std
::
normal_distribution
<
ctype
>
(
24
.0
,
4.5
),
// minor axis length: mean value & standard deviation
std
::
normal_distribution
<
ctype
>
(
toRadians
(
0.0
),
toRadians
(
7.5
)),
// rotation around x-axis: mean value & standard deviation
std
::
normal_distribution
<
ctype
>
(
toRadians
(
0.0
),
toRadians
(
7.5
)),
// rotation around x-axis: mean value & standard deviation
std
::
normal_distribution
<
ctype
>
(
toRadians
(
0.0
),
toRadians
(
7.5
)),
// rotation around y-axis: mean value & standard deviation
std
::
normal_distribution
<
ctype
>
(
toRadians
(
0.0
),
toRadians
(
7.5
)),
// rotation around y-axis: mean value & standard deviation
std
::
normal_distribution
<
ctype
>
(
toRadians
(
0.0
),
toRadians
(
7.5
)));
// rotation around z-axis: mean value & standard deviation
std
::
normal_distribution
<
ctype
>
(
toRadians
(
0.0
),
toRadians
(
7.5
)));
// rotation around z-axis: mean value & standard deviation
...
@@ -89,7 +89,7 @@ int main(int argc, char** argv)
...
@@ -89,7 +89,7 @@ int main(int argc, char** argv)
QuadrilateralSampler
<
3
>
quadSampler
(
makeUniformPointSampler
(
domainBBox
),
// sampler for quadrilateral center points
QuadrilateralSampler
<
3
>
quadSampler
(
makeUniformPointSampler
(
domainBBox
),
// sampler for quadrilateral center points
std
::
normal_distribution
<
ctype
>
(
toRadians
(
0.0
),
toRadians
(
5.0
)),
// strike angle: mean value & standard deviation
std
::
normal_distribution
<
ctype
>
(
toRadians
(
0.0
),
toRadians
(
5.0
)),
// strike angle: mean value & standard deviation
std
::
normal_distribution
<
ctype
>
(
toRadians
(
45.0
),
toRadians
(
5.0
)),
// dip angle: mean value & standard deviation
std
::
normal_distribution
<
ctype
>
(
toRadians
(
45.0
),
toRadians
(
5.0
)),
// dip angle: mean value & standard deviation
std
::
normal_distribution
<
ctype
>
(
40
.0
,
5.0
),
// edge length: mean value & standard deviation
std
::
normal_distribution
<
ctype
>
(
35
.0
,
5.0
),
// edge length: mean value & standard deviation
5.0
);
// threshold for minimum edge length
5.0
);
// threshold for minimum edge length
// Define ids for the two entity sets
// Define ids for the two entity sets
...
@@ -111,13 +111,20 @@ int main(int argc, char** argv)
...
@@ -111,13 +111,20 @@ int main(int argc, char** argv)
// of different orientations. //
// of different orientations. //
///////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////
// Define constraints between entities of
the same set
// Define constraints between entities of
orientation 1
using
Constraints
=
EntityNetworkConstraints
<
ctype
>
;
using
Constraints
=
EntityNetworkConstraints
<
ctype
>
;
Constraints
constraintsOnSelf
;
Constraints
constraints1
;
constraintsOnSelf
.
setMinDistance
(
2.5
);
constraints1
.
setMinDistance
(
1.5
);
constraintsOnSelf
.
setMinIntersectingAngle
(
toRadians
(
25.0
));
constraints1
.
setMinIntersectingAngle
(
toRadians
(
25.0
));
constraintsOnSelf
.
setMinIntersectionMagnitude
(
2.5
);
constraints1
.
setMinIntersectionMagnitude
(
2.5
);
constraintsOnSelf
.
setMinIntersectionDistance
(
2.0
);
constraints1
.
setMinIntersectionDistance
(
2.0
);
// Define constraints between entities of orientation 2
Constraints
constraints2
;
constraints2
.
setMinDistance
(
10.0
);
constraints2
.
setMinIntersectingAngle
(
toRadians
(
25.0
));
constraints2
.
setMinIntersectionMagnitude
(
2.5
);
constraints2
.
setMinIntersectionDistance
(
2.0
);
// Define constraints between entities of different sets
// Define constraints between entities of different sets
Constraints
constraintsOnOther
;
Constraints
constraintsOnOther
;
...
@@ -128,9 +135,11 @@ int main(int argc, char** argv)
...
@@ -128,9 +135,11 @@ int main(int argc, char** argv)
// We can use a constraint matrix to facilitate constraint evaluation
// We can use a constraint matrix to facilitate constraint evaluation
EntityNetworkConstraintsMatrix
<
Constraints
>
constraintsMatrix
;
EntityNetworkConstraintsMatrix
<
Constraints
>
constraintsMatrix
;
constraintsMatrix
.
addConstraints
(
constraintsOnSelf
,
// constraint instance
constraintsMatrix
.
addConstraints
(
constraints1
,
// constraint instance
{
IdPair
(
diskSetId
,
diskSetId
),
// sets between which to use these constraints
IdPair
(
diskSetId
,
diskSetId
));
// set between which to use these constraints
IdPair
(
quadSetId
,
quadSetId
)});
// sets between which to use these constraints
constraintsMatrix
.
addConstraints
(
constraints2
,
// constraint instance
IdPair
(
quadSetId
,
quadSetId
));
// set between which to use these constraints
constraintsMatrix
.
addConstraints
(
constraintsOnOther
,
// constraint instance
constraintsMatrix
.
addConstraints
(
constraintsOnOther
,
// constraint instance
{
IdPair
(
diskSetId
,
quadSetId
),
// sets between which to use these constraints
{
IdPair
(
diskSetId
,
quadSetId
),
// sets between which to use these constraints
...
@@ -173,9 +182,9 @@ int main(int argc, char** argv)
...
@@ -173,9 +182,9 @@ int main(int argc, char** argv)
if
(
status
.
finished
(
id
))
if
(
status
.
finished
(
id
))
{
status
.
increaseRejectedCounter
();
continue
;
}
{
status
.
increaseRejectedCounter
();
continue
;
}
// Moreover, we want to avoid small fragments (< 2
0
0 m²)
// Moreover, we want to avoid small fragments (< 2
5
0 m²)
const
auto
containedArea
=
computeContainedMagnitude
(
geom
,
networkDomain
);
const
auto
containedArea
=
computeContainedMagnitude
(
geom
,
networkDomain
);
if
(
containedArea
<
2
0
0.0
)
if
(
containedArea
<
2
5
0.0
)
{
status
.
increaseRejectedCounter
();
continue
;
}
{
status
.
increaseRejectedCounter
();
continue
;
}
// enforce constraints w.r.t. to the other entities
// enforce constraints w.r.t. to the other entities
...
...
Write
Preview
Supports
Markdown
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