Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pugs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
code
pugs
Commits
e1597508
Commit
e1597508
authored
7 years ago
by
Stéphane Del Pino
Browse files
Options
Downloads
Patches
Plain Diff
Begining of VTK ascii writer
parent
c5940096
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
CMakeLists.txt
+1
-0
1 addition, 0 deletions
CMakeLists.txt
src/CMakeLists.txt
+3
-0
3 additions, 0 deletions
src/CMakeLists.txt
src/main.cpp
+6
-1
6 additions, 1 deletion
src/main.cpp
src/output/VTKWriter.hpp
+45
-0
45 additions, 0 deletions
src/output/VTKWriter.hpp
with
55 additions
and
1 deletion
CMakeLists.txt
+
1
−
0
View file @
e1597508
...
...
@@ -98,6 +98,7 @@ add_subdirectory(src)
include_directories
(
src
)
include_directories
(
src/algebra
)
include_directories
(
src/mesh
)
include_directories
(
src/output
)
include_directories
(
src/utils
)
include_directories
(
src/scheme
)
...
...
This diff is collapsed.
Click to expand it.
src/CMakeLists.txt
+
3
−
0
View file @
e1597508
...
...
@@ -19,6 +19,9 @@ include_directories(mesh)
#add_subdirectory(mesh)
include_directories
(
scheme
)
# Pastis output
include_directories
(
output
)
# Pastis experimental
add_subdirectory
(
experimental
)
include_directories
(
experimental
)
This diff is collapsed.
Click to expand it.
src/main.cpp
+
6
−
1
View file @
e1597508
...
...
@@ -16,6 +16,8 @@
#include
<BoundaryCondition.hpp>
#include
<AcousticSolver.hpp>
#include
<VTKWriter.hpp>
#include
<TinyVector.hpp>
#include
<TinyMatrix.hpp>
...
...
@@ -133,13 +135,16 @@ int main(int argc, char *argv[])
timer
.
reset
();
MeshDataType
mesh_data
(
mesh
);
VTKWriter
vtk_writer
(
"output.vtu"
);
std
::
vector
<
BoundaryConditionHandler
>
bc_list
;
{
// quite dirty!
for
(
size_t
i_boundary
=
0
;
i_boundary
<
mesh
.
connectivity
().
numberOfNodeBoundaries
();
++
i_boundary
)
{
Connectivity2D
::
NodesBoundary
nodes_boundary
=
mesh
.
connectivity
().
nodesBoundary
(
i_boundary
);
unsigned
int
ref
=
nodes_boundary
.
first
;
TinyVector
<
2
>
normal
(
0
,
0
);
if
((
ref
==
3
)
or
(
ref
==
4
))
{
if
((
ref
==
5
)
or
(
ref
==
6
))
{
normal
=
TinyVector
<
2
>
(
0
,
1
);
}
else
{
normal
=
TinyVector
<
2
>
(
1
,
0
);
...
...
This diff is collapsed.
Click to expand it.
src/output/VTKWriter.hpp
0 → 100644
+
45
−
0
View file @
e1597508
#ifndef VTK_WRITER_HPP
#define VTK_WRITER_HPP
#include
<string>
#include
<fstream>
class
VTKWriter
{
public:
VTKWriter
(
const
std
::
string
&
filename
)
{
std
::
ofstream
fout
(
filename
);
fout
<<
"<?xml version=
\"
1.0
\"
?>
\n
"
;
fout
<<
"<VTKFile type=
\"
UnstructuredGrid
\"
>
\n
"
;
fout
<<
"<UnstructuredGrid>
\n
"
;
fout
<<
"<Piece NumberOfPoints=
\"
3
\"
NumberOfCells=
\"
1
\"
>
\n
"
;
fout
<<
"<Points>
\n
"
;
fout
<<
"<DataArray Name=
\"
Positions
\"
NumberOfComponents=
\"
3
\"
type=
\"
Float64
\"
format=
\"
ascii
\"
>
\n
"
;
fout
<<
"0 0 0 1 0 0 0 1 0
\n
"
;
fout
<<
"</DataArray>
\n
"
;
fout
<<
"</Points>
\n
"
;
fout
<<
"<Cells>
\n
"
;
fout
<<
"<DataArray type=
\"
Int32
\"
Name=
\"
connectivity
\"
NumberOfComponents=
\"
1
\"
format=
\"
ascii
\"
>
\n
"
;
fout
<<
"0 1 2
\n
"
;
fout
<<
"</DataArray>
\n
"
;
fout
<<
"<DataArray type=
\"
UInt32
\"
Name=
\"
offsets
\"
NumberOfComponents=
\"
1
\"
format=
\"
ascii
\"
>
\n
"
;
fout
<<
3
<<
'\n'
;
fout
<<
"</DataArray>
\n
"
;
fout
<<
"<DataArray type=
\"
Int8
\"
Name=
\"
types
\"
NumberOfComponents=
\"
1
\"
format=
\"
ascii
\"
>
\n
"
;
fout
<<
"5
\n
"
;
fout
<<
"</DataArray>
\n
"
;
fout
<<
"</Cells>
\n
"
;
fout
<<
"</Piece>
\n
"
;
fout
<<
"</UnstructuredGrid>
\n
"
;
fout
<<
"</VTKFile>
\n
"
;
}
~
VTKWriter
()
=
default
;
};
#endif // VTK_WRITER_HPP
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