24小时热门版块排行榜    

查看: 1803  |  回复: 0

uciqplvtkd

新虫 (初入文坛)

[求助] comsol4.2怎样在matlab中通过函数输出数据

急!comsol4.2怎样在matlab中运行输出数据,怎样通过mpheval等函数读取comsol4.2计算结果。
运行以下代码老是报错:Corrupt P-file "...\COMSOL42\mli\mphplot.p"

import com.comsol.model.*
import com.comsol.model.util.*
model = ModelUtil.create('Model');


model = ModelUtil.create('Model');
% Create the geometry
model.geom.create('geom1', 2);
model.geom('geom1').feature.create('sq1', 'Square');
model.geom('geom1').run;


% Create the mesh
model.mesh.create('mesh1', 'geom1');
model.mesh('mesh1').feature.create('fre1', 'FreeTri');
model.mesh('mesh1').run;
model.mesh('mesh1')



% Setup physics
es=model.physics.create('es', 'Electrostatics', 'geom1');
es.feature('ccn1').set('epsilonr_mat', 1, 'userdef');
es.feature.create('gnd1', 'Ground', 1);
es.feature('gnd1').selection.set([2]);
es.feature.create('sfcd1', 'SurfaceChargeDensity', 1);
es.feature('sfcd1').selection.set([4]);
es.feature('sfcd1').set('rhoqs', 1, '1e-10');
%Create the study
model.study.create('std1');
model.study('std1').feature.create('stat1', 'Stationary');
model.study('std1').run;
% Create a plot group
model.result.create('pg1', 2);
model.result('pg1').set('data', 'dset1');
model.result('pg1').feature.create('surf1', 'Surface');
mphplot(model,'pg1');
figure(2);
mphmesh(model,'mesh1');
回复此楼
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

智能机器人

Robot (super robot)

我们都爱小木虫

相关版块跳转 我要订阅楼主 uciqplvtkd 的主题更新
信息提示
请填处理意见