CalculiX  2.8
A Free Software Three-Dimensional Structural Finite Element Program
 All Classes Files Functions Variables Macros
checkinclength.c File Reference
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include "CalculiX.h"
Include dependency graph for checkinclength.c:

Go to the source code of this file.

Functions

void checkinclength (double *time, double *ttime, double *theta, double *dtheta, ITG *idrct, double *tper, double *tmax, double *tmin, double *ctrl, double *amta, ITG *namta, ITG *itpamp, ITG *inext, double *dthetaref, ITG *itp, ITG *jprint, ITG *jout)
 

Function Documentation

void checkinclength ( double *  time,
double *  ttime,
double *  theta,
double *  dtheta,
ITG idrct,
double *  tper,
double *  tmax,
double *  tmin,
double *  ctrl,
double *  amta,
ITG namta,
ITG itpamp,
ITG inext,
double *  dthetaref,
ITG itp,
ITG jprint,
ITG jout 
)

Definition at line 32 of file checkinclength.c.

35  {
36 
37  ITG id,istart,iend,inew,ireduceincrement;
38  double reftime;
39 
40  ITG i0,ir,ip,ic,il,ig,ia;
41  double df,dc,db,dd,ran,can,rap,ea,cae,ral,da;
42  i0=ctrl[0];ir=ctrl[1];ip=ctrl[2];ic=ctrl[3];il=ctrl[4];ig=ctrl[5];ia=ctrl[7];
43  df=ctrl[10];dc=ctrl[11];db=ctrl[12];da=ctrl[13];dd=ctrl[16];
44  ran=ctrl[18];can=ctrl[19];rap=ctrl[22];
45  ea=ctrl[23];cae=ctrl[24];ral=ctrl[25];
46 
47  /* check whether the new increment size is not too big */
48 
49  if(*dtheta>*tmax){
50  *dtheta=*tmax;
51 // printf(" the increment size exceeds thetamax and is decreased to %e\n\n",*dtheta**tper);
52  }
53 
54  /* if itp=1 the increment just finished ends at a time point */
55 
56  if((*itpamp>0)&&(*idrct==0)){
57  if(namta[3**itpamp-1]<0){
58  reftime=*ttime+*time+(*dtheta)**tper;
59  }else{
60  reftime=*time+(*dtheta)**tper;
61  }
62  istart=namta[3**itpamp-3];
63  iend=namta[3**itpamp-2];
64  FORTRAN(identamta,(amta,&reftime,&istart,&iend,&id));
65  if(id<istart){
66  inew=istart;
67  }else{
68  inew=id+1;
69  }
70 // printf("istart=%" ITGFORMAT ",iend=%" ITGFORMAT ",inext=%" ITGFORMAT ",inew=%" ITGFORMAT "\n",istart,iend,*inext,inew);
71 
72  /* inew: smallest time point exceeding time+dtheta*tper
73  inext: smallest time point exceeding time */
74 
75  /* the check with *tmin
76  was introduced to circumvent the following problem: if the new data point is
77  smaller than the next data point, but the distance is very small, the next *dheta
78  calculated a few lines below may be zero due to the subtraction of two nearly equal
79  numbers; a zero *dtheta leads to a fatal error */
80 
81  ireduceincrement=0;
82  if(*inext<iend){
83  if(fabs((amta[2**inext-2]-reftime)/(*tper))<*tmin){
84  ireduceincrement=1;
85  }
86  }
87 
88  if((*inext<inew)||(ireduceincrement==1)){
89 // if((*inext<inew)||(fabs((amta[2**inext-2]-reftime)/(*tper))<*tmin)){
90  // if((*inext<inew)||(fabs((amta[2**inext-2]-reftime))<1.e-10)){
91 
92  if(namta[3**itpamp-1]<0){
93  *dtheta=(amta[2**inext-2]-*ttime-*time)/(*tper);
94  }else{
95  *dtheta=(amta[2**inext-2]-*time)/(*tper);
96  }
97  (*inext)++;
98  *itp=1;
99 // printf(" the increment size exceeds a time point and is decreased to %e\n\n",*dtheta**tper);
100  }else{*itp=0;}
101  }
102 
103  /* check whether the step length is not exceeded */
104 
105  if(*dtheta>1.-*theta){
106  *dtheta=1.-*theta;
107  *dthetaref=*dtheta;
108  printf(" the increment size exceeds the remainder of the step and is decreased to %e\n\n",*dtheta**tper);
109 // if(*dtheta<=1.e-6){(*ttime)+=(*dtheta**tper);}
110  }
111 
112  return;
113 }
void FORTRAN(addimdnodecload,(ITG *nodeforc, ITG *i, ITG *imdnode, ITG *nmdnode, double *xforc, ITG *ikmpc, ITG *ilmpc, ITG *ipompc, ITG *nodempc, ITG *nmpc, ITG *imddof, ITG *nmddof, ITG *nactdof, ITG *mi, ITG *imdmpc, ITG *nmdmpc, ITG *imdboun, ITG *nmdboun, ITG *ikboun, ITG *nboun, ITG *ilboun, ITG *ithermal))
subroutine df(x, u, uprime, rpar, nev)
Definition: subspace.f:132
subroutine identamta(amta, reftime, istart, iend, id)
Definition: identamta.f:25
#define ITG
Definition: CalculiX.h:51
Hosted by OpenAircraft.com, (Michigan UAV, LLC)