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
09b97b02
Commit
09b97b02
authored
11 years ago
by
Elias Pipping
Browse files
Options
Downloads
Patches
Plain Diff
[Cleanup] Friction writing: Split writeInfo up into two functions
parent
b27415d1
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/friction_writer.cc
+16
-6
16 additions, 6 deletions
src/friction_writer.cc
src/friction_writer.hh
+2
-2
2 additions, 2 deletions
src/friction_writer.hh
src/one-body-sample.cc
+2
-1
2 additions, 1 deletion
src/one-body-sample.cc
with
20 additions
and
9 deletions
src/friction_writer.cc
+
16
−
6
View file @
09b97b02
...
@@ -29,22 +29,32 @@ FrictionWriter<ScalarVector, Vector>::~FrictionWriter() {
...
@@ -29,22 +29,32 @@ FrictionWriter<ScalarVector, Vector>::~FrictionWriter() {
}
}
template
<
class
ScalarVector
,
class
Vector
>
template
<
class
ScalarVector
,
class
Vector
>
void
FrictionWriter
<
ScalarVector
,
Vector
>::
writeInfo
(
void
FrictionWriter
<
ScalarVector
,
Vector
>::
writeKinetics
(
Vector
const
&
u
,
ScalarVector
const
&
coefficient
,
ScalarVector
const
&
alpha
,
Vector
const
&
u
,
Vector
const
&
v
)
{
Vector
const
&
v
)
{
for
(
size_t
i
=
0
;
i
<
boundaryNodes
.
size
();
++
i
)
{
for
(
size_t
i
=
0
;
i
<
boundaryNodes
.
size
();
++
i
)
{
if
(
!
boundaryNodes
[
i
][
0
])
if
(
!
boundaryNodes
[
i
][
0
])
continue
;
continue
;
coefficientWriter
<<
coefficient
[
i
]
<<
" "
;
displacementWriter
<<
u
[
i
][
0
]
<<
" "
;
displacementWriter
<<
u
[
i
][
0
]
<<
" "
;
stateWriter
<<
alpha
[
i
][
0
]
<<
" "
;
velocityWriter
<<
v
[
i
][
0
]
<<
" "
;
velocityWriter
<<
v
[
i
][
0
]
<<
" "
;
}
}
stateWriter
<<
std
::
endl
;
displacementWriter
<<
std
::
endl
;
displacementWriter
<<
std
::
endl
;
velocityWriter
<<
std
::
endl
;
velocityWriter
<<
std
::
endl
;
}
template
<
class
ScalarVector
,
class
Vector
>
void
FrictionWriter
<
ScalarVector
,
Vector
>::
writeOther
(
ScalarVector
const
&
coefficient
,
ScalarVector
const
&
alpha
)
{
for
(
size_t
i
=
0
;
i
<
boundaryNodes
.
size
();
++
i
)
{
if
(
!
boundaryNodes
[
i
][
0
])
continue
;
coefficientWriter
<<
coefficient
[
i
]
<<
" "
;
stateWriter
<<
alpha
[
i
][
0
]
<<
" "
;
}
stateWriter
<<
std
::
endl
;
coefficientWriter
<<
std
::
endl
;
coefficientWriter
<<
std
::
endl
;
}
}
...
...
This diff is collapsed.
Click to expand it.
src/friction_writer.hh
+
2
−
2
View file @
09b97b02
...
@@ -12,8 +12,8 @@ template <class ScalarVector, class Vector> class FrictionWriter {
...
@@ -12,8 +12,8 @@ template <class ScalarVector, class Vector> class FrictionWriter {
~
FrictionWriter
();
~
FrictionWriter
();
void
write
Info
(
Scalar
Vector
const
&
coefficient
,
Scalar
Vector
const
&
alpha
,
void
write
Kinetics
(
Vector
const
&
u
,
Vector
const
&
v
);
Vector
const
&
u
,
Vector
const
&
v
);
void
writeOther
(
ScalarVector
const
&
coefficient
,
Scalar
Vector
const
&
alpha
);
private:
private:
std
::
fstream
coefficientWriter
;
std
::
fstream
coefficientWriter
;
...
...
This diff is collapsed.
Click to expand it.
src/one-body-sample.cc
+
2
−
1
View file @
09b97b02
...
@@ -286,7 +286,8 @@ int main(int argc, char *argv[]) {
...
@@ -286,7 +286,8 @@ int main(int argc, char *argv[]) {
ScalarVector
const
&
_alpha
)
{
ScalarVector
const
&
_alpha
)
{
ScalarVector
c
;
ScalarVector
c
;
myGlobalNonlinearity
->
coefficientOfFriction
(
_v
,
c
);
myGlobalNonlinearity
->
coefficientOfFriction
(
_v
,
c
);
writer
.
writeInfo
(
c
,
_alpha
,
_u
,
_v
);
writer
.
writeKinetics
(
_u
,
_v
);
writer
.
writeOther
(
c
,
_alpha
);
};
};
reportFriction
(
u_initial
,
v_initial
,
alpha_initial
);
reportFriction
(
u_initial
,
v_initial
,
alpha_initial
);
...
...
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