Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
dg
dg
Commits
94d1cb43
Commit
94d1cb43
authored
Jun 06, 2017
by
Jonathan Lambrechts
Browse files
fix2
parent
304f7071
Pipeline
#2088
passed with stage
in 36 minutes and 32 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
mesh/dgMesh.cpp
View file @
94d1cb43
...
...
@@ -456,10 +456,10 @@ static void loadMSH2(const char *fileName, std::ifstream &input, LoadMesh &mesh,
static
void
loadMSH3
(
const
char
*
fileName
,
std
::
ifstream
&
input
,
LoadMesh
&
mesh
,
bool
sequentialLoad
)
{
printf
(
"loading mesh format 3 %i
\n
"
,
__
line
__
);
printf
(
"loading mesh format 3 %i
\n
"
,
__
LINE
__
);
std
::
string
line
;
if
(
!
(
input
>>
line
))
ferror
;
printf
(
"loading mesh format 3 %i
\n
"
,
__
line
__
);
printf
(
"loading mesh format 3 %i
\n
"
,
__
LINE
__
);
if
(
line
==
"$PhysicalNames"
){
int
nphys
;
if
(
!
(
input
>>
nphys
))
ferror
;
...
...
@@ -477,7 +477,7 @@ static void loadMSH3(const char *fileName, std::ifstream &input, LoadMesh &mesh,
if
(
!
(
input
>>
line
))
ferror
;
if
(
line
!=
"$EndPhysicalNames"
)
ferror
;
}
printf
(
"loading mesh format 3 %i
\n
"
,
__
line
__
);
printf
(
"loading mesh format 3 %i
\n
"
,
__
LINE
__
);
if
(
!
(
input
>>
line
))
ferror
;
if
(
line
!=
"$Entities"
)
ferror
;
int
nent
[
4
];
...
...
@@ -497,9 +497,9 @@ static void loadMSH3(const char *fileName, std::ifstream &input, LoadMesh &mesh,
getline
(
input
,
line
);
}
}
printf
(
"loading mesh format 3 %i
\n
"
,
__
line
__
);
printf
(
"loading mesh format 3 %i
\n
"
,
__
LINE
__
);
getline
(
input
,
line
);
printf
(
"loading mesh format 3 %i
\n
"
,
__
line
__
);
printf
(
"loading mesh format 3 %i
\n
"
,
__
LINE
__
);
if
(
line
!=
"$EndEntities"
)
ferror
;
getline
(
input
,
line
);
if
(
line
!=
"$Nodes"
)
ferror
;
...
...
@@ -546,12 +546,12 @@ static void loadMSH3(const char *fileName, std::ifstream &input, LoadMesh &mesh,
keep
|=
(
tmp
-
1
==
Msg
::
GetCommRank
());
}
}
printf
(
"loading mesh format 3 %i
\n
"
,
__
line
__
);
printf
(
"loading mesh format 3 %i
\n
"
,
__
LINE
__
);
if
(
fs
->
dimension
>
mesh
.
dimension
)
mesh
.
dimension
=
fs
->
dimension
;
printf
(
"loading mesh format 3 %i
\n
"
,
__
line
__
);
printf
(
"loading mesh format 3 %i
\n
"
,
__
LINE
__
);
evertices
.
reserve
(
nNodes
);
printf
(
"loading mesh format 3 %i
\n
"
,
__
line
__
);
printf
(
"loading mesh format 3 %i
\n
"
,
__
LINE
__
);
for
(
int
j
=
0
;
j
<
nNodes
;
++
j
)
{
Vertex
&
v
=
vmap
[
tags
[
j
]];
if
(
v
.
id
==
-
1
&&
keep
)
...
...
@@ -563,11 +563,11 @@ static void loadMSH3(const char *fileName, std::ifstream &input, LoadMesh &mesh,
mesh
.
elements
[
key
].
push_back
(
MElement
(
evertices
,
num
));
}
}
printf
(
"loading mesh format 3 %i
\n
"
,
__
line
__
);
printf
(
"loading mesh format 3 %i
\n
"
,
__
LINE
__
);
if
(
!
(
input
>>
line
))
ferror
;
if
(
line
!=
"$EndElements"
)
ferror
;
mesh
.
nodes
.
resize
(
cid
,
3
);
printf
(
"loading mesh format 3 %i
\n
"
,
__
line
__
);
printf
(
"loading mesh format 3 %i
\n
"
,
__
LINE
__
);
for
(
auto
&
it
:
vmap
)
{
Vertex
&
v
=
it
.
second
;
if
(
v
.
id
!=
-
1
)
{
...
...
@@ -577,7 +577,7 @@ static void loadMSH3(const char *fileName, std::ifstream &input, LoadMesh &mesh,
mesh
.
nodes
(
v
.
id
,
2
)
=
v
.
z
;
}
}
printf
(
"loading mesh format 3 %i
\n
"
,
__
line
__
);
printf
(
"loading mesh format 3 %i
\n
"
,
__
LINE
__
);
}
static
void
loadMSH
(
const
char
*
fileName
,
LoadMesh
&
mesh
,
bool
sequentialLoad
)
...
...
@@ -619,19 +619,19 @@ static dgFullMatrix<double> copyCoordinates(const std::vector<MElement> &element
dgMesh
::
dgMesh
(
const
std
::
string
filename
,
int
dimension
,
const
std
::
vector
<
std
::
string
>
physicalTags
,
bool
sequentialLoad
,
const
std
::
string
periodicFile
)
{
printf
(
"loading mesh %i
\n
"
,
__
line
__
);
printf
(
"loading mesh %i
\n
"
,
__
LINE
__
);
LoadMesh
mesh
;
_octree
=
NULL
;
sequentialLoad
|=
(
Msg
::
GetCommSize
()
==
1
);
_sequentialLoad
=
sequentialLoad
;
printf
(
"loading mesh %i
\n
"
,
__
line
__
);
printf
(
"loading mesh %i
\n
"
,
__
LINE
__
);
loadMSH
(
filename
.
c_str
(),
mesh
,
sequentialLoad
);
printf
(
"loading mesh %i
\n
"
,
__
line
__
);
printf
(
"loading mesh %i
\n
"
,
__
LINE
__
);
_spaceTransform
=
NULL
;
if
(
dimension
==
0
)
dimension
=
mesh
.
dimension
;
_dimension
=
dimension
;
printf
(
"loading mesh %i
\n
"
,
__
line
__
);
printf
(
"loading mesh %i
\n
"
,
__
LINE
__
);
for
(
auto
&
it
:
mesh
.
elements
)
{
int
type
=
it
.
first
.
type
;
int
dim
=
ElementType
::
DimensionFromTag
(
type
);
...
...
@@ -640,14 +640,14 @@ dgMesh::dgMesh(const std::string filename, int dimension, const std::vector<std:
if
(
!
physicalTags
.
empty
()
&&
std
::
find
(
physicalTags
.
begin
(),
physicalTags
.
end
(),
tag
)
==
physicalTags
.
end
())
continue
;
int
iGroup
=
_elements
.
size
();
if
(
it
.
first
.
partition
!=
Msg
::
GetCommRank
())
continue
;
printf
(
"loading mesh %i
\n
"
,
__
line
__
);
printf
(
"loading mesh %i
\n
"
,
__
LINE
__
);
_elements
.
push_back
(
new
dgElementVector
(
iGroup
,
it
.
second
,
tag
,
type
,
copyCoordinates
(
it
.
second
,
mesh
.
nodes
),
it
.
first
.
partition
));
printf
(
"loading mesh %i
\n
"
,
__
line
__
);
printf
(
"loading mesh %i
\n
"
,
__
LINE
__
);
for
(
size_t
i
=
0
;
i
<
it
.
second
.
size
();
++
i
)
_elementMap
[
it
.
second
[
i
].
num
()]
=
std
::
make_pair
(
iGroup
,
i
);
printf
(
"loading mesh %i
\n
"
,
__
line
__
);
printf
(
"loading mesh %i
\n
"
,
__
LINE
__
);
}
printf
(
"loading mesh %i
\n
"
,
__
line
__
);
printf
(
"loading mesh %i
\n
"
,
__
LINE
__
);
for
(
auto
&
it
:
mesh
.
elements
)
{
int
type
=
it
.
first
.
type
;
int
dim
=
ElementType
::
DimensionFromTag
(
type
);
...
...
@@ -656,21 +656,21 @@ dgMesh::dgMesh(const std::string filename, int dimension, const std::vector<std:
if
(
!
physicalTags
.
empty
()
&&
std
::
find
(
physicalTags
.
begin
(),
physicalTags
.
end
(),
tag
)
==
physicalTags
.
end
())
continue
;
int
iGroup
=
_elements
.
size
()
+
_ghostElements
.
size
();
if
(
it
.
first
.
partition
==
Msg
::
GetCommRank
())
continue
;
printf
(
"loading mesh %i
\n
"
,
__
line
__
);
printf
(
"loading mesh %i
\n
"
,
__
LINE
__
);
_ghostElements
.
push_back
(
new
dgElementVector
(
iGroup
,
it
.
second
,
tag
,
type
,
copyCoordinates
(
it
.
second
,
mesh
.
nodes
),
it
.
first
.
partition
));
printf
(
"loading mesh %i
\n
"
,
__
line
__
);
printf
(
"loading mesh %i
\n
"
,
__
LINE
__
);
for
(
size_t
i
=
0
;
i
<
it
.
second
.
size
();
++
i
)
_elementMap
[
it
.
second
[
i
].
num
()]
=
std
::
make_pair
(
iGroup
,
i
);
}
printf
(
"loading mesh %i
\n
"
,
__
line
__
);
printf
(
"loading mesh %i
\n
"
,
__
LINE
__
);
if
(
_elements
.
size
()
==
0
)
Msg
::
Fatal
(
"no element loaded in dgMesh !"
);
_gmshVertexId
.
resize
(
mesh
.
mshToVertexId
.
size
());
for
(
auto
it
:
mesh
.
mshToVertexId
)
_gmshVertexId
[
it
.
second
]
=
it
.
first
;
printf
(
"loading mesh %i
\n
"
,
__
line
__
);
printf
(
"loading mesh %i
\n
"
,
__
LINE
__
);
buildInterfaces
(
*
this
,
mesh
,
_interfaces
,
_interfaceMap
,
_periodicMap
,
sequentialLoad
,
periodicFile
);
printf
(
"loading mesh %i
\n
"
,
__
line
__
);
printf
(
"loading mesh %i
\n
"
,
__
LINE
__
);
}
void
dgMesh
::
findElement
(
int
mElementId
,
int
&
iGroup
,
int
&
iElement
)
const
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment