Skip to content

Commit

Permalink
Merge pull request #446 from ONSAS/jorge
Browse files Browse the repository at this point in the history
add matrices export global option
  • Loading branch information
jorgepz committed Mar 28, 2022
2 parents 9c83088 + 0bc9fbd commit 32863f1
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 65 deletions.
2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ authors:
- family-names: "Toro"
given-names: "Sebastián"
title: "ONSAS.m: an Open Nonlinear Structural Analysis Solver for GNU-Octave/Matlab"
version: 0.2.5
version: 0.2.6
url: "https://github.com/ONSAS/ONSAS.m"
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Name: ONSAS
Version: 0.2.5
Date: 2022-26-02
Version: 0.2.6
Date: 2022-28-03
Author: Pérez Zerpa, Jorge M. and Bazzano García, Juan Bruno and Viera Sosa, Joaquin and Vanzulli Pena, Mauricio and Forets, Marcelo and Battini, Jean-Marc and Toro, Sebastián
Maintainer: Pérez Zerpa, Jorge M. (jorgepz@fing.edu.uy)
Title: ONSAS: an Open Nonlinear Structural Analysis Solver
Title: ONSAS.m: an Open Nonlinear Structural Analysis Solver
Description: ONSAS is a GNU-Octave code for static/dynamic and linear/non-linear analysis of structures including, solids, beams, truss or plane structures.
Categories: package
License: GPLv3+
5 changes: 4 additions & 1 deletion examples/springMass/springMass.m
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
elements(1).elemType = 'node' ;
elements(2).elemType = 'truss';
elements(2).elemCrossSecParams = {'circle', [sqrt(4*A/pi) ] } ;
elements(2).elemTypeParams = 0
elements(2).elemTypeParams = 0 ;
%md
%md### Boundary conditions
%md
Expand Down Expand Up @@ -103,6 +103,8 @@
analysisSettings.stopTolIts = 10 ;
%md
otherParams.problemName = 'springMass' ;
global exportFirstMatrices
exportFirstMatrices = true ;
%md
[matUsNewmark, loadFactorsMat] = ONSAS( materials, elements, boundaryConds, initialConds, mesh, analysisSettings, otherParams ) ;
times = 0:analysisSettings.deltaT:(analysisSettings.finalTime+analysisSettings.deltaT) ;
Expand All @@ -112,6 +114,7 @@
%md
%md### Numerical case 2: nodal mass model with $\alpha$-HHT method
%md
exportFirstMatrices = true ;
materials(1).density = 0 ;
materials(2).nodalMass = [m m m] ;
analysisSettings.methodName = 'alphaHHT' ;
Expand Down
19 changes: 1 addition & 18 deletions src/ONSAS_init.m
Original file line number Diff line number Diff line change
@@ -1,25 +1,8 @@
% Copyright (C) 2021, Jorge M. Perez Zerpa, J. Bruno Bazzano, Joaquin Viera,
% Mauricio Vanzulli, Marcelo Forets, Jean-Marc Battini, Sebastian Toro
%
% This file is part of ONSAS.
%
% ONSAS is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% ONSAS is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with ONSAS. If not, see <https://www.gnu.org/licenses/>.

function [ modelCurrSol, modelProperties, BCsData ] = ONSAS_init( materials, elements, boundaryConds, initialConds, mesh, analysisSettings, otherParams )

%md sets the current version
ONSASversion = '0.2.5' ;
ONSASversion = '0.2.6' ;

%md set defaults
[ materials, elements, boundaryConds, analysisSettings, otherParams ] = setDefaults( materials, elements, boundaryConds, analysisSettings, otherParams ) ;
Expand Down
18 changes: 1 addition & 17 deletions src/assembler.m
Original file line number Diff line number Diff line change
@@ -1,20 +1,4 @@
% Copyright (C) 2021, Jorge M. Perez Zerpa, J. Bruno Bazzano, Joaquin Viera,
% Mauricio Vanzulli, Marcelo Forets, Jean-Marc Battini, Sebastian Toro
%
% This file is part of ONSAS.
%
% ONSAS is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% ONSAS is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with ONSAS. If not, see <https://www.gnu.org/licenses/>.


%mdThis function computes the assembled force vectors, tangent matrices and stress matrices.
function [ fsCell, stressMat, tangMatsCell ] = assembler ( Conec, elements, Nodes,...
Expand Down
19 changes: 9 additions & 10 deletions src/computeMatrix.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,24 @@

KT = mats{1} ;
if strcmp( analysisSettings.methodName, 'newmark' ) || strcmp( analysisSettings.methodName, 'alphaHHT' )

dampingMat = mats{2} ;
massMat = mats{3} ;

global spitMatrices
if spitMatrices == true
KTred = KT(neumdofs,neumdofs);
global exportFirstMatrices;
if exportFirstMatrices == true
KTred = KT(neumdofs,neumdofs);
massMatred = massMat(neumdofs,neumdofs);
save('-mat', 'output/matrices.mat', 'KTred','massMatred','neumdofs' );
save('-mat', 'output/matrices.mat', 'KT','massMat','neumdofs' );
figure
spy(full(KTred))
spy(full(KT))
figure
spy(full(massMatred))
fprintf('matrices spitted.\n--------\n')
spitMatrices = false;
spy(full(massMat))
fprintf('matrices exported.\n--------\n')
exportFirstMatrices = false;
end

end


if strcmp( analysisSettings.methodName, 'newtonRaphson' ) || strcmp( analysisSettings.methodName, 'arcLength' )

systemDeltauMatrix = KT ( neumdofs, neumdofs ) ;
Expand Down
13 changes: 0 additions & 13 deletions src/plotTemp.m

This file was deleted.

6 changes: 4 additions & 2 deletions src/setDefaults.m
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,10 @@
otherParams = checkOrSetDefault ( otherParams , 'plotsFormat', [] ) ;
otherParams = checkOrSetDefault ( otherParams , 'nodalDispDamping', 0 ) ;



global exportFirstMatrices;
if isempty( exportFirstMatrices )
exportFirstMatrices = false ;
end

%md function that checks if a field is defined in a (scalar or array) struct
%md and sets a default value if it is not defined.
Expand Down

0 comments on commit 32863f1

Please sign in to comment.