Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

https://github.com/jrethore/ufreckles
21 April 2026, 21:14:19 UTC
  • Code
  • Branches (4)
  • Releases (0)
  • Visits
    • Branches
    • Releases
    • HEAD
    • refs/heads/master
    • refs/heads/v2.0
    • refs/heads/v2.1
    • refs/heads/v2.2
    No releases to show
  • 5ade5ef
  • /
  • Forms
  • /
  • ComputeInternalForceVector.m
Raw File Download Save again
Take a new snapshot of a software origin

If the archived software origin currently browsed is not synchronized with its upstream version (for instance when new commits have been issued), you can explicitly request Software Heritage to take a new snapshot of it.

Use the form below to proceed. Once a request has been submitted and accepted, it will be processed as soon as possible. You can then check its processing state by visiting this dedicated page.
swh spinner

Processing "take a new snapshot" request ...

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
  • revision
  • snapshot
origin badgecontent badge
swh:1:cnt:8d4dab50a230e1c99602c4e35156d0c63878b5bf
origin badgedirectory badge
swh:1:dir:269607eeb54e8c75acaed083f3f4d5cca7eb8d30
origin badgerevision badge
swh:1:rev:c38c036275d400217c433acd624a7e968a09fb55
origin badgesnapshot badge
swh:1:snp:e93363e05fc035dd2687d48111453842fa57bff8

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • content
  • directory
  • revision
  • snapshot
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
Tip revision: c38c036275d400217c433acd624a7e968a09fb55 authored by Julien Réthoré on 16 June 2025, 12:35:44 UTC
update june 2025
Tip revision: c38c036
ComputeInternalForceVector.m
function Fint=ComputeInternalForceVector(nmod,U,step)
persistent nmodo maskg epsxx epsyy epsxy epszz epsxz epsyz wdetJ doinit Fold Fprev stepold
iscale=1;
load(fullfile('TMP','params'),'param');
param0=param;
pix2m=param0.pixel_size;
load(fullfile('TMP',sprintf('%d_params',nmod)),'param');
if isfield(param0,'helper')
    soft=param0.helper;
else
    soft='none';
end
dflag=isfield(param,'extrusion_parameters')||(length(param0.roi)==6);
nlflag=false;
if isfield(param,'nlgeom')
    nlflag=param.nlgeom;
end
reload=1;
if ~isempty(nmodo)
    if (nmodo==nmod)
        reload=0;
    else
        reload=1;
    end
end

reload=reload||nlflag;
switch soft
    case 'none'

        if ~isfield(param,'enrichment')
            if reload


                if dflag


                    load(fullfile('TMP',sprintf('%d_3d_epsxx_%d',nmod,iscale-1)),'epsxx','wdetJ');
                    load(fullfile('TMP',sprintf('%d_3d_epsyy_%d',nmod,iscale-1)),'epsyy');
                    load(fullfile('TMP',sprintf('%d_3d_epsxy_%d',nmod,iscale-1)),'epsxy');
                    load(fullfile('TMP',sprintf('%d_3d_epszz_%d',nmod,iscale-1)),'epszz');
                    load(fullfile('TMP',sprintf('%d_3d_epsxz_%d',nmod,iscale-1)),'epsxz');
                    load(fullfile('TMP',sprintf('%d_3d_epsyz_%d',nmod,iscale-1)),'epsyz');
