Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Aland, Sebastian
amdis
Commits
68fe64e3
Commit
68fe64e3
authored
Dec 16, 2010
by
Naumann, Andreas
Browse files
tried extending the meshtest
parent
3e8be011
Changes
2
Hide whitespace changes
Inline
Side-by-side
AMDiS/test/Meshtest/src/Meshtest.cpp
View file @
68fe64e3
...
...
@@ -3,9 +3,33 @@
#include "ProblemScal.h"
#include <sstream>
#include <string>
#include <stdexcept>
typedef
std
::
vector
<
std
::
string
>
StringVector
;
template
<
typename
Test
>
void
require
(
Test
l
,
Test
r
,
int
line
,
std
::
string
message
)
{
if
(
l
!=
r
)
{
std
::
stringstream
ss
;
ss
<<
"Condition for "
<<
message
<<
" is wrong
\n
"
;
ss
<<
"l: "
<<
l
<<
"
\n
"
<<
"r: "
<<
r
<<
"
\n
"
;
throw
std
::
runtime_error
(
ss
.
str
());
}
}
template
<
typename
Test
>
void
require
(
Test
l
,
Test
r
,
std
::
string
message
,
StringVector
&
res
)
{
if
(
l
!=
r
)
{
std
::
stringstream
ss
;
ss
<<
"Condition for "
<<
message
<<
" is wrong
\n
"
;
ss
<<
"l: "
<<
l
<<
"
\n
"
<<
"r: "
<<
r
<<
"
\n
"
;
res
.
push_back
(
ss
.
str
());
}
}
using
namespace
AMDiS
;
void
testMesh
(
int
dim
)
{
void
testMesh
(
int
dim
,
int
nrEls
,
int
nrVert
,
StringVector
&
res
)
{
std
::
stringstream
ss
;
ss
<<
dim
;
Parameters
::
addGlobalParameter
(
0
,
"dimension of world"
,
ss
.
str
());
...
...
@@ -15,6 +39,11 @@ void testMesh(int dim) {
ln_dof
[
VERTEX
]
=
1
;
mesh
.
createDOFAdmin
(
"vertex_dofs"
,
ln_dof
);
mesh
.
initialize
();
require
(
mesh
.
getDim
(),
dim
,
__LINE__
,
"mesh dimension"
);
std
::
stringstream
ss2
;
ss2
<<
"
\n
current dimension: "
<<
dim
<<
"
\n
"
;
require
(
mesh
.
getNumberOfElements
()
,
nrEls
,
ss2
.
str
()
+
"number of elements"
,
res
);
require
(
mesh
.
getNumberOfVertices
(),
nrVert
,
ss2
.
str
()
+
"number of vertices"
,
res
);
}
int
main
(
int
argc
,
char
**
argv
)
{
...
...
@@ -23,10 +52,17 @@ int main(int argc, char** argv) {
Parameters
::
addGlobalParameter
(
0
,
"testMesh2->macro file name"
,
"macro/macro.stand.2d"
);
Parameters
::
addGlobalParameter
(
0
,
"testMesh3->macro file name"
,
"macro/macro.stand.3d"
);
testMesh
(
1
);
testMesh
(
2
);
testMesh
(
3
);
StringVector
errorMessages
;
testMesh
(
1
,
1
,
2
,
errorMessages
);
testMesh
(
2
,
4
,
5
,
errorMessages
);
testMesh
(
3
,
6
,
8
,
errorMessages
);
return
0
;
if
(
errorMessages
.
size
()
>
0
)
std
::
cout
<<
" got errors:
\n
"
;
for
(
StringVector
::
size_type
i
=
0
;
i
<
errorMessages
.
size
();
++
i
)
std
::
cout
<<
errorMessages
[
i
]
<<
"
\n
"
;
if
(
errorMessages
.
size
()
!=
0
)
return
1
;
return
0
;
}
AMDiS/test/demoimpl/src/ParametricProject.hh
View file @
68fe64e3
...
...
@@ -54,7 +54,7 @@ public:
void
buildBeforeCoarsen
(
AdaptInfo
*
adaptInfo
,
Flag
flag
)
{
FUNCNAME
(
"ParametricSphere::buildAfterCoarsen()"
);
MSG
(
"calculation of parametric coordinates
\n
"
);
int
preDOFs
=
this
->
getFeSpace
()
->
getAdmin
()
->
getNumberOfPreD
OF
s
(
VERTEX
);
int
preDOFs
=
this
->
getFeSpace
()
->
getAdmin
()
->
getNumberOfPreD
of
s
(
VERTEX
);
int
dim
=
this
->
getMesh
()
->
getDim
();
int
dow
=
Global
::
getGeo
(
WORLD
);
WorldVector
<
double
>
vertexCoords
;
...
...
Write
Preview
Supports
Markdown
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