00001 #include <math.h>
00002 #include "galias.h"
00003 #include "alias.h"
00004 #include "effstress.h"
00005 #include "matrix.h"
00006 #include "vector.h"
00007 #include "global.h"
00008 #include "intpoints.h"
00009 #include "vecttens.h"
00010 #include "iotools.h"
00011
00012
00013
00014 effstress::effstress()
00015 {
00016 ppv = 0.0;
00017 }
00018
00019
00020
00021 effstress::~effstress()
00022 {
00023 }
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 void effstress::read(XFILE *in)
00039 {
00040 xfscanf(in, "%k%m", "pore_press_comp", &pore_press_comp_kwdset, &ppct);
00041 switch (ppct)
00042 {
00043 case noporep:
00044 break;
00045 case const_all:
00046 xfscanf(in, "%le", &ppv);
00047 if (Mp->pore_press < 2)
00048 Mp->pore_press = 1;
00049 else
00050 {
00051 print_err("partially coupled and fully coupled approaches cannot be used together", __FILE__, __LINE__, __func__);
00052 abort();
00053 }
00054 break;
00055 case nonmechq:
00056 if (Mp->pore_press == 1)
00057 {
00058 print_err("partially coupled and fully coupled approaches cannot be used together", __FILE__, __LINE__, __func__);
00059 abort();
00060 }
00061 else
00062 {
00063
00064
00065 Mp->pore_press = 2;
00066 }
00067 break;
00068 default:
00069 print_err("Unknown type of pore pressure computation is required", __FILE__, __LINE__, __func__);
00070 }
00071
00072 return;
00073 }
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090 void effstress::nlstresses (long ipp, long im, long ido)
00091 {
00092 long i;
00093 long ncomp = Mm->ip[ipp].ncompstr;
00094 vector sig(ncomp);
00095 matrix sigt(3,3);
00096 double pp;
00097
00098 pp = Mm->givenonmechq(pore_pressure,ipp);
00099
00100
00101 Mm->computenlstresses(ipp, im+1, ido);
00102
00103 Mm->givestress(0, ipp, sig);
00104
00105
00106 vector_tensor(sig, sigt, Mm->ip[ipp].ssst,stress);
00107
00108
00109
00110 for (i=0;i<3;i++)
00111 sigt[i][i] += pp;
00112
00113
00114 tensor_vector(sig, sigt, Mm->ip[ipp].ssst,stress);
00115
00116
00117 for (i=0;i<ncomp;i++)
00118 Mm->ip[ipp].stress[i] = sig[i];
00119 }
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131 void effstress::give_reqnmq(long *anmq)
00132 {
00133 switch (ppct)
00134 {
00135 case noporep:
00136 break;
00137 case const_all:
00138 case nonmechq:
00139 anmq[pore_pressure-1] = 1;
00140 break;
00141 default:
00142 print_err("Unknown type of pore pressure computation is required", __FILE__, __LINE__, __func__);
00143 }
00144 }
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159 void effstress::initvalues(long ipp)
00160 {
00161 if (ppct == const_all)
00162 {
00163
00164 Mm->storenonmechq(pore_pressure, ipp, ppv);
00165 }
00166 }