|
@@ -80,12 +80,8 @@ public:
|
|
|
virtual ~AbstractCoupledModel()
|
|
|
{
|
|
|
#ifdef WITH_TRACE
|
|
|
- utils::Trace < utils::DoubleTime >::trace()
|
|
|
- << utils::TraceElement < utils::DoubleTime >(
|
|
|
- AbstractCoupledModel < T, U, V, W >::path(this).erase(0,6),
|
|
|
- utils::DoubleTime::null,
|
|
|
- utils::DESTRUCT);
|
|
|
- utils::Trace < utils::DoubleTime >::trace().flush();
|
|
|
+ trace_element(utils::DoubleTime::null,
|
|
|
+ utils::DESTRUCT);
|
|
|
#endif
|
|
|
}
|
|
|
|
|
@@ -93,12 +89,8 @@ public:
|
|
|
{
|
|
|
|
|
|
#ifdef WITH_TRACE
|
|
|
- utils::Trace < utils::DoubleTime >::trace()
|
|
|
- << utils::TraceElement < utils::DoubleTime >(
|
|
|
- AbstractCoupledModel < T, U, V, W >::path(this),
|
|
|
- t, utils::AFTER_COMPUTE);
|
|
|
- utils::Trace < utils::DoubleTime >::trace().flush();
|
|
|
- trace_model(t, false);
|
|
|
+ trace_element(t, utils::AFTER_COMPUTE);
|
|
|
+ trace_internals(t, utils::AFTER_COMPUTE);
|
|
|
#else
|
|
|
(void) t;
|
|
|
#endif
|
|
@@ -121,12 +113,9 @@ public:
|
|
|
{
|
|
|
|
|
|
#ifdef WITH_TRACE
|
|
|
- utils::Trace < utils::DoubleTime >::trace()
|
|
|
- << utils::TraceElement < utils::DoubleTime >(
|
|
|
- AbstractCoupledModel < T, U, V, W >::path(this),
|
|
|
- t, utils::BEFORE_COMPUTE);
|
|
|
- utils::Trace < utils::DoubleTime >::trace().flush();
|
|
|
- trace_model(t, false);
|
|
|
+ trace_element(t, utils::BEFORE_COMPUTE);
|
|
|
+ trace_internals(t, utils::BEFORE_COMPUTE);
|
|
|
+ trace_externals(t, utils::BEFORE_COMPUTE);
|
|
|
#else
|
|
|
(void) t;
|
|
|
#endif
|
|
@@ -335,53 +324,64 @@ public:
|
|
|
Externals < T, U, V >::save(this, state);
|
|
|
}
|
|
|
|
|
|
-#ifdef WITH_TRACE
|
|
|
- virtual void trace_model(typename U::type t) const {
|
|
|
+ virtual void trace_element(typename U::type t, utils::TraceType type = utils::KERNEL) const
|
|
|
+ {
|
|
|
+ utils::Trace < utils::DoubleTime >::trace()
|
|
|
+ << utils::TraceElement < utils::DoubleTime >(
|
|
|
+ AbstractCoupledModel < T, U, V, W >::path(this),
|
|
|
+ t, type);
|
|
|
+ utils::Trace < utils::DoubleTime >::trace().flush();
|
|
|
+ }
|
|
|
+
|
|
|
+ virtual void trace_internals(typename U::type t, utils::TraceType type) const
|
|
|
+ {
|
|
|
for (size_t i = 0; i < Internals < T, U, V >::size(); ++i) {
|
|
|
if (not Internals < T, U, V >::get(i).is_null()) {
|
|
|
utils::Trace < utils::DoubleTime >::trace()
|
|
|
- << utils::KernelInfo({
|
|
|
- Internals < T, U, V >::name(i), true,
|
|
|
- Internals < T, U, V >::get(i).to_string(
|
|
|
- dynamic_cast < const T* >(this))
|
|
|
- });
|
|
|
+ << utils::TraceElement < utils::DoubleTime >(
|
|
|
+ AbstractCoupledModel < T, U, V, W >::path(this),
|
|
|
+ t, type)
|
|
|
+ << utils::KernelInfo(
|
|
|
+ Internals < T, U, V >::name(i), true,
|
|
|
+ Internals < T, U, V >::get(i).to_string(
|
|
|
+ dynamic_cast < const T* >(this))
|
|
|
+ );
|
|
|
+ utils::Trace < utils::DoubleTime >::trace().flush();
|
|
|
}
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
+ virtual void trace_externals(typename U::type t, utils::TraceType type = utils::KERNEL) const
|
|
|
+ {
|
|
|
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 >(
|
|
|
+ AbstractCoupledModel < T, U, V, W >::path(this),
|
|
|
+ t, type)
|
|
|
<< utils::KernelInfo(
|
|
|
Externals < T, U, V >::name(i), false,
|
|
|
Externals < T, U, V >::get(i).to_string(
|
|
|
dynamic_cast < const T* >(this))
|
|
|
);
|
|
|
+ utils::Trace < utils::DoubleTime >::trace().flush();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- virtual utils::TraceElement < utils::DoubleTime > trace_element(){
|
|
|
- utils::Trace < utils::DoubleTime >::trace()
|
|
|
- << utils::TraceElement < utils::DoubleTime >(
|
|
|
- AbstractCoupledModel < T, U, V, W >::path(this),
|
|
|
- t, trace_type);
|
|
|
- }
|
|
|
-
|
|
|
- void trace_indepth_model(typename U::type t, utils::Trace::TraceType trace_type) const
|
|
|
+ virtual void trace_model(typename U::type t, utils::TraceType type = utils::KERNEL) const
|
|
|
{
|
|
|
-
|
|
|
-
|
|
|
- utils::Trace < utils::DoubleTime >::trace().flush();
|
|
|
+ trace_element(t, type);
|
|
|
+ trace_internals(t, type);
|
|
|
+ trace_externals(t, type);
|
|
|
typename AbstractCoupledModel::Submodels::const_iterator it =
|
|
|
- submodels.begin();
|
|
|
+ submodels.begin();
|
|
|
|
|
|
while (it != submodels.end()) {
|
|
|
- if(it->)
|
|
|
- it->second->trace_indepth_model(t);
|
|
|
+ it->second->trace_model(t, type);
|
|
|
++it;
|
|
|
}
|
|
|
}
|
|
|
-#endif
|
|
|
|
|
|
|
|
|
virtual void stable()
|
|
@@ -422,18 +422,17 @@ protected:
|
|
|
submodel_internals[index] =
|
|
|
std::pair < type*, int >(model, sub_index);
|
|
|
#ifdef WITH_TRACE
|
|
|
- utils::Trace < utils::DoubleTime >::trace()
|
|
|
- << utils::TraceElement < utils::DoubleTime >("KERNEL", -1,
|
|
|
- utils::INTERNAL_LINK)
|
|
|
- << "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();
|
|
|
+ utils::Trace < utils::DoubleTime >::trace()
|
|
|
+ << utils::TraceElement < utils::DoubleTime >(
|
|
|
+ AbstractCoupledModel < T, U, V, W >::path(this),
|
|
|
+ utils::DoubleTime::null,
|
|
|
+ utils::INTERNAL_LINK)
|
|
|
+ << utils::KernelInfo(
|
|
|
+ var_name,
|
|
|
+ AbstractCoupledModel < T, U, V, W >::path(model),
|
|
|
+ sub_var_name);
|
|
|
+ utils::Trace < utils::DoubleTime >::trace().flush();
|
|
|
+
|
|
|
#endif
|
|
|
}
|
|
|
|
|
@@ -446,18 +445,16 @@ protected:
|
|
|
std::pair < type*, int >(it->model, it->sub_index);
|
|
|
|
|
|
#ifdef WITH_TRACE
|
|
|
- utils::Trace < utils::DoubleTime >::trace()
|
|
|
- << utils::TraceElement < utils::DoubleTime >("KERNEL", -1,
|
|
|
- utils::INTERNAL_DECL)
|
|
|
- << "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();
|
|
|
+ utils::Trace < utils::DoubleTime >::trace()
|
|
|
+ << utils::TraceElement < utils::DoubleTime >(
|
|
|
+ AbstractCoupledModel < T, U, V, W >::path(this),
|
|
|
+ utils::DoubleTime::null,
|
|
|
+ utils::INTERNAL_LINK)
|
|
|
+ << utils::KernelInfo(
|
|
|
+ it->var_name,
|
|
|
+ AbstractCoupledModel < T, U, V, W >::path(it->model),
|
|
|
+ it->sub_var_name);
|
|
|
+ utils::Trace < utils::DoubleTime >::trace().flush();
|
|
|
#endif
|
|
|
}
|
|
|
}
|
|
@@ -473,12 +470,12 @@ protected:
|
|
|
|
|
|
#ifdef WITH_TRACE
|
|
|
utils::Trace < utils::DoubleTime >::trace()
|
|
|
- << utils::TraceElement < utils::DoubleTime >("KERNEL", -1,
|
|
|
- utils::SUBMODEL_ADD)
|
|
|
- << "SUBMODEL - "
|
|
|
- << AbstractCoupledModel < T, U, V, W >::path(it->second)
|
|
|
- << " to "
|
|
|
- << AbstractCoupledModel < T, U, V, W >::path(this);
|
|
|
+ << utils::TraceElement < utils::DoubleTime >(
|
|
|
+ AbstractCoupledModel < T, U, V, W >::path(this),
|
|
|
+ utils::DoubleTime::null,
|
|
|
+ utils::SUBMODEL_ADD)
|
|
|
+ << utils::KernelInfo(
|
|
|
+ AbstractCoupledModel < T, U, V, W >::path(it->second));
|
|
|
utils::Trace < utils::DoubleTime >::trace().flush();
|
|
|
#endif
|
|
|
|
|
@@ -495,12 +492,12 @@ protected:
|
|
|
|
|
|
#ifdef WITH_TRACE
|
|
|
utils::Trace < utils::DoubleTime >::trace()
|
|
|
- << utils::TraceElement < utils::DoubleTime >("KERNEL", -1,
|
|
|
- utils::KERNEL)
|
|
|
- << "SUBMODEL - "
|
|
|
- << AbstractCoupledModel < T, U, V, W >::path(model)
|
|
|
- << " added to "
|
|
|
- << AbstractCoupledModel < T, U, V, W >::path(this);
|
|
|
+ << utils::TraceElement < utils::DoubleTime >(
|
|
|
+ AbstractCoupledModel < T, U, V, W >::path(this),
|
|
|
+ utils::DoubleTime::null,
|
|
|
+ utils::SUBMODEL_ADD)
|
|
|
+ << utils::KernelInfo(
|
|
|
+ AbstractCoupledModel < T, U, V, W >::path(model));
|
|
|
utils::Trace < utils::DoubleTime >::trace().flush();
|
|
|
#endif
|
|
|
}
|