C INTERNATIONAL AVS CENTER C (This disclaimer must remain at the top of all files) C C WARRANTY DISCLAIMER C C This module and the files associated with it are distributed free of charge. C It is placed in the public domain and permission is granted for anyone to use, C duplicate, modify, and redistribute it unless otherwise noted. Some modules C may be copyrighted. You agree to abide by the conditions also included in C the AVS Licensing Agreement, version 1.0, located in the main module C directory located at the International AVS Center ftp site and to include C the AVS Licensing Agreement when you distribute any files downloaded from C that site. C C The International AVS Center, MCNC, the AVS Consortium and the individual C submitting the module and files associated with said module provide absolutely C NO WARRANTY OF ANY KIND with respect to this software. The entire risk as to C the quality and performance of this software is with the user. IN NO EVENT C WILL The International AVS Center, MCNC, the AVS Consortium and the individual C submitting the module and files associated with said module BE LIABLE TO C ANYONE FOR ANY DAMAGES ARISING FROM THE USE OF THIS SOFTWARE, INCLUDING, C WITHOUT LIMITATION, DAMAGES RESULTING FROM LOST DATA OR LOST PROFITS, OR ANY C SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES. C C This AVS module and associated files are public domain software unless C otherwise noted. Permission is hereby granted to do whatever you like with C it, subject to the conditions that may exist in copyrighted materials. Should C you wish to make a contribution toward the improvement, modification, or C general performance of this module, please send us your comments: why you C liked or disliked it, how you use it, and most important, how it helps your C work. We will receive your comments at avs@ncsc.org. C C Please send AVS module bug reports to avs@ncsc.org. C C "@(#)cd_scale.f 1.1 Stardent 90/03/23" C Copyright (c) 1989 by C Stardent Computer Inc. C All Rights Reserved C C c *--------------------------------------------------------* c * * c * **** cd_scale **** * c * * c * compute the deformation magnification scale. * c * * c * cd_scale.f * c *--------------------------------------------------------* real function comp_def_scale (num_nodes, num_node_data, & num_states, node_data, state, model_extent, def_fact) include 'read_dyna3d.h' integer num_nodes, num_node_data, num_states, state real def_fact, model_extent(6), 1 node_data(num_nodes, num_node_data, num_states) integer i real dx, dy, dz, maxx, maxy, maxz, minx, miny, minz, max_dim, & ddx, ddy, ddz, max_disp, x, y, z c ************** c *** body *** c ************** minx = node_data(1, 2, state) maxx = minx miny = node_data(1, 3, state) maxy = miny minz = node_data(1, 4, state) maxz = minz do i = 1, num_nodes x = node_data(i, 2, state) y = node_data(i, 3, state) z = node_data(i, 4, state) if (x .gt. maxx) maxx = x if (x .lt. minx) minx = x if (y .gt. maxy) maxy = y if (y .lt. miny) miny = y if (z .gt. maxz) maxz = z if (z .lt. minz) minz = z end do dx = model_extent(2) - model_extent(1) dy = model_extent(4) - model_extent(3) dz = model_extent(6) - model_extent(5) if (dx .gt. dy) then max_dim = dx else max_dim = dy end if if (dz .gt. max_dim) max_dim = dz ddx = maxx - minx ddy = maxy - miny ddz = maxz - minz if (ddx .gt. ddy) then max_disp = ddx else max_disp = ddy end if print *, '=======================' print *, ' max disp: ', max_disp print *, '=======================' if (ddz .gt. max_disp) max_disp = ddz if (max_disp .ne. 0.0) then comp_def_scale = def_fact * max_dim / max_disp / 50.0 else comp_def_scale = 0.0 end if return end