Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-gfe
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Sander, Oliver
dune-gfe
Merge requests
!73
Feature/stress plot
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Feature/stress plot
lnebel/dune-gfe:feature/stress-plot
into
master
Overview
25
Commits
6
Pipelines
8
Changes
11
Merged
Nebel, Lisa Julia
requested to merge
lnebel/dune-gfe:feature/stress-plot
into
master
4 years ago
Overview
14
Commits
6
Pipelines
8
Changes
11
Expand
0
0
Merge request reports
Compare
master
version 7
012b1d0a
3 years ago
version 6
fd6e98a8
3 years ago
version 5
a287b7f9
3 years ago
version 4
581a08cd
4 years ago
version 3
48a893ff
4 years ago
version 2
1ffd2ab4
4 years ago
version 1
96b5dde4
4 years ago
master (base)
and
latest version
latest version
384e7d10
6 commits,
3 years ago
version 7
012b1d0a
6 commits,
3 years ago
version 6
fd6e98a8
6 commits,
3 years ago
version 5
a287b7f9
6 commits,
3 years ago
version 4
581a08cd
6 commits,
4 years ago
version 3
48a893ff
6 commits,
4 years ago
version 2
1ffd2ab4
2 commits,
4 years ago
version 1
96b5dde4
2 commits,
4 years ago
11 files
+
422934
−
4
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
11
Search (e.g. *.vue) (Ctrl+P)
dune/gfe/filereader.hh
0 → 100644
+
43
−
0
Options
#ifndef DUNE_GFE_FILEREADER_HH
#define DUNE_GFE_FILEREADER_HH
#include
<iostream>
#include
<fstream>
#include
<dune/common/fvector.hh>
// This is a custom file format parser which reads in a grid deformation file
// The file must contain lines of the format <grid vertex>:<displacement or rotation>
// !!! THIS IS A TEMPORARY SOLUTION AND WILL BE REPLACED BY THE Dune::VtkReader in dune-vtk/dune/vtk/vtkreader.hh !!!
namespace
Dune
{
namespace
GFE
{
// Convert the pairs {grid vertex, vector of dimension d} in the given file to a map
template
<
int
d
>
static
std
::
unordered_map
<
std
::
string
,
FieldVector
<
double
,
d
>>
transformFileToMap
(
std
::
string
pathToFile
)
{
std
::
unordered_map
<
std
::
string
,
FieldVector
<
double
,
d
>>
map
;
std
::
string
line
,
displacement
,
entry
;
std
::
ifstream
file
(
pathToFile
,
std
::
ios
::
in
);
if
(
file
.
is_open
())
{
while
(
std
::
getline
(
file
,
line
))
{
size_t
j
=
0
;
size_t
pos
=
line
.
find
(
":"
);
displacement
=
line
.
substr
(
pos
+
1
);
line
.
erase
(
pos
);
std
::
stringstream
entries
(
displacement
);
FieldVector
<
double
,
d
>
vector
(
0
);
while
(
entries
>>
entry
)
vector
[
j
++
]
=
std
::
stod
(
entry
);
map
.
insert
({
line
,
vector
});
}
file
.
close
();
}
else
{
DUNE_THROW
(
Exception
,
"Error: Could not open the file "
+
pathToFile
+
" !"
);
}
return
map
;
}
}
}
#endif
\ No newline at end of file
Loading