Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

代码块显示不正常bug: #50

Closed
winsway opened this issue Oct 9, 2023 · 8 comments
Closed

代码块显示不正常bug: #50

winsway opened this issue Oct 9, 2023 · 8 comments
Labels
bug Something isn't working

Comments

@winsway
Copy link

winsway commented Oct 9, 2023

是什么 Halo 版本出现了此问题?

2.9

使用的 Dream 版本是多少?

1.1.1

在线博客地址

No response

BUG 内容

image
具体代码为

import os
from paraview.simple import *
# 定义新文件夹的名称
folder_name = "cPlaneTime"

# 获取当前工作目录
current_directory = os.getcwd()

# Print the current working directory using the specified encoding
print("Current working directory:", current_directory.encode('utf-8', errors='replace').decode('utf-8'))


# Build the full file path
file_path = os.path.join(current_directory, 'case.foam')
# 检查文件是否存在
if not os.path.exists(file_path):
    # 如果文件不存在,创建一个空的 case.foam 文件
    with open(file_path, 'w') as file:
        pass  
    print(f"File 'case.foam' has been created in the current directory.")
else:
    print(f"File 'case.foam' already exists in the current directory.")
    
# Print the full file path
print("Full file path:", file_path)

# 构建 postProcessing 文件夹的完整路径
postprocessing_directory = os.path.join(current_directory, "postProcessing")

# 创建 test 文件夹的完整路径
new_folder_path = os.path.join(postprocessing_directory, folder_name)

# 检查文件夹是否已经存在,如果不存在则创建
if not os.path.exists(new_folder_path):
    os.mkdir(new_folder_path)
    print(f"Folder '{folder_name}' has been created in the current directory.")
else:
    print(f"Folder '{folder_name}' already exists in the current directory.")

casefoam = OpenFOAMReader(registrationName='case.foam', FileName=file_path)
casefoam.MeshRegions = ['internalMesh']
casefoam.CellArrays = ['Q', 'U', 'UMean', 'UPrime2Mean', 'alpha.water', 'force', 'k', 'moment', 'nut', 'omega', 'p', 'pMean', 'pPrime2Mean', 'p_rgh', 'surfaceTension', 'vorticity']

# Properties modified on casefoam
casefoam.CellArrays = ['U', 'alpha.water', 'vorticity']
casefoam.Decomposepolyhedra = 0

# create a new 'Slice'
slice1 = Slice(registrationName='Slice1', Input=casefoam)
slice1.SliceType = 'Plane'
slice1.HyperTreeGridSlicer = 'Plane'
slice1.SliceOffsetValues = [0.0]

# init the 'Plane' selected for 'SliceType'
slice1.SliceType.Origin = [-9.080395102500916e-08, -1.30385160446167e-08, 0.05999999865889549]

# init the 'Plane' selected for 'HyperTreeGridSlicer'
slice1.HyperTreeGridSlicer.Origin = [-9.080395102500916e-08, -1.30385160446167e-08, 0.05999999865889549]

# Properties modified on slice1.SliceType
slice1.SliceType.Origin = [0.0, 0.0, 0.06]
slice1.SliceType.Normal = [0.0, 1.0, 0.0]

# toggle 3D widget visibility (only when running from the GUI)
Hide3DWidgets(proxy=slice1.SliceType)
file_path = os.path.join(new_folder_path,'plane.csv')

# save data
SaveData(file_path, proxy=slice1, WriteTimeSteps=1,
    ChooseArraysToWrite=1,
    PointDataArrays=['U', 'alpha.water', 'vorticity'],
    UseScientificNotation=1,
    AddTime=1)

相关 Console 日志输出

No response

附加信息

No response

@winsway winsway added the bug Something isn't working label Oct 9, 2023
@nineya
Copy link
Owner

nineya commented Oct 9, 2023

未能成功复现该问题

@winsway
Copy link
Author

winsway commented Oct 9, 2023 via email

@nineya
Copy link
Owner

nineya commented Oct 9, 2023

提供下这个问题页面地址看看

@winsway
Copy link
Author

winsway commented Oct 9, 2023 via email

@winsway
Copy link
Author

winsway commented Oct 9, 2023 via email

@nineya
Copy link
Owner

nineya commented Oct 9, 2023

image
文档渲染的html结果已经错了,问题与主题无关,检查一下编辑器和插件吧

@winsway
Copy link
Author

winsway commented Oct 9, 2023 via email

@winsway
Copy link
Author

winsway commented Oct 9, 2023 via email

@nineya nineya closed this as completed Oct 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants