Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Kirill Terekhov
INMOST
Commits
aa464182
Commit
aa464182
authored
Mar 04, 2021
by
Kirill Terekhov
Browse files
remove cell<->node connections
parent
9325de74
Changes
13
Hide whitespace changes
Inline
Side-by-side
Examples/Solver/main.cpp
View file @
aa464182
...
...
@@ -305,7 +305,7 @@ int main(int argc,char ** argv)
for
(
Mesh
::
iteratorFace
face
=
m
->
BeginFace
();
face
!=
m
->
EndFace
();
++
face
)
{
//~ std::cout << face->LocalID() << " / " << m->NumberOfFaces() << std::endl;
Element
::
Status
s1
,
s2
;
Element
::
Status
s1
=
Element
::
Any
,
s2
=
Element
::
Any
;
Cell
r1
=
face
->
BackCell
();
Cell
r2
=
face
->
FrontCell
();
if
(
((
!
r1
.
isValid
()
||
(
s1
=
r1
->
GetStatus
())
==
Element
::
Ghost
)
?
0
:
1
)
+
...
...
Source/Headers/inmost_mesh.h
View file @
aa464182
...
...
@@ -1488,11 +1488,11 @@ namespace INMOST
std
::
pair
<
Edge
,
bool
>
CreateEdge
(
const
ElementArray
<
Node
>
&
nodes
);
std
::
pair
<
Face
,
bool
>
CreateFace
(
const
ElementArray
<
Edge
>
&
edges
);
std
::
pair
<
Face
,
bool
>
CreateFace
(
const
ElementArray
<
Node
>
&
nodes
);
std
::
pair
<
Cell
,
bool
>
CreateCell
(
const
ElementArray
<
Face
>
&
faces
,
const
ElementArray
<
Node
>
&
suggest_nodes_order
=
ElementArray
<
Node
>
(
NULL
));
std
::
pair
<
Cell
,
bool
>
CreateCell
(
const
ElementArray
<
Node
>
&
c_f_nodes
,
const
integer
*
c_f_numnodes
,
integer
num_c_faces
,
const
ElementArray
<
Node
>
&
suggest_nodes_order
=
ElementArray
<
Node
>
(
NULL
));
std
::
pair
<
Cell
,
bool
>
CreateCell
(
const
ElementArray
<
Node
>
&
c_nodes
,
const
integer
*
c_f_nodeinds
,
const
integer
*
c_f_numnodes
,
integer
num_c_faces
,
const
ElementArray
<
Node
>
&
suggest_nodes_order
=
ElementArray
<
Node
>
(
NULL
));
std
::
pair
<
Cell
,
bool
>
CreateCell
(
const
ElementArray
<
Face
>
&
faces
);
//
, const ElementArray<Node> & suggest_nodes_order = ElementArray<Node>(NULL));
std
::
pair
<
Cell
,
bool
>
CreateCell
(
const
ElementArray
<
Node
>
&
c_f_nodes
,
const
integer
*
c_f_numnodes
,
integer
num_c_faces
);
//
,
//
const ElementArray<Node> & suggest_nodes_order = ElementArray<Node>(NULL));
std
::
pair
<
Cell
,
bool
>
CreateCell
(
const
ElementArray
<
Node
>
&
c_nodes
,
const
integer
*
c_f_nodeinds
,
const
integer
*
c_f_numnodes
,
integer
num_c_faces
);
//
,
//
const ElementArray<Node> & suggest_nodes_order = ElementArray<Node>(NULL));
std
::
pair
<
ElementSet
,
bool
>
CreateSet
(
std
::
string
name
);
/// Same as Mesh::CreateSet without checking existance of the set
std
::
pair
<
ElementSet
,
bool
>
CreateSetUnique
(
std
::
string
name
);
...
...
Source/IO/mesh_pmf_file.cpp
View file @
aa464182
...
...
@@ -234,14 +234,8 @@ namespace INMOST
lid
=
IntegerDF
(
lc
[
kt
],
set_id
);
uconv
.
write_iValue
(
out
,
lid
);
}
Element
::
adj_type
&
hc
=
HighConn
(
*
it
);
nhigh
=
static_cast
<
INMOST_DATA_ENUM_TYPE
>
(
hc
.
size
());
nhigh
=
0
;
uconv
.
write_iValue
(
out
,
nhigh
);
for
(
Element
::
adj_type
::
size_type
kt
=
0
;
kt
<
hc
.
size
();
++
kt
)
{
lid
=
IntegerDF
(
hc
[
kt
],
set_id
);
uconv
.
write_iValue
(
out
,
lid
);
}
}
// Element Sets
...
...
@@ -1259,7 +1253,8 @@ namespace INMOST
uconv
.
read_iValue
(
in
,
lid
);
suggest_nodes
.
push_back
(
new_nodes
[
lid
]);
}
new_cells
[
i
]
=
CreateCell
(
sub_elements
,
suggest_nodes
).
first
->
GetHandle
();
//new_cells[i] = CreateCell(sub_elements, suggest_nodes).first->GetHandle();
new_cells
[
i
]
=
CreateCell
(
sub_elements
).
first
->
GetHandle
();
sub_elements
.
clear
();
suggest_nodes
.
clear
();
}
...
...
Source/IO/mesh_vtk_file.cpp
View file @
aa464182
...
...
@@ -1882,7 +1882,8 @@ safe_output:
f_edges
.
at
(
1
)
=
CreateEdge
(
e_nodes
).
first
->
GetHandle
();
c_faces
.
push_back
(
CreateFace
(
f_edges
).
first
);
}
Cell
c
=
CreateCell
(
c_faces
,
c_nodes
).
first
;
//Cell c = CreateCell(c_faces,c_nodes).first;
Cell
c
=
CreateCell
(
c_faces
).
first
;
newcells
[
i
]
=
c
->
GetHandle
();
}
else
...
...
@@ -1921,7 +1922,8 @@ safe_output:
f_edges
.
at
(
1
)
=
CreateEdge
(
e_nodes
).
first
->
GetHandle
();
c_faces
.
push_back
(
CreateFace
(
f_edges
).
first
);
}
Cell
c
=
CreateCell
(
c_faces
,
c_nodes
).
first
;
//Cell c = CreateCell(c_faces,c_nodes).first;
Cell
c
=
CreateCell
(
c_faces
).
first
;
newcells
[
i
]
=
c
->
GetHandle
();
}
else
newcells
[
i
]
=
CreateFace
(
c_nodes
).
first
->
GetHandle
();
...
...
@@ -1948,7 +1950,8 @@ safe_output:
f_edges
.
at
(
1
)
=
CreateEdge
(
e_nodes
).
first
->
GetHandle
();
c_faces
.
push_back
(
CreateFace
(
f_edges
).
first
);
}
Cell
c
=
CreateCell
(
c_faces
,
c_nodes
).
first
;
//Cell c = CreateCell(c_faces,c_nodes).first;
Cell
c
=
CreateCell
(
c_faces
).
first
;
newcells
[
i
]
=
c
->
GetHandle
();
}
else
newcells
[
i
]
=
CreateFace
(
c_nodes
).
first
->
GetHandle
();
...
...
Source/IO/mesh_vtu_file.cpp
View file @
aa464182
...
...
@@ -674,7 +674,8 @@ namespace INMOST
f_edges
.
at
(
1
)
=
CreateEdge
(
e_nodes
).
first
->
GetHandle
();
c_faces
.
push_back
(
CreateFace
(
f_edges
).
first
);
}
Cell
c
=
CreateCell
(
c_faces
,
hnodes
).
first
;
//Cell c = CreateCell(c_faces,hnodes).first;
Cell
c
=
CreateCell
(
c_faces
).
first
;
newcells
[
q
]
=
c
->
GetHandle
();
}
else
...
...
@@ -703,7 +704,8 @@ namespace INMOST
f_edges
.
at
(
1
)
=
CreateEdge
(
e_nodes
).
first
->
GetHandle
();
c_faces
.
push_back
(
CreateFace
(
f_edges
).
first
);
}
Cell
c
=
CreateCell
(
c_faces
,
hnodes
).
first
;
//Cell c = CreateCell(c_faces, hnodes).first;
Cell
c
=
CreateCell
(
c_faces
).
first
;
newcells
[
q
]
=
c
->
GetHandle
();
}
else
...
...
@@ -733,7 +735,8 @@ namespace INMOST
f_edges
.
at
(
1
)
=
CreateEdge
(
e_nodes
).
first
->
GetHandle
();
c_faces
.
push_back
(
CreateFace
(
f_edges
).
first
);
}
Cell
c
=
CreateCell
(
c_faces
,
hnodes
).
first
;
//Cell c = CreateCell(c_faces, hnodes).first;
Cell
c
=
CreateCell
(
c_faces
).
first
;
newcells
[
q
]
=
c
->
GetHandle
();
}
else
...
...
@@ -757,7 +760,8 @@ namespace INMOST
f_edges
.
at
(
1
)
=
CreateEdge
(
e_nodes
).
first
->
GetHandle
();
c_faces
.
push_back
(
CreateFace
(
f_edges
).
first
);
}
Cell
c
=
CreateCell
(
c_faces
,
hnodes
).
first
;
//Cell c = CreateCell(c_faces, hnodes).first;
Cell
c
=
CreateCell
(
c_faces
).
first
;
newcells
[
q
]
=
c
->
GetHandle
();
}
else
...
...
Source/Mesh/cell.cpp
View file @
aa464182
...
...
@@ -141,7 +141,6 @@ namespace INMOST
if
(
jt
==
jend
)
return
false
;
//no matching edge
}
adj_type
::
size_type
it
=
1
,
iend
=
lc
.
size
()
-
1
;
bool
corrected
=
false
;
while
(
it
<
iend
)
//loop over edges
{
adj_type
const
&
ilc
=
m
->
LowConn
(
lc
[
it
]);
...
...
@@ -168,20 +167,12 @@ namespace INMOST
HandleType
temp
=
lc
[
it
];
lc
[
it
]
=
lc
[
jt
];
lc
[
jt
]
=
temp
;
corrected
=
true
;
break
;
}
}
if
(
jt
==
jend
)
return
false
;
//no matching edge
}
}
if
(
corrected
)
{
ElementArray
<
Node
>
nodes
(
GetMeshLink
());
GetMeshLink
()
->
RestoreCellNodes
(
GetHandle
(),
nodes
);
Element
::
adj_type
&
hc
=
GetMeshLink
()
->
HighConn
(
GetHandle
());
hc
.
replace
(
hc
.
begin
(),
hc
.
end
(),
nodes
.
begin
(),
nodes
.
end
());
}
//check that the loop is closed
adj_type
const
&
ilc
=
m
->
LowConn
(
lc
[
iend
]);
if
(
ilc
.
size
()
!=
2
)
return
false
;
...
...
@@ -305,20 +296,9 @@ namespace INMOST
{
assert
(
GetHandleElementType
(
GetHandle
())
==
CELL
);
Mesh
*
m
=
GetMeshLink
();
if
(
!
m
->
HideMarker
()
)
{
adj_type
const
&
hc
=
m
->
HighConn
(
GetHandle
());
return
ElementArray
<
Node
>
(
m
,
hc
.
data
(),
hc
.
data
()
+
hc
.
size
());
}
else
{
MarkerType
hm
=
m
->
HideMarker
();
ElementArray
<
Node
>
aret
(
m
);
adj_type
const
&
hc
=
m
->
HighConn
(
GetHandle
());
for
(
adj_type
::
size_type
it
=
0
;
it
<
hc
.
size
();
++
it
)
if
(
!
m
->
GetMarker
(
hc
[
it
],
hm
)
)
aret
.
push_back
(
hc
[
it
]);
return
aret
;
}
ElementArray
<
Node
>
ret
(
m
);
m
->
RestoreCellNodes
(
GetHandle
(),
ret
);
return
ret
;
}
...
...
@@ -326,39 +306,19 @@ namespace INMOST
{
assert
(
GetHandleElementType
(
GetHandle
())
==
CELL
);
Mesh
*
m
=
GetMeshLink
();
ElementArray
<
Node
>
aret
(
m
);
if
(
!
m
->
HideMarker
()
)
ElementArray
<
Node
>
aret
(
m
),
ret
(
m
);
m
->
RestoreCellNodes
(
GetHandle
(),
ret
);
if
(
isPrivate
(
mask
)
)
{
adj_type
const
&
hc
=
m
->
HighConn
(
GetHandle
());
if
(
isPrivate
(
mask
)
)
{
for
(
adj_type
::
size_type
it
=
0
;
it
<
hc
.
size
();
++
it
)
if
(
invert
^
m
->
GetPrivateMarker
(
hc
[
it
],
mask
)
)
aret
.
push_back
(
hc
[
it
]);
}
else
{
for
(
adj_type
::
size_type
it
=
0
;
it
<
hc
.
size
();
++
it
)
if
(
invert
^
m
->
GetMarker
(
hc
[
it
],
mask
)
)
aret
.
push_back
(
hc
[
it
]);
}
for
(
ElementArray
<
Node
>::
iterator
it
=
ret
.
begin
();
it
!=
ret
.
end
();
++
it
)
if
(
invert
^
m
->
GetPrivateMarker
(
*
it
,
mask
)
)
aret
.
push_back
(
*
it
);
}
else
{
MarkerType
hm
=
m
->
HideMarker
();
adj_type
const
&
hc
=
m
->
HighConn
(
GetHandle
());
if
(
isPrivate
(
mask
)
)
{
for
(
adj_type
::
size_type
it
=
0
;
it
<
hc
.
size
();
++
it
)
if
(
(
invert
^
m
->
GetPrivateMarker
(
hc
[
it
],
mask
))
&&
!
m
->
GetMarker
(
hc
[
it
],
hm
)
)
aret
.
push_back
(
hc
[
it
]);
}
else
{
for
(
adj_type
::
size_type
it
=
0
;
it
<
hc
.
size
();
++
it
)
if
(
(
invert
^
m
->
GetMarker
(
hc
[
it
],
mask
))
&&
!
m
->
GetMarker
(
hc
[
it
],
hm
)
)
aret
.
push_back
(
hc
[
it
]);
}
for
(
ElementArray
<
Node
>::
iterator
it
=
ret
.
begin
();
it
!=
ret
.
end
();
++
it
)
if
(
invert
^
m
->
GetMarker
(
*
it
,
mask
)
)
aret
.
push_back
(
*
it
);
}
return
aret
;
}
...
...
Source/Mesh/element.cpp
View file @
aa464182
...
...
@@ -71,13 +71,14 @@ namespace INMOST
Mesh
*
mesh
=
GetMeshLink
();
std
::
vector
<
HandleType
>
result
;
INMOST_DATA_INTEGER_TYPE
conn
[
4
]
=
{
0
,
0
,
0
,
0
};
INMOST_DATA_INTEGER_TYPE
myconn
=
-
1
,
i
;
INMOST_DATA_INTEGER_TYPE
myconn
=
-
1
,
i
=
0
;
enumerator
ret
=
0
;
for
(
ElementType
e
=
NODE
,
i
=
0
;
e
<=
CELL
;
i
++
,
e
=
e
<<
1
)
for
(
ElementType
e
=
NODE
;
e
<=
CELL
;
e
=
NextElementType
(
e
)
)
{
if
(
_etype
&
e
)
conn
[
i
]
=
1
;
if
(
GetElementType
()
&
e
)
myconn
=
i
;
i
++
;
}
if
(
!
mesh
->
HideMarker
()
)
{
...
...
@@ -87,53 +88,95 @@ namespace INMOST
{
ret
+=
1
;
}
else
if
(
i
==
(
myconn
+
1
+
4
)
%
4
)
else
if
(
i
==
myconn
+
1
)
{
ret
+=
static_cast
<
enumerator
>
(
mesh
->
HighConn
(
GetHandle
()).
size
());
}
else
if
(
i
==
(
myconn
-
1
+
4
)
%
4
)
else
if
(
i
==
myconn
-
1
)
{
ret
+=
static_cast
<
enumerator
>
(
mesh
->
LowConn
(
GetHandle
()).
size
());
}
else
if
(
i
==
(
myconn
-
2
+
4
)
%
4
)
else
if
(
i
==
myconn
+
2
)
{
MarkerType
mrk
=
mesh
->
CreatePrivateMarker
();
if
(
(
GetElementType
()
&
NODE
)
||
(
GetElementType
()
&
EDGE
)
)
adj_type
const
&
hc
=
mesh
->
HighConn
(
GetHandle
());
for
(
adj_type
::
size_type
it
=
0
;
it
<
hc
.
size
();
it
++
)
{
adj_type
const
&
hc
=
mesh
->
HighConn
(
GetHandle
());
for
(
adj_type
::
size_type
it
=
0
;
it
<
hc
.
size
();
it
++
)
adj_type
const
&
ihc
=
mesh
->
HighConn
(
hc
[
it
]);
for
(
adj_type
::
size_type
jt
=
0
;
jt
<
ihc
.
size
();
jt
++
)
if
(
!
mesh
->
GetPrivateMarker
(
ihc
[
jt
],
mrk
)
)
{
result
.
push_back
(
ihc
[
jt
]);
mesh
->
SetPrivateMarker
(
ihc
[
jt
],
mrk
);
}
}
ret
+=
static_cast
<
enumerator
>
(
result
.
size
());
if
(
!
result
.
empty
()
)
mesh
->
RemPrivateMarkerArray
(
&
result
[
0
],
result
.
size
(),
mrk
);
result
.
clear
();
mesh
->
ReleasePrivateMarker
(
mrk
);
}
else
if
(
i
==
myconn
-
2
)
{
MarkerType
mrk
=
mesh
->
CreatePrivateMarker
();
adj_type
const
&
lc
=
mesh
->
LowConn
(
GetHandle
());
for
(
adj_type
::
size_type
it
=
0
;
it
<
lc
.
size
();
it
++
)
{
adj_type
const
&
ilc
=
mesh
->
LowConn
(
lc
[
it
]);
for
(
adj_type
::
size_type
jt
=
0
;
jt
<
ilc
.
size
();
jt
++
)
if
(
!
mesh
->
GetPrivateMarker
(
ilc
[
jt
],
mrk
)
)
{
result
.
push_back
(
ilc
[
jt
]);
mesh
->
SetPrivateMarker
(
ilc
[
jt
],
mrk
);
}
}
ret
+=
static_cast
<
enumerator
>
(
result
.
size
());
if
(
!
result
.
empty
()
)
mesh
->
RemPrivateMarkerArray
(
&
result
[
0
],
result
.
size
(),
mrk
);
result
.
clear
();
mesh
->
ReleasePrivateMarker
(
mrk
);
}
else
if
(
i
==
myconn
+
3
)
{
MarkerType
mrk
=
mesh
->
CreatePrivateMarker
();
adj_type
const
&
hc
=
mesh
->
HighConn
(
GetHandle
());
for
(
adj_type
::
size_type
it
=
0
;
it
<
hc
.
size
();
it
++
)
{
adj_type
const
&
ihc
=
mesh
->
HighConn
(
hc
[
it
]);
for
(
adj_type
::
size_type
jt
=
0
;
jt
<
ihc
.
size
();
jt
++
)
{
adj_type
const
&
i
hc
=
mesh
->
HighConn
(
hc
[
i
t
]);
for
(
adj_type
::
size_type
j
t
=
0
;
j
t
<
i
hc
.
size
();
j
t
++
)
if
(
!
mesh
->
GetPrivateMarker
(
i
hc
[
j
t
],
mrk
)
)
adj_type
const
&
j
hc
=
mesh
->
HighConn
(
i
hc
[
j
t
]);
for
(
adj_type
::
size_type
k
t
=
0
;
k
t
<
j
hc
.
size
();
k
t
++
)
if
(
!
mesh
->
GetPrivateMarker
(
j
hc
[
k
t
],
mrk
)
)
{
result
.
push_back
(
i
hc
[
j
t
]);
mesh
->
SetPrivateMarker
(
i
hc
[
j
t
],
mrk
);
result
.
push_back
(
j
hc
[
k
t
]);
mesh
->
SetPrivateMarker
(
j
hc
[
k
t
],
mrk
);
}
}
ret
+=
static_cast
<
enumerator
>
(
result
.
size
());
}
else
if
(
GetElementType
()
&
FACE
)
{
ret
+=
static_cast
<
enumerator
>
(
mesh
->
LowConn
(
GetHandle
()).
size
());
}
else
ret
+=
static_cast
<
enumerator
>
(
result
.
size
());
if
(
!
result
.
empty
()
)
mesh
->
RemPrivateMarkerArray
(
&
result
[
0
],
result
.
size
(),
mrk
);
result
.
clear
();
mesh
->
ReleasePrivateMarker
(
mrk
);
}
else
if
(
i
==
myconn
-
3
)
{
MarkerType
mrk
=
mesh
->
CreatePrivateMarker
();
adj_type
const
&
lc
=
mesh
->
LowConn
(
GetHandle
());
for
(
adj_type
::
size_type
it
=
0
;
it
<
lc
.
size
();
it
++
)
{
adj_type
const
&
lc
=
mesh
->
LowConn
(
GetHandle
()
);
for
(
adj_type
::
size_type
i
t
=
0
;
i
t
<
lc
.
size
();
i
t
++
)
adj_type
const
&
i
lc
=
mesh
->
LowConn
(
lc
[
it
]
);
for
(
adj_type
::
size_type
j
t
=
0
;
j
t
<
i
lc
.
size
();
j
t
++
)
{
adj_type
const
&
i
lc
=
mesh
->
LowConn
(
lc
[
i
t
]);
for
(
adj_type
::
size_type
j
t
=
0
;
j
t
<
i
lc
.
size
();
j
t
++
)
if
(
!
mesh
->
GetPrivateMarker
(
i
lc
[
j
t
],
mrk
)
)
adj_type
const
&
j
lc
=
mesh
->
LowConn
(
i
lc
[
j
t
]);
for
(
adj_type
::
size_type
k
t
=
0
;
k
t
<
j
lc
.
size
();
k
t
++
)
if
(
!
mesh
->
GetPrivateMarker
(
j
lc
[
k
t
],
mrk
)
)
{
result
.
push_back
(
i
lc
[
j
t
]);
mesh
->
SetPrivateMarker
(
i
lc
[
j
t
],
mrk
);
result
.
push_back
(
j
lc
[
k
t
]);
mesh
->
SetPrivateMarker
(
j
lc
[
k
t
],
mrk
);
}
}
ret
+=
static_cast
<
enumerator
>
(
result
.
size
());
}
for
(
size_t
it
=
0
;
it
<
result
.
size
();
it
++
)
mesh
->
RemPrivateMarker
(
result
[
it
],
mrk
);
}
}
ret
+=
static_cast
<
enumerator
>
(
result
.
size
());
if
(
!
result
.
empty
()
)
mesh
->
RemPrivateMarkerArray
(
&
result
[
0
],
result
.
size
(),
mrk
);
result
.
clear
();
mesh
->
ReleasePrivateMarker
(
mrk
);
}
...
...
@@ -148,55 +191,101 @@ namespace INMOST
{
if
(
!
GetMarker
(
hm
)
)
ret
++
;
}
else
if
(
i
==
(
myconn
+
1
+
4
)
%
4
)
else
if
(
i
==
myconn
+
1
)
{
adj_type
const
&
hc
=
mesh
->
HighConn
(
GetHandle
());
for
(
adj_type
::
size_type
it
=
0
;
it
<
hc
.
size
();
++
it
)
if
(
!
mesh
->
GetMarker
(
hc
[
it
],
hm
)
)
ret
++
;
}
else
if
(
i
==
(
myconn
-
1
+
4
)
%
4
)
else
if
(
i
==
myconn
-
1
)
{
adj_type
const
&
lc
=
mesh
->
LowConn
(
GetHandle
());
for
(
adj_type
::
size_type
it
=
0
;
it
<
lc
.
size
();
++
it
)
if
(
!
mesh
->
GetMarker
(
lc
[
it
],
hm
)
)
ret
++
;
}
else
if
(
i
==
(
myconn
-
2
+
4
)
%
4
)
else
if
(
i
==
myconn
+
2
)
{
MarkerType
mrk
=
mesh
->
CreatePrivateMarker
();
if
(
(
GetElementType
()
&
NODE
)
||
(
GetElementType
()
&
EDGE
)
)
adj_type
const
&
hc
=
mesh
->
HighConn
(
GetHandle
());
for
(
adj_type
::
size_type
it
=
0
;
it
<
hc
.
size
();
it
++
)
if
(
!
mesh
->
GetMarker
(
hc
[
it
],
hm
)
)
{
adj_type
const
&
hc
=
mesh
->
HighConn
(
GetHandle
()
);
for
(
adj_type
::
size_type
i
t
=
0
;
i
t
<
hc
.
size
();
i
t
++
)
if
(
!
mesh
->
GetMarker
(
hc
[
i
t
],
hm
)
)
adj_type
const
&
i
hc
=
mesh
->
HighConn
(
hc
[
it
]
);
for
(
adj_type
::
size_type
j
t
=
0
;
j
t
<
i
hc
.
size
();
j
t
++
)
if
(
!
mesh
->
GetMarker
(
i
hc
[
j
t
],
hm
)
)
{
adj_type
const
&
ihc
=
mesh
->
HighConn
(
hc
[
it
]);
for
(
adj_type
::
size_type
jt
=
0
;
jt
<
ihc
.
size
();
jt
++
)
if
(
!
mesh
->
GetMarker
(
ihc
[
jt
],
hm
)
)
if
(
!
mesh
->
GetPrivateMarker
(
ihc
[
jt
],
mrk
)
)
{
result
.
push_back
(
ihc
[
jt
]);
mesh
->
SetPrivateMarker
(
ihc
[
jt
],
mrk
);
}
}
}
ret
+=
static_cast
<
enumerator
>
(
result
.
size
());
if
(
!
result
.
empty
()
)
mesh
->
RemPrivateMarkerArray
(
&
result
[
0
],
result
.
size
(),
mrk
);
result
.
clear
();
mesh
->
ReleasePrivateMarker
(
mrk
);
}
else
if
(
i
==
myconn
-
2
)
{
MarkerType
mrk
=
mesh
->
CreatePrivateMarker
();
adj_type
const
&
lc
=
mesh
->
LowConn
(
GetHandle
());
for
(
adj_type
::
size_type
it
=
0
;
it
<
lc
.
size
();
it
++
)
if
(
!
mesh
->
GetMarker
(
lc
[
it
],
hm
)
)
{
adj_type
const
&
ilc
=
mesh
->
LowConn
(
lc
[
it
]);
for
(
adj_type
::
size_type
jt
=
0
;
jt
<
ilc
.
size
();
jt
++
)
if
(
!
mesh
->
GetMarker
(
ilc
[
jt
],
hm
)
)
if
(
!
mesh
->
GetPrivateMarker
(
ilc
[
jt
],
mrk
)
)
{
if
(
!
mesh
->
GetPrivateMarker
(
ihc
[
jt
],
mrk
)
)
result
.
push_back
(
ilc
[
jt
]);
mesh
->
SetPrivateMarker
(
ilc
[
jt
],
mrk
);
}
}
ret
+=
static_cast
<
enumerator
>
(
result
.
size
());
if
(
!
result
.
empty
()
)
mesh
->
RemPrivateMarkerArray
(
&
result
[
0
],
result
.
size
(),
mrk
);
result
.
clear
();
mesh
->
ReleasePrivateMarker
(
mrk
);
}
else
if
(
i
==
myconn
+
3
)
{
MarkerType
mrk
=
mesh
->
CreatePrivateMarker
();
adj_type
const
&
hc
=
mesh
->
HighConn
(
GetHandle
());
for
(
adj_type
::
size_type
it
=
0
;
it
<
hc
.
size
();
it
++
)
if
(
!
mesh
->
GetMarker
(
hc
[
it
],
hm
)
)
{
adj_type
const
&
ihc
=
mesh
->
HighConn
(
hc
[
it
]);
for
(
adj_type
::
size_type
jt
=
0
;
jt
<
ihc
.
size
();
jt
++
)
if
(
!
mesh
->
GetMarker
(
ihc
[
jt
],
hm
)
)
{
adj_type
const
&
jhc
=
mesh
->
HighConn
(
ihc
[
jt
]);
for
(
adj_type
::
size_type
kt
=
0
;
kt
<
jhc
.
size
();
kt
++
)
if
(
!
mesh
->
GetMarker
(
jhc
[
kt
],
hm
)
)
if
(
!
mesh
->
GetPrivateMarker
(
jhc
[
kt
],
mrk
)
)
{
result
.
push_back
(
i
hc
[
j
t
]);
mesh
->
SetPrivateMarker
(
i
hc
[
j
t
],
mrk
);
result
.
push_back
(
j
hc
[
k
t
]);
mesh
->
SetPrivateMarker
(
j
hc
[
k
t
],
mrk
);
}
}
}
ret
+=
static_cast
<
enumerator
>
(
result
.
size
());
}
else
ret
+=
static_cast
<
enumerator
>
(
result
.
size
());
if
(
!
result
.
empty
()
)
mesh
->
RemPrivateMarkerArray
(
&
result
[
0
],
result
.
size
(),
mrk
);
result
.
clear
();
mesh
->
ReleasePrivateMarker
(
mrk
);
}
else
if
(
i
==
myconn
-
3
)
{
MarkerType
mrk
=
mesh
->
CreatePrivateMarker
();
adj_type
const
&
lc
=
mesh
->
LowConn
(
GetHandle
());
for
(
adj_type
::
size_type
it
=
0
;
it
<
lc
.
size
();
it
++
)
if
(
!
mesh
->
GetMarker
(
lc
[
it
],
hm
)
)
{
adj_type
const
&
lc
=
mesh
->
LowConn
(
GetHandle
()
);
for
(
adj_type
::
size_type
i
t
=
0
;
i
t
<
lc
.
size
();
i
t
++
)
if
(
!
mesh
->
GetMarker
(
lc
[
i
t
],
hm
)
)
adj_type
const
&
i
lc
=
mesh
->
LowConn
(
lc
[
it
]
);
for
(
adj_type
::
size_type
j
t
=
0
;
j
t
<
i
lc
.
size
();
j
t
++
)
if
(
!
mesh
->
GetMarker
(
i
lc
[
j
t
],
hm
)
)
{
adj_type
const
&
i
lc
=
mesh
->
LowConn
(
lc
[
i
t
]);
for
(
adj_type
::
size_type
j
t
=
0
;
j
t
<
i
lc
.
size
();
j
t
++
)
if
(
!
mesh
->
GetMarker
(
i
lc
[
j
t
],
hm
)
)
if
(
!
mesh
->
GetPrivateMarker
(
i
lc
[
j
t
],
mrk
)
)
adj_type
const
&
j
lc
=
mesh
->
LowConn
(
i
lc
[
j
t
]);
for
(
adj_type
::
size_type
k
t
=
0
;
k
t
<
j
lc
.
size
();
k
t
++
)
if
(
!
mesh
->
GetMarker
(
j
lc
[
k
t
],
hm
)
)
if
(
!
mesh
->
GetPrivateMarker
(
j
lc
[
k
t
],
mrk
)
)
{
result
.
push_back
(
i
lc
[
j
t
]);
mesh
->
SetPrivateMarker
(
i
lc
[
j
t
],
mrk
);
result
.
push_back
(
j
lc
[
k
t
]);
mesh
->
SetPrivateMarker
(
j
lc
[
k
t
],
mrk
);
}
}
ret
+=
static_cast
<
enumerator
>
(
result
.
size
());
}
for
(
size_t
it
=
0
;
it
<
result
.
size
()
;
it
++
)
mesh
->
RemPrivateMarker
(
result
[
it
]
,
mrk
);
ret
+=
static_cast
<
enumerator
>
(
result
.
size
())
;
if
(
!
result
.
empty
()
)
mesh
->
RemPrivateMarkerArray
(
&
result
[
0
],
result
.
size
()
,
mrk
);
result
.
clear
();
mesh
->
ReleasePrivateMarker
(
mrk
);
}
...
...
@@ -214,13 +303,14 @@ namespace INMOST
Mesh
*
mesh
=
GetMeshLink
();
std
::
vector
<
HandleType
>
result
;
INMOST_DATA_INTEGER_TYPE
conn
[
4
]
=
{
0
,
0
,
0
,
0
};
INMOST_DATA_INTEGER_TYPE
myconn
=
-
1
,
i
;
INMOST_DATA_INTEGER_TYPE
myconn
=
-
1
,
i
=
0
;
enumerator
ret
=
0
;
for
(
ElementType
e
=
NODE
,
i
=
0
;
e
<=
CELL
;
i
++
,
e
=
e
<<
1
)
for
(
ElementType
e
=
NODE
;
e
<=
CELL
;
e
=
NextElementType
(
e
)
)
{
if
(
_etype
&
e
)
conn
[
i
]
=
1
;
if
(
GetElementType
()
&
e
)
myconn
=
i
;
i
++
;
}
if
(
isPrivate
(
mask
)
)
{
...
...
@@ -232,53 +322,103 @@ namespace INMOST
{
if
(
invert
^
GetPrivateMarker
(
mask
)
)
ret
+=
1
;
}
else
if
(
i
==
(
myconn
+
1
+
4
)
%
4
)
else
if
(
i
==
myconn
+
1
)
{
adj_type
const
&
hc
=
mesh
->
HighConn
(
GetHandle
());
for
(
adj_type
::
size_type
it
=
0
;
it
<
hc
.
size
();
++
it
)
if
(
invert
^
mesh
->
GetPrivateMarker
(
hc
[
it
],
mask
)
)
ret
++
;
}
else
if
(
i
==
(
myconn
-
1
+
4
)
%
4
)
else
if
(
i
==
myconn
-
1
)
{
adj_type
const
&
lc
=
mesh
->
LowConn
(
GetHandle
());
for
(
adj_type
::
size_type
it
=
0
;
it
<
lc
.
size
();
++
it
)
if
(
invert
^
mesh
->
GetPrivateMarker
(
lc
[
it
],
mask
)
)
ret
++
;
}
else
if
(
i
==
(
myconn
-
2
+
4
)
%
4
)
else
if
(
i
==
myconn
+
2
)
{
MarkerType
mrk
=
mesh
->
CreatePrivateMarker
();
adj_type
const
&
hc
=
mesh
->
HighConn
(
GetHandle
());
for
(
adj_type
::
size_type
it
=
0
;
it
<
hc
.
size
();
it
++
)
{
adj_type
const
&
ihc
=
mesh
->
HighConn
(
hc
[
it
]);
for
(
adj_type
::
size_type
jt
=
0
;
jt
<
ihc
.
size
();
jt
++
)
if
(
(
invert
^
mesh
->
GetPrivateMarker
(
ihc
[
jt
],
mask
))
&&
!
mesh
->
GetPrivateMarker
(
ihc
[
jt
],
mrk
)
)
{
result
.
push_back
(
ihc
[
jt
]);
mesh
->
SetPrivateMarker
(
ihc
[
jt
],
mrk
);
}
}
ret
+=
static_cast
<
enumerator
>
(
result
.
size
());
if
(
!
result
.
empty
()
)
mesh
->
RemPrivateMarkerArray
(
&
result
[
0
],
result
.
size
(),
mrk
);
result
.
clear
();
mesh
->
ReleasePrivateMarker
(
mrk
);
}
else
if
(
i
==
myconn
-
2
)
{
MarkerType
mrk
=
mesh
->
CreatePrivateMarker
();
adj_type
const
&
lc
=
mesh
->
LowConn
(
GetHandle
());
for
(
adj_type
::
size_type
it
=
0
;
it
<
lc
.
size
();
it
++
)
{
adj_type
const
&
ilc
=
mesh
->
LowConn
(
lc
[
it
]);
for
(
adj_type
::
size_type
jt
=
0
;
jt
<
ilc
.
size
();
jt
++
)
if
(
(
invert
^
mesh
->
GetPrivateMarker
(
ilc
[
jt
],
mask
))
&&
!
mesh
->
GetPrivateMarker
(
ilc
[
jt
],
mrk
)
)
{
result
.
push_back
(
ilc
[
jt
]);
mesh
->
SetPrivateMarker
(
ilc
[
jt
],
mrk
);
}
}
ret
+=
static_cast
<
enumerator
>
(
result
.
size
());
if
(
!
result
.
empty
()
)
mesh
->
RemPrivateMarkerArray
(
&
result
[
0
],
result
.
size
(),
mrk
);
result
.
clear
();
mesh
->
ReleasePrivateMarker
(
mrk
);
}
else
if
(
i
==
myconn
+
3
)
{
MarkerType
mrk
=
mesh
->
CreatePrivateMarker
();
if
(
(
GetElementType
()
&
NODE
)
||
(
GetElementType
()
&
EDGE
)
)
adj_type
const
&
hc
=
mesh
->
HighConn
(
GetHandle
());
for
(
adj_type
::
size_type
it
=
0