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
2cff8125
Commit
2cff8125
authored
Jan 31, 2020
by
Dennis Gläser
Browse files
[ex1][README] improve doc
parent
40b3647a
Changes
1
Show whitespace changes
Inline
Side-by-side
appl/example1/README.md
View file @
2cff8125
...
@@ -12,12 +12,17 @@ to this example is the file `example1.cc` which is located in this folder.
...
@@ -12,12 +12,17 @@ to this example is the file `example1.cc` which is located in this folder.
Two main orientations are considered for the quadrilaterals, for both of which
Two main orientations are considered for the quadrilaterals, for both of which
a corresponding instance of the
`QuadrilateralSampler`
class is created.
a corresponding instance of the
`QuadrilateralSampler`
class is created.
For example, we instantiate
the sampler class for the second orientation with
:
For example, we instantiate
an instance of this class by writing
:
```
cpp
```
cpp
using
QuadSampler
=
QuadrilateralSampler
<
worldDimension
>
;
static
constexpr
int
worldDimension
=
3
;
using
ctype
=
double
;
using
Distro
=
std
::
normal_distribution
<
ctype
>
;
using
Distro
=
std
::
normal_distribution
<
ctype
>
;
QuadSampler
quadSampler2
(
makeUniformPointSampler
(
domain
),
// use a new point sampler instance!
using
QuadSampler
=
QuadrilateralSampler
<
worldDimension
>
;
Box
<
ctype
>
domain
(
0.0
,
0.0
,
0.0
,
1.0
,
1.0
,
1.0
);
QuadSampler
quadSampler
(
makeUniformPointSampler
(
domain
),
// point sampler that samples the center points of the quadrilaterals
Distro
(
toRadians
(
0.0
),
toRadians
(
5.0
)),
// strike angle: mean value & standard deviation
Distro
(
toRadians
(
0.0
),
toRadians
(
5.0
)),
// strike angle: mean value & standard deviation
Distro
(
toRadians
(
0.0
),
toRadians
(
5.0
)),
// dip angle: mean value & standard deviation
Distro
(
toRadians
(
0.0
),
toRadians
(
5.0
)),
// dip angle: mean value & standard deviation
Distro
(
0.5
,
0.1
),
// edge length: mean value & standard deviation
Distro
(
0.5
,
0.1
),
// edge length: mean value & standard deviation
...
@@ -28,22 +33,22 @@ The first constructor argument is a point sampler with which the center points o
...
@@ -28,22 +33,22 @@ The first constructor argument is a point sampler with which the center points o
the quadrilaterals are sampled. Here we use uniformly sampled points in the unit
the quadrilaterals are sampled. Here we use uniformly sampled points in the unit
cube, which is represented by an instance of the
`Box`
class, stored in the
cube, which is represented by an instance of the
`Box`
class, stored in the
variable
`domain`
. The second and third arguments define the distributions for
variable
`domain`
. The second and third arguments define the distributions for
the strike and dip angle, where in this case we use uniform distributions with
the strike and dip angle
(for details see the
[
class documentation
][
2
]
)
, where in this case we use uniform distributions with
a mean value of 0° and a standard deviation of 5°. The fourth argument is the
a mean value of 0° and a standard deviation of 5°. The fourth argument is the
distribution to be used for sampling the edge lengths, while the last argument
distribution to be used for sampling the edge lengths, while the last argument
defines a minimum value below which the edge length must not fall.
defines a minimum value below which the edge length must not fall.
T
he quadrilaterals are
then
sampled from the two samplers
`quadSampler1`
and
In the example, t
he quadrilaterals are sampled from the two samplers
`quadSampler1`
and
`quadSampler2`
, using the
`()`
operator:
`quadSampler2`
, using the
`()`
operator:
```
cpp
```
cpp
auto
quad
=
sampleIntoSet1
?
quadSampler1
()
:
quadSampler2
();
auto
quad
=
sampleIntoSet1
?
quadSampler1
()
:
quadSampler2
();
```
```
In this example
we use the boolean variable
`sampleIntoSet1`
to determine from
Here,
we use the boolean variable
`sampleIntoSet1`
to determine from
which sampler we should sample the next quadrilateral (more details follow below).
which sampler we should sample the next quadrilateral (more details follow below).
The variable
`quad`
holds a new candidate for an entity of the network, however,
The variable
`quad`
holds a new candidate for an entity of the network, however,
However,
we want to enforce certain constraints such as a minimum distance between
we want to enforce certain constraints such as a minimum distance between
entities. For this we use instances of the
`EntityNetworkConstraints`
class and
entities. For this we use instances of the
`EntityNetworkConstraints`
class and
configure it as desired. For example, the constraints on entities of the same
configure it as desired. For example, the constraints on entities of the same
orientation are defined in this example as follows:
orientation are defined in this example as follows:
...
@@ -68,7 +73,7 @@ if (!constraintsOnSelf.evaluate(entitySet, quad))
...
@@ -68,7 +73,7 @@ if (!constraintsOnSelf.evaluate(entitySet, quad))
where
`entityset1`
and
`entitySet2`
are of type
`std::vector<Quadrilateral>`
and
where
`entityset1`
and
`entitySet2`
are of type
`std::vector<Quadrilateral>`
and
store all quadrilaterals that are accepted. The function
`evaluate`
of the
store all quadrilaterals that are accepted. The function
`evaluate`
of the
`EntityNetworkConstraints`
class evaluates the constraints for
`quad`
against all
`EntityNetworkConstraints`
class evaluates the constraints for
`quad`
against all
entities contained in
`entitySet`
and returns
`true`
only if
there
no violation of
entities contained in
`entitySet`
and returns
`true`
only if no violation of
any of the defined constraints has been found. After an admissible quadrilateral
any of the defined constraints has been found. After an admissible quadrilateral
has been generated, the line
has been generated, the line
...
@@ -80,7 +85,7 @@ sampleIntoSet1 = !sampleIntoSet1;
...
@@ -80,7 +85,7 @@ sampleIntoSet1 = !sampleIntoSet1;
at the end of the loop makes sure that a quadrilateral of the other orientation
at the end of the loop makes sure that a quadrilateral of the other orientation
is sampled next. In
[
Example 3
][
0
]
we will get to know how to use helper classes
is sampled next. In
[
Example 3
][
0
]
we will get to know how to use helper classes
that store different entity sets and automatically sample from various sampler
that store different entity sets and automatically sample from various sampler
classes such that this
does not have to be done manual
ly.
classes such that this
can be written more easi
ly.
After the desired number of entities has been generated, the entities are cast
After the desired number of entities has been generated, the entities are cast
into an entity network using the builder class:
into an entity network using the builder class:
...
@@ -101,5 +106,15 @@ writer.write("network", // filename of the .geo files (will add extension .geo a
...
@@ -101,5 +106,15 @@ writer.write("network", // filename of the .geo files (will add extension .geo a
0.1
);
// element size to be used
0.1
);
// element size to be used
```
```
Note that with the
`EntityNetworkBuilder`
class we have created a network that
solely carries information about the fracture entities. We have not defined any
domain in this example, the unit cube in the variable
`domain`
was only used to
sample the center points of the quadrilaterals. Thus, the geometry files written
by the
`GmshWriter`
also only contain data on the fracture entities. This can be
used in contexts where one is only interested in the fractures. In the following
examples we will see how to construct fracture networks embedded in one or more
(sub-)domains.
[
0
]:
https://git.iws.uni-stuttgart.de/DennisGlaeser/frackit/tree/master/appl/example3
[
0
]:
https://git.iws.uni-stuttgart.de/DennisGlaeser/frackit/tree/master/appl/example3
[
1
]:
http://gmsh.info/
[
1
]:
http://gmsh.info/
[
2
]:
https://git.iws.uni-stuttgart.de/DennisGlaeser/frackit/blob/master/frackit/sampling/quadrilateralsampler.hh
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