Skip to content

Commit

Permalink
Merge pull request #343 from ONSAS/jorge-vtk
Browse files Browse the repository at this point in the history
fix bug truss vtk
  • Loading branch information
jorgepz committed Nov 24, 2021
2 parents 0806093 + a7ff8e3 commit 06b7247
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
analysisSettings.methodName = 'arcLength' ;
analysisSettings.finalTime = 4.5 ;
analysisSettings.incremArcLen = 0.1 ;
analysisSettings.iniDeltaLamb = boundaryConds(2).loadsTimeFact(.2)/100
analysisSettings.iniDeltaLamb = boundaryConds(2).loadsTimeFact(.2)/100 ;
analysisSettings.posVariableLoadBC = 2 ;
%md
[matUs, loadFactorsMat] = ONSAS( materials, elements, boundaryConds, initialConds, mesh, analysisSettings, otherParams ) ;
Expand All @@ -153,7 +153,7 @@

verifBoolean = ( ( norm( difLoadEngRot ) / norm( loadFactorsNREngRot ) ) < 1e-4 ) ...
&& ( ( norm( difLoadGreen ) / norm( loadFactorsNRGreen ) ) < 1e-4 ) ...
&& ( ( norm( difLoadGreenNRAL ) / norm( loadFactorsNRALGreen ) ) < 1e-4 )
&& ( ( norm( difLoadGreenNRAL ) / norm( loadFactorsNRALGreen ) ) < 1e-4 ) ;

%md### Plots
%md and solutions are plotted.
Expand Down
12 changes: 6 additions & 6 deletions src/vtk/trussVtkData.m
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,21 @@
dispsElem = U( dofsElem ) ;
thetaLocIniSubElem = zeros(3,1) ;
thetaLocEndSubElem = zeros(3,1) ;
dispLocIniSubElem = zeros(3,1) ;
dispLocEndSubElem = zeros(3,1) ;

[ R0, Rr, locDisp ] = elementBeamRotData( coordsElemNodes, dispsElem ) ;

dispLocIniSubElem = zeros(3,1) ;
dispLocEndSubElem = [ locDisp(1); 0; 0 ] ;

coordLocSubElem = [ 0; elemLength ] ;

[ Nodesvtk, Conecvtk, Dispsvtk ] = vtkBeam2SolidConverter( coordsElemNodes, ...
dispsElem, coordLocSubElem, dispLocIniSubElem, dispLocEndSubElem, thetaLocIniSubElem, thetaLocEndSubElem, sectPar, Rr, R0 ) ;


Conecvtk( :, 2:end ) = Conecvtk(:,2:end)+counterNodes ;
vtkNodes = [ vtkNodes ; Nodesvtk ] ;
vtkConec = [ vtkConec ; Conecvtk ] ;
vtkNodalDisps = [ vtkNodalDisps; Dispsvtk ] ;
vtkNodes = [ vtkNodes ; Nodesvtk ] ;
vtkConec = [ vtkConec ; Conecvtk ] ;
vtkNodalDisps = [ vtkNodalDisps; Dispsvtk ] ;

counterNodes = counterNodes + 8 ;

Expand Down
3 changes: 1 addition & 2 deletions src/vtk/vtkBeam2SolidConverter.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@

typeSolid = sectPar(1) ;

dispIniSection = dispsElem(1:2:5) ;
dispEndSection = dispsElem(7:2:11) ;
dispIniSection = dispsElem(1:2:5) ; dispEndSection = dispsElem(7:2:11) ;

if typeSolid == 12 % vtkHexa

Expand Down
2 changes: 1 addition & 1 deletion src/vtk/vtkDataConversion.m
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
vtkConec = [ vtkConec ; [currVtkConec(:,1) currVtkConec(:,2:end)+totalNodes]] ;
vtkNodalDisps = [ vtkNodalDisps ; currVtkNodalDisps ] ;

totalNodes = totalNodes + size(currVtkNodes,1)
totalNodes = totalNodes + size(currVtkNodes,1) ;

end % for: elemTypeInds

Expand Down

0 comments on commit 06b7247

Please sign in to comment.