|
@@ -55,9 +55,13 @@ public:
|
|
unsigned int index;
|
|
unsigned int index;
|
|
type* model;
|
|
type* model;
|
|
int sub_index;
|
|
int sub_index;
|
|
|
|
+ std::string var_name;
|
|
|
|
+ std::string sub_var_name;
|
|
|
|
|
|
- Var (unsigned int index, type* model, int sub_index) :
|
|
|
|
- index(index), model(model), sub_index(sub_index)
|
|
|
|
|
|
+ Var (unsigned int index, std::string var_name,
|
|
|
|
+ type* model, int sub_index, std::string sub_var_name) :
|
|
|
|
+ index(index), model(model), sub_index(sub_index),
|
|
|
|
+ var_name(var_name), sub_var_name(sub_var_name)
|
|
{ }
|
|
{ }
|
|
};
|
|
};
|
|
|
|
|
|
@@ -145,6 +149,18 @@ public:
|
|
utils::Trace < utils::DoubleTime >::trace().flush();
|
|
utils::Trace < utils::DoubleTime >::trace().flush();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ for (size_t i = 0; i < Externals < T, U, V >::size(); ++i) {
|
|
|
|
+ if (not Externals < T, U, V >::get(i).is_null()) {
|
|
|
|
+ utils::Trace < utils::DoubleTime >::trace()
|
|
|
|
+ << utils::TraceElement < utils::DoubleTime >("KERNEL", t,
|
|
|
|
+ utils::KERNEL)
|
|
|
|
+ << "*" << Externals < T, U, V >::name(i) << " = "
|
|
|
|
+ << Externals < T, U, V >::get(i).to_string(
|
|
|
|
+ dynamic_cast < const T* >(this));
|
|
|
|
+ utils::Trace < utils::DoubleTime >::trace().flush();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
#else
|
|
#else
|
|
(void) t;
|
|
(void) t;
|
|
#endif
|
|
#endif
|
|
@@ -368,28 +384,43 @@ public:
|
|
}
|
|
}
|
|
|
|
|
|
protected:
|
|
protected:
|
|
- void change_internal(unsigned int index, double T::* var)
|
|
|
|
- {
|
|
|
|
- submodel_internals.erase(index);
|
|
|
|
- Internals < T, U, V >::internal(index, var);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- void change_internal(unsigned int index, int T::* var)
|
|
|
|
- {
|
|
|
|
- submodel_internals.erase(index);
|
|
|
|
- Internals < T, U, V >::internalI(index, var);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- void change_internal(unsigned int index, bool T::* var)
|
|
|
|
- {
|
|
|
|
- submodel_internals.erase(index);
|
|
|
|
- Internals < T, U, V >::internalB(index, var);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- void internal_(unsigned int index, type* model, int sub_index)
|
|
|
|
|
|
+// void change_internal(unsigned int index, double T::* var)
|
|
|
|
+// {
|
|
|
|
+// submodel_internals.erase(index);
|
|
|
|
+// Internals < T, U, V >::internal(index, var);
|
|
|
|
+// }
|
|
|
|
+
|
|
|
|
+// void change_internal(unsigned int index, int T::* var)
|
|
|
|
+// {
|
|
|
|
+// submodel_internals.erase(index);
|
|
|
|
+// Internals < T, U, V >::internalI(index, var);
|
|
|
|
+// }
|
|
|
|
+
|
|
|
|
+// void change_internal(unsigned int index, bool T::* var)
|
|
|
|
+// {
|
|
|
|
+// submodel_internals.erase(index);
|
|
|
|
+// Internals < T, U, V >::internalB(index, var);
|
|
|
|
+// }
|
|
|
|
+
|
|
|
|
+ void link_internal_(unsigned int index, std::string var_name,
|
|
|
|
+ type* model, int sub_index, std::string sub_var_name)
|
|
{
|
|
{
|
|
submodel_internals[index] =
|
|
submodel_internals[index] =
|
|
std::pair < type*, int >(model, sub_index);
|
|
std::pair < type*, int >(model, sub_index);
|
|
|
|
+#ifdef WITH_TRACE
|
|
|
|
+ utils::Trace < utils::DoubleTime >::trace()
|
|
|
|
+ << utils::TraceElement < utils::DoubleTime >("KERNEL", -1,
|
|
|
|
+ utils::KERNEL)
|
|
|
|
+ << "LINK INTERNAL "
|
|
|
|
+ << AbstractCoupledModel < T, U, V, W >::path(this)
|
|
|
|
+ << ":"
|
|
|
|
+ << var_name
|
|
|
|
+ << " to "
|
|
|
|
+ << AbstractCoupledModel < T, U, V, W >::path(model)
|
|
|
|
+ << ":"
|
|
|
|
+ << sub_var_name;
|
|
|
|
+ utils::Trace < utils::DoubleTime >::trace().flush();
|
|
|
|
+#endif
|
|
}
|
|
}
|
|
|
|
|
|
void I_(std::initializer_list < Var > internals)
|
|
void I_(std::initializer_list < Var > internals)
|
|
@@ -399,6 +430,21 @@ protected:
|
|
|
|
|
|
submodel_internals[it->index] =
|
|
submodel_internals[it->index] =
|
|
std::pair < type*, int >(it->model, it->sub_index);
|
|
std::pair < type*, int >(it->model, it->sub_index);
|
|
|
|
+
|
|
|
|
+#ifdef WITH_TRACE
|
|
|
|
+ utils::Trace < utils::DoubleTime >::trace()
|
|
|
|
+ << utils::TraceElement < utils::DoubleTime >("KERNEL", -1,
|
|
|
|
+ utils::KERNEL)
|
|
|
|
+ << "LINK INTERNAL "
|
|
|
|
+ << AbstractCoupledModel < T, U, V, W >::path(this)
|
|
|
|
+ << ":"
|
|
|
|
+ << it->var_name
|
|
|
|
+ << " to "
|
|
|
|
+ << AbstractCoupledModel < T, U, V, W >::path(it->model)
|
|
|
|
+ << ":"
|
|
|
|
+ << it->sub_var_name;
|
|
|
|
+ utils::Trace < utils::DoubleTime >::trace().flush();
|
|
|
|
+#endif
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -415,7 +461,7 @@ protected:
|
|
utils::Trace < utils::DoubleTime >::trace()
|
|
utils::Trace < utils::DoubleTime >::trace()
|
|
<< utils::TraceElement < utils::DoubleTime >("KERNEL", -1,
|
|
<< utils::TraceElement < utils::DoubleTime >("KERNEL", -1,
|
|
utils::KERNEL)
|
|
utils::KERNEL)
|
|
- << "ADD SUBMODEL - "
|
|
|
|
|
|
+ << "SUBMODEL - "
|
|
<< AbstractCoupledModel < T, U, V, W >::path(it->second)
|
|
<< AbstractCoupledModel < T, U, V, W >::path(it->second)
|
|
<< " to "
|
|
<< " to "
|
|
<< AbstractCoupledModel < T, U, V, W >::path(this);
|
|
<< AbstractCoupledModel < T, U, V, W >::path(this);
|
|
@@ -437,9 +483,9 @@ protected:
|
|
utils::Trace < utils::DoubleTime >::trace()
|
|
utils::Trace < utils::DoubleTime >::trace()
|
|
<< utils::TraceElement < utils::DoubleTime >("KERNEL", -1,
|
|
<< utils::TraceElement < utils::DoubleTime >("KERNEL", -1,
|
|
utils::KERNEL)
|
|
utils::KERNEL)
|
|
- << "ADD SUBMODEL - "
|
|
|
|
|
|
+ << "SUBMODEL - "
|
|
<< AbstractCoupledModel < T, U, V, W >::path(model)
|
|
<< AbstractCoupledModel < T, U, V, W >::path(model)
|
|
- << " to "
|
|
|
|
|
|
+ << " added to "
|
|
<< AbstractCoupledModel < T, U, V, W >::path(this);
|
|
<< AbstractCoupledModel < T, U, V, W >::path(this);
|
|
utils::Trace < utils::DoubleTime >::trace().flush();
|
|
utils::Trace < utils::DoubleTime >::trace().flush();
|
|
#endif
|
|
#endif
|
|
@@ -451,9 +497,9 @@ private:
|
|
Setsubmodels setsubmodels;
|
|
Setsubmodels setsubmodels;
|
|
};
|
|
};
|
|
|
|
|
|
-#define InternalS(index, var, sub_index) internal_(index, var, sub_index)
|
|
|
|
|
|
|
|
-#define ITEM_S(index, var, sub_index) Var(index, var, sub_index)
|
|
|
|
|
|
+#define InternalS(index, var, sub_index) link_internal_(index, std::string(ESCAPEQUOTE(index)), var, sub_index, std::string(ESCAPEQUOTE(index)))
|
|
|
|
+#define ITEM_S(index, var, sub_index) Var(index, std::string(ESCAPEQUOTE(index)), var, sub_index, std::string(ESCAPEQUOTE(index)))
|
|
#define UNWRAP_ITEM_S(...) ITEM_S __VA_ARGS__
|
|
#define UNWRAP_ITEM_S(...) ITEM_S __VA_ARGS__
|
|
#define LIST_S_16(L1, L2, L3, L4, L5, L6, L7, L8, L9, L10, L11, L12, L13, L14, L15, L16) { UNWRAP_ITEM_S(L1), UNWRAP_ITEM_S(L2), UNWRAP_ITEM_S(L3), UNWRAP_ITEM_S(L4), UNWRAP_ITEM_S(L5), UNWRAP_ITEM_S(L6), UNWRAP_ITEM_S(L7), UNWRAP_ITEM_S(L8), UNWRAP_ITEM_S(L9), UNWRAP_ITEM_S(L10), UNWRAP_ITEM_S(L11), UNWRAP_ITEM_S(L12), UNWRAP_ITEM_S(L13), UNWRAP_ITEM_S(L14), UNWRAP_ITEM_S(L15), UNWRAP_ITEM_S(L16) }
|
|
#define LIST_S_16(L1, L2, L3, L4, L5, L6, L7, L8, L9, L10, L11, L12, L13, L14, L15, L16) { UNWRAP_ITEM_S(L1), UNWRAP_ITEM_S(L2), UNWRAP_ITEM_S(L3), UNWRAP_ITEM_S(L4), UNWRAP_ITEM_S(L5), UNWRAP_ITEM_S(L6), UNWRAP_ITEM_S(L7), UNWRAP_ITEM_S(L8), UNWRAP_ITEM_S(L9), UNWRAP_ITEM_S(L10), UNWRAP_ITEM_S(L11), UNWRAP_ITEM_S(L12), UNWRAP_ITEM_S(L13), UNWRAP_ITEM_S(L14), UNWRAP_ITEM_S(L15), UNWRAP_ITEM_S(L16) }
|
|
#define LIST_S_15(L1, L2, L3, L4, L5, L6, L7, L8, L9, L10, L11, L12, L13, L14, L15) { UNWRAP_ITEM_S(L1), UNWRAP_ITEM_S(L2), UNWRAP_ITEM_S(L3), UNWRAP_ITEM_S(L4), UNWRAP_ITEM_S(L5), UNWRAP_ITEM_S(L6), UNWRAP_ITEM_S(L7), UNWRAP_ITEM_S(L8), UNWRAP_ITEM_S(L9), UNWRAP_ITEM_S(L10), UNWRAP_ITEM_S(L11), UNWRAP_ITEM_S(L12), UNWRAP_ITEM_S(L13), UNWRAP_ITEM_S(L14), UNWRAP_ITEM_S(L15) }
|
|
#define LIST_S_15(L1, L2, L3, L4, L5, L6, L7, L8, L9, L10, L11, L12, L13, L14, L15) { UNWRAP_ITEM_S(L1), UNWRAP_ITEM_S(L2), UNWRAP_ITEM_S(L3), UNWRAP_ITEM_S(L4), UNWRAP_ITEM_S(L5), UNWRAP_ITEM_S(L6), UNWRAP_ITEM_S(L7), UNWRAP_ITEM_S(L8), UNWRAP_ITEM_S(L9), UNWRAP_ITEM_S(L10), UNWRAP_ITEM_S(L11), UNWRAP_ITEM_S(L12), UNWRAP_ITEM_S(L13), UNWRAP_ITEM_S(L14), UNWRAP_ITEM_S(L15) }
|