diff --git a/Examples/OldDrawGrid/main.cpp b/Examples/OldDrawGrid/main.cpp index 029feda7..1e878aaa 100644 --- a/Examples/OldDrawGrid/main.cpp +++ b/Examples/OldDrawGrid/main.cpp @@ -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(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(v[comp].GetValue()); } +#endif vol += wgt; } res = val / vol; @@ -1832,6 +1843,7 @@ void draw_screen() } else val += wgt * static_cast(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; diff --git a/Source/Autodiff/model.cpp b/Source/Autodiff/model.cpp index 09a912e2..fa3106a2 100644 --- a/Source/Autodiff/model.cpp +++ b/Source/Autodiff/model.cpp @@ -1,5 +1,5 @@ #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 diff --git a/Source/Headers/inmost_expression.h b/Source/Headers/inmost_expression.h index e6ab651e..7a510414 100644 --- a/Source/Headers/inmost_expression.h +++ b/Source/Headers/inmost_expression.h @@ -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;} diff --git a/Source/Headers/inmost_nonlinear.h b/Source/Headers/inmost_nonlinear.h index e61d5e7b..74e40955 100644 --- a/Source/Headers/inmost_nonlinear.h +++ b/Source/Headers/inmost_nonlinear.h @@ -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; diff --git a/Source/Headers/inmost_operator.h b/Source/Headers/inmost_operator.h index 668b8619..482a64a7 100644 --- a/Source/Headers/inmost_operator.h +++ b/Source/Headers/inmost_operator.h @@ -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 { diff --git a/Source/Mesh/parallel.cpp b/Source/Mesh/parallel.cpp index 0bb6f1fd..7ac819f3 100644 --- a/Source/Mesh/parallel.cpp +++ b/Source/Mesh/parallel.cpp @@ -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();