[3683] | 1 | /*!\file Penpair.c
|
---|
| 2 | * \brief: implementation of the Penpair object
|
---|
| 3 | */
|
---|
| 4 |
|
---|
[5937] | 5 | /*Headers*/
|
---|
| 6 | /*{{{1*/
|
---|
[3683] | 7 | #ifdef HAVE_CONFIG_H
|
---|
[9320] | 8 | #include <config.h>
|
---|
[3683] | 9 | #else
|
---|
| 10 | #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
|
---|
| 11 | #endif
|
---|
| 12 |
|
---|
[9320] | 13 | #include <stdio.h>
|
---|
[3683] | 14 | #include <string.h>
|
---|
| 15 | #include "../objects.h"
|
---|
| 16 | #include "../../EnumDefinitions/EnumDefinitions.h"
|
---|
[3775] | 17 | #include "../../include/include.h"
|
---|
[3683] | 18 | #include "../../shared/shared.h"
|
---|
[5937] | 19 | /*}}}*/
|
---|
| 20 |
|
---|
| 21 | /*Element macros*/
|
---|
| 22 | #define NUMVERTICES 2
|
---|
| 23 |
|
---|
[4248] | 24 | /*Penpair constructors and destructor*/
|
---|
[3683] | 25 | /*FUNCTION Penpair::constructor {{{1*/
|
---|
| 26 | Penpair::Penpair(){
|
---|
[4396] | 27 |
|
---|
| 28 | this->hnodes=NULL;
|
---|
[5940] | 29 | this->nodes=NULL;
|
---|
[4887] | 30 | this->parameters=NULL;
|
---|
[3683] | 31 | return;
|
---|
| 32 | }
|
---|
| 33 | /*}}}1*/
|
---|
| 34 | /*FUNCTION Penpair::creation {{{1*/
|
---|
[4396] | 35 | Penpair::Penpair(int penpair_id, int* penpair_node_ids,int in_analysis_type){
|
---|
| 36 |
|
---|
[3683] | 37 | this->id=penpair_id;
|
---|
[4007] | 38 | this->analysis_type=in_analysis_type;
|
---|
[4396] | 39 | this->hnodes=new Hook(penpair_node_ids,2);
|
---|
[4887] | 40 | this->parameters=NULL;
|
---|
[5940] | 41 | this->nodes=NULL;
|
---|
[3683] | 42 |
|
---|
| 43 | return;
|
---|
| 44 | }
|
---|
| 45 | /*}}}1*/
|
---|
| 46 | /*FUNCTION Penpair::destructor {{{1*/
|
---|
| 47 | Penpair::~Penpair(){
|
---|
[4396] | 48 | delete hnodes;
|
---|
[3683] | 49 | return;
|
---|
| 50 | }
|
---|
| 51 | /*}}}1*/
|
---|
| 52 |
|
---|
[4248] | 53 | /*Object virtual functions definitions:*/
|
---|
[3683] | 54 | /*FUNCTION Penpair::Echo {{{1*/
|
---|
| 55 | void Penpair::Echo(void){
|
---|
| 56 |
|
---|
| 57 | int i;
|
---|
| 58 |
|
---|
| 59 | printf("Penpair:\n");
|
---|
| 60 | printf(" id: %i\n",id);
|
---|
[8224] | 61 | printf(" analysis_type: %s\n",EnumToStringx(analysis_type));
|
---|
[4396] | 62 | hnodes->Echo();
|
---|
[3683] | 63 |
|
---|
| 64 | return;
|
---|
| 65 | }
|
---|
| 66 | /*}}}1*/
|
---|
[4248] | 67 | /*FUNCTION Penpair::DeepEcho {{{1*/
|
---|
| 68 | void Penpair::DeepEcho(void){
|
---|
[4007] | 69 |
|
---|
[4248] | 70 | printf("Penpair:\n");
|
---|
| 71 | printf(" id: %i\n",id);
|
---|
[8224] | 72 | printf(" analysis_type: %s\n",EnumToStringx(analysis_type));
|
---|
[4396] | 73 | hnodes->DeepEcho();
|
---|
[4248] | 74 |
|
---|
| 75 | return;
|
---|
| 76 | }
|
---|
[4007] | 77 | /*}}}1*/
|
---|
| 78 | /*FUNCTION Penpair::Id {{{1*/
|
---|
| 79 | int Penpair::Id(void){ return id; }
|
---|
| 80 | /*}}}1*/
|
---|
[4248] | 81 | /*FUNCTION Penpair::MyRank {{{1*/
|
---|
| 82 | int Penpair::MyRank(void){
|
---|
| 83 | extern int my_rank;
|
---|
| 84 | return my_rank;
|
---|
| 85 | }
|
---|
| 86 | /*}}}1*/
|
---|
[9777] | 87 | #ifdef _SERIAL_
|
---|
[3683] | 88 | /*FUNCTION Penpair::Marshall {{{1*/
|
---|
| 89 | void Penpair::Marshall(char** pmarshalled_dataset){
|
---|
| 90 |
|
---|
| 91 | char* marshalled_dataset=NULL;
|
---|
| 92 | int enum_type=0;
|
---|
| 93 |
|
---|
| 94 | /*recover marshalled_dataset: */
|
---|
| 95 | marshalled_dataset=*pmarshalled_dataset;
|
---|
| 96 |
|
---|
| 97 | /*get enum type of Penpair: */
|
---|
| 98 | enum_type=PenpairEnum;
|
---|
| 99 |
|
---|
| 100 | /*marshall enum: */
|
---|
| 101 | memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
|
---|
| 102 |
|
---|
| 103 | /*marshall Penpair data: */
|
---|
| 104 | memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);
|
---|
[4007] | 105 | memcpy(marshalled_dataset,&analysis_type,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type);
|
---|
[3683] | 106 |
|
---|
| 107 | /*Marshall hooks*/
|
---|
[4396] | 108 | hnodes->Marshall(&marshalled_dataset);
|
---|
[3683] | 109 |
|
---|
| 110 | *pmarshalled_dataset=marshalled_dataset;
|
---|
| 111 | return;
|
---|
| 112 | }
|
---|
| 113 | /*}}}1*/
|
---|
| 114 | /*FUNCTION Penpair::MarshallSize {{{1*/
|
---|
| 115 | int Penpair::MarshallSize(){
|
---|
| 116 |
|
---|
| 117 | return sizeof(id)+
|
---|
[4007] | 118 | +sizeof(analysis_type)
|
---|
[4396] | 119 | +hnodes->MarshallSize()
|
---|
[3683] | 120 | +sizeof(int); //sizeof(int) for enum type
|
---|
| 121 | }
|
---|
| 122 | /*}}}1*/
|
---|
[4248] | 123 | /*FUNCTION Penpair::Demarshall {{{1*/
|
---|
| 124 | void Penpair::Demarshall(char** pmarshalled_dataset){
|
---|
| 125 |
|
---|
| 126 | int i;
|
---|
| 127 | char* marshalled_dataset=NULL;
|
---|
| 128 |
|
---|
| 129 | /*recover marshalled_dataset: */
|
---|
| 130 | marshalled_dataset=*pmarshalled_dataset;
|
---|
| 131 |
|
---|
| 132 | /*this time, no need to get enum type, the pointer directly points to the beginning of the
|
---|
| 133 | *object data (thanks to DataSet::Demarshall):*/
|
---|
| 134 | memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
|
---|
| 135 | memcpy(&analysis_type,marshalled_dataset,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type);
|
---|
| 136 |
|
---|
| 137 | /*demarshall hooks: */
|
---|
[4396] | 138 | hnodes=new Hook(); hnodes->Demarshall(&marshalled_dataset);
|
---|
[4248] | 139 |
|
---|
[5940] | 140 | /*pointers are garbabe, until configuration is carried out: */
|
---|
| 141 | nodes=NULL;
|
---|
| 142 | parameters=NULL;
|
---|
[4887] | 143 |
|
---|
[4248] | 144 | /*return: */
|
---|
| 145 | *pmarshalled_dataset=marshalled_dataset;
|
---|
| 146 | return;
|
---|
[3683] | 147 | }
|
---|
| 148 | /*}}}1*/
|
---|
[9777] | 149 | #endif
|
---|
[9883] | 150 | /*FUNCTION Penpair::ObjectEnum{{{1*/
|
---|
| 151 | int Penpair::ObjectEnum(void){
|
---|
[3683] | 152 |
|
---|
[4248] | 153 | return PenpairEnum;
|
---|
| 154 | }
|
---|
| 155 | /*}}}1*/
|
---|
| 156 | /*FUNCTION Penpair::copy {{{1*/
|
---|
| 157 | Object* Penpair::copy() {
|
---|
| 158 |
|
---|
| 159 | Penpair* penpair=NULL;
|
---|
| 160 |
|
---|
| 161 | penpair=new Penpair();
|
---|
| 162 |
|
---|
| 163 | /*copy fields: */
|
---|
| 164 | penpair->id=this->id;
|
---|
| 165 | penpair->analysis_type=this->analysis_type;
|
---|
| 166 |
|
---|
| 167 | /*now deal with hooks and objects: */
|
---|
[4396] | 168 | penpair->hnodes=(Hook*)this->hnodes->copy();
|
---|
[5940] | 169 | penpair->nodes =(Node**)penpair->hnodes->deliverp();
|
---|
[4248] | 170 |
|
---|
[4887] | 171 | /*point parameters: */
|
---|
| 172 | penpair->parameters=this->parameters;
|
---|
| 173 |
|
---|
[4248] | 174 | return penpair;
|
---|
| 175 |
|
---|
| 176 | }
|
---|
| 177 | /*}}}*/
|
---|
| 178 |
|
---|
| 179 | /*Load virtual functions definitions:*/
|
---|
| 180 | /*FUNCTION Penpair::Configure {{{1*/
|
---|
| 181 | void Penpair::Configure(Elements* elementsin,Loads* loadsin,Nodes* nodesin,Vertices* verticesin,Materials* materialsin,Parameters* parametersin){
|
---|
| 182 |
|
---|
| 183 | /*Take care of hooking up all objects for this element, ie links the objects in the hooks to their respective
|
---|
| 184 | * datasets, using internal ids and offsets hidden in hooks: */
|
---|
[4396] | 185 | hnodes->configure(nodesin);
|
---|
[5940] | 186 |
|
---|
| 187 | /*Initialize hooked fields*/
|
---|
| 188 | this->nodes =(Node**)hnodes->deliverp();
|
---|
| 189 |
|
---|
[4887] | 190 | /*point parameters to real dataset: */
|
---|
| 191 | this->parameters=parametersin;
|
---|
[4248] | 192 |
|
---|
| 193 | }
|
---|
| 194 | /*}}}1*/
|
---|
[4575] | 195 | /*FUNCTION Penpair::SetCurrentConfiguration {{{1*/
|
---|
| 196 | void Penpair::SetCurrentConfiguration(Elements* elementsin,Loads* loadsin,Nodes* nodesin,Vertices* verticesin,Materials* materialsin,Parameters* parametersin){
|
---|
| 197 |
|
---|
| 198 | }
|
---|
| 199 | /*}}}1*/
|
---|
[3683] | 200 | /*FUNCTION Penpair::CreateKMatrix {{{1*/
|
---|
[11679] | 201 | void Penpair::CreateKMatrix(Matrix* Kff, Matrix* Kfs){
|
---|
[4887] | 202 | /*If you code this piece, don't forget that a penalty will be inactive if it is dealing with clone nodes*/
|
---|
[3683] | 203 | /*No loads applied, do nothing: */
|
---|
| 204 | return;
|
---|
| 205 |
|
---|
| 206 | }
|
---|
| 207 | /*}}}1*/
|
---|
| 208 | /*FUNCTION Penpair::CreatePVector {{{1*/
|
---|
[11679] | 209 | void Penpair::CreatePVector(Vector* pf){
|
---|
[3683] | 210 |
|
---|
| 211 | /*No loads applied, do nothing: */
|
---|
| 212 | return;
|
---|
| 213 |
|
---|
| 214 | }
|
---|
| 215 | /*}}}1*/
|
---|
[11327] | 216 | /*FUNCTION Penpair::CreateJacobianMatrix{{{1*/
|
---|
[11679] | 217 | void Penpair::CreateJacobianMatrix(Matrix* Jff){
|
---|
[11332] | 218 | this->CreateKMatrix(Jff,NULL);
|
---|
[11327] | 219 | }
|
---|
| 220 | /*}}}1*/
|
---|
[3683] | 221 | /*FUNCTION Penpair::PenaltyCreateKMatrix {{{1*/
|
---|
[11679] | 222 | void Penpair::PenaltyCreateKMatrix(Matrix* Kff, Matrix* Kfs,double kmax){
|
---|
[4887] | 223 |
|
---|
| 224 | /*Retrieve parameters: */
|
---|
[5937] | 225 | ElementMatrix* Ke=NULL;
|
---|
| 226 | int analysis_type;
|
---|
[4887] | 227 | this->parameters->FindParam(&analysis_type,AnalysisTypeEnum);
|
---|
| 228 |
|
---|
[5937] | 229 | switch(analysis_type){
|
---|
| 230 | case DiagnosticHorizAnalysisEnum:
|
---|
| 231 | Ke=PenaltyCreateKMatrixDiagnosticHoriz(kmax);
|
---|
| 232 | break;
|
---|
[7833] | 233 | case PrognosticAnalysisEnum:
|
---|
| 234 | Ke=PenaltyCreateKMatrixPrognostic(kmax);
|
---|
| 235 | break;
|
---|
[5937] | 236 | default:
|
---|
[8224] | 237 | _error_("analysis %i (%s) not supported yet",analysis_type,EnumToStringx(analysis_type));
|
---|
[5937] | 238 | }
|
---|
[5557] | 239 |
|
---|
[5937] | 240 | /*Add to global Vector*/
|
---|
| 241 | if(Ke){
|
---|
[8800] | 242 | Ke->AddToGlobal(Kff,Kfs);
|
---|
[5937] | 243 | delete Ke;
|
---|
[4887] | 244 | }
|
---|
[3683] | 245 | }
|
---|
| 246 | /*}}}1*/
|
---|
| 247 | /*FUNCTION Penpair::PenaltyCreatePVector {{{1*/
|
---|
[11679] | 248 | void Penpair::PenaltyCreatePVector(Vector* pf,double kmax){
|
---|
[3683] | 249 | /*No loads applied, do nothing: */
|
---|
| 250 | return;
|
---|
| 251 | }
|
---|
| 252 | /*}}}1*/
|
---|
[11327] | 253 | /*FUNCTION Penpair::PenaltyCreateJacobianMatrix{{{1*/
|
---|
[11679] | 254 | void Penpair::PenaltyCreateJacobianMatrix(Matrix* Jff,double kmax){
|
---|
[11327] | 255 | this->PenaltyCreateKMatrix(Jff,NULL,kmax);
|
---|
| 256 | }
|
---|
| 257 | /*}}}1*/
|
---|
[4546] | 258 | /*FUNCTION Penpair::InAnalysis{{{1*/
|
---|
[4004] | 259 | bool Penpair::InAnalysis(int in_analysis_type){
|
---|
[4232] | 260 | if (in_analysis_type==this->analysis_type)return true;
|
---|
[4004] | 261 | else return false;
|
---|
| 262 | }
|
---|
| 263 | /*}}}*/
|
---|
[4887] | 264 |
|
---|
| 265 | /*Update virtual functions definitions:*/
|
---|
| 266 | /*FUNCTION Penpair::InputUpdateFromConstant(double constant, int name) {{{1*/
|
---|
| 267 | void Penpair::InputUpdateFromConstant(double constant, int name){
|
---|
| 268 | /*Nothing updated yet*/
|
---|
| 269 | }
|
---|
| 270 | /*}}}*/
|
---|
| 271 | /*FUNCTION Penpair::InputUpdateFromConstant(int constant, int name) {{{1*/
|
---|
| 272 | void Penpair::InputUpdateFromConstant(int constant, int name){
|
---|
| 273 | /*Nothing updated yet*/
|
---|
| 274 | }
|
---|
| 275 | /*}}}*/
|
---|
| 276 | /*FUNCTION Penpair::InputUpdateFromConstant(bool constant, int name) {{{1*/
|
---|
| 277 | void Penpair::InputUpdateFromConstant(bool constant, int name){
|
---|
| 278 | /*Nothing updated yet*/
|
---|
| 279 | }
|
---|
| 280 | /*}}}*/
|
---|
[11247] | 281 | /*FUNCTION Penpair::InputUpdateFromVector(double* vector, int name, int type) {{{1*/
|
---|
| 282 | void Penpair::InputUpdateFromVector(double* vector, int name, int type){
|
---|
| 283 | /*Nothing updated yet*/
|
---|
| 284 | }
|
---|
| 285 | /*}}}*/
|
---|
| 286 | /*FUNCTION Penpair::InputUpdateFromVector(int* vector, int name, int type) {{{1*/
|
---|
| 287 | void Penpair::InputUpdateFromVector(int* vector, int name, int type){
|
---|
| 288 | /*Nothing updated yet*/
|
---|
| 289 | }
|
---|
| 290 | /*}}}*/
|
---|
| 291 | /*FUNCTION Penpair::InputUpdateFromVector(bool* vector, int name, int type) {{{1*/
|
---|
| 292 | void Penpair::InputUpdateFromVector(bool* vector, int name, int type){
|
---|
| 293 | /*Nothing updated yet*/
|
---|
| 294 | }
|
---|
| 295 | /*}}}*/
|
---|
[4887] | 296 |
|
---|
| 297 | /*Penpair management:*/
|
---|
[5937] | 298 | /*FUNCTION Penpair::PenaltyCreateKMatrixDiagnosticHoriz{{{1*/
|
---|
| 299 | ElementMatrix* Penpair::PenaltyCreateKMatrixDiagnosticHoriz(double kmax){
|
---|
| 300 |
|
---|
| 301 | int approximation0=nodes[0]->GetApproximation();
|
---|
| 302 | int approximation1=nodes[1]->GetApproximation();
|
---|
| 303 |
|
---|
| 304 | switch(approximation0){
|
---|
| 305 | case MacAyealApproximationEnum:
|
---|
| 306 | switch(approximation1){
|
---|
| 307 | case MacAyealApproximationEnum: return PenaltyCreateKMatrixDiagnosticMacAyealPattyn(kmax);
|
---|
| 308 | case PattynApproximationEnum: return PenaltyCreateKMatrixDiagnosticMacAyealPattyn(kmax);
|
---|
[6412] | 309 | default: _error_("not supported yet");
|
---|
[5937] | 310 | }
|
---|
| 311 | case PattynApproximationEnum:
|
---|
| 312 | switch(approximation1){
|
---|
| 313 | case MacAyealApproximationEnum: return PenaltyCreateKMatrixDiagnosticMacAyealPattyn(kmax);
|
---|
| 314 | case PattynApproximationEnum: return PenaltyCreateKMatrixDiagnosticMacAyealPattyn(kmax);
|
---|
[6412] | 315 | default: _error_("not supported yet");
|
---|
[5937] | 316 | }
|
---|
| 317 | case StokesApproximationEnum:
|
---|
| 318 | switch(approximation1){
|
---|
| 319 | case StokesApproximationEnum: return PenaltyCreateKMatrixDiagnosticStokes(kmax);
|
---|
| 320 | case NoneApproximationEnum: return PenaltyCreateKMatrixDiagnosticStokes(kmax);
|
---|
[6412] | 321 | default: _error_("not supported yet");
|
---|
[5937] | 322 | }
|
---|
| 323 | case NoneApproximationEnum:
|
---|
| 324 | switch(approximation1){
|
---|
| 325 | case StokesApproximationEnum: return PenaltyCreateKMatrixDiagnosticStokes(kmax);
|
---|
| 326 | case NoneApproximationEnum: return PenaltyCreateKMatrixDiagnosticStokes(kmax);
|
---|
[6412] | 327 | default: _error_("not supported yet");
|
---|
[5937] | 328 | }
|
---|
[6412] | 329 | default: _error_("not supported yet");
|
---|
[5937] | 330 | }
|
---|
| 331 | }
|
---|
| 332 | /*}}}1*/
|
---|
| 333 | /*FUNCTION Penpair::PenaltyCreateKMatrixDiagnosticMacAyealPattyn {{{1*/
|
---|
| 334 | ElementMatrix* Penpair::PenaltyCreateKMatrixDiagnosticMacAyealPattyn(double kmax){
|
---|
[4887] | 335 |
|
---|
[5937] | 336 | const int numdof=NUMVERTICES*NDOF2;
|
---|
[4887] | 337 | double penalty_offset;
|
---|
| 338 |
|
---|
[5937] | 339 | /*Initialize Element vector and return if necessary*/
|
---|
[5989] | 340 | ElementMatrix* Ke=new ElementMatrix(nodes,NUMVERTICES,this->parameters);
|
---|
[4887] | 341 |
|
---|
| 342 | /*recover parameters: */
|
---|
[9679] | 343 | parameters->FindParam(&penalty_offset,DiagnosticPenaltyFactorEnum);
|
---|
[4887] | 344 |
|
---|
| 345 | //Create elementary matrix: add penalty to
|
---|
[5937] | 346 | Ke->values[0*numdof+0]=+kmax*pow((double)10.0,penalty_offset);
|
---|
| 347 | Ke->values[0*numdof+2]=-kmax*pow((double)10.0,penalty_offset);
|
---|
| 348 | Ke->values[2*numdof+0]=-kmax*pow((double)10.0,penalty_offset);
|
---|
| 349 | Ke->values[2*numdof+2]=+kmax*pow((double)10.0,penalty_offset);
|
---|
[4887] | 350 |
|
---|
[5937] | 351 | Ke->values[1*numdof+1]=+kmax*pow((double)10.0,penalty_offset);
|
---|
| 352 | Ke->values[1*numdof+3]=-kmax*pow((double)10.0,penalty_offset);
|
---|
| 353 | Ke->values[3*numdof+1]=-kmax*pow((double)10.0,penalty_offset);
|
---|
| 354 | Ke->values[3*numdof+3]=+kmax*pow((double)10.0,penalty_offset);
|
---|
[5096] | 355 |
|
---|
[5937] | 356 | /*Clean up and return*/
|
---|
| 357 | return Ke;
|
---|
[4887] | 358 | }
|
---|
| 359 | /*}}}1*/
|
---|
[5510] | 360 | /*FUNCTION Penpair::PenaltyCreateKMatrixDiagnosticStokes {{{1*/
|
---|
[5937] | 361 | ElementMatrix* Penpair::PenaltyCreateKMatrixDiagnosticStokes(double kmax){
|
---|
[5510] | 362 |
|
---|
[5937] | 363 | const int numdof=NUMVERTICES*NDOF4;
|
---|
[5510] | 364 | double penalty_offset;
|
---|
| 365 |
|
---|
[5937] | 366 | /*Initialize Element vector and return if necessary*/
|
---|
[5989] | 367 | ElementMatrix* Ke=new ElementMatrix(nodes,NUMVERTICES,this->parameters);
|
---|
[5510] | 368 |
|
---|
| 369 | /*recover parameters: */
|
---|
[9679] | 370 | parameters->FindParam(&penalty_offset,DiagnosticPenaltyFactorEnum);
|
---|
[5510] | 371 |
|
---|
| 372 | //Create elementary matrix: add penalty to
|
---|
[5937] | 373 | Ke->values[0*numdof+0]=+kmax*pow((double)10.0,penalty_offset);
|
---|
| 374 | Ke->values[0*numdof+4]=-kmax*pow((double)10.0,penalty_offset);
|
---|
| 375 | Ke->values[4*numdof+0]=-kmax*pow((double)10.0,penalty_offset);
|
---|
| 376 | Ke->values[4*numdof+4]=+kmax*pow((double)10.0,penalty_offset);
|
---|
[5510] | 377 |
|
---|
[5937] | 378 | Ke->values[1*numdof+1]=+kmax*pow((double)10.0,penalty_offset);
|
---|
| 379 | Ke->values[1*numdof+5]=-kmax*pow((double)10.0,penalty_offset);
|
---|
| 380 | Ke->values[5*numdof+1]=-kmax*pow((double)10.0,penalty_offset);
|
---|
| 381 | Ke->values[5*numdof+5]=+kmax*pow((double)10.0,penalty_offset);
|
---|
[5510] | 382 |
|
---|
[5937] | 383 | Ke->values[2*numdof+2]=+kmax*pow((double)10.0,penalty_offset);
|
---|
| 384 | Ke->values[2*numdof+6]=-kmax*pow((double)10.0,penalty_offset);
|
---|
| 385 | Ke->values[6*numdof+2]=-kmax*pow((double)10.0,penalty_offset);
|
---|
| 386 | Ke->values[6*numdof+6]=+kmax*pow((double)10.0,penalty_offset);
|
---|
[5510] | 387 |
|
---|
[5937] | 388 | Ke->values[3*numdof+3]=+kmax*pow((double)10.0,penalty_offset);
|
---|
| 389 | Ke->values[3*numdof+7]=-kmax*pow((double)10.0,penalty_offset);
|
---|
| 390 | Ke->values[7*numdof+3]=-kmax*pow((double)10.0,penalty_offset);
|
---|
| 391 | Ke->values[7*numdof+7]=+kmax*pow((double)10.0,penalty_offset);
|
---|
[5510] | 392 |
|
---|
[5937] | 393 | /*Clean up and return*/
|
---|
| 394 | return Ke;
|
---|
[5510] | 395 | }
|
---|
| 396 | /*}}}1*/
|
---|
[7833] | 397 | /*FUNCTION Penpair::PenaltyCreateKMatrixPrognostic {{{1*/
|
---|
| 398 | ElementMatrix* Penpair::PenaltyCreateKMatrixPrognostic(double kmax){
|
---|
| 399 |
|
---|
| 400 | const int numdof=NUMVERTICES*NDOF1;
|
---|
[9642] | 401 | double penalty_factor;
|
---|
[7833] | 402 |
|
---|
| 403 | /*Initialize Element vector and return if necessary*/
|
---|
| 404 | ElementMatrix* Ke=new ElementMatrix(nodes,NUMVERTICES,this->parameters);
|
---|
| 405 |
|
---|
| 406 | /*recover parameters: */
|
---|
[9642] | 407 | parameters->FindParam(&penalty_factor,PrognosticPenaltyFactorEnum);
|
---|
[7833] | 408 |
|
---|
| 409 | //Create elementary matrix: add penalty to
|
---|
[9642] | 410 | Ke->values[0*numdof+0]=+kmax*pow((double)10.0,penalty_factor);
|
---|
| 411 | Ke->values[0*numdof+1]=-kmax*pow((double)10.0,penalty_factor);
|
---|
| 412 | Ke->values[1*numdof+0]=-kmax*pow((double)10.0,penalty_factor);
|
---|
| 413 | Ke->values[1*numdof+1]=+kmax*pow((double)10.0,penalty_factor);
|
---|
[7833] | 414 |
|
---|
| 415 | /*Clean up and return*/
|
---|
| 416 | return Ke;
|
---|
| 417 | }
|
---|
| 418 | /*}}}1*/
|
---|