![]() |
![]() |
![]() |
cpg-network Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Implemented Interfaces | Properties | Signals |
#define CPG_INTEGRATOR_CONST (obj) struct CpgIntegrator; struct CpgIntegratorClass; CpgIntegratorState * cpg_integrator_get_state (CpgIntegrator *integrator
); void cpg_integrator_set_state (CpgIntegrator *integrator
,CpgIntegratorState *state
); void cpg_integrator_run (CpgIntegrator *integrator
,gdouble from
,gdouble timestep
,gdouble to
); gdouble cpg_integrator_step (CpgIntegrator *integrator
,gdouble t
,gdouble timestep
); gboolean cpg_integrator_step_prepare (CpgIntegrator *integrator
,gdouble t
,gdouble timestep
); void cpg_integrator_evaluate (CpgIntegrator *integrator
,gdouble t
,gdouble timestep
); void cpg_integrator_reset (CpgIntegrator *integrator
); const gchar * cpg_integrator_get_name (CpgIntegrator *integrator
); gdouble cpg_integrator_get_time (CpgIntegrator *integrator
); void cpg_integrator_set_time (CpgIntegrator *integrator
,gdouble t
); CpgObject * cpg_integrator_get_object (CpgIntegrator *integrator
); CpgIntegratorPrivate;
GObject +----CpgObject +----CpgIntegrator +----CpgIntegratorEuler +----CpgIntegratorPredictCorrect +----CpgIntegratorRungeKutta +----CpgIntegratorStub
CpgIntegrator implements CpgUsable, CpgAnnotatable, CpgLayoutable and CpgTaggable.
"object" CpgObject* : Read / Write "state" CpgIntegratorState* : Read "time" gdouble : Read
#define CPG_INTEGRATOR_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CPG_TYPE_INTEGRATOR, CpgIntegrator const))
struct CpgIntegratorClass { void (*run) (CpgIntegrator *integrator, gdouble from, gdouble timestep, gdouble to); gdouble (*step) (CpgIntegrator *integrator, gdouble t, gdouble timestep); gboolean (*step_prepare) (CpgIntegrator *integrator, gdouble t, gdouble timestep); const gchar *(*get_name) (CpgIntegrator *integrator); void (*reset) (CpgIntegrator *integrator); /* private field */ const gchar *integrator_id; };
The CpgIntegrator class
run virtual function | |
step virtual function | |
get_name virtual function | |
reset virtual function | |
const gchar * |
the integrator id |
CpgIntegratorState * cpg_integrator_get_state (CpgIntegrator *integrator
);
Get the integrator state.
|
A CpgIntegrator |
Returns : |
A CpgIntegratorState. [transfer none] |
void cpg_integrator_set_state (CpgIntegrator *integrator
,CpgIntegratorState *state
);
Set the integrator state. You should normally not need to use this function.
|
A CpgIntegrator |
|
A CpgIntegratorState |
void cpg_integrator_run (CpgIntegrator *integrator
,gdouble from
,gdouble timestep
,gdouble to
);
Integrate the object for a certain period of time.
|
A CpgIntegrator |
|
The time at which to start integrating |
|
The timestep to use for integration |
|
The time until which to run the integration |
gdouble cpg_integrator_step (CpgIntegrator *integrator
,gdouble t
,gdouble timestep
);
Perform a single integration step. Use cpg_integrator_run if you want to run the integration for a period of time.
|
A CpgIntegrator |
|
The time at which to perform the integration step |
|
The timestep with which to perform the integration step |
Returns : |
The real time step with which the integration was performed |
gboolean cpg_integrator_step_prepare (CpgIntegrator *integrator
,gdouble t
,gdouble timestep
);
void cpg_integrator_evaluate (CpgIntegrator *integrator
,gdouble t
,gdouble timestep
);
Evaluate the system of equations comprising the object. This is a utility
function for integrator implementations. Call this function to calculate
all the states. After this function completes, the update values for the
states can be found (see
cpg_integrator_state_get_update)
|
A CpgIntegrator |
|
The time at which to evaluate the object |
|
The timestep with which the current step is evaluating |
void cpg_integrator_reset (CpgIntegrator *integrator
);
Reset the integrator. This is usually called from cpg_object_reset on the main network.
|
A CpgIntegrator |
const gchar * cpg_integrator_get_name (CpgIntegrator *integrator
);
The integrator name.
|
A CpgIntegrator |
Returns : |
the integrator name |
gdouble cpg_integrator_get_time (CpgIntegrator *integrator
);
Get the current time at which the object is being integrated.
|
A CpgIntegrator |
Returns : |
the current integration time |
CpgObject * cpg_integrator_get_object (CpgIntegrator *integrator
);
Get the object associated with the integrator.
|
A CpgIntegrator |
Returns : |
A CpgObject. [transfer none] |
"time"
property"time" gdouble : Read
The current simulated time
Allowed values: >= 0
Default value: 0
"begin"
signalvoid user_function (CpgIntegrator *object,
gdouble from,
gdouble timestep,
gdouble to,
gpointer user_data) : Run Last
Emitted before running an integration of several steps
|
the integrator |
|
from where to start the simulation |
|
the desired timestep |
|
to where to simulate |
|
user data set when the signal handler was connected. |
"end"
signalvoid user_function (CpgIntegrator *arg0,
gpointer user_data) : Run Last
Emitted after running an integration of several steps has finished
|
user data set when the signal handler was connected. |
"step"
signalvoid user_function (CpgIntegrator *object,
gdouble timestep,
gdouble time,
gpointer user_data) : Run Last
Emitted when an integrator step has been performed
|
the integrator |
|
the timestep |
|
the elapsed time |
|
user data set when the signal handler was connected. |
"step-prepare"
signalvoid user_function (CpgIntegrator *cpgintegrator,
gdouble arg1,
gdouble arg2,
gpointer user_data) : Run Last
|
the object which received the signal. |
|
user data set when the signal handler was connected. |