Пример #1
0
EXPORT	INTERFACE *f_zoom_interface(
	INTERFACE	*intfc,
	RECT_GRID	*gr,
	float		*L,	/* Lower coord of clip box */
	float		*U,	/* upper coord of clip box */
	float		**Q)	/* Rotation matrix */
{
	INTERFACE	*zoom_intfc;

	DEBUG_ENTER(f_zoom_interface)
	zoom_intfc = i_zoom_interface(intfc,gr,L,U,Q);
	copy_rect_grid(computational_grid(intfc),gr);
	rotate_and_zoom_rect_grid(computational_grid(zoom_intfc),L,U,Q);
	DEBUG_LEAVE(f_zoom_interface)
	return zoom_intfc;
}		/*end f_zoom_interface*/
Пример #2
0
/*ARGSUSED*/
EXPORT	void	get_state_2d_riemann(
	float		*coords,
	Locstate	s,
	COMP_TYPE	*ct,
	HYPER_SURF	*hs,
	INTERFACE	*intfc,
	INIT_DATA	*init,
	int		stype)
{
	int		i,num_sections;
	float		angle,x,y,xm,ym;
	float		*start_angle;
	Locstate	*states;
	RECT_GRID	*gr = computational_grid(intfc);

	debug_print("init_states","Entered get_state_2d_riemann()\n");

	num_sections = Riemann_2d(ct)->num_sections;
	start_angle = Riemann_2d(ct)->start_angle;
	states = Riemann_2d(ct)->states;

	xm = 0.5*(gr->GL[0] + gr->GU[0]);
	ym = 0.5*(gr->GL[1] + gr->GU[1]);
	x = coords[0] - xm;
	y = coords[1] - ym;

	if (x == 0.0)
	    angle = (x > 0.0) ? 0.0 : PI;
	else
	{
	    angle = atan(fabs(y/x));
	    if (x < 0.0 && y > 0.0) 
		angle = PI - angle;
	    else if (x < 0.0 && y < 0.0) 
		angle = PI + angle;
	    else if (x > 0.0 && y < 0.0) 
		angle = 2.0*PI - angle;
	}

	if (angle < start_angle[0] || angle >= start_angle[num_sections-1])
	    set_state(s,stype,states[num_sections-1]);
	else
	{
	    for (i = 0; i < num_sections-1; ++i)
	    {
		if (angle >= start_angle[i] && angle < start_angle[i+1])
	    	    set_state(s,stype,states[i]);
	    }
	}
}	/*end get_state_2d_riemann*/
Пример #3
0
EXPORT	void	bi_interpolate_intfc_states(
	INTERFACE *intfc,
	double alpha,
	double beta,
	double *coords0,
	Locstate s0,
	double *coords1,
	Locstate s1,
	Locstate ans)
{
	if (intfc == NULL)
	    return;
	(*f_user_interface(intfc)._bi_interpolate_intfc_states)(alpha,beta,
				coords0,s0,coords1,s1,
				computational_grid(intfc),ans);
}		/*end bi_interpolate_intfc_states*/
Пример #4
0
EXPORT	boolean	tri_interpolate_intfc_states(
	INTERFACE *intfc,
	double alpha,
	double beta,
	double gamma,
	double *coords0,
	Locstate s0,
	double *coords1,
	Locstate s1,
	double *coords2,
	Locstate s2,
	Locstate ans)
{
	if (intfc == NULL)
	    return FUNCTION_FAILED;
	return (*f_user_interface(intfc)._tri_interpolate_intfc_states)(
			alpha,beta,gamma,coords0,s0,coords1,s1,coords2,s2,
			computational_grid(intfc),ans);
}		/*end tri_interpolate_intfc_states*/