Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Xdmf
Xdmf
Commits
d07ee80d
Commit
d07ee80d
authored
Jul 02, 2010
by
Kenneth Leiter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ENH: Add Hexahedron() to Hexahedron_125() Topology Conversion.
parent
4f65d6c6
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
642 additions
and
140 deletions
+642
-140
XdmfTopologyType.cpp
XdmfTopologyType.cpp
+6
-0
XdmfTopologyType.hpp
XdmfTopologyType.hpp
+6
-1
utils/XdmfTopologyConverter.cpp
utils/XdmfTopologyConverter.cpp
+611
-131
utils/XdmfTopologyConverter.hpp
utils/XdmfTopologyConverter.hpp
+5
-7
utils/tests/Cxx/TestXdmfTopologyConverter.cpp
utils/tests/Cxx/TestXdmfTopologyConverter.cpp
+14
-1
No files found.
XdmfTopologyType.cpp
View file @
d07ee80d
...
...
@@ -137,6 +137,12 @@ boost::shared_ptr<const XdmfTopologyType> XdmfTopologyType::Hexahedron_64()
return
p
;
}
boost
::
shared_ptr
<
const
XdmfTopologyType
>
XdmfTopologyType
::
Hexahedron_125
()
{
static
boost
::
shared_ptr
<
const
XdmfTopologyType
>
p
(
new
XdmfTopologyType
(
125
,
"Hexahedron_125"
,
Quartic
));
return
p
;
}
boost
::
shared_ptr
<
const
XdmfTopologyType
>
XdmfTopologyType
::
Mixed
()
{
static
boost
::
shared_ptr
<
const
XdmfTopologyType
>
p
(
new
XdmfTopologyType
(
0
,
"Mixed"
,
Arbitrary
));
...
...
XdmfTopologyType.hpp
View file @
d07ee80d
...
...
@@ -27,6 +27,10 @@
* Pyramid_13
* Wedge_15
* Hexahedron_20
* Hexahedron_24
* Hexahedron_27
* Hexahedron_64
* Hexahedron_125
* Mixed
* TwoDSMesh
* TwoDRectMesh
...
...
@@ -44,7 +48,7 @@ public:
friend
class
XdmfTopology
;
enum
CellType
{
NoCellType
,
Linear
,
Quadratic
,
Cubic
,
Arbitrary
,
Structured
NoCellType
,
Linear
,
Quadratic
,
Cubic
,
Quartic
,
Arbitrary
,
Structured
};
// Supported Xdmf Topology Types
...
...
@@ -68,6 +72,7 @@ public:
static
boost
::
shared_ptr
<
const
XdmfTopologyType
>
Hexahedron_24
();
static
boost
::
shared_ptr
<
const
XdmfTopologyType
>
Hexahedron_27
();
static
boost
::
shared_ptr
<
const
XdmfTopologyType
>
Hexahedron_64
();
static
boost
::
shared_ptr
<
const
XdmfTopologyType
>
Hexahedron_125
();
static
boost
::
shared_ptr
<
const
XdmfTopologyType
>
Mixed
();
static
boost
::
shared_ptr
<
const
XdmfTopologyType
>
TwoDSMesh
();
static
boost
::
shared_ptr
<
const
XdmfTopologyType
>
TwoDRectMesh
();
...
...
utils/XdmfTopologyConverter.cpp
View file @
d07ee80d
This diff is collapsed.
Click to expand it.
utils/XdmfTopologyConverter.hpp
View file @
d07ee80d
...
...
@@ -42,15 +42,13 @@ protected:
private:
/**
* PIMPL
*/
class
XdmfTopologyConverterImpl
;
XdmfTopologyConverter
(
const
XdmfTopologyConverter
&
converter
);
// Not implemented.
void
operator
=
(
const
XdmfTopologyConverter
&
converter
);
// Not implemented.
// Specific Topology Converters
class
HexahedronToHexahedron64
;
class
Hexahedron64ToHexahedron
;
// Point comparator
class
PointComparison
;
};
#endif
/* XDMFPARTITIONER_HPP_ */
utils/tests/Cxx/TestXdmfTopologyConverter.cpp
View file @
d07ee80d
...
...
@@ -62,6 +62,20 @@ int main(int argc, char* argv[])
assert
(
i
==
hex64Grid
->
getTopology
()
->
getArray
()
->
getValueCopy
<
unsigned
int
>
(
i
));
}
/*
* Hexahedron to Hexahedron_125
*/
boost
::
shared_ptr
<
XdmfGrid
>
hex125Grid
=
converter
->
convert
(
hexGrid
,
XdmfTopologyType
::
Hexahedron_125
());
assert
(
hex125Grid
->
getGeometry
()
->
getType
()
==
XdmfGeometryType
::
XYZ
());
assert
(
hex125Grid
->
getGeometry
()
->
getNumberPoints
()
==
125
);
assert
(
hex125Grid
->
getTopology
()
->
getType
()
==
XdmfTopologyType
::
Hexahedron_125
());
assert
(
hex125Grid
->
getTopology
()
->
getNumberElements
()
==
1
);
for
(
unsigned
int
i
=
0
;
i
<
125
;
++
i
)
{
assert
(
i
==
hex125Grid
->
getTopology
()
->
getArray
()
->
getValueCopy
<
unsigned
int
>
(
i
));
}
/*
* Hexahedron_64 to Hexahedron
*/
...
...
@@ -74,6 +88,5 @@ int main(int argc, char* argv[])
}
assert
(
newHexGrid
->
getTopology
()
->
getType
()
==
XdmfTopologyType
::
Hexahedron
());
assert
(
newHexGrid
->
getTopology
()
->
getNumberElements
()
==
27
);
return
0
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment