quiver Subroutine

public subroutine quiver(x, y, u, v, s, c, scaling, lineColor, lineStyle, lineWidth)

Plot vectors

Arguments

Type IntentOptional AttributesName
real(kind=wp), intent(in), dimension(:):: x

x-positions of vectors

real(kind=wp), intent(in), dimension(:):: y

y-positions of vectors

real(kind=wp), intent(in), dimension(:,:):: u

u-components of vectors

real(kind=wp), intent(in), dimension(:,:):: v

v-components of vectors

real(kind=wp), intent(in), optional dimension(:,:):: s

Scale of vectors

real(kind=wp), intent(in), optional dimension(:,:):: c

Color values for vectors

real(kind=wp), intent(in), optional :: scaling

Scaling of vectors < 0 = Automatic, then scaled 0 = Automatic

0 = Directly scaled

character(len=*), intent(in), optional :: lineColor

Color of vectors

character(len=*), intent(in), optional :: lineStyle

Style of vectors' lines

real(kind=wp), optional :: lineWidth

Width of vectors' lines

Calls

proc~~quiver~~CallsGraph proc~quiver quiver plcol1 plcol1 proc~quiver->plcol1 plvect plvect proc~quiver->plvect interface~mixval mixval proc~quiver->interface~mixval
Help

Called By

proc~~quiver~~CalledByGraph proc~quiver quiver proc~doquiver doQuiver proc~doquiver->proc~quiver program~examples_prg examples_prg program~examples_prg->proc~doquiver
Help

Source Code


Source Code

	subroutine quiver(x,y,u,v,s,c,scaling,lineColor,lineStyle,lineWidth)
		!! Plot vectors
		real(wp),dimension(:),intent(in)::x
			!! x-positions of vectors
		real(wp),dimension(:),intent(in)::y
			!! y-positions of vectors
		real(wp),dimension(:,:),intent(in)::u
			!! u-components of vectors
		real(wp),dimension(:,:),intent(in)::v
			!! v-components of vectors
		real(wp),dimension(:,:),intent(in),optional::s
			!! Scale of vectors
		real(wp),dimension(:,:),intent(in),optional::c
			!! Color values for vectors
		real(wp),intent(in),optional::scaling
			!! Scaling of vectors
			!! < 0 = Automatic, then scaled
			!!   0 = Automatic
			!! > 0 = Directly scaled
		character(*),intent(in),optional::lineColor
			!! Color of vectors
		character(*),intent(in),optional::lineStyle
			!! Style of vectors' lines
		real(wp),optional::lineWidth
			!! Width of vectors' lines
		
		real(pp),dimension(:),allocatable::xl,yl
		real(pp),dimension(:,:),allocatable::ul,vl,sl
		real(pp),dimension(2)::xb,yb,sb,cb,d
		real(pp)::scalingl,scl,mag,clr
		integer::i,j
		
		xl = localize(x)
		yl = localize(y)
		ul = localize(u)
		vl = localize(v)
		
		d = real([x(2)-x(1),y(2)-y(1)],pp)
		
		xb = real(mixval(x),pp)
		yb = real(mixval(y),pp)
		if(present(s)) then
			sl = localize(s)
			sl = sl/maxval(sl)
		else
			sl = localize(u**2+v**2)
			sl = sqrt(sl)
			sl = sl/maxval(sl)
		end if
		sb = [minval(sl),maxval(sl)]
		cb = 0.0_wp
		if(present(c)) cb = real([minval(c),maxval(c)],pp)
		
		scalingl = 1.0_pp
		if(present(scaling)) scalingl = real(scaling,pp)
		
		if(present(lineColor)) call setColor(lineColor)
		if(present(lineStyle)) call setLineStyle(lineStyle)
		if(present(lineWidth)) call setLineWidth(lineWidth)
		
		do i=1,size(u,1)
			do j=1,size(u,2)
				mag = norm2([ul(i,j),vl(i,j)])
				scl = scalingl*norm2(d)*sl(i,j)
				if(abs(scl)<1.0E-5_wp) cycle
				if(present(c)) then
					clr = real( (c(i,j)-cb(1))/(cb(2)-cb(1)) ,pp)
					clr = max(clr,0.0_pp)
					clr = min(clr,1.0_pp)
					call plcol1( clr )
				end if
				call plvect(ul(i:i,j:j)/mag,vl(i:i,j:j)/mag,scl,xl(i:i),yl(j:j))
			end do
		end do
		
		call resetPen()
	end subroutine quiver


