Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-common
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
Timo Koch
dune-common
Commits
2f6d3897
Commit
2f6d3897
authored
19 years ago
by
Oliver Sander
Browse files
Options
Downloads
Patches
Plain Diff
minor cleanup
[[Imported from SVN: r3685]]
parent
a90f9252
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
io/file/amiramesh/amuggridreader.cc
+11
-22
11 additions, 22 deletions
io/file/amiramesh/amuggridreader.cc
with
11 additions
and
22 deletions
io/file/amiramesh/amuggridreader.cc
+
11
−
22
View file @
2f6d3897
...
...
@@ -60,8 +60,7 @@ public:
// Create the domain from an explicitly given boundary description
void
Dune
::
AmiraMeshReader
<
Dune
::
UGGrid
<
3
,
3
>
>::
createDomain
(
UGGrid
<
3
,
3
>&
grid
,
const
std
::
string
&
filename
/*,
std::vector<int>& isBoundaryNode*/
)
const
std
::
string
&
filename
)
{
#ifdef HAVE_PSURFACE
int
point
[
3
]
=
{
-
1
,
-
1
,
-
1
};
...
...
@@ -76,8 +75,8 @@ void Dune::AmiraMeshReader<Dune::UGGrid<3,3> >::createDomain(UGGrid<3,3>& grid,
DUNE_THROW
(
IOError
,
"Error in AmiraMeshReader<Dune::UGGrid<3,3> >::createDomain:"
<<
"StartEditing failed!"
);
/
*
All
e weiteren Anfragen an die Bibliothek beziehen sich jetzt auf das eben
geladen Gebiet. Maessig elegant, sollte aber gehen */
/
/
All
further queries to the psurface library refer to the most recently
// loaded parametrization.
int
noOfSegments
=
AmiraGetNoOfSegments
();
if
(
noOfSegments
<=
0
)
...
...
@@ -87,8 +86,6 @@ void Dune::AmiraMeshReader<Dune::UGGrid<3,3> >::createDomain(UGGrid<3,3>& grid,
if
(
noOfNodes
<=
0
)
DUNE_THROW
(
IOError
,
"No nodes found"
);
//grid.createDomain(noOfNodes, noOfSegments);
static
int
boundaryNumber
=
0
;
for
(
int
i
=
0
;
i
<
noOfSegments
;
i
++
)
{
...
...
@@ -106,7 +103,8 @@ void Dune::AmiraMeshReader<Dune::UGGrid<3,3> >::createDomain(UGGrid<3,3>& grid,
}
boundaryNumber
++
;
std
::
cout
<<
noOfSegments
<<
" segments created!"
<<
std
::
endl
;
std
::
cout
<<
noOfSegments
<<
" segments from psurface file "
<<
filename
<<
" created!"
<<
std
::
endl
;
#endif // #define HAVE_PSURFACE
...
...
@@ -119,7 +117,7 @@ void Dune::AmiraMeshReader<Dune::UGGrid<3,3> >::read(Dune::UGGrid<3,3>& grid,
{
#ifndef HAVE_PSURFACE
DUNE_THROW
(
IOError
,
"Dune has not been built with support for the "
<<
"
AmiraMesh-Parametrization
library!"
);
<<
"
psurface
library!"
);
#else
dverb
<<
"This is the AmiraMesh reader for UGGrid<3,3>!"
<<
std
::
endl
;
...
...
@@ -130,7 +128,6 @@ void Dune::AmiraMeshReader<Dune::UGGrid<3,3> >::read(Dune::UGGrid<3,3>& grid,
// Load the AmiraMesh file
// /////////////////////////////////////////////////////
AmiraMesh
*
am
=
AmiraMesh
::
read
(
filename
.
c_str
());
//std::vector<int> isBoundaryNode;
if
(
!
am
)
DUNE_THROW
(
IOError
,
"Could not open AmiraMesh file "
<<
filename
);
...
...
@@ -143,7 +140,7 @@ void Dune::AmiraMeshReader<Dune::UGGrid<3,3> >::read(Dune::UGGrid<3,3>& grid,
}
else
{
// Load domain from an AmiraMesh
hex
agrid file
// Load domain from an AmiraMesh
tetr
agrid file
createDomain
(
grid
,
domainFilename
);
}
...
...
@@ -176,8 +173,7 @@ void Dune::AmiraMeshReader<Dune::UGGrid<3,3> >::read(Dune::UGGrid<3,3>& grid,
void
Dune
::
AmiraMeshReader
<
Dune
::
UGGrid
<
3
,
3
>
>::
buildGrid
(
UGGrid
<
3
,
3
>&
grid
,
AmiraMesh
*
am
/* ,
std::vector<int>& isBoundaryNode*/
)
AmiraMesh
*
am
)
{
bool
isTetraGrid
=
am
->
findData
(
"Tetrahedra"
,
HxINT32
,
4
,
"Nodes"
);
...
...
@@ -364,16 +360,11 @@ void Dune::AmiraMeshReader<Dune::UGGrid<2,2> >::read(Dune::UGGrid<2,2>& grid,
// /////////////////////////////////////////////////////
// Load the AmiraMesh file
// /////////////////////////////////////////////////////
/** \todo Use an auto_ptr here */
AmiraMesh
*
am
=
AmiraMesh
::
read
(
filename
.
c_str
());
std
::
auto_ptr
<
AmiraMesh
>
am
(
AmiraMesh
::
read
(
filename
.
c_str
()));
if
(
!
am
)
if
(
am
.
operator
->
()
==
NULL
)
DUNE_THROW
(
IOError
,
"2d AmiraMesh reader: File '"
<<
filename
<<
"' could not be read!"
);
// ///////////////////////////////////////
// Extract domain from the grid file
// ///////////////////////////////////////
// Determine whether grid contains only triangles
bool
containsOnlyTriangles
=
am
->
findData
(
"Triangles"
,
HxINT32
,
3
,
"Nodes"
);
...
...
@@ -390,7 +381,7 @@ void Dune::AmiraMeshReader<Dune::UGGrid<2,2> >::read(Dune::UGGrid<2,2>& grid,
if
(
containsOnlyTriangles
)
{
AmiraMesh
::
Data
*
triangleData
=
am
->
findData
(
"Triangles"
,
HxINT32
,
3
,
"Nodes"
);
if
(
triangleData
)
elemData
=
(
int
*
)
triangleData
->
dataPtr
();
elemData
=
(
int
*
)
triangleData
->
dataPtr
();
else
DUNE_THROW
(
IOError
,
"2D AmiraMesh loader: field 'Triangles' not found!"
);
...
...
@@ -469,8 +460,6 @@ void Dune::AmiraMeshReader<Dune::UGGrid<2,2> >::read(Dune::UGGrid<2,2>& grid,
std
::
cout
<<
"amiraloadmesh: "
<<
noOfCreatedElem
<<
" elements created"
<<
std
::
endl
;
delete
am
;
grid
.
createend
();
}
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