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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
code
pugs
Commits
406fedff
Commit
406fedff
authored
4 years ago
by
Stéphane Del Pino
Browse files
Options
Downloads
Patches
Plain Diff
Add handling of B, N, R^dxd data types in output
parent
cbe4d8b8
No related branches found
No related tags found
1 merge request
!75
Feature/language discretization
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/output/OutputNamedItemValueSet.hpp
+12
-2
12 additions, 2 deletions
src/output/OutputNamedItemValueSet.hpp
src/output/VTKWriter.cpp
+58
-0
58 additions, 0 deletions
src/output/VTKWriter.cpp
src/output/VTKWriter.hpp
+21
-0
21 additions, 0 deletions
src/output/VTKWriter.hpp
with
91 additions
and
2 deletions
src/output/OutputNamedItemValueSet.hpp
+
12
−
2
View file @
406fedff
...
...
@@ -54,19 +54,29 @@ class NamedItemValue
class
OutputNamedItemValueSet
{
public:
using
ItemValueVariant
=
std
::
variant
<
NodeValue
<
const
int
>
,
using
ItemValueVariant
=
std
::
variant
<
NodeValue
<
const
bool
>
,
NodeValue
<
const
int
>
,
NodeValue
<
const
long
int
>
,
NodeValue
<
const
unsigned
long
int
>
,
NodeValue
<
const
double
>
,
NodeValue
<
const
TinyVector
<
1
,
double
>>
,
NodeValue
<
const
TinyVector
<
2
,
double
>>
,
NodeValue
<
const
TinyVector
<
3
,
double
>>
,
NodeValue
<
const
TinyMatrix
<
1
,
double
>>
,
NodeValue
<
const
TinyMatrix
<
2
,
double
>>
,
NodeValue
<
const
TinyMatrix
<
3
,
double
>>
,
CellValue
<
const
bool
>
,
CellValue
<
const
int
>
,
CellValue
<
const
long
int
>
,
CellValue
<
const
unsigned
long
int
>
,
CellValue
<
const
double
>
,
CellValue
<
const
TinyVector
<
1
,
double
>>
,
CellValue
<
const
TinyVector
<
2
,
double
>>
,
CellValue
<
const
TinyVector
<
3
,
double
>>>
;
CellValue
<
const
TinyVector
<
3
,
double
>>
,
CellValue
<
const
TinyMatrix
<
1
,
double
>>
,
CellValue
<
const
TinyMatrix
<
2
,
double
>>
,
CellValue
<
const
TinyMatrix
<
3
,
double
>>>
;
private:
std
::
map
<
std
::
string
,
ItemValueVariant
>
m_name_itemvariant_map
;
...
...
This diff is collapsed.
Click to expand it.
src/output/VTKWriter.cpp
+
58
−
0
View file @
406fedff
...
...
@@ -47,6 +47,16 @@ VTKWriter::_write_node_pvtu(std::ofstream& os,
<<
"
\"
/>
\n
"
;
}
template
<
size_t
N
,
typename
DataType
>
void
VTKWriter
::
_write_node_pvtu
(
std
::
ofstream
&
os
,
const
std
::
string
&
name
,
const
NodeValue
<
const
TinyMatrix
<
N
,
DataType
>>&
)
const
{
os
<<
"<PDataArray type=
\"
"
<<
VTKType
<
DataType
>::
name
<<
"
\"
Name=
\"
"
<<
name
<<
"
\"
NumberOfComponents=
\"
"
<<
N
*
N
<<
"
\"
/>
\n
"
;
}
template
<
typename
DataType
>
void
VTKWriter
::
_write_node_pvtu
(
std
::
ofstream
&
,
const
std
::
string
&
,
const
CellValue
<
const
DataType
>&
)
const
...
...
@@ -69,6 +79,16 @@ VTKWriter::_write_cell_pvtu(std::ofstream& os,
<<
"
\"
/>
\n
"
;
}
template
<
size_t
N
,
typename
DataType
>
void
VTKWriter
::
_write_cell_pvtu
(
std
::
ofstream
&
os
,
const
std
::
string
&
name
,
const
CellValue
<
const
TinyMatrix
<
N
,
DataType
>>&
)
const
{
os
<<
"<PDataArray type=
\"
"
<<
VTKType
<
DataType
>::
name
<<
"
\"
Name=
\"
"
<<
name
<<
"
\"
NumberOfComponents=
\"
"
<<
N
*
N
<<
"
\"
/>
\n
"
;
}
template
<
typename
DataType
>
void
VTKWriter
::
_write_cell_pvtu
(
std
::
ofstream
&
,
const
std
::
string
&
,
const
NodeValue
<
const
DataType
>&
)
const
...
...
@@ -152,6 +172,25 @@ VTKWriter::_write_node_value(std::ofstream& os,
os
<<
"
\n
</DataArray>
\n
"
;
}
template
<
size_t
N
,
typename
DataType
>
void
VTKWriter
::
_write_node_value
(
std
::
ofstream
&
os
,
const
std
::
string
&
name
,
const
NodeValue
<
const
TinyMatrix
<
N
,
DataType
>>&
item_value
)
const
{
os
<<
"<DataArray type=
\"
"
<<
VTKType
<
DataType
>::
name
<<
"
\"
Name=
\"
"
<<
name
<<
"
\"
NumberOfComponents=
\"
"
<<
N
*
N
<<
"
\"
>
\n
"
;
for
(
NodeId
i
=
0
;
i
<
item_value
.
size
();
++
i
)
{
for
(
size_t
j
=
0
;
j
<
N
;
++
j
)
{
for
(
size_t
k
=
0
;
k
<
N
;
++
k
)
{
// The following '+' enforces integer output for char types
os
<<
+
item_value
[
i
](
j
,
k
)
<<
' '
;
}
}
}
os
<<
"
\n
</DataArray>
\n
"
;
}
template
<
typename
DataType
>
void
VTKWriter
::
_write_node_value
(
std
::
ofstream
&
,
const
std
::
string
&
,
const
CellValue
<
const
DataType
>&
)
const
...
...
@@ -188,6 +227,25 @@ VTKWriter::_write_cell_value(std::ofstream& os,
os
<<
"
\n
</DataArray>
\n
"
;
}
template
<
size_t
N
,
typename
DataType
>
void
VTKWriter
::
_write_cell_value
(
std
::
ofstream
&
os
,
const
std
::
string
&
name
,
const
CellValue
<
const
TinyMatrix
<
N
,
DataType
>>&
item_value
)
const
{
os
<<
"<DataArray type=
\"
"
<<
VTKType
<
DataType
>::
name
<<
"
\"
Name=
\"
"
<<
name
<<
"
\"
NumberOfComponents=
\"
"
<<
N
*
N
<<
"
\"
>
\n
"
;
for
(
CellId
i
=
0
;
i
<
item_value
.
size
();
++
i
)
{
for
(
size_t
j
=
0
;
j
<
N
;
++
j
)
{
for
(
size_t
k
=
0
;
k
<
N
;
++
k
)
{
// The following '+' enforces integer output for char types
os
<<
+
item_value
[
i
](
j
,
k
)
<<
' '
;
}
}
}
os
<<
"
\n
</DataArray>
\n
"
;
}
template
<
typename
DataType
>
void
VTKWriter
::
_write_cell_value
(
std
::
ofstream
&
,
const
std
::
string
&
,
const
NodeValue
<
const
DataType
>&
)
const
...
...
This diff is collapsed.
Click to expand it.
src/output/VTKWriter.hpp
+
21
−
0
View file @
406fedff
...
...
@@ -3,6 +3,7 @@
#include
<output/IWriter.hpp>
#include
<algebra/TinyMatrix.hpp>
#include
<algebra/TinyVector.hpp>
#include
<output/OutputNamedItemValueSet.hpp>
...
...
@@ -30,6 +31,11 @@ class VTKWriter : public IWriter
const
std
::
string
&
name
,
const
NodeValue
<
const
TinyVector
<
N
,
DataType
>>&
)
const
;
template
<
size_t
N
,
typename
DataType
>
void
_write_node_pvtu
(
std
::
ofstream
&
os
,
const
std
::
string
&
name
,
const
NodeValue
<
const
TinyMatrix
<
N
,
DataType
>>&
)
const
;
template
<
typename
DataType
>
void
_write_node_pvtu
(
std
::
ofstream
&
,
const
std
::
string
&
,
const
CellValue
<
const
DataType
>&
)
const
;
...
...
@@ -41,6 +47,11 @@ class VTKWriter : public IWriter
const
std
::
string
&
name
,
const
CellValue
<
const
TinyVector
<
N
,
DataType
>>&
)
const
;
template
<
size_t
N
,
typename
DataType
>
void
_write_cell_pvtu
(
std
::
ofstream
&
os
,
const
std
::
string
&
name
,
const
CellValue
<
const
TinyMatrix
<
N
,
DataType
>>&
)
const
;
template
<
typename
DataType
>
void
_write_cell_pvtu
(
std
::
ofstream
&
,
const
std
::
string
&
,
const
NodeValue
<
const
DataType
>&
)
const
;
...
...
@@ -61,6 +72,11 @@ class VTKWriter : public IWriter
const
std
::
string
&
name
,
const
NodeValue
<
const
TinyVector
<
N
,
DataType
>>&
item_value
)
const
;
template
<
size_t
N
,
typename
DataType
>
void
_write_node_value
(
std
::
ofstream
&
os
,
const
std
::
string
&
name
,
const
NodeValue
<
const
TinyMatrix
<
N
,
DataType
>>&
item_value
)
const
;
template
<
typename
DataType
>
void
_write_node_value
(
std
::
ofstream
&
,
const
std
::
string
&
,
const
CellValue
<
const
DataType
>&
)
const
;
...
...
@@ -72,6 +88,11 @@ class VTKWriter : public IWriter
const
std
::
string
&
name
,
const
CellValue
<
const
TinyVector
<
N
,
DataType
>>&
item_value
)
const
;
template
<
size_t
N
,
typename
DataType
>
void
_write_cell_value
(
std
::
ofstream
&
os
,
const
std
::
string
&
name
,
const
CellValue
<
const
TinyMatrix
<
N
,
DataType
>>&
item_value
)
const
;
template
<
typename
DataType
>
void
_write_cell_value
(
std
::
ofstream
&
,
const
std
::
string
&
,
const
NodeValue
<
const
DataType
>&
)
const
;
...
...
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