Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tnl-dev
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor 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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
TNL
tnl-dev
Commits
65c1747d
There was an error fetching the commit references. Please try again later.
Commit
65c1747d
authored
9 years ago
by
Tomáš Oberhuber
Browse files
Options
Downloads
Patches
Plain Diff
Implementing mesh function writer.
parent
576521e2
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/functions/tnlMeshFunction.h
+3
-0
3 additions, 0 deletions
src/functions/tnlMeshFunction.h
src/functions/tnlMeshFunction_impl.h
+12
-0
12 additions, 0 deletions
src/functions/tnlMeshFunction_impl.h
tools/src/tnl-view.h
+40
-28
40 additions, 28 deletions
tools/src/tnl-view.h
with
55 additions
and
28 deletions
src/functions/tnlMeshFunction.h
+
3
−
0
View file @
65c1747d
...
...
@@ -119,6 +119,9 @@ class tnlMeshFunction :
bool
boundLoad
(
tnlFile
&
file
);
bool
write
(
const
tnlString
&
fileName
,
const
tnlString
&
format
=
"vtk"
)
const
;
using
tnlObject
::
save
;
using
tnlObject
::
load
;
...
...
This diff is collapsed.
Click to expand it.
src/functions/tnlMeshFunction_impl.h
+
12
−
0
View file @
65c1747d
...
...
@@ -352,6 +352,18 @@ boundLoad( tnlFile& file )
return
this
->
data
.
boundLoad
(
file
);
}
template
<
typename
Mesh
,
int
MeshEntityDimensions
,
typename
Real
>
bool
tnlMeshFunction
<
Mesh
,
MeshEntityDimensions
,
Real
>::
write
(
const
tnlString
&
fileName
,
const
tnlString
&
format
)
const
{
return
true
;
}
#endif
/* TNLMESHFUNCTION_IMPL_H */
This diff is collapsed.
Click to expand it.
tools/src/tnl-view.h
+
40
−
28
View file @
65c1747d
...
...
@@ -25,30 +25,60 @@
#include
<core/vectors/tnlVector.h>
#include
<core/vectors/tnlMultiVector.h>
#include
<mesh/tnlGrid.h>
#include
<functions/tnlMeshFunction.h>
using
namespace
std
;
bool
getOutputFileName
(
const
tnlString
&
inputFileName
,
const
tnlString
&
outputFormat
,
tnlString
&
outputFileName
)
{
outputFileName
=
inputFileName
;
RemoveFileExtension
(
outputFileName
);
if
(
outputFormat
==
"gnuplot"
)
{
outputFileName
+=
".gplt"
;
return
true
;
}
else
{
cerr
<<
"Unknown file format "
<<
outputFormat
<<
"."
;
return
false
;
}
}
template
<
typename
MeshFunction
>
bool
writeMeshFunction
y
(
const
Mesh
&
mesh
,
const
tnlString
&
inputFileName
,
const
tnlParameterContainer
&
parameters
)
bool
writeMeshFunction
(
const
typename
MeshFunction
::
MeshType
&
mesh
,
const
tnlString
&
inputFileName
,
const
tnlParameterContainer
&
parameters
)
{
MeshFunction
function
(
mesh
);
if
(
!
funtion
.
load
(
inputFileName
)
)
if
(
!
fun
c
tion
.
load
(
inputFileName
)
)
{
std
::
cerr
<<
"Unable to load mesh function from a file "
<<
inputFileName
<<
"."
<<
std
::
endl
;
return
false
;
}
}
}
int
verbose
=
parameters
.
getParameter
<
int
>
(
"verbose"
);
tnlString
outputFormat
=
parameters
.
getParameter
<
tnlString
>
(
"output-format"
);
tnlString
outputFileName
;
if
(
!
getOutputFileName
(
inputFileName
,
outputFormat
,
outputFileName
)
)
return
false
;
if
(
verbose
)
cout
<<
" writing to "
<<
outputFileName
<<
" ... "
<<
flush
;
return
function
.
write
(
outputFileName
,
outputFormat
);
}
template
<
typename
Mesh
,
int
EntityDimensions
,
typename
Real
>
bool
setMeshFunction
y
RealType
(
const
Mesh
&
mesh
,
const
tnlString
&
inputFileName
,
const
tnlParameterContainer
&
parameters
)
bool
setMeshFunctionRealType
(
const
Mesh
&
mesh
,
const
tnlString
&
inputFileName
,
const
tnlParameterContainer
&
parameters
)
{
return
writeMeshFunction
<
tnlMeshFunction
<
Mesh
,
EntityDimensions
,
Real
>
>
(
mesh
,
inputFileName
,
parameters
);
}
...
...
@@ -76,7 +106,7 @@ bool setMeshFunction( const Mesh& mesh,
const
tnlList
<
tnlString
>&
parsedObjectType
,
const
tnlParameterContainer
&
parameters
)
{
if
(
parsedObjectType
[
1
]
!=
mesh
.
getType
()
)
if
(
parsedObjectType
[
1
]
!=
mesh
.
get
Serialization
Type
()
)
{
cerr
<<
"Incompatible mesh type for the mesh function "
<<
inputFileName
<<
"."
<<
endl
;
return
false
;
...
...
@@ -100,24 +130,6 @@ bool setMeshFunction( const Mesh& mesh,
}
bool
getOutputFileName
(
const
tnlString
&
inputFileName
,
const
tnlString
&
outputFormat
,
tnlString
&
outputFileName
)
{
outputFileName
=
inputFileName
;
RemoveFileExtension
(
outputFileName
);
if
(
outputFormat
==
"gnuplot"
)
{
outputFileName
+=
".gplt"
;
return
true
;
}
else
{
cerr
<<
"Unknown file format "
<<
outputFormat
<<
"."
;
return
false
;
}
}
template
<
typename
Mesh
,
typename
Element
,
typename
Real
,
typename
Index
,
int
Dimensions
>
bool
convertObject
(
const
Mesh
&
mesh
,
const
tnlString
&
inputFileName
,
...
...
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