How to combine 2 cells to make one pde model?

조회 수: 9 (최근 30일)
Kabo
Kabo 2023년 10월 10일
편집: Dyuman Joshi 2023년 10월 10일
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");
Error using importGeometry
File D:\GPDnow.stl does not exist.

Error in pde.EquationModel/importGeometry (line 46)
gm = importGeometry(geofilename,varargin{:});
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개)

카테고리

Help CenterFile Exchange에서 Geometry and Mesh에 대해 자세히 알아보기

태그

제품


릴리스

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by