Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
INMOST
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Terekhov
INMOST
Commits
1e58380d
Commit
1e58380d
authored
Jun 01, 2018
by
Kirill Terekhov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix compilation with USE_AUTODIFF=OFF
Thanks to Matvey Kraposhin
parent
f518784d
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
31 additions
and
7 deletions
+31
-7
Examples/OldDrawGrid/main.cpp
Examples/OldDrawGrid/main.cpp
+14
-1
Source/Autodiff/model.cpp
Source/Autodiff/model.cpp
+2
-1
Source/Headers/inmost_expression.h
Source/Headers/inmost_expression.h
+3
-0
Source/Headers/inmost_nonlinear.h
Source/Headers/inmost_nonlinear.h
+5
-4
Source/Headers/inmost_operator.h
Source/Headers/inmost_operator.h
+1
-1
Source/Mesh/parallel.cpp
Source/Mesh/parallel.cpp
+6
-0
No files found.
Examples/OldDrawGrid/main.cpp
View file @
1e58380d
...
...
@@ -1693,10 +1693,19 @@ void draw_screen()
{
if
(
source_tag
.
isDefined
(
visualization_type
))
{
if
(
source_tag
.
GetDataType
()
==
DATA_REAL
||
source_tag
.
GetDataType
()
==
DATA_INTEGER
||
source_tag
.
GetDataType
()
==
DATA_BULK
||
source_tag
.
GetDataType
()
==
DATA_VARIABLE
)
if
(
source_tag
.
GetDataType
()
==
DATA_REAL
||
source_tag
.
GetDataType
()
==
DATA_INTEGER
||
source_tag
.
GetDataType
()
==
DATA_BULK
#if defined(USE_AUTODIFF)
||
source_tag
.
GetDataType
()
==
DATA_VARIABLE
#endif
)
{
#if defined(USE_AUTODIFF)
if
(
source_tag
.
GetDataType
()
==
DATA_VARIABLE
)
printf
(
"I can show only value for data of type variable
\n
"
);
#endif
float
min
=
1.0e20
,
max
=
-
1.0e20
;
printf
(
"prepearing data for visualization
\n
"
);
if
(
visualization_tag
.
isValid
())
...
...
@@ -1760,6 +1769,7 @@ void draw_screen()
}
else
val
+=
wgt
*
static_cast
<
double
>
(
v
[
comp
]);
}
#if defined(USE_AUTODIFF)
else
if
(
source_tag
.
GetDataType
()
==
DATA_VARIABLE
)
{
Storage
::
var_array
v
=
jt
->
VariableArray
(
source_tag
);
...
...
@@ -1772,6 +1782,7 @@ void draw_screen()
}
else
val
+=
wgt
*
static_cast
<
double
>
(
v
[
comp
].
GetValue
());
}
#endif
vol
+=
wgt
;
}
res
=
val
/
vol
;
...
...
@@ -1832,6 +1843,7 @@ void draw_screen()
}
else
val
+=
wgt
*
static_cast
<
double
>
(
v
[
comp
]);
}
#if defined(USE_AUTODIFF)
else
if
(
source_tag
.
GetDataType
()
==
DATA_VARIABLE
)
{
Storage
::
var_array
v
=
jt
->
VariableArray
(
source_tag
);
...
...
@@ -1844,6 +1856,7 @@ void draw_screen()
}
else
val
+=
wgt
*
v
[
comp
].
GetValue
();
}
#endif
vol
+=
wgt
;
}
res
=
val
/
vol
;
...
...
Source/Autodiff/model.cpp
View file @
1e58380d
#include "inmost_model.h"
#if defined(USE_AUTODIFF) && defined(USE_MESH) && defined(USE_SOLVER)
namespace
INMOST
{
...
...
@@ -273,3 +273,4 @@ namespace INMOST
return
ret
;
}
}
#endif
Source/Headers/inmost_expression.h
View file @
1e58380d
...
...
@@ -2283,6 +2283,9 @@ __INLINE INMOST_DATA_REAL_TYPE get_table(INMOST_DATA_RE
#else //USE_AUTODIFF
__INLINE
bool
check_nans
(
INMOST_DATA_REAL_TYPE
val
)
{
return
val
!=
val
;}
__INLINE
bool
check_infs
(
INMOST_DATA_REAL_TYPE
val
)
{
return
std
::
isinf
(
val
);}
__INLINE
bool
check_nans_infs
(
INMOST_DATA_REAL_TYPE
val
)
{
return
check_nans
(
val
)
||
check_infs
(
val
);}
__INLINE
void
assign
(
INMOST_DATA_INTEGER_TYPE
&
Arg
,
INMOST_DATA_INTEGER_TYPE
Val
)
{
Arg
=
Val
;}
__INLINE
void
assign
(
INMOST_DATA_INTEGER_TYPE
&
Arg
,
INMOST_DATA_REAL_TYPE
Val
)
{
Arg
=
Val
;}
__INLINE
void
assign
(
INMOST_DATA_REAL_TYPE
&
Arg
,
INMOST_DATA_INTEGER_TYPE
Val
)
{
Arg
=
Val
;}
...
...
Source/Headers/inmost_nonlinear.h
View file @
1e58380d
...
...
@@ -17,11 +17,12 @@ namespace INMOST
class
NonlinearSolver
{
Automatizator
&
aut
;
//
Automatizator & aut;
public:
NonlinearSolver
(
Automatizator
&
aut
)
:
aut
(
aut
)
{}
NonlinearSolver
(
const
NonlinearSolver
&
b
)
:
aut
(
b
.
aut
)
{}
NonlinearSolver
&
operator
=
(
NonlinearSolver
const
&
b
)
{
aut
=
b
.
aut
;
return
*
this
;}
//NonlinearSolver(Automatizator & aut) : aut(aut) {}
NonlinearSolver
()
{}
NonlinearSolver
(
const
NonlinearSolver
&
b
)
/*: aut(b.aut)*/
{}
NonlinearSolver
&
operator
=
(
NonlinearSolver
const
&
b
)
{
/*aut = b.aut;*/
return
*
this
;}
~
NonlinearSolver
()
{}
RequestedAction
GetAction
()
const
;
...
...
Source/Headers/inmost_operator.h
View file @
1e58380d
...
...
@@ -3,7 +3,7 @@
#include "inmost_variable.h"
#if defined(USE_AUTODIFF) && defined(USE_MESH)
#if defined(USE_AUTODIFF) && defined(USE_MESH)
&& defined(USE_SOLVER)
namespace
INMOST
{
...
...
Source/Mesh/parallel.cpp
View file @
1e58380d
...
...
@@ -2334,12 +2334,14 @@ namespace INMOST
//array_data_send.resize(had_s+s*tag.GetBytesSize());
if
(
s
)
{
#if defined(USE_AUTODIFF)
if
(
tag
.
GetDataType
()
==
DATA_VARIABLE
)
{
REPORT_VAL
(
"data size: "
,
s
);
REPORT_VAL
(
"data capacity: "
,
GetDataCapacity
(
*
eit
,
tag
));
REPORT_VAL
(
"array size: "
,
had_s
);
}
#endif
array_data_send
.
resize
(
had_s
+
GetDataCapacity
(
*
eit
,
tag
));
GetData
(
*
eit
,
tag
,
0
,
s
,
&
array_data_send
[
had_s
]);
//REPORT_VAL("size",s);
...
...
@@ -2364,6 +2366,7 @@ namespace INMOST
//array_data_send.resize(had_s+s*tag.GetBytesSize());
if
(
s
)
{
#if defined(USE_AUTODIFF)
if
(
tag
.
GetDataType
()
==
DATA_VARIABLE
)
{
REPORT_VAL
(
"on element "
,
Element
(
this
,
*
eit
).
GlobalID
());
...
...
@@ -2371,6 +2374,7 @@ namespace INMOST
REPORT_VAL
(
"data capacity: "
,
GetDataCapacity
(
*
eit
,
tag
));
REPORT_VAL
(
"size: "
,
s
);
}
#endif
array_data_send
.
resize
(
had_s
+
GetDataCapacity
(
*
eit
,
tag
));
if
(
tag
.
GetDataType
()
==
DATA_REFERENCE
)
{
...
...
@@ -2630,6 +2634,7 @@ namespace INMOST
{
if
(
!
select
||
GetMarker
(
*
eit
,
select
)
)
{
#if defined(USE_AUTODIFF)
if
(
tag
.
GetDataType
()
==
DATA_VARIABLE
)
{
REPORT_VAL
(
"on element "
,
Element
(
this
,
*
eit
).
GlobalID
());
...
...
@@ -2637,6 +2642,7 @@ namespace INMOST
REPORT_VAL
(
"capacity "
,
GetDataCapacity
(
&
array_data_recv
[
pos
],
size
,
tag
));
REPORT_VAL
(
"size "
,
size
);
}
#endif
op
(
tag
,
Element
(
this
,
*
eit
),
&
array_data_recv
[
pos
],
size
);
pos
+=
GetDataCapacity
(
&
array_data_recv
[
pos
],
size
,
tag
);
//pos += size*tag.GetBytesSize();
...
...
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