abs abs_t acos_t ad_t add_t arg arrayToChar asin_t assignment(=) atan_t bar barh biCGSTAB_t biConjugateGradientStabilized binData box charToArray checkPrecision colorbar colorbar2 colorize colorMap config_t conjg conjugateGradient conjugateGradient_t contour contourf cos_a cos_t cpuTime cubicSpline_t deDup DFT div_t doBar doContour doError doFillBetween doFunction doHist doLegend doLogPlot doPlot doQuiver doScatter doSurface endsWith errorbar eval_test eval_testN evalR_abs evalR_acos evalR_add evalR_asin evalR_atan evalR_cos evalR_div evalR_exp evalR_imag evalR_log evalR_log10 evalR_mul evalR_neg evalR_p evalR_pow evalR_real evalR_sin evalR_sqrt evalR_sub evalR_tan evalR_var evalZ_abs evalZ_acos evalZ_add evalZ_asin evalZ_atan evalZ_cos evalZ_div evalZ_exp evalZ_imag evalZ_log evalZ_log10 evalZ_mul evalZ_neg evalZ_p evalZ_pow evalZ_real evalZ_sin evalZ_sqrt evalZ_sub evalZ_tan evalZ_var exp exp exp_t f FFT FFT_freq figure fillBetween fillBetweenx findInterval flatten function_t gaussSeidel gaussSeidel_t hist iDFT iFFT imag_t intToChar inv jacobi jacobi_t labels legend linearInterp linearSpline_t lineSearch_t linspace log log log10 log10 log10_t log_t makeLogo matmul matmul maxval mean meshGridX meshGridY minimumResidual minval mixval mul_t neg_t newAbs newAcos newAdd newAsin newAtan newCos newDiv newExp newImag newIterator newLog newLog10 newMul newNeg newNodeStack newPow newReal newSin newSparse newSpvec newSqrt newSub newTan newToken newVar nint nodeStack_t norm2 norm2 operator(*) operator(*) operator(*) operator(**) operator(+) operator(+) operator(+) operator(-) operator(-) operator(.d.) operator(.o.) operator(.o.) operator(.oo.) operator(.sx.) operator(.x.) operator(/) operator(/) operator(<) operator(>) plot plot3 pop pow_t printTypes push quat_t quiver randomNormal randomUniform readGrid readStep real_t realToChar realToTime removeSpaces scaler scatter setRandomSeed setup show showProgress sin_a sin_t solveLU solveLU solverProgress SOR_t span sqrt sqrt_t startReport startsWith stDev steepestDescent sub_t subplot successiveOverRelaxation sum sum surface symmetricGaussSeidel symmetricSuccessiveOverRelaxation tan_a tan_t TDMA TDMA testBasic testBasicSolvers testColorize testColorMap testConstants testCpuTime testDeDup testDiff testDot testEndsWith testFFT testFlatten testFunction testIFFT testIntToChar testLinearInterp testLinspace testLU testMean testMeshGrid testMixval testNewConfig testNewSparse testNewSpline testNext testObjective testObjectiveN testPlot testPrecision testRandomNormal testRandomUniform testRead testReadGmsh testRealToChar testRealToTime testRemoveSpaces testSetRandomSeed testSolvers testSpan testSplineX testSpvec testStartsWith testStDev testTDMA testWallTime testWrite testWriteMat testWriteVTK testWriteVTK ticks title token_t tokenize toRPN transpose v2m var_t vector wait wallTime wireframe writeGrid writeGridVTK writeHeaderVTK writeMat writeScalarVTK writeStep writeVectorVTK xlabel xlim xticks xylim xyzlim ylabel ylim yticks