|
软件工程硕士论文实现工程软件计算过程图形交互的一种方法
Realization of software engineering calculation process of interactive a method
VF provide the multithreaded make up interface, which can be realized in multiple linear programming. But the numerical calculation speed higher requirements, can be made to realize the interaction interaction multithreaded way. The specific implementation of the numerical calculation of setting of source code mark, and for related data storage space distribution; The numerical calculation thread priority set higher, with interactive thread detect the state of numerical thread. When graphics display signs for a complete data amount; In a free computer resources to activate graphics thread, detect signs quantity, and reads the storage data interactive. But interactive and not calculated the current state of the thread, to the judge and interrupt bring certain difficulties. When the numerical calculation speed demand is not high, can simply by a single thread method. Interactive data needed is ready, will process control to interactive; Interactive complete to control over to numerical calculation. Finally, be sure executive points each. It refers to in the realization of multithreaded numerical thread for signs of quantity and single thread in the realization of the numerical calculation process control passed to the place. This step the work must use the front to get data flow chart and KuangJiaTu program. Through the data flow chart, can determine the key data in the numerical calculation of generating method; Combined with program flow chart, can be in numerical calculation or determine interactive executive points.
vF提供了多线程编接口,可方便地实现多线编程。但数值计算的速度要求较高时,可采用多线程交互方式来实现交互。具体实现中可在数值计算源代码中设置标志量,并为相关数据分配存储空间;将数值计算线程优先级设置较高,用图形交互线程侦测数值线程的状态。当图形显示所数据齐备标志量为真;在有空闲计算机资源时激活图形线程,侦测标志量,并读取存储数据进行图形交互。但是图形交互并不是计算线程的当前状态,这给判断和中断带来一定的困难。当数值计算的速度要求不高时,可以简单地采用单线程的方法。图形交互所需数据齐备时,将进程控制交给图形交互;交互完成后再将控制权转交给数值计算。最后,要确定互执行点。它指多线程实现中数值线程置标志量或单线程实现中数值计算的进程控制权转交处。这步工作中要用到前面得到的数据流图和程序框架图。通过数据流图,可确定数值计算中关键数据的生成方式;结合程序流程图,可在数值计算或确定交互执行点。
1.分析阶段可以利用原需求规格文档来初步确认计算过程中涉及的关键数据及其关系,利用原数据流图和程序流程图来辅助图形交互方式的设计。如果缺乏这些资料,可采用以下来步骤完成分析工作:追踪源代码执行过程一,得到程序流程图2、在流程图的辅助下,追踪产生数据流图3、分析关键数据及其关系,建立数据字典上述步骤通常要往复来回,逐步求精。其中关键数据是指用户关心的数据及与其紧密相关数据,它的确定要依据用户需求和算法结构两方面来考虑。
2.设计阶段首先,要确定哪些关键数据将在屏幕显示,并确定其显示方式。关键数据一般包括用户关心数据、图从事贸易、坐标和其控制参数。其次,要对这些数据分类,初步考虑其屏幕布局。一般采用多窗口形式实现各类数据的显示。注意,工程软件一般都有字符形式的屏幕输出,并且输出内容的价值较高。对部分内容可以转换成图形方式在分类窗口中显示;其它内容可专设一个窗口嘲行字符
3.实现阶段这是软件升级中关键的一部分。依据前面的分析,选用VF编译器的QuickWin模式来实现图形交互。
首先,用VF的Application Wizard创建一个QuickWin工程;将原代码的备份添加到工程试编译,确认编译通过并能顺利运行。此时将出现含有菜单项的单窗口界面,其窗口将用字符方式显示原Fortran程序的屏幕输出随后要进行图形模块初始化。可以在主程序中调用子程序来实现,其中包括设置初始主窗口大小,注册子窗口,设计菜单,指定坐标系统,设置初始活动窗口,绘制固定图形(坐标、表格)等工作。有两点要特别指出:
(1)所有利用QuickWin图形库的子程序都必须访问DFLIB模块。由于DFLIB模块中的INTERFACE语句必须在程序的主体之前出现,所以一般都将包含模块的语句USEDFLIB放在子程序的最前面。
(2)如果要求初始主窗口和菜单不采用默认设置,可定义自己的INITIALSETTINGS函数。用户不必在程序中调用,编译器会自动选择用户定义的函数进行初始化。(注意不能在这个函数中定义子窗口和改变大小)附录B中给出了部分增强QuickWin应用程序的函数,这部分函数能极大地提供便利,实现众多的功能。接下来的工作就随工程软件不同而相异。但是大致可先在各交互执行点调用空的图形子程序或设置标志量,随后实现各子程序或对标志量的处理。下面的建议仅供参考:
4.测试阶段这部分工作主要是与前后处理部分连接,组成功能完善的软件。对于没有改变I/O接口,又用Shell方式内嵌到前后处理的软件,这部分工作只要让Shell找到新开发的可执行文件。如果输入输出接口改变,则必须先统一接口,而后定位新的可执行文件。与前后处理连接为整软件以后,要进行必要的测试。由于软件升级是在对数值计算部分把握不充分的情况下进行,分析的时候容易遗漏部分特殊算例,而这些算例经常会使得图形示变得杂乱,此时要求回到QuickWin模式重新开发。
Five, implement instances full 3 d hydraulic fracturing numerical simulation software in guiding hydraulic fracturing the exploitation of oil plays an important role. The existing software before and after processing using VB prepare and provide a database support, to be able to complete the data processing before preparation, provide a comprehensive analysis of the post-processing. It's part Fortran77 numerical simulation of development, with Shell way before and after treatment with connection. Numerical simulation of the finite element method solution partial differential equations, and involves the fluid-solid coupling, rock fracture, temperature field distribution, support agent in many ways, such as transportation, is a highly complex analysis process. During simulation software only simple screen output, http://www.e-lunwen.com/rjgcshlw/ unable to show users care about the cracks of the extension, temperature field distribution and support agent concentration distribution. In this case the method used successfully realized the software to simulate the process of interactive.
五、实现实例全三维水力压裂数值模拟软件在指导水力压裂开采石油中发挥着重要的作用。现有软件的前后处理部分采用VB编制,并提供了数据库支持,能够完成前处理部分的数据准备,提供较全面的后处理分析。它的数值模拟部分利用Fortran77开发,用Shell方式与前后处理连接。数值模拟采用有限元法解偏微分方程组,并涉及到流固耦合、岩石断裂、温度场分布、支撑剂输送等多个方面,是一个高度复杂的分析过程。软件在模拟过程只有简单的屏幕输出,无法显示用户关心的裂缝延伸、温度场分布和支撑剂浓度分布。本例采用前述方法成功地实现了此软件模拟过程的图形交互。
六、结语本言语通过比较实现计算过程图形交互的各种方案,选VF编译器作为实现工具。并提出涵盖分析到测试的实现方法,实现了石油天然气总公司95攻关项目中全三维水力压裂数值模拟软件的计算过程图形交互。本文方法的特点是能方便可靠地解决实际工程软件中大量存在的问题,为工程软件分阶段,分步聚升级提供了可行方案。
(责任编辑:工程师职称论文代写) |