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
fd3c0eee
Commit
fd3c0eee
authored
Dec 27, 2014
by
Kirill Terekhov
Browse files
Fixes
Various fixes
parent
f3de6b96
Changes
12
Hide whitespace changes
Inline
Side-by-side
TODO.txt
View file @
fd3c0eee
...
...
@@ -99,6 +99,15 @@ mesh + !partitioner + !domain + solvers + +/-nonlinear solvers + autodiff + !sys
53) SortByGlobalID, globalid
54) ( unit tests)
55) mpi_send/mpi_recv -
56) Enumerate with mask should accept MarkerType select to select elements
57) GlobalID service class with different operation options to help pick new global ids when mesh is modified locally
options:
a) global id continuous among processors
b) global id may have gaps but local interval for each processor is bounded
c) global id is just a unique number
58) vtk- "VTK_WRITE_SETS_TO_FILES" = "YES"
7.MSPP: () : , ,
8.MSPP:
...
...
@@ -111,7 +120,7 @@ mesh + !partitioner + !domain + solvers + +/-nonlinear solvers + autodiff + !sys
13. INMOST / MMTK = Mathematical Modelling ToolKit / NSTK
last_created_element -
()
last_created_element -
...
...
@@ -152,6 +161,14 @@ last_created_element -
11) amls
12)
13) Matrix Row:
Row::MergeRows(linked_list_storage, row b
Matrix::MergeRow(alpha, row & a, real beta, row &b)
14) CSRMatrix, CSRRow
15) Matrix -> CSRMatrix
16) OrderInfo CSRMatrix
17)
solver:
read mc64
...
...
eset.cpp
View file @
fd3c0eee
...
...
@@ -163,7 +163,7 @@ namespace INMOST
{
assert
(
GetElementType
()
==
ESET
);
std
::
string
ret
;
bulk_array
arr
=
BulkArrayD
F
(
GetMeshLink
()
->
SetNameTag
());
bulk_array
arr
=
BulkArrayD
V
(
GetMeshLink
()
->
SetNameTag
());
ret
.
resize
(
arr
.
size
());
for
(
bulk_array
::
size_type
it
=
0
;
it
<
arr
.
size
();
++
it
)
ret
[
it
]
=
arr
[
it
];
...
...
geometry.cpp
View file @
fd3c0eee
...
...
@@ -414,13 +414,16 @@ namespace INMOST
if
(
types
==
ORIENTATION
)
{
if
(
mask
&
FACE
)
for
(
integer
e
=
0
;
e
<
FaceLastLocalID
();
++
e
)
if
(
isValidElement
(
FACE
,
e
)
)
Face
(
this
,
e
)
->
FixNormalOrientation
();
for
(
integer
e
=
0
;
e
<
FaceLastLocalID
();
++
e
)
{
if
(
isValidElement
(
FACE
,
e
)
)
Face
(
this
,
ComposeHandle
(
FACE
,
e
))
->
FixNormalOrientation
();
}
ShowGeometricData
(
ORIENTATION
,
FACE
);
}
if
(
types
==
MEASURE
)
{
for
(
integer
etype
=
EDGE
;
etype
<=
CELL
;
etype
=
etype
<<
1
)
for
(
ElementType
etype
=
EDGE
;
etype
<=
CELL
;
etype
=
NextElementType
(
etype
)
)
{
if
(
(
mask
&
etype
)
&&
!
HaveGeometricData
(
MEASURE
,
etype
))
{
...
...
@@ -436,7 +439,7 @@ namespace INMOST
}
if
(
types
==
CENTROID
)
{
for
(
ElementType
etype
=
EDGE
;
etype
<=
CELL
;
etype
=
etype
<<
1
)
for
(
ElementType
etype
=
EDGE
;
etype
<=
CELL
;
etype
=
NextElementType
(
etype
)
)
{
if
(
(
mask
&
etype
)
&&
!
HaveGeometricData
(
CENTROID
,
etype
))
{
...
...
@@ -452,7 +455,7 @@ namespace INMOST
}
if
(
types
==
BARYCENTER
)
{
for
(
ElementType
etype
=
EDGE
;
etype
<=
CELL
;
etype
=
etype
<<
1
)
for
(
ElementType
etype
=
EDGE
;
etype
<=
CELL
;
etype
=
NextElementType
(
etype
)
)
{
if
(
(
mask
&
etype
)
&&
!
HaveGeometricData
(
BARYCENTER
,
etype
))
{
...
...
@@ -468,7 +471,7 @@ namespace INMOST
}
if
(
types
==
NORMAL
)
{
for
(
ElementType
etype
=
FACE
;
etype
<=
CELL
;
etype
=
etype
<<
1
)
for
(
ElementType
etype
=
FACE
;
etype
<=
CELL
;
etype
=
NextElementType
(
etype
)
)
{
if
(
(
mask
&
etype
)
&&
!
HaveGeometricData
(
NORMAL
,
etype
))
{
...
...
@@ -693,15 +696,17 @@ namespace INMOST
else
{
ElementArray
<
Node
>
nodes
=
Element
(
this
,
e
)
->
getNodes
();
Storage
::
real
div
=
1.0
/
nodes
.
size
();
memset
(
ret
,
0
,
sizeof
(
real
)
*
mdim
);
assert
(
nodes
.
size
()
!=
0
);
for
(
ElementArray
<
Node
>::
size_type
i
=
0
;
i
<
nodes
.
size
();
i
++
)
if
(
nodes
.
size
()
!=
0
)
{
Storage
::
real_array
c
=
nodes
[
i
].
Coords
();
for
(
integer
j
=
0
;
j
<
mdim
;
j
++
)
ret
[
j
]
+=
c
[
j
];
Storage
::
real
div
=
1.0
/
nodes
.
size
();
for
(
ElementArray
<
Node
>::
size_type
i
=
0
;
i
<
nodes
.
size
();
i
++
)
{
Storage
::
real_array
c
=
nodes
[
i
].
Coords
();
for
(
integer
j
=
0
;
j
<
mdim
;
j
++
)
ret
[
j
]
+=
c
[
j
];
}
for
(
integer
j
=
0
;
j
<
mdim
;
j
++
)
ret
[
j
]
*=
div
;
}
for
(
integer
j
=
0
;
j
<
mdim
;
j
++
)
ret
[
j
]
*=
div
;
}
break
;
case
BARYCENTER
:
...
...
inmost_common.h
View file @
fd3c0eee
...
...
@@ -43,7 +43,7 @@
// output xml files for debugging of parallel algorithms
// search for style.xsl within examples for comfortable
// view of generated xml files
#define USE_PARALLEL_WRITE_TIME
//
#define USE_PARALLEL_WRITE_TIME
// this will revert Mesh::PrepareReceiveInner to always
// use MPI point to point functionality disregarding problem type
...
...
inmost_mesh.h
View file @
fd3c0eee
...
...
@@ -78,7 +78,6 @@ namespace INMOST
//Use topolgy checking for debug purposes
typedef
INMOST_DATA_ENUM_TYPE
TopologyCheck
;
static
const
TopologyCheck
NO_ERROR
=
0x00000000
;
static
const
TopologyCheck
THROW_EXCEPTION
=
0x00000001
;
//done//throw TopologyError exception on error
static
const
TopologyCheck
PRINT_NOTIFY
=
0x00000002
;
//done//print topology notify to std::cerr
static
const
TopologyCheck
DELETE_ON_ERROR
=
0x00000004
;
//done//element should be deleted if there is an error in EndTopologyCheck
...
...
@@ -175,7 +174,7 @@ namespace INMOST
__INLINE
void
SetPosition
(
INMOST_DATA_ENUM_TYPE
pos
,
ElementType
type
)
{
mem
->
pos
[
ElementNum
(
type
)]
=
pos
;}
__INLINE
INMOST_DATA_ENUM_TYPE
GetPosition
(
ElementType
type
)
const
{
assert
(
mem
!=
NULL
);
return
mem
->
pos
[
ElementNum
(
type
)];}
__INLINE
void
SetSparse
(
ElementType
type
)
{
mem
->
sparse
[
ElementNum
(
type
)]
=
true
;}
__INLINE
INMOST_DATA_ENUM_TYPE
GetPosition
Nu
m
(
INMOST_DATA_ENUM_TYPE
typenum
)
const
{
return
mem
->
pos
[
typenum
];}
__INLINE
INMOST_DATA_ENUM_TYPE
GetPosition
ByDi
m
(
INMOST_DATA_ENUM_TYPE
typenum
)
const
{
return
mem
->
pos
[
typenum
];}
public:
~
Tag
()
{
mem
=
NULL
;}
Tag
()
{
mem
=
NULL
;}
...
...
@@ -194,7 +193,8 @@ namespace INMOST
__INLINE
bool
isSparse
(
ElementType
type
)
const
{
assert
(
mem
!=
NULL
&&
OneType
(
type
));
return
mem
->
sparse
[
ElementNum
(
type
)];}
__INLINE
bool
isValid
()
const
{
return
mem
!=
NULL
;}
__INLINE
Mesh
*
GetMeshLink
()
const
{
assert
(
mem
!=
NULL
);
return
mem
->
m_link
;}
__INLINE
bool
isSparseNum
(
INMOST_DATA_ENUM_TYPE
typenum
)
const
{
assert
(
mem
!=
NULL
);
return
mem
->
sparse
[
typenum
];}
__INLINE
bool
isSparseByDim
(
INMOST_DATA_INTEGER_TYPE
typenum
)
const
{
assert
(
mem
!=
NULL
);
return
mem
->
sparse
[
typenum
];}
__INLINE
bool
isDefinedByDim
(
INMOST_DATA_INTEGER_TYPE
typenum
)
const
{
assert
(
mem
!=
NULL
);
return
GetPositionByDim
(
typenum
)
!=
ENUMUNDEF
;}
__INLINE
void
SetBulkDataType
(
INMOST_MPI_Type
type
)
{
assert
(
mem
!=
NULL
&&
mem
->
dtype
==
DATA_BULK
);
mem
->
bulk_data_type
=
type
;}
friend
class
TagManager
;
friend
class
Storage
;
...
...
@@ -552,9 +552,10 @@ namespace INMOST
__INLINE
HandleType
&
at
(
size_type
n
)
{
return
container
.
at
(
n
);
}
__INLINE
HandleType
at
(
size_type
n
)
const
{
return
container
.
at
(
n
);
}
__INLINE
void
swap
(
ElementArray
<
StorageType
>
&
other
)
{
Mesh
*
t
=
m_link
;
m_link
=
other
.
m_link
;
other
.
m_link
=
t
;
container
.
swap
(
other
.
container
);}
__INLINE
void
push_back
(
const
Storage
&
x
)
{
assert
(
x
.
GetMeshLink
()
==
m_link
);
container
.
push_back
(
x
.
GetHandle
());}
__INLINE
void
push_back
(
const
Storage
&
x
)
{
if
(
m_link
==
NULL
)
m_link
=
x
.
GetMeshLink
();
assert
(
x
.
GetMeshLink
()
==
m_link
);
container
.
push_back
(
x
.
GetHandle
());}
//__INLINE void push_back (const StorageType & x) {container.push_back(x.GetHandle());}
__INLINE
void
push_back
(
HandleType
x
)
{
assert
(
m_link
!=
NULL
);
container
.
push_back
(
x
);}
__INLINE
void
pop_back
()
{
container
.
pop_back
();}
__INLINE
void
resize
(
size_type
n
)
{
container
.
resize
(
n
);}
__INLINE
bool
empty
()
const
{
return
container
.
empty
();}
__INLINE
void
clear
()
{
container
.
clear
();}
...
...
@@ -990,7 +991,7 @@ namespace INMOST
void
PutElements
(
const
ElementSet
&
other
)
const
{
PutElements
(
other
->
getHandles
(),
other
->
nbHandles
());}
/// Put multiple handles without checking
template
<
typename
EType
>
void
PutElements
(
const
ElementArray
<
EType
>
&
elems
)
const
{
Pu
sh
Elements
(
elems
.
data
(),
static_cast
<
enumerator
>
(
elems
.
size
()));}
void
PutElements
(
const
ElementArray
<
EType
>
&
elems
)
const
{
Pu
t
Elements
(
elems
.
data
(),
static_cast
<
enumerator
>
(
elems
.
size
()));}
/// Put one element with checking of the existance of duplicate
/// preserves order for sorted set, thus may be expensive
void
AddElement
(
HandleType
e
)
const
;
...
...
@@ -1224,12 +1225,12 @@ namespace INMOST
__INLINE
sparse_type
&
MGetSparseLink
(
HandleType
h
)
{
return
MGetSparseLink
(
GetHandleElementNum
(
h
),
GetHandleID
(
h
));}
__INLINE
const
void
*
MGetSparseLink
(
HandleType
h
,
const
Tag
&
t
)
const
{
sparse_type
const
&
s
=
MGetSparseLink
(
GetHandleElementNum
(
h
),
GetHandleID
(
h
));
for
(
senum
i
=
0
;
i
<
s
.
size
();
++
i
)
if
(
s
[
i
].
tag
==
t
.
mem
)
return
s
[
i
].
rec
;
return
NULL
;}
__INLINE
void
*
&
MGetSparseLink
(
HandleType
h
,
const
Tag
&
t
)
{
sparse_type
&
s
=
MGetSparseLink
(
GetHandleElementNum
(
h
),
GetHandleID
(
h
));
for
(
senum
i
=
0
;
i
<
s
.
size
();
++
i
)
if
(
s
[
i
].
tag
==
t
.
mem
)
return
s
[
i
].
rec
;
s
.
push_back
(
mkrec
(
t
));
return
s
.
back
().
rec
;}
__INLINE
const
void
*
MGetDenseLink
(
integer
n
,
integer
id
,
const
Tag
&
t
)
const
{
return
&
(
GetDenseData
(
t
.
GetPosition
Nu
m
(
n
))[
links
[
n
][
id
]]);}
__INLINE
void
*
MGetDenseLink
(
integer
n
,
integer
id
,
const
Tag
&
t
)
{
return
&
(
GetDenseData
(
t
.
GetPosition
Nu
m
(
n
))[
links
[
n
][
id
]]);}
__INLINE
const
void
*
MGetDenseLink
(
integer
n
,
integer
id
,
const
Tag
&
t
)
const
{
return
&
(
GetDenseData
(
t
.
GetPosition
ByDi
m
(
n
))[
links
[
n
][
id
]]);}
__INLINE
void
*
MGetDenseLink
(
integer
n
,
integer
id
,
const
Tag
&
t
)
{
return
&
(
GetDenseData
(
t
.
GetPosition
ByDi
m
(
n
))[
links
[
n
][
id
]]);}
__INLINE
const
void
*
MGetDenseLink
(
HandleType
h
,
const
Tag
&
t
)
const
{
return
MGetDenseLink
(
GetHandleElementNum
(
h
),
GetHandleID
(
h
),
t
);}
__INLINE
void
*
MGetDenseLink
(
HandleType
h
,
const
Tag
&
t
)
{
return
MGetDenseLink
(
GetHandleElementNum
(
h
),
GetHandleID
(
h
),
t
);}
__INLINE
const
void
*
MGetLink
(
HandleType
h
,
const
Tag
&
t
)
const
{
if
(
!
t
.
isSparse
Nu
m
(
GetHandleElementNum
(
h
))
)
return
MGetDenseLink
(
h
,
t
);
else
return
MGetSparseLink
(
h
,
t
);}
__INLINE
void
*
MGetLink
(
HandleType
h
,
const
Tag
&
t
)
{
if
(
!
t
.
isSparse
Nu
m
(
GetHandleElementNum
(
h
))
)
return
MGetDenseLink
(
h
,
t
);
else
{
void
*
&
q
=
MGetSparseLink
(
h
,
t
);
if
(
q
==
NULL
)
q
=
calloc
(
1
,
t
.
GetRecordSize
());
return
q
;}}
__INLINE
const
void
*
MGetLink
(
HandleType
h
,
const
Tag
&
t
)
const
{
if
(
!
t
.
isSparse
ByDi
m
(
GetHandleElementNum
(
h
))
)
return
MGetDenseLink
(
h
,
t
);
else
return
MGetSparseLink
(
h
,
t
);}
__INLINE
void
*
MGetLink
(
HandleType
h
,
const
Tag
&
t
)
{
if
(
!
t
.
isSparse
ByDi
m
(
GetHandleElementNum
(
h
))
)
return
MGetDenseLink
(
h
,
t
);
else
{
void
*
&
q
=
MGetSparseLink
(
h
,
t
);
if
(
q
==
NULL
)
q
=
calloc
(
1
,
t
.
GetRecordSize
());
return
q
;}}
public:
Mesh
();
Mesh
(
const
Mesh
&
other
);
...
...
@@ -2602,6 +2603,13 @@ namespace INMOST
MarkerType
NewMarker
()
const
{
return
new_element
;}
void
SwapModification
();
// swap hidden and new elements, so that old mesh is recovered
void
BeginModification
();
//allow elements to be hidden
/// After this function any link to deleted element will be replaced by InvalidHandle()
/// TODO:
/// 1) maybe instead of forming set of deleted elements and subtracting set from other sets it is better
/// to remove each modified element
/// (done, check and compare)
/// 2) parent/child elements in set would not be replaced or reconnected, this may lead to wrong behavior
/// (done, check and compare)
void
ApplyModification
();
//modify DATA_REFERENCE tags so that links to hidden elements are converted to NULL and removed from sets
/// This function is not yet implemented. It should correctly resolve parallel state of
/// newly created elements, provide them valid global identificators, resolve owners of
...
...
iterator.cpp
View file @
fd3c0eee
...
...
@@ -180,13 +180,8 @@ namespace INMOST
if
(
lid
==
m
->
LastLocalID
(
etype
)
)
{
etype
=
GetNextType
(
etype
,
types
);
if
(
etype
)
lid
=
0
;
else
{
lid
=
-
1
;
break
;
}
lid
=
-
1
;
if
(
!
etype
)
break
;
}
else
break
;
}
...
...
@@ -243,7 +238,7 @@ namespace INMOST
Mesh
::
iteratorStorage
Mesh
::
Begin
(
ElementType
Types
)
{
return
base_iterator
<
Storage
>
(
Types
,
this
,
false
);}
Mesh
::
iteratorStorage
Mesh
::
End
()
{
return
base_iterator
<
Storage
>
(
this
);}
Mesh
::
iteratorElement
Mesh
::
BeginElement
(
ElementType
Types
)
{
return
base_iterator
<
Element
>
(
Types
&
(
NODE
|
EDGE
|
FACE
|
CELL
),
this
,
false
);}
Mesh
::
iteratorElement
Mesh
::
BeginElement
(
ElementType
Types
)
{
return
base_iterator
<
Element
>
(
Types
&
(
NODE
|
EDGE
|
FACE
|
CELL
|
ESET
),
this
,
false
);}
Mesh
::
iteratorElement
Mesh
::
EndElement
()
{
return
base_iterator
<
Element
>
(
this
);}
Mesh
::
iteratorSet
Mesh
::
BeginSet
()
{
return
base_iterator
<
ElementSet
>
(
ESET
,
this
,
false
);}
Mesh
::
iteratorSet
Mesh
::
EndSet
()
{
return
base_iterator
<
ElementSet
>
(
this
);}
...
...
mesh.cpp
View file @
fd3c0eee
...
...
@@ -1361,8 +1361,8 @@ namespace INMOST
if
(
e
->
GetName
()
==
name
)
return
std
::
make_pair
(
e
->
self
(),
false
);
}
HandleType
he
=
TieElement
(
4
);
bulk_array
set_name
=
BulkArrayD
F
(
he
,
SetNameTag
());
HandleType
he
=
ComposeHandle
(
4
,
TieElement
(
4
)
)
;
bulk_array
set_name
=
BulkArrayD
V
(
he
,
SetNameTag
());
set_name
.
resize
(
static_cast
<
bulk_array
::
size_type
>
(
name
.
size
()));
memcpy
(
set_name
.
data
(),
name
.
c_str
(),
name
.
size
());
HighConn
(
he
).
resize
(
ElementSet
::
high_conn_reserved
);
//Allocate initial space for parent/sibling/child/unsorted info
...
...
@@ -1469,12 +1469,15 @@ namespace INMOST
back_links
[
etypenum
][
old_addr
]
=
-
1
;
back_links
[
etypenum
][
new_addr
]
=
ID
;
links
[
etypenum
][
ID
]
=
new_addr
;
#if !defined(LAZY_SPARSE_ALLOCATION)
if
(
!
sparse_data
[
etypenum
].
empty
()
)
#endif
sparse_data
[
etypenum
][
new_addr
].
swap
(
sparse_data
[
etypenum
][
old_addr
]);
for
(
Mesh
::
iteratorTag
t
=
BeginTag
();
t
!=
EndTag
();
t
++
)
{
if
(
!
t
->
isSparse
Nu
m
(
etypenum
)
)
if
(
!
t
->
isSparse
ByDi
m
(
etypenum
)
)
{
INMOST_DATA_ENUM_TYPE
data_pos
=
t
->
GetPosition
Nu
m
(
etypenum
);
INMOST_DATA_ENUM_TYPE
data_pos
=
t
->
GetPosition
ByDi
m
(
etypenum
);
if
(
data_pos
==
ENUMUNDEF
)
continue
;
TagManager
::
dense_sub_type
&
arr
=
GetDenseData
(
data_pos
);
INMOST_DATA_ENUM_TYPE
record_size
=
t
->
GetRecordSize
();
...
...
@@ -1636,14 +1639,14 @@ namespace INMOST
{
Asserts
(
h
,
tag
,
expected
);
assert
(
tag
.
GetSize
()
==
ENUMUNDEF
);
//data is of variable size
assert
(
!
tag
.
isSparse
Nu
m
(
GetHandleElementNum
(
h
)));
//tag is not sparse
assert
(
!
tag
.
isSparse
ByDi
m
(
GetHandleElementNum
(
h
)));
//tag is not sparse
}
void
Mesh
::
AssertsDF
(
HandleType
h
,
const
Tag
&
tag
,
DataType
expected
)
const
{
Asserts
(
h
,
tag
,
expected
);
assert
(
tag
.
GetSize
()
!=
ENUMUNDEF
);
//data is of variable size
assert
(
!
tag
.
isSparse
Nu
m
(
GetHandleElementNum
(
h
)));
//tag is not sparse
assert
(
!
tag
.
isSparse
ByDi
m
(
GetHandleElementNum
(
h
)));
//tag is not sparse
}
void
Mesh
::
Asserts
(
HandleType
h
,
const
Tag
&
tag
,
DataType
expected
)
const
...
...
@@ -1653,7 +1656,7 @@ namespace INMOST
assert
(
tag
.
isValid
());
//tag was allocated
assert
(
this
==
tag
.
GetMeshLink
());
//tag is not mine
assert
(
tag
.
GetDataType
()
==
expected
);
//tag data type coinside with expected data type
assert
(
tag
.
isDefined
(
GetHandleElement
Type
(
h
)));
//tag data type coinside with expected data type
assert
(
tag
.
isDefined
ByDim
(
GetHandleElement
Num
(
h
)));
//tag data type coinside with expected data type
}
void
Mesh
::
ClearMarkerSpace
(
HandleType
h
)
...
...
@@ -1754,7 +1757,7 @@ namespace INMOST
void
Mesh
::
DelDenseData
(
HandleType
h
,
const
Tag
&
tag
)
{
assert
(
tag
.
GetMeshLink
()
==
this
);
assert
(
!
tag
.
isSparse
Nu
m
(
GetHandleElementNum
(
h
))
);
assert
(
!
tag
.
isSparse
ByDi
m
(
GetHandleElementNum
(
h
))
);
void
*
data
=
MGetLink
(
h
,
tag
);
if
(
data
!=
NULL
)
{
...
...
@@ -1769,7 +1772,7 @@ namespace INMOST
void
Mesh
::
DelSparseData
(
HandleType
h
,
const
Tag
&
tag
)
{
assert
(
tag
.
GetMeshLink
()
==
this
);
assert
(
tag
.
isSparse
Nu
m
(
GetHandleElementNum
(
h
))
);
assert
(
tag
.
isSparse
ByDi
m
(
GetHandleElementNum
(
h
))
);
sparse_type
&
s
=
MGetSparseLink
(
h
);
for
(
sparse_type
::
size_type
i
=
0
;
i
<
s
.
size
();
++
i
)
if
(
s
[
i
].
tag
==
tag
.
mem
)
{
...
...
@@ -1793,7 +1796,7 @@ namespace INMOST
bool
Mesh
::
HaveData
(
HandleType
h
,
const
Tag
&
tag
)
const
{
integer
n
=
GetHandleElementNum
(
h
);
if
(
tag
.
isSparse
Nu
m
(
n
))
if
(
tag
.
isSparse
ByDi
m
(
n
))
{
if
(
MGetSparseLink
(
h
,
tag
)
!=
NULL
)
return
true
;
...
...
@@ -1801,7 +1804,7 @@ namespace INMOST
}
else
{
if
(
tag
.
GetPosition
Nu
m
(
n
)
!=
ENUMUNDEF
)
if
(
tag
.
GetPosition
ByDi
m
(
n
)
!=
ENUMUNDEF
)
return
true
;
return
false
;
}
...
...
mesh_file.cpp
View file @
fd3c0eee
...
...
@@ -1510,7 +1510,7 @@ ecl_exit_loop:
{
e_nodes
.
at
(
0
)
=
newnodes
[
cp
[
k
]];
e_nodes
.
at
(
1
)
=
newnodes
[
cp
[
k
+
1
]];
//
eset->
Inser
t(CreateEdge(e_nodes).first);
eset
->
PutElemen
t
(
CreateEdge
(
e_nodes
).
first
);
RemMarker
(
newnodes
[
cp
[
k
]],
unused_marker
);
}
RemMarker
(
newnodes
[
cp
[
j
+
cp
[
j
]]],
unused_marker
);
...
...
@@ -1993,8 +1993,8 @@ ecl_exit_loop:
if
(
GetHandleElementType
(
newcells
[
i
])
&
ESET
)
{
ElementSet
set
=
ElementSet
(
this
,
newcells
[
i
]);
/*
for(ElementSet::iterator it = set->
b
egin(); it != set->
e
nd(); ++it)
for
(
ElementSet
::
iterator
it
=
set
->
B
egin
();
it
!=
set
->
E
nd
();
++
it
)
{
for
(
std
::
vector
<
Tag
>::
iterator
jt
=
datatags
.
begin
();
jt
!=
datatags
.
end
();
++
jt
)
{
...
...
@@ -2009,14 +2009,14 @@ ecl_exit_loop:
{
Storage
::
integer_array
arra
=
it
->
IntegerArray
(
*
jt
);
Storage
::
integer_array
arrb
=
set
->
IntegerArray
(
*
jt
);
for(
int
k = 0; k < jt->GetSize(); k++) arra[k] = arrb[k];
for
(
enumerator
k
=
0
;
k
<
jt
->
GetSize
();
k
++
)
arra
[
k
]
=
arrb
[
k
];
}
break
;
case
DATA_REAL
:
{
Storage
::
real_array
arra
=
it
->
RealArray
(
*
jt
);
Storage
::
real_array
arrb
=
set
->
RealArray
(
*
jt
);
for(
int
k = 0; k < jt->GetSize(); k++) arra[k] = arrb[k];
for
(
enumerator
k
=
0
;
k
<
jt
->
GetSize
();
k
++
)
arra
[
k
]
=
arrb
[
k
];
}
break
;
default:
...
...
@@ -2025,7 +2025,7 @@ ecl_exit_loop:
}
}
}
*/
Destroy
(
newcells
[
i
]);
}
}
...
...
@@ -4253,6 +4253,8 @@ safe_output:
REPORT_VAL
(
"tag_size"
,
header
[
6
]);
for
(
Mesh
::
iteratorTag
it
=
BeginTag
();
it
!=
EndTag
();
it
++
)
{
//don't forget to change header[6] if you skip more
//should match with content after MeshDataHeader
if
(
*
it
==
set_id
)
continue
;
if
(
*
it
==
HighConnTag
()
)
continue
;
if
(
*
it
==
LowConnTag
()
)
continue
;
...
...
@@ -4407,10 +4409,12 @@ safe_output:
for
(
Mesh
::
iteratorTag
jt
=
BeginTag
();
jt
!=
EndTag
();
jt
++
)
{
std
::
string
tagname
=
jt
->
GetTagName
();
//skipping should match with header[6] and content
// after TagsHeader
if
(
*
jt
==
set_id
)
continue
;
if
(
*
jt
==
HighConnTag
()
)
continue
;
if
(
*
jt
==
LowConnTag
()
)
continue
;
REPORT_VAL
(
"TagName"
,
jt
->
GetT
ag
N
ame
()
);
REPORT_VAL
(
"TagName"
,
t
ag
n
ame
);
for
(
ElementType
etype
=
NODE
;
etype
<=
MESH
;
etype
=
etype
<<
1
)
if
(
jt
->
isDefined
(
etype
)
)
{
...
...
modify.cpp
View file @
fd3c0eee
...
...
@@ -2006,6 +2006,7 @@ public:
}
}
//need to gather the set of deleted elements
/*//old approach
ElementSet erase = CreateSet("TEMPORARY_ERASE_SET").first;
for(ElementType etype = NODE; etype <= ESET; etype = etype << 1)
{
...
...
@@ -2017,9 +2018,25 @@ public:
//in case any algorithm further will use this fact (Subtract currently would not use this fact)
//but may use by retriving lower_bound/higher_bound O(log(n)) operations to narrow performed operations
erase->BulkDF(SetComparatorTag()) = ElementSet::HANDLE_COMPARATOR;
*/
for
(
Mesh
::
iteratorSet
it
=
BeginSet
();
it
!=
EndSet
();
it
++
)
it
->
Subtract
(
erase
);
Destroy
(
erase
);
{
if
(
it
->
HaveParent
()
&&
it
->
GetParent
()
->
Hidden
()
)
it
->
GetParent
()
->
RemChild
(
it
->
self
());
while
(
it
->
HaveChild
()
&&
it
->
GetChild
()
->
Hidden
()
)
it
->
RemChild
(
it
->
GetChild
());
while
(
it
->
HaveSibling
()
&&
it
->
GetSibling
()
->
Hidden
()
)
it
->
RemSibling
(
it
->
GetSibling
());
ElementSet
::
iterator
jt
=
it
->
Begin
();
while
(
jt
!=
it
->
End
()
)
{
if
(
jt
->
Hidden
()
)
jt
=
it
->
Erase
(
jt
);
else
++
jt
;
}
//it->Subtract(erase); //old approach
}
//Destroy(erase);//old approach
}
void
Mesh
::
ResolveModification
()
...
...
@@ -2056,6 +2073,14 @@ public:
ElementType
htype
=
GetHandleElementType
(
h
);
if
(
htype
&
(
NODE
|
EDGE
|
FACE
|
CELL
)
)
ElementByHandle
(
h
).
Disconnect
(
true
);
else
if
(
htype
&
ESET
)
{
ElementSet
eset
(
this
,
h
);
if
(
eset
->
HaveParent
()
)
eset
->
GetParent
()
->
RemChild
(
eset
);
while
(
eset
->
HaveChild
()
)
eset
->
RemChild
(
eset
->
GetChild
());
}
for
(
iteratorTag
t
=
BeginTag
();
t
!=
EndTag
();
++
t
)
if
(
t
->
isDefined
(
htype
)
)
DelData
(
h
,
*
t
);
UntieElement
(
GetHandleElementNum
(
h
),
GetHandleID
(
h
));
...
...
solver.cpp
View file @
fd3c0eee
...
...
@@ -1550,7 +1550,12 @@ namespace INMOST
sol
->
ReplaceMAT
(
*
mat
);
if
(
matrix_data
!=
NULL
)
delete
(
Solver
::
Matrix
*
)
matrix_data
;
matrix_data
=
(
void
*
)
mat
;
if
(
!
sol
->
isInitialized
())
{
sol
->
Initialize
();
}
ok
=
true
;
}
for
(
Matrix
::
iterator
it
=
A
.
Begin
();
it
!=
A
.
End
();
it
++
)
it
->
modified_pattern
=
false
;
if
(
!
ok
)
throw
NotImplemented
;
...
...
storage.cpp
View file @
fd3c0eee
...
...
@@ -9,10 +9,7 @@ namespace INMOST
{
handle
=
other
.
handle
;
if
(
handle_link
!=
NULL
)
{
assert
(
m_link
==
other
.
m_link
);
*
handle_link
=
handle
;
}
else
handle_link
=
other
.
handle_link
;
//if other have remote link this will copy this link and current will also be remote
m_link
=
other
.
m_link
;
return
*
this
;
...
...
tag.cpp
View file @
fd3c0eee
...
...
@@ -349,7 +349,7 @@ namespace INMOST
{
#if !defined(LAZY_SPARSE_ALLOCATION)
for
(
int
j
=
0
;
j
<
6
;
j
++
)
if
(
tags
[
i
].
isSparse
Nu
m
(
j
)
)
have_sparse
[
j
]
=
true
;
if
(
tags
[
i
].
isSparse
ByDi
m
(
j
)
)
have_sparse
[
j
]
=
true
;
#endif
if
(
tags
[
i
]
==
tag
)
{
...
...
@@ -399,9 +399,9 @@ namespace INMOST
#endif
for
(
iteratorTag
t
=
tags
.
begin
();
t
!=
tags
.
end
();
++
t
)
{
if
(
t
->
isDefined
(
1
<<
etypenum
)
)
if
(
t
->
isDefined
ByDim
(
etypenum
)
)
{
if
(
!
t
->
isSparse
(
1
<<
etypenum
)
)
if
(
!
t
->
isSparse
ByDim
(
etypenum
)
)
ReallocateData
(
*
t
,
etypenum
,
new_size
);
#if !defined(LAZY_SPARSE_ALLOCATION)
else
...
...
@@ -424,7 +424,7 @@ namespace INMOST
void
TagManager
::
ReallocateData
(
const
Tag
&
t
,
INMOST_DATA_INTEGER_TYPE
etypenum
,
INMOST_DATA_ENUM_TYPE
new_size
)
{
INMOST_DATA_ENUM_TYPE
data_pos
=
t
.
GetPosition
Nu
m
(
etypenum
);
INMOST_DATA_ENUM_TYPE
data_pos
=
t
.
GetPosition
ByDi
m
(
etypenum
);
INMOST_DATA_ENUM_TYPE
data_size
=
t
.
GetSize
();
TagManager
::
dense_sub_type
&
arr
=
GetDenseData
(
data_pos
);
INMOST_DATA_ENUM_TYPE
old_size
=
static_cast
<
INMOST_DATA_ENUM_TYPE
>
(
arr
.
size
());
...
...
Write
Preview
Markdown
is supported
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