251251
252252 end
253253
254- function jumpConditions = solve(obj , mixArray , varargin )
254+ function [ jumpConditions , mixArray1 , mixArray2 ] = solve(obj , mixArray , varargin )
255255 % Solve the jump conditions for the given mixture
256256 %
257257 % Args:
275275 obj.time = tic ;
276276
277277 % Compute jump conditions
278- jumpConditions = getJumpData(obj );
278+ [ jumpConditions , mixArray1 , mixArray2 ] = getJumpData(obj );
279279
280280 % Solve Gammas (calorically perfect gas)
281281 if obj .equilibriumSolver .caloricGasModel .isPerfect()
282282 [jumpConditions .Gammas1 , jumpConditions .Gammas2 , jumpConditions .Gammas3 ] = obj .getGammasPerfect(jumpConditions .gamma1 , jumpConditions .M1 );
283283
284- % Interpolate results into a smaller grid
285- reduceSize(obj , jumpConditions );
284+ % Interpolate results into a smaller grid (only if nargout == 1)
285+ if nargout == 1
286+ jumpConditions = reduceSize(obj , jumpConditions );
287+ end
286288
287289 % Timer
288290 obj.time = toc(obj .time );
297299 jumpConditions.Gammas1 = getGammas1(obj , jumpConditions );
298300 jumpConditions.Gammas3 = getGammas3(obj , jumpConditions );
299301
300- % Interpolate results into a smaller grid
301- jumpConditions = reduceSize(obj , jumpConditions );
302+ % Interpolate results into a smaller grid (only if nargout == 1)
303+ if nargout == 1
304+ jumpConditions = reduceSize(obj , jumpConditions );
305+ end
302306
303307 % Clean instabilities close to 0/0
304308 jumpConditions = obj .cleanInstabilities(jumpConditions );
@@ -422,7 +426,7 @@ function printTime(obj)
422426
423427 methods (Access = private )
424428
425- function jumpConditions = getJumpData(obj )
429+ function [ jumpConditions , mixArray1 , mixArray2 ] = getJumpData(obj )
426430 % Get jump conditions
427431 %
428432 % Args:
@@ -432,6 +436,8 @@ function printTime(obj)
432436 %
433437 % Returns:
434438 % jumpConditions (struct): Structure containing the jump conditions
439+ % mixArray1 (Mixture): Mixture object for the pre-shock state
440+ % mixArray2 (Mixture): Mixture object for the post-shock state
435441
436442 % Print status
437443 fprintf(' Solving jump conditions... ' );
0 commit comments