How to combine 2 cells to make one pde model?
8 ビュー (過去 30 日間)
古いコメントを表示
I receive this error ''Undefined function 'addCell' for input arguments of type 'pde.DiscreteGeometry'. Error in NEW (line 134) TPMSDomainCombine = addCell(gm,gk);'' I was following https://www.mathworks.com/help/pde/ug/discretegeometry.addcell.html
clc
clear
close all
%Create a PDEModel container for a system of three equations.
model = createpde("thermal","transient");
%Import geometry into the container.
gm = importGeometry(model,"D:\GPDnow.stl");
pdegplot(gm,"CellLabels","on","FaceAlpha",0.5)
Nx = 20;
Ny = 20;
Nz = 20;
x = linspace(-5, 5, Nx*10);
y = linspace(0, 1, Ny*1);
z = linspace(0, 1, Nz*1);
[xg, yg, zg] = meshgrid(x, y, z);
Pcube = [xg(:) yg(:), zg(:)];
ttq = alphaShape(Pcube(:,1), ...
Pcube(:,2), ...
Pcube(:,3));
% figure
% plot(ttq,'FaceAlpha',0.4)
% title('domain')
%Recover the triangulation that defines the domain of the alphaShape object.
[tri,loc] = alphaTriangulation(ttq);
%Create a PDE model.
modelCube = createpde;
%Create a geometry from the mesh and import the geometry and the mesh into the model.
gk = geometryFromMesh(modelCube,loc',tri');
pdegplot(gk,"FaceAlpha",0.5,"CellLabels","on")
% title("PDEModel: Cube with Spherical Cavity")
%Combine the models
TPMSDomainCombine = addCell(gm,gk);
pdegplot(TPMSDomainCombine,"FaceAlpha",0.5,"CellLabels","on")
title('()TPMS model')
0 件のコメント
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Geometry and Mesh についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!