How to combine 2 cells to make one pde model?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Antworten (0)
Siehe auch
Kategorien
Mehr zu Geometry and Mesh finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!