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
905c2eab
Commit
905c2eab
authored
Nov 29, 2020
by
Dennis Gläser
Browse files
[ex3] collect rejection info
parent
b46e23d6
Changes
2
Show whitespace changes
Inline
Side-by-side
appl/example3/example3.cc
View file @
905c2eab
...
...
@@ -177,20 +177,20 @@ int main(int argc, char** argv)
// If the set this geometry belongs to is finished, skip the rest
if
(
status
.
finished
(
id
))
{
status
.
increaseRejectedCounter
();
continue
;
}
{
status
.
increaseRejectedCounter
(
"set finished"
);
continue
;
}
// Moreover, we want to avoid small fragments (< 250 m²)
const
auto
containedArea
=
computeContainedMagnitude
(
geom
,
networkDomain
);
if
(
containedArea
<
350.0
)
{
status
.
increaseRejectedCounter
();
continue
;
}
{
status
.
increaseRejectedCounter
(
"minimum contained area violation"
);
continue
;
}
// enforce constraints w.r.t. to the other entities
if
(
!
constraintsMatrix
.
evaluate
(
entitySets
,
geom
,
id
))
{
status
.
increaseRejectedCounter
();
continue
;
}
if
(
const
auto
res
=
constraintsMatrix
.
evaluate
(
entitySets
,
geom
,
id
)
;
!
res
)
{
status
.
increaseRejectedCounter
(
res
.
violationLabel
()
);
continue
;
}
// enforce constraints w.r.t. the domain boundaries
if
(
!
constraintsOnDomain
.
evaluate
(
domainBoundaryFaces
,
geom
))
{
status
.
increaseRejectedCounter
();
continue
;
}
if
(
const
auto
res
=
constraintsOnDomain
.
evaluate
(
domainBoundaryFaces
,
geom
)
;
!
res
)
{
status
.
increaseRejectedCounter
(
res
.
violationLabel
()
+
" (boundary)"
);
continue
;
}
// the geometry is admissible
entitySets
.
addEntity
(
geom
,
id
);
...
...
@@ -205,7 +205,9 @@ int main(int argc, char** argv)
const
auto
density
=
containedNetworkArea
/
domainVolume
;
std
::
cout
<<
"
\n
Entity density of the contained network: "
<<
density
<<
" m²/m³"
<<
std
::
endl
;
// print info on rejection events
status
.
printRejectionData
();
std
::
cout
<<
std
::
endl
;
//////////////////////////////////////////////////////////////////////////
...
...
appl/example3/example3.py
View file @
905c2eab
...
...
@@ -143,24 +143,26 @@ while not status.finished():
# If the set this geometry belongs to is finished, skip the rest
if
status
.
finished
(
id
):
sampleIntoSet1
=
not
sampleIntoSet1
status
.
increaseRejectedCounter
()
status
.
increaseRejectedCounter
(
"set finished"
)
continue
# Moreover, we want to avoid small fragments (< 250 m²)
from
frackit.geometry
import
computeContainedMagnitude
containedArea
=
computeContainedMagnitude
(
geom
,
networkDomain
);
if
containedArea
<
350.0
:
status
.
increaseRejectedCounter
()
status
.
increaseRejectedCounter
(
"minimum contained area violation"
)
continue
# enforce constraints w.r.t. to the other entities
if
not
constraintsMatrix
.
evaluate
(
entitySets
,
geom
,
id
):
status
.
increaseRejectedCounter
()
check
=
constraintsMatrix
.
evaluate
(
entitySets
,
geom
,
id
)
if
not
check
:
status
.
increaseRejectedCounter
(
check
.
violationLabel
())
continue
# enforce constraints w.r.t. the domain boundaries
if
not
constraintsOnDomain
.
evaluate
(
domainBoundaryFaces
,
geom
):
status
.
increaseRejectedCounter
()
check
=
constraintsOnDomain
.
evaluate
(
domainBoundaryFaces
,
geom
)
if
not
check
:
status
.
increaseRejectedCounter
(
check
.
violationLabel
()
+
" (boundary)"
)
continue
# the geometry is admissible
...
...
@@ -178,6 +180,9 @@ while not status.finished():
density
=
containedNetworkArea
/
domainVolume
;
print
(
"
\n
Entity density of the contained network: {:f} m²/m³
\n
"
.
format
(
density
))
# print info on rejection events
status
.
printRejectionData
();
print
(
""
)
##########################################################################
## 5. The entities of the network have been created. We can now ##
...
...
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