maskg=1;
                else
                    load(fullfile('TMP',sprintf('%d_epsxx_%d',nmod,iscale-1)),'epsxx','wdetJ');
                    load(fullfile('TMP',sprintf('%d_epsyy_%d',nmod,iscale-1)),'epsyy');
                    load(fullfile('TMP',sprintf('%d_epsxy_%d',nmod,iscale-1)),'epsxy');
                    epsxz=sparse(size(epsxx,1),size(epsxx,2));epsyz=epsxz;epszz=epsxz;
                load(fullfile('TMP',sprintf('%d_mask_%d',nmod,iscale-1)),'maskg');
                end
                nmodo=nmod;
            end
            [sxx,syy,sxy,sxz,syz,szz]=ComputeStress(epsxx*U,epsyy*U,epsxy*U,nmod,epsxz*U,epsyz*U,epszz*U);
            Fint=(epsxx'*maskg*wdetJ*sxx+epsyy'*maskg*wdetJ*syy+epsxy'*maskg*wdetJ*sxy...
                +epsxz'*maskg*wdetJ*sxz+epsyz'*maskg*wdetJ*syz+epszz'*maskg*wdetJ*szz)*pix2m;
            if nlflag
                load(fullfile('TMP',sprintf('%d_matmod',nmod)),'DU');
                if dflag
                    meshfile=fullfile('TMP',sprintf('%d_3d_mesh_%d',nmod,0));
                else
                    meshfile=fullfile('TMP',sprintf('%d_mesh_%d',nmod,0));
                end
                load(meshfile,'xo','yo','zo','Nnodes');
nn=prod(Nnodes);
                Ux=0.5*DU((1:nn));
                Uy=0.5*DU(nn+(1:nn));
                if dflag
                    Uz=0.5*DU(2*nn+(1:nn));
                else
                    Uz=zeros(size(zi));
                end
                xo=xo+Ux;
                yo=yo+Uy;
                zo=zo+Uz;
                save(meshfile,'xo','yo','zo','-append');
                if dflag
                    CreateGradBasisFunction3D(1,nmod);
                else
                    CreateGradBasisFunction(1,nmod);
                end

            end
        else
            load(fullfile('TMP',sprintf('%d_k_operator_%d',nmod,iscale-1)),'K');
            Fint=K*U;
            if isfield(param0,'cz_length')&&isfield(param,'interface_model')
                load(fullfile('TMP',sprintf('%d_dphin_%d',nmod,iscale-1)),'dphincz');
                load(fullfile('TMP',sprintf('%d_dphit_%d',nmod,iscale-1)),'dphitcz');
                load(sprintf('TMP/%d_iphi_%d',nmod,iscale-1),'dz');
                [tn,tt]=ComputeCohesiveStress(dphincz*U,dphitcz*U,nmod);
                dz=diag(sparse(dz));
                Fint=Fint+(dphincz'*(dz*tn)+dphitcz'*(dz*tt))*pix2m;
            end

        end
    case 'abaqus'
        abqcmd='abaqus';
        if isfield(param0,'abaqus_command_line')
            abqcmd=param0.abaqus_command_line;
        end
        if nargin<3
            step=[];
        end

        if isempty(step)
            restart=0;
            filres=[sprintf('%d_',nmod),param0.result_file];
        else
            filres=sprintf('%d_%s_%d',nmod,param0.result_file,step);
            if step==1
                restart=0;
            else
                restart=1;
            end
        end
        if isempty(doinit)
            writeAbaqus(U,nmod,step,restart,'init');
            doinit=false;
        end

        writeAbaqus(U,nmod,step,restart,'Fint');

        if restart
            filresold=sprintf('%d_%s_%d',nmod,param0.result_file,step-1);
            unix([abqcmd,' job=',filres,' oldjob=',filresold,' double interactive']);
        else
            unix([abqcmd,' job=',filres,' double  interactive']);
        end
        Fint=readAbaqus(nmod,step,'Fint')*pix2m;
        %         writeAbaqus(U,nmod,step,restart,'S');
        %
        %         if restart
        %             filresold=sprintf('%d_%s_%d',nmod,param0.result_file,step-1);
        %             unix(['abaqus68 job=',filres,' oldjob=',filresold,' double interactive']);
        %         else
        %             unix(['abaqus68 job=',filres,' double  interactive']);
        %         end
        %         S=readAbaqus(nmod,step,'S');
        %         if size(S,2)==3
        %             if reload
        %                 load(fullfile('TMP',sprintf('%d_epsxx_%d',nmod,iscale-1)),'epsxx','wdetJ');
        %                 load(fullfile('TMP',sprintf('%d_epsyy_%d',nmod,iscale-1)),'epsyy');
        %                 load(fullfile('TMP',sprintf('%d_epsxy_%d',nmod,iscale-1)),'epsxy');
        %                 load(fullfile('TMP',sprintf('%d_mask_%d',nmod,iscale-1)),'maskg');
        %                 nmodo=nmod;
        %             end
        %         Fint=(epsxx'*maskg*wdetJ*S(:,1)+epsyy'*maskg*wdetJ*S(:,2)+epsxy'*maskg*wdetJ*S(:,3))*pix2m^2;
        %         elseif size(S,2)==6
        %             if reload
        %                 load(fullfile('TMP',sprintf('%d_3d_epsxx_%d',nmod,iscale-1))),'epsxx','wdetJ');
        %                 load(fullfile('TMP',sprintf('%d_3d_epsyy_%d',nmod,iscale-1)),'epsyy');
        %                 load(fullfile('TMP',sprintf('%d_3d_epsxy_%d',nmod,iscale-1)),'epsxy');
        %                 load(fullfile('TMP',sprintf('%d_3d_epszz_%d',nmod,iscale-1)),'epszz');
        %                 load(fullfile('TMP',sprintf('%d_3d_epsxz_%d',nmod,iscale-1)),'epsxz');
        %                 load(fullfile('TMP',sprintf('%d_3d_epsyz_%d',nmod,iscale-1)),'epsyz');
        %                 load(fullfile('TMP',sprintf('%d_mask_%d',nmod,iscale-1)),'maskg');
        %                 nmodo=nmod;
        %             end
        % %             U
        % %             [epsxx*U,epsyy*U,epszz*U,epsxy*U,epsxz*U,epsyz*U]
        %         Fint=(epsxx'*maskg*wdetJ*S(:,1)+epsyy'*maskg*wdetJ*S(:,2)+epszz'*maskg*wdetJ*S(:,3)...
        %             +epsxy'*maskg*wdetJ*S(:,4)+epsxz'*maskg*wdetJ*S(:,5)+epsyz'*maskg*wdetJ*S(:,6))*pix2m^2;
        %
        %         else
        %             error
        %         end

        %         Fprev=Fint;
        %         if ~isempty(step)
        %             if (step==1)
        %                 Fold=0;
        %                 stepold=0;
        %                 'step 1'
        %             else
        %                 'step>1'
        %             display(sprintf('step %d stepold %d',step,stepold))
        %                 if (step>stepold+1)
        %                     'step>stepold+1'
        %                     Fold=Fprev+Fold;
        %                     stepold=step-1;
        %
        %                 end
        %                 Fint=Fint+Fold;
        %             end
        %         end
    case 'ansys'
        if nargin<3
            step=1;
        end
        jobname=sprintf('%s',param0.result_file);
        filres=sprintf('%d_%s_%d',nmod,param0.result_file,step);
        if step==1
            restart=0;
            writeAnsys([],nmod,step,restart,'init');
        else
            restart=1;
        end
        %         if isempty(doinit)
        %             writeAnsys(U,nmod,step,restart,'init');
        %             doinit=false;
        %         end
        writeAnsys(U,nmod,step,restart,'Fint');


        unix(['/opt/ansys_inc/v121/ansys/bin/ansys121  -p AA_T_I  -j ',jobname,' -s read -l en-us -b < ',filres,'.inp | tee -i ',filres,'.out' ]);
        %            ['/opt/ansys_inc/v121/ansys/bin/ansys121  -p AA_T_I  -j ',jobname,' -s read -l en-us -b < ',filres,'.inp | tee -i ',filres,'.out' ]
        Fint=readAnsys(nmod,step,'Fint')*pix2m;

    otherwise
        error('Unknown helper');
end
end

back to top

Software Heritage — Copyright (C) 2015–2026, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API