Quantcast
Channel: COMSOL Forums: postint over multiple FEMs
Viewing all articles
Browse latest Browse all 12

Re: postint over multiple FEMs

0
0


Hello, I think I have a solution.

to integrate two different postevaluate quantities, I use this script and it works well.


% First, you "must" create a fem object with two applications mode (your case) or more applications.
% exemple for N application (It's my script for EMconductiveMediaDC) :



for i=1:N;

clear appl
appl.mode.class = ...;
appl.module = ...;

appl.dim={(sprintf('V%i',i))}; % My case, I solve electrical potential "V"
appl.sshape = ...;

appl.name = (sprintf('emdc%i',i)); % ...
appl.assignsuffix=(sprintf('_emdc%i',i));

clear pnt
pnt.Qj0 = ...;
pnt.ind = ...;
appl.pnt = ...;

clear bnd
bnd.type = ...;
bnd.ind = ...;
appl.bnd = ...;

clear equ
equ.sigma = ...;
equ.ind = ...;
appl.equ = equ;
fem.appl{i} = appl;

end

fem.frame = {'ref'};
fem.border = 1;
clear ode
clear units;
units.basesystem = 'SI';
ode.units = units;
fem.ode=ode;
fem=multiphysics(fem);
fem.xmesh=meshextend(fem);


% Now, you have the structure without solutions %

% I store before all fem object (two in your case) in a FEMS object :
% FEMS{1} = fem1;
% FEMS{2} = fem2; ... ; It's just to concatenate solutions

conc=[];
for i=1:N
u=FEMS{i}.sol.u;
conc=[conc , u];
end

solution=reshape(conc',[],1);
fem.sol=femsol(solution);

% Now, you have your object with all applications mode, so you can use the "postint function" %

Partial_der = postint ( fem , ' Pozav_rfwv1 * Pozav_rfwv2 ' , '' dl '' , [...] );

% Pozav_rfwv1 = application mode 1, Pozav_rfwv2 = application mode 2 %









Viewing all articles
Browse latest Browse all 12

Latest Images

Trending Articles





Latest Images