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
3a9aab06
Commit
3a9aab06
authored
19 years ago
by
Oliver Sander
Browse files
Options
Downloads
Patches
Plain Diff
read parametrized boundaries using the psurface library
[[Imported from SVN: r2223]]
parent
0ef12a43
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
io/file/amiramesh/Makefile.am
+6
-0
6 additions, 0 deletions
io/file/amiramesh/Makefile.am
io/file/amiramesh/amuggridreader.cc
+30
-12
30 additions, 12 deletions
io/file/amiramesh/amuggridreader.cc
with
36 additions
and
12 deletions
io/file/amiramesh/Makefile.am
+
6
−
0
View file @
3a9aab06
...
...
@@ -13,6 +13,12 @@ libug3amiramesh_la_SOURCES = amuggridreader.cc
libug3amiramesh_la_CXXFLAGS
=
$(
AMIRAMESH_CPPFLAGS
)
$(
UG_NODIM_CPPFLAGS
)
-D_3
libug3amiramesh_la_LIBADD
=
$(
AMIRAMESH_LDFLAGS
)
$(
AMIRAMESH_LIBS
)
if
PSURFACE
# psurface only supports three-dimensional grids
libug3amiramesh_la_CXXFLAGS
+=
$(
PSURFACE_CPPFLAGS
)
libug3amiramesh_la_LIBADD
+=
$(
PSURFACE_LDFLAGS
)
$(
PSURFACE_LIBS
)
endif
endif
endif
...
...
This diff is collapsed.
Click to expand it.
io/file/amiramesh/amuggridreader.cc
+
30
−
12
View file @
3a9aab06
...
...
@@ -4,6 +4,7 @@
// Specialization of the AmiraMesh reader for UGGrid<3,3> and UGGrid<2,2>
// /////////////////////////////////////////////////////////////////////////
#include
<dune/config.h>
#include
<dune/io/file/amiramesh/amuggridreader.hh>
#include
<dune/grid/uggrid.hh>
#include
<dune/common/stdstreams.hh>
...
...
@@ -13,15 +14,15 @@
#include
<vector>
#include
<algorithm>
#ifdef HAVE_P
ARAMETRIZATION_LIBRARY
#include
<AmiraParamAccess.h>
#if
def
ined
HAVE_P
SURFACE && defined _3
#include
<
parametrization/
AmiraParamAccess.h>
#endif
#ifdef _3
// //////////////////////////////////////////////////
// //////////////////////////////////////////////////
#ifdef HAVE_P
ARAMETRIZATION_LIBRARY
#ifdef HAVE_P
SURFACE
static
int
SegmentDescriptionByAmira
(
void
*
data
,
double
*
param
,
double
*
result
)
{
...
...
@@ -43,7 +44,7 @@ static int SegmentDescriptionByAmira(void *data, double *param, double *result)
return
0
;
}
#endif // #define HAVE_P
ARAMETRIZATION_LIBRARY
#endif // #define HAVE_P
SURFACE
/** This method implements a linear function in order to be able to
* work with straight line boundaries.
...
...
@@ -194,7 +195,7 @@ void Dune::AmiraMeshReader<Dune::UGGrid<3,3> >::createDomain(UGGrid<3,3>& grid,
const
std
::
string
&
filename
,
std
::
vector
<
int
>&
isBoundaryNode
)
{
#ifdef HAVE_P
ARAMETRIZATION_LIBRARY
#ifdef HAVE_P
SURFACE
const
int
CORNERS_OF_BND_SEG
=
4
;
int
point
[
CORNERS_OF_BND_SEG
]
=
{
-
1
,
-
1
,
-
1
,
-
1
};
double
alpha
[
2
],
beta
[
2
];
...
...
@@ -293,7 +294,7 @@ void Dune::AmiraMeshReader<Dune::UGGrid<3,3> >::createDomain(UGGrid<3,3>& grid,
boundaryNumber
++
;
std
::
cout
<<
noOfSegments
<<
" segments created!"
<<
std
::
endl
;
#endif // #define HAVE_P
ARAMETRIZATION_LIBRARY
#endif // #define HAVE_P
SURFACE
}
...
...
@@ -443,7 +444,7 @@ void Dune::AmiraMeshReader<Dune::UGGrid<3,3> >::read(Dune::UGGrid<3,3>& grid,
const
std
::
string
&
filename
,
const
std
::
string
&
domainFilename
)
{
#ifndef HAVE_P
ARAMETRIZATION_LIBRARY
#ifndef HAVE_P
SURFACE
DUNE_THROW
(
IOError
,
"Dune has not been built with support for the "
<<
"AmiraMesh-Parametrization library!"
);
#else
...
...
@@ -452,6 +453,7 @@ 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
);
...
...
@@ -459,7 +461,9 @@ void Dune::AmiraMeshReader<Dune::UGGrid<3,3> >::read(Dune::UGGrid<3,3>& grid,
if
(
am
->
findData
(
"Hexahedra"
,
HxINT32
,
8
,
"Nodes"
))
{
// Load a domain from an AmiraMesh hexagrid file
createHexaDomain
(
grid
,
am
);
std
::
cout
<<
"Hexahedral grids with a parametrized boundary are not supported!"
<<
std
::
endl
;
std
::
cout
<<
"I will therefore ignore the boundary parametrization."
<<
std
::
endl
;
createHexaDomain
(
grid
,
am
,
isBoundaryNode
);
}
else
{
...
...
@@ -467,13 +471,13 @@ void Dune::AmiraMeshReader<Dune::UGGrid<3,3> >::read(Dune::UGGrid<3,3>& grid,
std
::
string
domainName
=
grid
.
name
()
+
"_Domain"
;
//loaddomain $file @PARA_FILE $name @DOMAIN
createDomain
(
grid
,
domainName
,
domainFilename
);
createDomain
(
grid
,
domainName
,
domainFilename
,
isBoundaryNode
);
}
// read and build the grid
buildGrid
(
grid
,
am
);
#endif // #define HAVE_P
ARAMETRIZATION_LIBRARY
buildGrid
(
grid
,
am
,
isBoundaryNode
);
#endif // #define HAVE_P
SURFACE
}
...
...
@@ -577,7 +581,21 @@ void Dune::AmiraMeshReader<Dune::UGGrid<3,3> >::buildGrid(UGGrid<3,3>& grid,
?
am
->
nElements
(
"Tetrahedra"
)
:
am
->
nElements
(
"Hexahedra"
);
// Insert interior nodes
// ///////////////////////////////////////////////////////////////////////////////
// The isBoundaryNode array contains information about which of all nodes is
// on the grid boundary. If we have read a parametrized domain description,
// though, the array is empty. To be able to proceed without to much hassle
// we fill the array now.
// ///////////////////////////////////////////////////////////////////////////////
isBoundaryNode
.
resize
(
noOfNodes
);
for
(
i
=
0
;
i
<=
maxBndNodeID
;
i
++
)
isBoundaryNode
[
i
]
=
i
;
for
(;
i
<
noOfNodes
;
i
++
)
isBoundaryNode
[
i
]
=
-
1
;
// //////////////////////////////////////
// Insert interior nodes
// //////////////////////////////////////
for
(
i
=
0
;
i
<
noOfNodes
;
i
++
)
{
if
(
isBoundaryNode
[
i
]
!=
-
1
)
...
...
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