提交 c08cba2b 编写于 作者: W weixin_51511955

Wed May 8 00:00:00 CST 2024 inscode

上级 2eebcf6c
run = "pip install -r requirements.txt;python main.py" run = "pip install -r requirements.txt;python main.py"
language = "python"
[packager] [packager]
AUTO_PIP = true AUTO_PIP = true
...@@ -9,4 +10,7 @@ PATH = "${VIRTUAL_ENV}/bin:${PATH}" ...@@ -9,4 +10,7 @@ PATH = "${VIRTUAL_ENV}/bin:${PATH}"
PYTHONPATH = "$PYTHONHOME/lib/python3.10:${VIRTUAL_ENV}/lib/python3.10/site-packages" PYTHONPATH = "$PYTHONHOME/lib/python3.10:${VIRTUAL_ENV}/lib/python3.10/site-packages"
REPLIT_POETRY_PYPI_REPOSITORY = "http://mirrors.csdn.net.cn/repository/csdn-pypi-mirrors/simple" REPLIT_POETRY_PYPI_REPOSITORY = "http://mirrors.csdn.net.cn/repository/csdn-pypi-mirrors/simple"
MPLBACKEND = "TkAgg" MPLBACKEND = "TkAgg"
POETRY_CACHE_DIR = "/root/${PROJECT_DIR}/.cache/pypoetry" POETRY_CACHE_DIR = "/root/${PROJECT_DIR}/.cache/pypoetry"
\ No newline at end of file
[debugger]
program = "main.py"
{ pkgs }: { function[P,T]=rectangle_mesh_2D(area,h_partition )
deps = [ colormap( jet (37));
pkgs.python310Packages.pip left=area (1);
pkgs.python310Full right=area(2);
]; bottom=area(3);
} top=area(4);
\ No newline at end of file h=h_partition;
N1=(right-left)/h(1);
N2=(top-bottom)/h(2);
tnp=(N1+1)*(N2+1);
P=zeros(tnp,2);
T=zeros(N1*N2,4);
Q=zeros(N1+1,N2+1);
for j=1:tnp
if mod(j,N2+1)==0
P(j,1)=left+(j/(N2+1)-1)*h(1);
P(j,2)=top;
else
P(j,1)=left+fix(j/(N2+1))*h(1);
P(j,2)=bottom+(mod(j,N2+1)-1)*h(2);
end
end
for i=1:N1+1
for j=1:N2+1
Q(i,j)=(i-1)*(N2+1)+j;
end
end
triangular elements whose element indices are 2n-1 and 2n. for n=1:N1*N2
if mod(n,N2)==0
row=N2;
column=n/N2;
else
row=mod(n ,N2);
column=fix (n/N2)+1;
end
T(n,1)=Q(column,row);
T(n,2)=Q(column+1,row);
T(n,3)=Q(column+1,row+1);
T(n,4)=Q(column ,row+1);
end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册