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
87b73fc7
Commit
87b73fc7
authored
Mar 28, 2018
by
igor
Browse files
Fix some warnings for MS Windows compiler
parent
35a37cf4
Changes
25
Hide whitespace changes
Inline
Side-by-side
Source/Autodiff/autodiff.cpp
View file @
87b73fc7
...
...
@@ -96,7 +96,7 @@ namespace INMOST
else
{
BlockEntry
b
(
typemask
,
domain_mask
);
for
(
int
k
=
0
;
k
<
t
.
GetSize
();
++
k
)
for
(
INMOST_DATA_ENUM_TYPE
k
=
0
;
k
<
t
.
GetSize
();
++
k
)
b
.
AddTag
(
t
,
k
);
return
RegisterEntry
(
b
);
}
...
...
@@ -282,8 +282,9 @@ namespace INMOST
std
::
vector
<
INMOST_DATA_ENUM_TYPE
>
Automatizator
::
ListRegisteredEntries
()
const
{
std
::
vector
<
INMOST_DATA_ENUM_TYPE
>
ret
;
for
(
blk_enum
::
size_type
it
=
0
;
it
<
reg_blocks
.
size
();
++
it
)
if
(
isRegisteredEntry
(
it
)
)
ret
.
push_back
(
static_cast
<
INMOST_DATA_ENUM_TYPE
>
(
it
));
for
(
blk_enum
::
size_type
it
=
0
;
it
<
reg_blocks
.
size
();
++
it
)
if
(
isRegisteredEntry
(
static_cast
<
INMOST_DATA_ENUM_TYPE
>
(
it
))
)
ret
.
push_back
(
static_cast
<
INMOST_DATA_ENUM_TYPE
>
(
it
));
return
ret
;
}
...
...
@@ -320,7 +321,7 @@ namespace INMOST
INMOST_DATA_REAL_TYPE
MultiEntry
::
Value
(
const
Storage
&
e
,
INMOST_DATA_ENUM_TYPE
unk
)
const
{
unsigned
pos
=
0
,
k
=
0
;
unsigned
pos
=
0
;
for
(
unsigned
k
=
0
;
k
<
entries
.
size
();
++
k
)
if
(
entries
[
k
]
->
isValid
(
e
)
)
{
unsigned
s
=
entries
[
k
]
->
MatrixSize
(
e
);
...
...
@@ -333,7 +334,7 @@ namespace INMOST
INMOST_DATA_REAL_TYPE
&
MultiEntry
::
Value
(
const
Storage
&
e
,
INMOST_DATA_ENUM_TYPE
unk
)
{
unsigned
pos
=
0
,
k
=
0
;
unsigned
pos
=
0
;
for
(
unsigned
k
=
0
;
k
<
entries
.
size
();
++
k
)
if
(
entries
[
k
]
->
isValid
(
e
)
)
{
unsigned
s
=
entries
[
k
]
->
MatrixSize
(
e
);
...
...
@@ -346,7 +347,7 @@ namespace INMOST
INMOST_DATA_ENUM_TYPE
MultiEntry
::
Index
(
const
Storage
&
e
,
INMOST_DATA_ENUM_TYPE
unk
)
const
{
unsigned
pos
=
0
,
k
=
0
;
unsigned
pos
=
0
;
for
(
unsigned
k
=
0
;
k
<
entries
.
size
();
++
k
)
if
(
entries
[
k
]
->
isValid
(
e
)
)
{
unsigned
s
=
entries
[
k
]
->
MatrixSize
(
e
);
...
...
@@ -359,7 +360,7 @@ namespace INMOST
unknown
MultiEntry
::
Unknown
(
const
Storage
&
e
,
INMOST_DATA_ENUM_TYPE
unk
)
const
{
unsigned
pos
=
0
,
k
=
0
;
unsigned
pos
=
0
;
for
(
unsigned
k
=
0
;
k
<
entries
.
size
();
++
k
)
if
(
entries
[
k
]
->
isValid
(
e
)
)
{
unsigned
s
=
entries
[
k
]
->
MatrixSize
(
e
);
...
...
Source/Headers/inmost_autodiff.h
View file @
87b73fc7
...
...
@@ -121,11 +121,11 @@ namespace INMOST
/// Return vector filled with unknowns of the block with their derivatives.
uMatrix
operator
[](
const
Storage
&
e
)
const
{
uMatrix
ret
(
MatrixSize
(
e
),
1
);
for
(
unsigned
k
=
0
;
k
<
Size
();
++
k
)
ret
(
k
,
0
)
=
Unknown
(
e
,
k
);
return
ret
;
}
/// The intended size of the matrix for this entry.
INMOST_DATA_ENUM_TYPE
MatrixSize
(
const
Storage
&
e
)
const
{
return
Size
();}
INMOST_DATA_ENUM_TYPE
MatrixSize
(
const
Storage
&
e
)
const
{
(
void
)
e
;
return
Size
();}
/// Number of tags in block.
INMOST_DATA_ENUM_TYPE
Size
()
const
{
return
(
INMOST_DATA_ENUM_TYPE
)
unknown_tags
.
size
();}
/// Number of entries for each tag in the block.
INMOST_DATA_ENUM_TYPE
Size
(
const
Storage
&
e
)
const
{
return
(
INMOST_DATA_ENUM_TYPE
)
unknown_tags
.
size
();}
INMOST_DATA_ENUM_TYPE
Size
(
const
Storage
&
e
)
const
{
(
void
)
e
;
return
(
INMOST_DATA_ENUM_TYPE
)
unknown_tags
.
size
();}
/// Retrive component of the tag related to unknown.
INMOST_DATA_ENUM_TYPE
GetValueComp
(
INMOST_DATA_ENUM_TYPE
unk
)
const
{
return
unknown_comp
[
unk
];}
/// Retrive tag related to unknown value.
...
...
@@ -148,11 +148,11 @@ namespace INMOST
///Provide tag.
void
SetTag
(
Tag
unknown_tag_in
,
INMOST_DATA_ENUM_TYPE
unknown_comp_in
=
0
)
{
unknown_tag
=
unknown_tag_in
;
unknown_comp
=
unknown_comp_in
;}
/// Return value in vector of unknowns of the block at certain position.
INMOST_DATA_REAL_TYPE
Value
(
const
Storage
&
e
,
INMOST_DATA_ENUM_TYPE
pos
)
const
{
assert
(
pos
==
0
);
return
unknown_tag
[
e
][
unknown_comp
];}
INMOST_DATA_REAL_TYPE
Value
(
const
Storage
&
e
,
INMOST_DATA_ENUM_TYPE
pos
)
const
{
(
void
)
pos
;
assert
(
pos
==
0
);
return
unknown_tag
[
e
][
unknown_comp
];}
/// Return value in vector of unknowns of the block at certain position.
INMOST_DATA_REAL_TYPE
&
Value
(
const
Storage
&
e
,
INMOST_DATA_ENUM_TYPE
pos
)
{
assert
(
pos
==
0
);
return
unknown_tag
[
e
][
unknown_comp
];}
INMOST_DATA_REAL_TYPE
&
Value
(
const
Storage
&
e
,
INMOST_DATA_ENUM_TYPE
pos
)
{
(
void
)
pos
;
assert
(
pos
==
0
);
return
unknown_tag
[
e
][
unknown_comp
];}
/// Return index in vector of indices of the block at certain position.
INMOST_DATA_ENUM_TYPE
Index
(
const
Storage
&
e
,
INMOST_DATA_ENUM_TYPE
pos
)
const
{
assert
(
pos
==
0
);
return
isValid
(
e
)
?
GetOffsetTag
()[
e
]
:
ENUMUNDEF
;}
INMOST_DATA_ENUM_TYPE
Index
(
const
Storage
&
e
,
INMOST_DATA_ENUM_TYPE
pos
)
const
{
(
void
)
pos
;
assert
(
pos
==
0
);
return
isValid
(
e
)
?
GetOffsetTag
()[
e
]
:
ENUMUNDEF
;}
/// Return unknown in vector of variables of the block at certain position.
unknown
Unknown
(
const
Storage
&
e
,
INMOST_DATA_ENUM_TYPE
pos
)
const
{
assert
(
pos
==
0
);
return
unknown
(
Value
(
e
,
pos
),
Index
(
e
,
pos
));}
/// Return vector filled with values of unknowns of the block.
...
...
@@ -164,15 +164,15 @@ namespace INMOST
/// Return vector filled with unknowns of the block with their derivatives.
uMatrix
operator
[](
const
Storage
&
e
)
const
{
uMatrix
ret
(
1
,
1
);
ret
(
0
,
0
)
=
Unknown
(
e
,
0
);
return
ret
;
}
/// The intended size of the matrix for this entry.
INMOST_DATA_ENUM_TYPE
MatrixSize
(
const
Storage
&
e
)
const
{
return
1
;}
INMOST_DATA_ENUM_TYPE
MatrixSize
(
const
Storage
&
e
)
const
{
(
void
)
e
;
return
1
;}
/// Number of tags in block.
INMOST_DATA_ENUM_TYPE
Size
()
const
{
return
1
;}
/// Number of entries for each tag in the block.
INMOST_DATA_ENUM_TYPE
Size
(
const
Storage
&
e
)
const
{
return
1
;}
INMOST_DATA_ENUM_TYPE
Size
(
const
Storage
&
e
)
const
{
(
void
)
e
;
return
1
;}
/// Retrive component of the tag related to unknown.
INMOST_DATA_ENUM_TYPE
GetValueComp
(
INMOST_DATA_ENUM_TYPE
unk
)
const
{
assert
(
unk
==
0
);
return
unknown_comp
;}
INMOST_DATA_ENUM_TYPE
GetValueComp
(
INMOST_DATA_ENUM_TYPE
unk
)
const
{
(
void
)
unk
;
assert
(
unk
==
0
);
return
unknown_comp
;}
/// Retrive tag related to unknown value.
TagRealArray
GetValueTag
(
INMOST_DATA_ENUM_TYPE
unk
)
const
{
assert
(
unk
==
0
);
return
unknown_tag
;}
TagRealArray
GetValueTag
(
INMOST_DATA_ENUM_TYPE
unk
)
const
{
(
void
)
unk
;
assert
(
unk
==
0
);
return
unknown_tag
;}
/// Retrive mesh pointer.
Mesh
*
GetMeshLink
()
const
{
return
unknown_tag
.
GetMeshLink
();}
/// Make a copy of the object
...
...
@@ -212,9 +212,9 @@ namespace INMOST
/// Number of entries for each tag in the block.
INMOST_DATA_ENUM_TYPE
Size
(
const
Storage
&
e
)
const
{
return
(
INMOST_DATA_ENUM_TYPE
)
unknown_tag
[
e
].
size
();}
/// Retrive component of the tag related to unknown.
INMOST_DATA_ENUM_TYPE
GetValueComp
(
INMOST_DATA_ENUM_TYPE
unk
)
const
{
assert
(
unk
==
0
);
return
ENUMUNDEF
;}
INMOST_DATA_ENUM_TYPE
GetValueComp
(
INMOST_DATA_ENUM_TYPE
unk
)
const
{
(
void
)
unk
;
assert
(
unk
==
0
);
return
ENUMUNDEF
;}
/// Retrive tag related to unknown value.
TagRealArray
GetValueTag
(
INMOST_DATA_ENUM_TYPE
unk
)
const
{
assert
(
unk
==
0
);
return
unknown_tag
;}
TagRealArray
GetValueTag
(
INMOST_DATA_ENUM_TYPE
unk
)
const
{
(
void
)
unk
;
assert
(
unk
==
0
);
return
unknown_tag
;}
/// Retrive mesh pointer.
Mesh
*
GetMeshLink
()
const
{
return
unknown_tag
.
GetMeshLink
();}
/// Make a copy of the object
...
...
@@ -262,7 +262,7 @@ namespace INMOST
/// Return vector filled with unknowns of the block with their derivatives.
uMatrix
operator
[](
const
Storage
&
e
)
const
{
uMatrix
ret
(
MatrixSize
(
e
),
1
);
for
(
INMOST_DATA_ENUM_TYPE
k
=
0
;
k
<
Size
();
++
k
)
ret
(
k
,
0
)
=
Unknown
(
e
,
k
);
return
ret
;
}
/// The intended size of the matrix for this entry.
INMOST_DATA_ENUM_TYPE
MatrixSize
(
const
Storage
&
e
)
const
{
return
Size
();}
INMOST_DATA_ENUM_TYPE
MatrixSize
(
const
Storage
&
e
)
const
{
(
void
)
e
;
return
Size
();}
/// Number of tags in block.
INMOST_DATA_ENUM_TYPE
Size
()
const
{
return
(
INMOST_DATA_ENUM_TYPE
)
unknown_tags
.
size
();}
/// Number of entries for each tag in the block.
...
...
Source/Headers/inmost_block_variable.h
View file @
87b73fc7
...
...
@@ -112,15 +112,15 @@ namespace INMOST
private:
rMatrix
value
;
public:
const_block_variable
(
INMOST_DATA_REAL_TYPE
_value
)
:
value
(
_value
)
{}
const_block_variable
(
const
rMatrix
&
_value
)
:
value
(
_value
)
{}
const_block_variable
(
const
const_block_variable
&
other
)
:
value
(
other
.
value
)
{}
const_block_variable
&
operator
=
(
const
const_block_variable
&
other
)
{
value
=
other
.
value
;
return
*
this
;
}
rMatrix
Value
(
const
Storage
&
e
)
const
{
return
value
;}
vMatrix
Variable
(
const
Storage
&
e
)
const
{
return
value
;
}
rMatrix
Value
(
const
Storage
&
e
)
const
{
(
void
)
e
;
return
value
;}
vMatrix
Variable
(
const
Storage
&
e
)
const
{
(
void
)
e
;
return
value
;}
abstract_dynamic_block_variable
*
Copy
()
const
{
return
static_cast
<
abstract_dynamic_block_variable
*>
(
new
const_block_variable
(
*
this
));}
};
...
...
@@ -231,16 +231,16 @@ namespace INMOST
rMatrix
Value
(
const
Storage
&
e
)
const
{
rMatrix
ret
=
Arg
.
Value
(
e
);
for
(
int
k
=
0
;
k
<
ret
.
Rows
();
++
k
)
for
(
int
l
=
0
;
l
<
ret
.
Cols
();
++
l
)
for
(
INMOST_DATA_ENUM_TYPE
k
=
0
;
k
<
ret
.
Rows
();
++
k
)
for
(
INMOST_DATA_ENUM_TYPE
l
=
0
;
l
<
ret
.
Cols
();
++
l
)
ret
(
k
,
l
)
=
get_table
(
ret
(
k
,
l
),
Table
);
return
ret
;
}
vMatrix
Variable
(
const
Storage
&
e
)
const
{
vMatrix
ret
=
Arg
.
Variable
(
e
);
for
(
int
k
=
0
;
k
<
ret
.
Rows
();
++
k
)
for
(
int
l
=
0
;
l
<
ret
.
Cols
();
++
l
)
for
(
INMOST_DATA_ENUM_TYPE
k
=
0
;
k
<
ret
.
Rows
();
++
k
)
for
(
INMOST_DATA_ENUM_TYPE
l
=
0
;
l
<
ret
.
Cols
();
++
l
)
ret
(
k
,
l
)
=
get_table
(
ret
(
k
,
l
),
Table
);
return
ret
;
}
...
...
Source/Headers/inmost_dense.h
View file @
87b73fc7
...
...
@@ -1795,6 +1795,7 @@ namespace INMOST
{
assert
(
Cols
()
==
cols
);
assert
(
Rows
()
==
rows
);
(
void
)
cols
;
(
void
)
rows
;
}
};
...
...
@@ -2153,7 +2154,7 @@ namespace INMOST
Matrix
<
typename
Promote
<
Var
,
typeB
>::
type
>
AtB
=
At
*
B
;
//m by l matrix
Matrix
<
Var
>
AtA
=
At
*
(
*
this
);
//m by m matrix
enumerator
l
=
AtB
.
Cols
();
enumerator
n
=
Rows
();
//
enumerator n = Rows();
enumerator
m
=
Cols
();
enumerator
*
order
=
new
enumerator
[
m
];
std
::
pair
<
Matrix
<
typename
Promote
<
Var
,
typeB
>::
type
>
,
bool
>
...
...
@@ -2315,7 +2316,7 @@ namespace INMOST
ret
.
second
=
SVD
(
U
,
S
,
V
);
if
(
print_fail
&&
!
ret
.
second
)
std
::
cout
<<
"Failed to compute Moore-Penrose inverse of the matrix"
<<
std
::
endl
;
for
(
int
k
=
0
;
k
<
S
.
Cols
();
++
k
)
for
(
INMOST_DATA_ENUM_TYPE
k
=
0
;
k
<
S
.
Cols
();
++
k
)
{
if
(
S
(
k
,
k
)
>
tol
)
S
(
k
,
k
)
=
1.0
/
S
(
k
,
k
);
...
...
Source/Headers/inmost_expression.h
View file @
87b73fc7
...
...
@@ -172,6 +172,7 @@ namespace INMOST
if
(
!
J
.
isSorted
()
)
std
::
sort
(
J
.
Begin
(),
J
.
End
());
for
(
Sparse
::
Row
::
iterator
it
=
J
.
Begin
();
it
!=
J
.
End
();
++
it
)
it
->
second
*=
multJ
;
H
.
Clear
();
(
void
)
multH
;
}
__INLINE
multivar_expression
&
operator
=
(
INMOST_DATA_REAL_TYPE
pvalue
)
{
...
...
@@ -631,6 +632,7 @@ namespace INMOST
for
(
Sparse
::
Row
::
iterator
it
=
J
.
Begin
();
it
!=
J
.
End
();
++
it
)
it
->
second
*=
multJ
;
H
.
Clear
();
}
(
void
)
multH
;
}
__INLINE
multivar_expression_reference
&
operator
=
(
INMOST_DATA_REAL_TYPE
pvalue
)
{
...
...
@@ -1848,6 +1850,7 @@ namespace INMOST
left
.
GetHessian
(
1
,
JL
,
1
,
HL
);
//retrive jacobian row and hessian matrix of the left expression
Sparse
::
HessianRow
::
MergeJacobianHessian
(
multH
*
ldmult2
,
JL
,
JL
,
multH
*
ldmult
,
HL
,
H
);
for
(
Sparse
::
Row
::
iterator
it
=
JL
.
Begin
();
it
!=
JL
.
End
();
++
it
)
it
->
second
*=
ldmult
*
multJ
;
(
void
)
J
;
}
};
...
...
Source/Headers/inmost_model.h
View file @
87b73fc7
...
...
@@ -38,7 +38,7 @@ namespace INMOST
/// Roll back to previous step.
virtual
bool
RestoreTimeStep
()
=
0
;
/// Calculate multiplier for update for this model. Can simply return 1.
virtual
double
UpdateMultiplier
(
const
Sparse
::
Vector
&
sol
)
const
{
return
1
;}
virtual
double
UpdateMultiplier
(
const
Sparse
::
Vector
&
sol
)
const
{
(
void
)
sol
;
return
1
;}
/// Calculate time step for this model. Can simply return dt.
virtual
double
AdjustTimeStep
(
double
dt
)
const
{
return
dt
;}
};
...
...
Source/Headers/inmost_sparse.h
View file @
87b73fc7
...
...
@@ -4,8 +4,6 @@
#include "inmost_common.h"
namespace
INMOST
{
namespace
Sparse
...
...
Source/Headers/inmost_variable.h
View file @
87b73fc7
...
...
@@ -273,12 +273,13 @@ namespace INMOST
value
=
other
.
value
;
return
*
this
;
}
INMOST_DATA_REAL_TYPE
Value
(
const
Storage
&
e
)
const
{
return
value
;}
INMOST_DATA_REAL_TYPE
Value
(
const
Storage
&
e
)
const
{
(
void
)
e
;
return
value
;}
multivar_expression
Variable
(
const
Storage
&
e
)
const
{
return
multivar_expression
(
value
);
(
void
)
e
;
return
multivar_expression
(
value
);
}
const_expression
operator
[](
const
Storage
&
e
)
const
{
return
const_expression
(
value
);}
const_expression
operator
[](
const
Storage
&
e
)
const
{
(
void
)
e
;
return
const_expression
(
value
);}
void
GetVariation
(
const
Storage
&
e
,
Sparse
::
Row
&
r
)
const
{
(
*
this
)[
e
].
GetJacobian
(
1.0
,
r
);
}
void
GetVariation
(
const
Storage
&
e
,
Sparse
::
RowMerger
&
r
)
const
{
(
*
this
)[
e
].
GetJacobian
(
1.0
,
r
);
}
abstract_dynamic_variable
*
Copy
()
const
{
return
static_cast
<
abstract_dynamic_variable
*>
(
new
const_variable
(
*
this
));}
...
...
@@ -296,12 +297,13 @@ namespace INMOST
value
=
other
.
value
;
return
*
this
;
}
INMOST_DATA_REAL_TYPE
Value
(
const
Storage
&
e
)
const
{
return
*
value
;}
INMOST_DATA_REAL_TYPE
Value
(
const
Storage
&
e
)
const
{
(
void
)
e
;
return
*
value
;}
multivar_expression
Variable
(
const
Storage
&
e
)
const
{
return
multivar_expression
(
*
value
);
(
void
)
e
;
return
multivar_expression
(
*
value
);
}
const_expression
operator
[](
const
Storage
&
e
)
const
{
return
const_expression
(
*
value
);}
const_expression
operator
[](
const
Storage
&
e
)
const
{
(
void
)
e
;
return
const_expression
(
*
value
);}
void
GetVariation
(
const
Storage
&
e
,
Sparse
::
Row
&
r
)
const
{
(
*
this
)[
e
].
GetJacobian
(
1.0
,
r
);
}
void
GetVariation
(
const
Storage
&
e
,
Sparse
::
RowMerger
&
r
)
const
{
(
*
this
)[
e
].
GetJacobian
(
1.0
,
r
);
}
abstract_dynamic_variable
*
Copy
()
const
{
return
static_cast
<
abstract_dynamic_variable
*>
(
new
const_link_variable
(
*
this
));}
...
...
Source/IO/mesh_ecl_file.cpp
View file @
87b73fc7
#ifdef _MSC_VER //kill some warnings
#ifndef _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_WARNINGS
#endif
#ifndef _SCL_SECURE_NO_WARNINGS
#define _SCL_SECURE_NO_WARNINGS
#endif
#endif
#include "inmost.h"
#include "../Mesh/incident_matrix.hpp"
...
...
Source/Mesh/geometry.cpp
View file @
87b73fc7
...
...
@@ -1419,7 +1419,7 @@ namespace INMOST
}
while
(
true
);
data
.
RemPrivateMarker
(
mrk
);
mesh
->
ReleasePrivateMarker
(
mrk
);
Storage
::
real
nrm
[
3
],
cnt
[
3
]
,
ccnt
[
3
]
;
Storage
::
real
nrm
[
3
],
cnt
[
3
];
for
(
unsigned
j
=
0
;
j
<
data
.
size
();
j
++
)
{
//std::cout << (data[j].GetPrivateMarker(rev) ? 0:1);
...
...
Source/Mesh/modify.cpp
View file @
87b73fc7
...
...
@@ -1609,7 +1609,7 @@ namespace INMOST
void
OperationMinDistance
(
const
Tag
&
tag
,
const
Element
&
element
,
const
INMOST_DATA_BULK_TYPE
*
data
,
INMOST_DATA_ENUM_TYPE
size
)
{
int
owner
=
*
((
double
*
)
data
);
int
owner
=
(
int
)
*
((
double
*
)
data
);
double
dist
=
*
((
double
*
)(
data
+
sizeof
(
double
)));
TagReal
r_tag
=
tag
;
...
...
@@ -1619,11 +1619,12 @@ namespace INMOST
element
->
RealArray
(
tag
)[
0
]
=
owner
;
element
->
RealArray
(
tag
)[
1
]
=
dist
;
}
(
void
)
size
;
}
void
Mesh
::
ResolveModification
()
{
int
rank
=
GetProcessorRank
()
,
mpisize
=
GetProcessorsNumber
()
;
int
rank
=
GetProcessorRank
();
Tag
tag
=
CreateTag
(
"TEMP_DISTANSE"
,
DATA_REAL
,
CELL
,
CELL
,
2
);
...
...
@@ -1642,7 +1643,7 @@ namespace INMOST
}
}
int
owner1
=
it
->
IntegerDF
(
tag_owner
);
//
int owner1 = it->IntegerDF(tag_owner);
int
owner2
=
near_cell
.
IntegerDF
(
tag_owner
);
it
->
RealArray
(
tag
)[
0
]
=
owner2
;
...
...
@@ -1654,7 +1655,7 @@ namespace INMOST
for
(
Mesh
::
iteratorCell
it
=
BeginCell
();
it
!=
EndCell
();
it
++
)
if
(
GetMarker
(
*
it
,
NewMarker
()))
{
int
new_owner
=
it
->
RealArray
(
tag
)[
0
];
int
new_owner
=
(
int
)
it
->
RealArray
(
tag
)[
0
];
it
->
IntegerDF
(
tag_owner
)
=
new_owner
;
...
...
Source/Mesh/parallel.cpp
View file @
87b73fc7
#ifdef _MSC_VER //kill some warnings
#ifndef _SCL_SECURE_NO_WARNINGS
#define _SCL_SECURE_NO_WARNINGS
#endif
#endif
#include "inmost.h"
...
...
@@ -40,7 +42,9 @@ namespace INMOST
std
::
string
ro
()
{
int
rank
=
0
;
#ifdef USE_MPI
MPI_Comm_rank
(
MPI_COMM_WORLD
,
&
rank
);
#endif
std
::
stringstream
ss
;
for
(
int
i
=
0
;
i
<
rank
;
i
++
)
ss
<<
" "
;
...
...
@@ -1618,6 +1622,7 @@ namespace INMOST
#else //USE_MPI
AssignGlobalID
(
CELL
|
FACE
|
EDGE
|
NODE
);
(
void
)
only_new
;
#endif //USE_MPI
EXIT_FUNC
();
}
...
...
@@ -2284,7 +2289,6 @@ namespace INMOST
void
Mesh
::
PackTagData
(
const
Tag
&
tag
,
const
elements_by_type
&
elements
,
int
destination
,
ElementType
mask
,
MarkerType
select
,
buffer_type
&
buffer
)
{
int
rank
=
GetProcessorRank
();
if
(
tag
.
GetDataType
()
==
DATA_REMOTE_REFERENCE
)
return
;
//NOT IMPLEMENTED TODO 14
ENTER_FUNC
();
#if defined(USE_MPI)
...
...
@@ -2397,6 +2401,7 @@ namespace INMOST
#else
(
void
)
tag
;
(
void
)
elements
;
(
void
)
destination
;
(
void
)
mask
;
(
void
)
select
;
(
void
)
buffer
;
...
...
@@ -2409,7 +2414,6 @@ namespace INMOST
bool
Mesh
::
FindSharedGhost
(
int
global_id
,
INMOST_DATA_INTEGER_TYPE
el_type_num
,
HandleType
&
res
)
{
int
rank
=
GetProcessorRank
();
int
dim
=
el_type_num
;
for
(
parallel_storage
::
iterator
it
=
shared_elements
.
begin
();
it
!=
shared_elements
.
end
();
it
++
)
{
...
...
@@ -2439,8 +2443,7 @@ namespace INMOST
void
Mesh
::
UnpackTagData
(
const
Tag
&
tag
,
const
elements_by_type
&
elements
,
ElementType
mask
,
MarkerType
select
,
buffer_type
&
buffer
,
int
&
position
,
ReduceOperation
op
)
{
int
rank
=
GetProcessorRank
();
(
void
)
mask
;
(
void
)
mask
;
if
(
tag
.
GetDataType
()
==
DATA_REMOTE_REFERENCE
)
return
;
//NOT IMPLEMENTED TODO 14
ENTER_FUNC
();
REPORT_VAL
(
"TagName"
,
tag
.
GetTagName
());
...
...
@@ -2980,13 +2983,13 @@ namespace INMOST
void
Mesh
::
PackElementsData
(
element_set
&
all
,
buffer_type
&
buffer
,
int
destination
,
const
std
::
vector
<
std
::
string
>
&
tag_list
)
{
int
rank
=
GetProcessorRank
();
//std::cout << ro() << rank << " In pack elements data " << all.size() << std::endl;
//std::cout << rank << " In pack elements Data" << std::endl;
ENTER_FUNC
();
REPORT_VAL
(
"dest"
,
destination
);
#if defined(USE_MPI)
INMOST_DATA_ENUM_TYPE
num
;
int
rank
=
GetProcessorRank
();
//std::cout << ro() << rank << " In pack elements data " << all.size() << std::endl;
//std::cout << rank << " In pack elements Data" << std::endl;
INMOST_DATA_ENUM_TYPE
num
;
//assume hex mesh for forward allocation
//8 nodes per cell, 2 nodes per edge, 4 edges per face, 6 faces per cell
const
INMOST_DATA_ENUM_TYPE
size_hint
[
5
]
=
{
8
,
2
,
4
,
6
,
1
};
...
...
@@ -3102,7 +3105,7 @@ namespace INMOST
}
stringstream
ss
;
ss
<<
ro
()
<<
rank
<<
": to send: "
;
ss
<<
ro
()
<<
mpi
rank
<<
": to send: "
;
ss
<<
"nodes: "
<<
selems
[
0
].
size
()
<<
" | "
;
ss
<<
"edge: "
<<
selems
[
1
].
size
()
<<
" | "
;
ss
<<
"faces: "
<<
selems
[
2
].
size
()
<<
" | "
;
...
...
@@ -3414,7 +3417,7 @@ namespace INMOST
// Compute names_buff_size
for
(
element_set
::
iterator
it
=
selems
[
4
].
begin
();
it
!=
selems
[
4
].
end
();
it
++
)
names_buff_size
+=
ElementSet
(
this
,
*
it
).
GetName
().
size
()
+
1
;
//cout << ro() << rank << ": Names buff size = " << names_buff_size << endl;
//cout << ro() <<
mpi
rank << ": Names buff size = " << names_buff_size << endl;
char
*
names_buff
;
if
(
names_buff_size
>
0
)
names_buff
=
new
char
[
names_buff_size
];
int
names_buff_pos
=
0
;
...
...
@@ -3429,7 +3432,7 @@ namespace INMOST
// Add all low conns to low_conn_nums
stringstream
ss
;
ss
<<
ro
()
<<
rank
<<
": For set "
<<
ElementSet
(
this
,
*
it
).
GetName
()
<<
" low conns ("
;
ss
<<
ro
()
<<
mpi
rank
<<
": For set "
<<
ElementSet
(
this
,
*
it
).
GetName
()
<<
" low conns ("
;
low_conn_size
[
k
]
=
0
;
Element
::
adj_type
const
&
lc
=
LowConn
(
*
it
);
for
(
Element
::
adj_type
::
const_iterator
jt
=
lc
.
begin
();
jt
!=
lc
.
end
();
jt
++
)
if
(
!
Hidden
(
*
jt
)
)
...
...
@@ -3451,7 +3454,7 @@ namespace INMOST
if
(
set
.
HaveParent
())
high_conn_nums
[
k
*
3
+
2
]
=
Integer
(
selems
[
4
][
Integer
(
set
.
GetParent
().
GetHandle
(),
arr_position
)],
arr_position
);
else
high_conn_nums
[
k
*
3
+
2
]
=
-
1
;
stringstream
ss5
;
ss5
<<
ro
()
<<
rank
<<
": high_conn_nums for set "
<<
set
.
GetName
()
<<
": "
;
ss5
<<
ro
()
<<
mpi
rank
<<
": high_conn_nums for set "
<<
set
.
GetName
()
<<
": "
;
ss5
<<
high_conn_nums
[
k
*
3
+
0
]
<<
" "
<<
high_conn_nums
[
k
*
3
+
1
]
<<
" "
<<
high_conn_nums
[
k
*
3
+
2
]
<<
endl
;
cout
<<
ss5
.
str
();
...
...
@@ -3459,7 +3462,7 @@ namespace INMOST
}
stringstream
s1
;
s1
<<
ro
()
<<
rank
<<
": Packed names: "
;
s1
<<
ro
()
<<
mpi
rank
<<
": Packed names: "
;
for
(
int
i
=
0
;
i
<
names_buff_size
;
i
++
)
if
(
names_buff
[
i
]
==
'\0'
)
s1
<<
"|"
;
...
...
@@ -3467,7 +3470,7 @@ namespace INMOST
s1
<<
names_buff
[
i
];
stringstream
ss
;
ss
<<
ro
()
<<
rank
<<
": packed low_conns_size array: "
;
ss
<<
ro
()
<<
mpi
rank
<<
": packed low_conns_size array: "
;
for
(
int
i
=
0
;
i
<
num
;
i
++
)
ss
<<
low_conn_size
[
i
]
<<
" "
;
MPI_Pack_size
(
1
,
INMOST_MPI_DATA_ENUM_TYPE
,
comm
,
&
temp
);
new_size
+=
temp
;
// count of sets
...
...
@@ -3555,7 +3558,7 @@ namespace INMOST
//PackTagData(GetTag(tag_list[i]),pack_tags,NODE | EDGE | FACE | CELL | ESET,0,buffer);
PackTagData
(
tag
,
selems
,
destination
,
NODE
|
EDGE
|
FACE
|
CELL
|
ESET
,
pack_tags_mrk
,
buffer
);
//PackTagData(tag,selems,NODE | EDGE | FACE | CELL | ESET,0,buffer);
//std::cout << rank << " After pack_tag_data\n" << std::endl;
//std::cout <<
mpi
rank << " After pack_tag_data\n" << std::endl;
}
}
...
...
@@ -4269,10 +4272,10 @@ namespace INMOST
void
Mesh
::
PrepareReceiveInner
(
Prepare
todo
,
exch_buffer_type
&
send_bufs
,
exch_buffer_type
&
recv_bufs
)
{
int
mpirank
=
GetProcessorRank
(),
mpisize
=
GetProcessorsNumber
();
if
(
parallel_strategy
==
0
&&
todo
==
UnknownSize
)
return
;
//in this case we know all we need
ENTER_FUNC
();
#if defined(USE_MPI)
int
mpirank
=
GetProcessorRank
();
#if defined(USE_MPI_P2P) && defined(PREFFER_MPI_P2P)
unsigned
i
,
end
=
send_bufs
.
size
();
REPORT_MPI
(
MPI_Win_fence
(
MPI_MODE_NOPRECEDE
,
window
));
//start exchange session
...
...
@@ -4488,11 +4491,10 @@ namespace INMOST
void
Mesh
::
ExchangeMarked
(
enum
Action
action
)
{
int
rank
=
GetProcessorRank
();
ENTER_FUNC
();
if
(
m_state
==
Serial
)
return
;
#if defined(USE_MPI)
INMOST_DATA_BIG_ENUM_TYPE
num_wait
;
INMOST_DATA_BIG_ENUM_TYPE
num_wait
;
int
mpirank
=
GetProcessorRank
();
std
::
vector
<
MPI_Request
>
send_reqs
,
recv_reqs
;
std
::
vector
<
std
::
string
>
tag_list
,
tag_list_recv
;
...
...
@@ -5351,6 +5353,7 @@ namespace INMOST
for
(
Storage
::
enumerator
k
=
0
;
k
<
local_nrm
.
size
();
++
k
)
dot
+=
local_nrm
[
k
]
*
remote_nrm
[
k
];
local_nrm
[
0
]
=
dot
;
(
void
)
size
;
}
void
Mesh
::
MarkNormalOrientation
(
MarkerType
mrk
)
...
...
@@ -5396,6 +5399,7 @@ namespace INMOST
void
Mesh
::
ResolveSets
()
{
#ifdef USE_MPI
int
mpirank
=
GetProcessorRank
();
int
mpisize
=
GetProcessorsNumber
();
...
...
@@ -5547,6 +5551,8 @@ namespace INMOST
cout << endl;
}
*/
#endif
}
}
...
...
Source/Misc/base64.cpp
View file @
87b73fc7
...
...
@@ -60,7 +60,7 @@ namespace INMOST
std
::
vector
<
BYTE
>
base64_decode
(
std
::
string
const
&
encoded_string
)
{
int
in_len
=
encoded_string
.
size
();
int
in_len
=
static_cast
<
int
>
(
encoded_string
.
size
()
)
;
int
i
=
0
;
int
j
=
0
;
int
in_
=
0
;
...
...
@@ -73,7 +73,7 @@ namespace INMOST
if
(
i
==
4
)
{
for
(
i
=
0
;
i
<
4
;
i
++
)
char_array_4
[
i
]
=
base64_chars
.
find
(
char_array_4
[
i
]);
char_array_4
[
i
]
=
(
BYTE
)
base64_chars
.
find
(
char_array_4
[
i
]);
char_array_3
[
0
]
=
(
char_array_4
[
0
]
<<
2
)
+
((
char_array_4
[
1
]
&
0x30
)
>>
4
);
char_array_3
[
1
]
=
((
char_array_4
[
1
]
&
0xf
)
<<
4
)
+
((
char_array_4
[
2
]
&
0x3c
)
>>
2
);
...
...
@@ -91,7 +91,7 @@ namespace INMOST
char_array_4
[
j
]
=
0
;
for
(
j
=
0
;
j
<
4
;
j
++
)
char_array_4
[
j
]
=
base64_chars
.
find
(
char_array_4
[
j
]);
char_array_4
[
j
]
=
(
BYTE
)
base64_chars
.
find
(
char_array_4
[
j
]);
char_array_3
[
0
]
=
(
char_array_4
[
0
]
<<
2
)
+
((
char_array_4
[
1
]
&
0x30
)
>>
4
);
char_array_3
[
1
]
=
((
char_array_4
[
1
]
&
0xf
)
<<
4
)
+
((
char_array_4
[
2
]
&
0x3c
)
>>
2
);
...
...
@@ -103,4 +103,4 @@ namespace INMOST
return
ret
;
}
}
\ No newline at end of file
}
Source/NonlinearSolver/nonlinear.cpp
View file @
87b73fc7
#include "inmost_nonlinear.h"
#if defined(_WIN32) || defined(_WIN64) || defined(WIN32) || defined(WIN64)
__declspec
(
dllexport
)
void
nonlinear_stub
(){}
//to avoid LNK4221 warning
#endif
Source/Partitioner/partitioner.cpp
View file @
87b73fc7
#include "inmost.h"
#if defined(_WIN32) || defined(_WIN64) || defined(WIN32) || defined(WIN64)
__declspec
(
dllexport
)
void
partitioner_stub
(){}
//to avoid LNK4221 warning
#endif
#if defined(USE_PARTITIONER)
...
...
Source/Solver/solver_ani/solver_ani.cpp
View file @
87b73fc7
#include "solver_ani.h"
#if defined(_WIN32) || defined(_WIN64) || defined(WIN32) || defined(WIN64)
__declspec
(
dllexport
)
void
solver_ani_stub
(){}
//to avoid LNK4221 warning
#endif
#if defined(USE_SOLVER_ANI)
#include <stdio.h>
...
...
@@ -7,7 +11,6 @@
#include <memory.h>
#include <math.h>
#if defined (__APPLE__) || defined(MAXOSX) || defined(__linux__)
#define ILUOO iluoo_
#define DDOT ddot_
...
...
Source/Solver/solver_inner/solver_ddpqiluc2/SolverDDPQILUC2.cpp
View file @
87b73fc7
...
...
@@ -46,6 +46,9 @@ namespace INMOST {
if
(
!
solver
->
isInitialized
())
{
solver
->
Initialize
();
}