Пример #1
0
float WidgetBase::GetDeformationSizeInitialRatio (
    ViewNumber::Enum viewNumber) const
{
    const Simulation& simulation = GetSimulation (viewNumber);
    float gridCellLength = GetBubbleDiameter (viewNumber);
    return gridCellLength / (2 * simulation.GetMaxDeformationEigenValue ());
}
Пример #2
0
void WidgetBase::infoFoam ()
{
    const ViewSettings& vs = GetViewSettings ();
    ostringstream ostr;
    ostr << GetFoam ().GetInfo () << endl 
         << GetSimulation ().GetT1Info (GetTime (), vs.T1sShiftLower ());
    ShowMessageBox (m_widget, ostr.str ().c_str ());
}
Пример #3
0
G3D::Matrix3 WidgetBase::GetRotationForAxisOrder (ViewNumber::Enum viewNumber, 
                                                  size_t timeStep) const
{
    const ViewSettings& vs = GetViewSettings (viewNumber);
    const Simulation& simulation = GetSimulation (viewNumber);
    const Foam& foam = simulation.GetFoam (timeStep);
    return vs.GetRotationForAxisOrder (foam);
}
Пример #4
0
float WidgetBase::GetVelocitySizeInitialRatio (
    ViewNumber::Enum viewNumber) const
{
    float bubbleDiameter = GetBubbleDiameter (viewNumber);
    const Simulation& simulation = GetSimulation (viewNumber);
    float velocityRange = simulation.GetMaxScalar (BodyScalar::VELOCITY_MAGNITUDE);
    // min velocity is 0.
    return bubbleDiameter / velocityRange;
}
Пример #5
0
/*
 * Function:	_dflt_log_func
 * Description:	Default function which writes the message to the log file.
 *		Messages are only logged on live executions. The log
 *		file is created and open for append if this hasn't been done
 *		previously.
 * Scope:	private
 * Parameters:	format	- format of the msg (used by the formatting routine).
 *		buf	- string to be logged
 * Return:	none
 */
static void
/*ARGSUSED0*/
_dflt_log_func(u_int format, char *buf)
{
	if (!GetSimulation(SIM_EXECUTE) || get_trace_level()) {
		if (_log_file == NULL) {
			if ((_log_file = fopen(TMPLOGFILE, "a")) != NULL)
				/*
				 * Unbuffered I/O
				 */
				(void) setbuf(_log_file, NULL);
		}

		if (_log_file != NULL)
			(void) fwrite(buf, strlen(buf), 1, _log_file);
	}
}
Пример #6
0
void WidgetBase::infoSimulation ()
{
    ShowMessageBox (m_widget, GetSimulation ().GetInfo ().c_str ());
}
Пример #7
0
const Foam& WidgetBase::GetFoam (ViewNumber::Enum viewNumber, 
                                 size_t timeStep) const
{
    return GetSimulation (viewNumber).GetFoam (timeStep);
}