如何用udf编写一个程序,将txt文件的数据导入到fluent中

如何用udf编写一个程序,将txt文件的数据导入到fluent中,第1张

viewHolder.mEditView.setText("" + mDatas.get(position))

viewHolder.mEditView.setOnFocusChangeListener(new OnFocusChangeListener() {

@Override

public void onFocusChange(View arg0, boolean hasFocus)

if (hasFocus) {

viewHolder.mEditView.setSelection(0, mDatas.get(mPosition).lastIndexOf('.'))

} else {

}

}

下面有些路径是根据我自己的程序安装路径。1)set environment variables for Fluent, C++, Fortran//设置FLUENT,c++,Fortran的环境变量;2)put sorce code file into ..\src folder, put compiled fortran .obj files into ..\ntx86\2d folder, copy sed.exe, user_nt.udf and makefile_nt.udf to the same folder as compiled fortran .obj files(this two folders are created by yourself, you can put them under your case folder).将源文件代码放入\src文件夹下,将编译之后的fortran的.obj文件放在路径为···\ntx86\2d的文件夹下,复制文件sed.exe,user_nt.udf和makefile_nt.udf文件到路径为···\ntx86\2d的文件夹下(这两个是自己创建的,你可以放它们在你的case文件夹下)。3)modify user_nt.udf file {follow the instructions. e.g. USER_OBJECTS = test.obj this obj file is the complied fortran .obj file ,SOURCES = &#36(SRC)test_use.c(c source file that is in the \src fold), VERSION = 2d(your model dimension), PARALLEL_NODE = none按下面的方法修改user_nt.udf文件:USER_OBJECTS = test.obj // test是你编译之后的fortran程序文睁搏伏件名;SOURCES = &#36(SRC)test_use.c(text_use.c是你放入\src文件下的c程序的源码银喊文件) ;VERSION = 2d //为你模型的维数。PARALLEL_NODE = none//是否并悉携行计算,一般选择不并行计算。4)change the name of file makefile_nt.udf tomakefile, modify makefile, (add this line "FLUENT_INC= D:\Fluent.Inc" below "UDFDATA = udf_names.c"改变makefile_nt.udf的文件名为:makefile;并且添加在UDFDATA = udf_names.c这行后面添加FLUENT_INC= D:\Fluent.Inc;* 5)You might need to copy all the .lib files under Fortran\lib fold to folder D:\Fluent.Inc\fluent6.3.26\ntx86\Fortran_lib (this folder is created by myself) change this line "LIBS = /Libpath:&#36(FLUENT_INC)\fluent&#36(RELEASE)\&#36(FLUENT_ARCH)\&#36(VERSION)" in the makefile file to "LIBS = /Libpath:&#36(FLUENT_INC)\fluent&#36(RELEASE)\&#36(FLUENT_ARCH)\&#36(VERSION)D:\Fluent.Inc\fluent6.3.26\ntx86\Fortran_lib\*.lib"你需要复制fortran的库文件到fluent的安装文件D:\Fluent.Inc\fluent6.3.26\ntx86\Fortran_lib(其中Fortran_lib为自己创建的文件名);并且改变makefile文件中的行LIBS = /Libpath:&#36(FLUENT_INC)\fluent&#36(RELEASE)\&#36(FLUENT_ARCH)\&#36(VERSION)为LIBS = /Libpath:&#36(FLUENT_INC)\fluent&#36(RELEASE)\&#36(FLUENT_ARCH)\&#36(VERSION)6)Type "nmake" in the command line console, make sure the console is displaying the right path that is including your files such as: "makefile",".obj","sed.exe".在编译之后,确保在fluent的界面中出现,文件"makefile",".obj","sed.exe".的正确路径。7)Put the generated .dll file with your .cas and .data files together.连接你的dll文件和你的case文件和date文件一起。

背景

在上一篇推文中,我们介绍了 MySQL Group Replication 8.0.16 支持信息碎片化功能来增强大型事务处理能力。

如果您想在组复咐激制中使用该功能,则任何组成员版本都不能低于 8.0.16!

简单地说就是由于低版本协议上不支持。MySQL 8.0.16 的组通讯开始支持新协议,简称“分段协议”,之前的版本中只有一种“压缩协议”。

如果多个成员想加入复制组,那么在协议匹配上遵循以下原则:

现有复制组成员和新加入成员版本相同,加入成功。

低版本仿凯成员想加入高版本的组会被驱逐,加入失败。

高版本的成员想加入低版本的组,单独加入成功,多个加入失败。

例如:

一个 MySQL Server 8.0.16 实例可以成功加入使用通信协议版本 5.7.24 的组。

一个 MySQL Server 5.7.24 实例无法成功加入使用通信协议版本 8.0.16 的组。

两个 MySQL Server 8.0.16 实例无法同时加入使用通信协议版本 5.7.24 的组。

两个 MySQL Server 8.0.16 实例可以同时加入使用通信协议版本 8.0.16 的组。

新增 UDF

为了能让高版本的复制组更便于加入低版本的成员,MySQL 8.0.16 新增两个 UDF。

您可以使用两个新的 UDF 命令去管理组通信协议:

1. group_replication_set_communication_protocol(new_protocol)

设置组复制通讯协议版本

SELECT group_replication_set_communication_protocol("8.0.15")

填入一个所有成员都支持的版本号,即:new_protocol ≤ 所有成员的 MySQL版本。

new_protocol 格式:major.minor.patch (主版本号.次版本号.发布版本号)例如:8.0.15。

2. group_replication_get_communication_protocol()

获取复制中最旧成员的 MySQL 版本号

SELECT group_replication_get_communication_protocol()   +------------------------------------------------+    | group_replication_get_communication_protocol() |    +------------------------------------------------+    | 5.7.14                                         |    +------------------------------------------------+

获取的版本号可能与设置的值不一致,但不一致的版本之间组复制协议是一样的。

返回结果格式:major.minor.patch (主版本号.次版本号.发布版本号)例如:8.0.15。

以上两个 UDF 对全部组成员有效,主机或从机上均可执行。

结论

若想使用衡大袜信息碎片功能。建议将组复制成员全部升级为 8.0.16。

若组内成员版本仅有部分为 8.0.16,可以用两个新的函数来让高版本的成员保持与其它成员组协议一致。

请点击输入图片描述


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/yw/12320813.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-24
下一篇 2023-05-24

发表评论

登录后才能评论

评论列表(0条)

保存