Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
ogs-feliks
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Feliks Kiszkurno
ogs-feliks
Commits
2045ff62
Commit
2045ff62
authored
7 years ago
by
wenqing
Browse files
Options
Downloads
Patches
Plain Diff
[VTU] Added make_output argument again
parent
0c4875de
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
ProcessLib/Output.cpp
+35
-23
35 additions, 23 deletions
ProcessLib/Output.cpp
ProcessLib/ProcessOutput.cpp
+6
-0
6 additions, 0 deletions
ProcessLib/ProcessOutput.cpp
ProcessLib/ProcessOutput.h
+1
-0
1 addition, 0 deletions
ProcessLib/ProcessOutput.h
with
42 additions
and
23 deletions
ProcessLib/Output.cpp
+
35
−
23
View file @
2045ff62
...
...
@@ -165,13 +165,6 @@ void Output::doOutputAlways(Process const& process,
const
double
t
,
GlobalVector
const
&
x
)
{
// For the staggered scheme for the coupling, only the last process, which
// gives the latest solution within a coupling loop, is allowed to make
// output.
if
(
process_id
!=
static_cast
<
int
>
(
_single_process_data
.
size
())
-
1
&&
!
process
.
isMonolithicSchemeUsed
())
return
;
BaseLib
::
RunTime
time_output
;
time_output
.
start
();
...
...
@@ -185,17 +178,29 @@ void Output::doOutputAlways(Process const& process,
std
::
string
const
output_file_path
=
BaseLib
::
joinPaths
(
_output_directory
,
output_file_name
);
DBUG
(
"output to %s"
,
output_file_path
.
c_str
());
// For the staggered scheme for the coupling, only the last process, which
// gives the latest solution within a coupling loop, is allowed to make
// output.
const
bool
make_output
=
process_id
==
static_cast
<
int
>
(
_single_process_data
.
size
())
-
1
||
process
.
isMonolithicSchemeUsed
();
if
(
make_output
)
{
DBUG
(
"output to %s"
,
output_file_path
.
c_str
());
}
doProcessOutput
(
output_file_path
,
_output_file_compression
,
// Need to add variables of process to vtu even no output takes place.
doProcessOutput
(
output_file_path
,
make_output
,
_output_file_compression
,
_output_file_data_mode
,
t
,
x
,
process
.
getMesh
(),
process
.
getDOFTable
(),
process
.
getProcessVariables
(),
process
.
getSecondaryVariables
(),
process_output
);
spd_ptr
->
pvd_file
.
addVTUFile
(
output_file_name
,
t
);
INFO
(
"[time] Output of timestep %d took %g s."
,
timestep
,
time_output
.
elapsed
());
if
(
make_output
)
{
spd_ptr
->
pvd_file
.
addVTUFile
(
output_file_name
,
t
);
INFO
(
"[time] Output of timestep %d took %g s."
,
timestep
,
time_output
.
elapsed
());
}
}
void
Output
::
doOutput
(
Process
const
&
process
,
...
...
@@ -244,13 +249,6 @@ void Output::doOutputNonlinearIteration(Process const& process,
return
;
}
// For the staggered scheme for the coupling, only the last process, which
// gives the latest solution within a coupling loop, is allowed to make
// output.
if
((
process_id
!=
static_cast
<
int
>
(
_single_process_data
.
size
())
-
1
&&
!
process
.
isMonolithicSchemeUsed
()))
return
;
BaseLib
::
RunTime
time_output
;
time_output
.
start
();
...
...
@@ -264,13 +262,27 @@ void Output::doOutputNonlinearIteration(Process const& process,
+
"_nliter_"
+
std
::
to_string
(
iteration
)
+
".vtu"
;
std
::
string
const
output_file_path
=
BaseLib
::
joinPaths
(
_output_directory
,
output_file_name
);
DBUG
(
"output iteration results to %s"
,
output_file_path
.
c_str
());
doProcessOutput
(
output_file_path
,
_output_file_compression
,
// For the staggered scheme for the coupling, only the last process, which
// gives the latest solution within a coupling loop, is allowed to make
// output.
const
bool
make_output
=
process_id
==
static_cast
<
int
>
(
_single_process_data
.
size
())
-
1
||
process
.
isMonolithicSchemeUsed
();
if
(
make_output
)
{
DBUG
(
"output iteration results to %s"
,
output_file_path
.
c_str
());
}
doProcessOutput
(
output_file_path
,
make_output
,
_output_file_compression
,
_output_file_data_mode
,
t
,
x
,
process
.
getMesh
(),
process
.
getDOFTable
(),
process
.
getProcessVariables
(),
process
.
getSecondaryVariables
(),
process_output
);
INFO
(
"[time] Output took %g s."
,
time_output
.
elapsed
());
if
(
make_output
)
{
INFO
(
"[time] Output took %g s."
,
time_output
.
elapsed
());
}
}
}
// namespace ProcessLib
This diff is collapsed.
Click to expand it.
ProcessLib/ProcessOutput.cpp
+
6
−
0
View file @
2045ff62
...
...
@@ -41,6 +41,7 @@ ProcessOutput::ProcessOutput(BaseLib::ConfigTree const& output_config)
}
void
doProcessOutput
(
std
::
string
const
&
file_name
,
bool
const
make_output
,
bool
const
compress_output
,
int
const
data_mode
,
const
double
t
,
...
...
@@ -225,6 +226,11 @@ void doProcessOutput(std::string const& file_name,
(
void
)
t
;
#endif // USE_PETSC
if
(
!
make_output
)
{
return
;
}
// Write output file
DBUG
(
"Writing output to
\'
%s
\'
."
,
file_name
.
c_str
());
MeshLib
::
IO
::
VtuInterface
vtu_interface
(
&
mesh
,
data_mode
,
compress_output
);
...
...
This diff is collapsed.
Click to expand it.
ProcessLib/ProcessOutput.h
+
1
−
0
View file @
2045ff62
...
...
@@ -33,6 +33,7 @@ struct ProcessOutput final
/// See Output::_output_file_data_mode documentation for the data_mode
/// parameter.
void
doProcessOutput
(
std
::
string
const
&
file_name
,
bool
const
make_output
,
bool
const
compress_output
,
int
const
data_mode
,
const
double
t
,
...
...
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