00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 #ifndef tetFemMatrix_H
00038 #define tetFemMatrix_H
00039
00040 #include "tetPointFields.H"
00041 #include "elementFields.H"
00042 #include "lduMatrix.H"
00043 #include "tmp.H"
00044 #include "dimensionedTypes.H"
00045 #include "Map.H"
00046 #include "constraints.H"
00047
00048
00049
00050 namespace Foam
00051 {
00052
00053
00054
00055 template<class Type>
00056 class tetFemMatrix;
00057
00058 template<class Type>
00059 Ostream& operator<<(Ostream&, const tetFemMatrix<Type>&);
00060
00061
00062
00063
00064
00065
00066 template<class Type>
00067 class tetFemMatrix
00068 :
00069 public refCount,
00070 public lduMatrix
00071 {
00072
00073
00074
00075 GeometricField<Type, tetPolyPatchField, tetPointMesh>& psi_;
00076
00077
00078 dimensionSet dimensions_;
00079
00080
00081 Field<Type> source_;
00082
00083
00084 mutable bool boundaryConditionsSet_;
00085
00086
00087 mutable Map<constraint<Type> > fixedEqns_;
00088
00089 direction solvingComponent;
00090
00091
00092
00093
00094
00095
00096 static const label fixFillIn;
00097
00098
00099
00100
00101 void addBoundarySourceDiag();
00102
00103
00104 void storeBoundaryCoeffs() const;
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120 void addCouplingCoeffs();
00121
00122 void eliminateCouplingCoeffs();
00123
00124 void addCouplingSource(scalarField&) const;
00125
00126
00127 void setComponentBoundaryConditions
00128 (
00129 const direction,
00130 scalarField& psiCmpt,
00131 scalarField& sourceCmpt
00132 );
00133
00134
00135 void reconstructMatrix();
00136
00137
00138
00139 tmp<Field<Type> > distributeSource(const Field<Type>&) const;
00140
00141
00142 public:
00143
00144 ClassName("tetFemMatrix");
00145
00146
00147
00148
00149
00150 tetFemMatrix
00151 (
00152 GeometricField<Type, tetPolyPatchField, tetPointMesh>&,
00153 const dimensionSet&
00154 );
00155
00156
00157 tetFemMatrix(const tetFemMatrix<Type>&);
00158
00159
00160 tetFemMatrix
00161 (
00162 GeometricField<Type, tetPolyPatchField, tetPointMesh>&,
00163 Istream&
00164 );
00165
00166
00167
00168
00169 virtual ~tetFemMatrix();
00170
00171
00172
00173
00174
00175
00176 const GeometricField<Type, tetPolyPatchField, tetPointMesh>&
00177 psi() const
00178 {
00179 return psi_;
00180 }
00181
00182 GeometricField<Type, tetPolyPatchField, tetPointMesh>& psi()
00183 {
00184 return psi_;
00185 }
00186
00187 const dimensionSet& dimensions() const
00188 {
00189 return dimensions_;
00190 }
00191
00192 Field<Type>& source()
00193 {
00194 return source_;
00195 }
00196
00197 const Field<Type>& source() const
00198 {
00199 return source_;
00200 }
00201
00202
00203
00204
00205
00206
00207
00208
00209 void addConstraint
00210 (
00211 const label vertex,
00212 const Type& value
00213 );
00214
00215
00216
00217
00218
00219 void relax(const scalar alpha);
00220
00221
00222
00223 void relax();
00224
00225
00226 void check();
00227
00228
00229
00230 lduMatrix::solverPerformance solve();
00231
00232
00233 tmp<Field<Type> > residual();
00234
00235
00236
00237
00238 void operator=(const tetFemMatrix<Type>&);
00239 void operator=(const tmp<tetFemMatrix<Type> >&);
00240
00241 void negate();
00242
00243 void operator+=(const tetFemMatrix<Type>&);
00244 void operator+=(const tmp<tetFemMatrix<Type> >&);
00245
00246 void operator-=(const tetFemMatrix<Type>&);
00247 void operator-=(const tmp<tetFemMatrix<Type> >&);
00248
00249 void operator+=
00250 (
00251 const GeometricField<Type, tetPolyPatchField, elementMesh>&
00252 );
00253 void operator+=
00254 (
00255 const tmp<GeometricField<Type, tetPolyPatchField, elementMesh> >&
00256 );
00257
00258 void operator-=
00259 (
00260 const GeometricField<Type, tetPolyPatchField, elementMesh>&
00261 );
00262
00263 void operator-=
00264 (
00265 const tmp<GeometricField<Type, tetPolyPatchField, elementMesh> >&
00266 );
00267
00268 void operator+=(const dimensioned<Type>&);
00269 void operator-=(const dimensioned<Type>&);
00270
00271 void operator*=(const dimensioned<scalar>&);
00272
00273
00274
00275 friend Ostream& operator<< <Type>
00276 (
00277 Ostream&,
00278 const tetFemMatrix<Type>&
00279 );
00280 };
00281
00282
00283
00284
00285 template<class Type>
00286 void checkMethod
00287 (
00288 const tetFemMatrix<Type>&,
00289 const tetFemMatrix<Type>&,
00290 const char*
00291 );
00292
00293 template<class Type>
00294 void checkMethod
00295 (
00296 const tetFemMatrix<Type>&,
00297 const GeometricField<Type, tetPolyPatchField, elementMesh>&,
00298 const char*
00299 );
00300
00301 template<class Type>
00302 void checkMethod
00303 (
00304 const tetFemMatrix<Type>&,
00305 const dimensioned<Type>&,
00306 const char*
00307 );
00308
00309
00310
00311 template<class Type>
00312 lduMatrix::solverPerformance solve(tetFemMatrix<Type>&);
00313
00314
00315
00316
00317 template<class Type>
00318 lduMatrix::solverPerformance solve(const tmp<tetFemMatrix<Type> >&);
00319
00320
00321
00322
00323 template<class Type>
00324 tmp<tetFemMatrix<Type> > operator-
00325 (
00326 const tetFemMatrix<Type>&
00327 );
00328
00329 template<class Type>
00330 tmp<tetFemMatrix<Type> > operator-
00331 (
00332 const tmp<tetFemMatrix<Type> >&
00333 );
00334
00335 template<class Type>
00336 tmp<tetFemMatrix<Type> > operator+
00337 (
00338 const tetFemMatrix<Type>&,
00339 const tetFemMatrix<Type>&
00340 );
00341
00342 template<class Type>
00343 tmp<tetFemMatrix<Type> > operator+
00344 (
00345 const tmp<tetFemMatrix<Type> >&,
00346 const tetFemMatrix<Type>&
00347 );
00348
00349 template<class Type>
00350 tmp<tetFemMatrix<Type> > operator+
00351 (
00352 const tetFemMatrix<Type>&,
00353 const tmp<tetFemMatrix<Type> >&
00354 );
00355
00356 template<class Type>
00357 tmp<tetFemMatrix<Type> > operator+
00358 (
00359 const tmp<tetFemMatrix<Type> >&,
00360 const tmp<tetFemMatrix<Type> >&
00361 );
00362
00363 template<class Type>
00364 tmp<tetFemMatrix<Type> > operator-
00365 (
00366 const tetFemMatrix<Type>&,
00367 const tetFemMatrix<Type>&
00368 );
00369
00370 template<class Type>
00371 tmp<tetFemMatrix<Type> > operator-
00372 (
00373 const tmp<tetFemMatrix<Type> >&,
00374 const tetFemMatrix<Type>&
00375 );
00376
00377 template<class Type>
00378 tmp<tetFemMatrix<Type> > operator-
00379 (
00380 const tetFemMatrix<Type>&,
00381 const tmp<tetFemMatrix<Type> >&
00382 );
00383
00384 template<class Type>
00385 tmp<tetFemMatrix<Type> > operator-
00386 (
00387 const tmp<tetFemMatrix<Type> >&,
00388 const tmp<tetFemMatrix<Type> >&
00389 );
00390
00391 template<class Type>
00392 tmp<tetFemMatrix<Type> > operator==
00393 (
00394 const tetFemMatrix<Type>&,
00395 const tetFemMatrix<Type>&
00396 );
00397
00398 template<class Type>
00399 tmp<tetFemMatrix<Type> > operator==
00400 (
00401 const tmp<tetFemMatrix<Type> >&,
00402 const tetFemMatrix<Type>&
00403 );
00404
00405 template<class Type>
00406 tmp<tetFemMatrix<Type> > operator==
00407 (
00408 const tetFemMatrix<Type>&,
00409 const tmp<tetFemMatrix<Type> >&
00410 );
00411
00412 template<class Type>
00413 tmp<tetFemMatrix<Type> > operator==
00414 (
00415 const tmp<tetFemMatrix<Type> >&,
00416 const tmp<tetFemMatrix<Type> >&
00417 );
00418
00419 template<class Type>
00420 tmp<tetFemMatrix<Type> > operator+
00421 (
00422 const tetFemMatrix<Type>&,
00423 const GeometricField<Type, tetPolyPatchField, elementMesh>&
00424 );
00425
00426 template<class Type>
00427 tmp<tetFemMatrix<Type> > operator+
00428 (
00429 const tmp<tetFemMatrix<Type> >&,
00430 const GeometricField<Type, tetPolyPatchField, elementMesh>&
00431 );
00432
00433 template<class Type>
00434 tmp<tetFemMatrix<Type> > operator+
00435 (
00436 const tetFemMatrix<Type>&,
00437 const tmp<GeometricField<Type, tetPolyPatchField, elementMesh> >&
00438 );
00439
00440 template<class Type>
00441 tmp<tetFemMatrix<Type> > operator+
00442 (
00443 const tmp<tetFemMatrix<Type> >&,
00444 const tmp<GeometricField<Type, tetPolyPatchField, elementMesh> >&
00445 );
00446
00447 template<class Type>
00448 tmp<tetFemMatrix<Type> > operator+
00449 (
00450 const GeometricField<Type, tetPolyPatchField, elementMesh>&,
00451 const tetFemMatrix<Type>&
00452 );
00453
00454 template<class Type>
00455 tmp<tetFemMatrix<Type> > operator+
00456 (
00457 const GeometricField<Type, tetPolyPatchField, elementMesh>&,
00458 const tmp<tetFemMatrix<Type> >&
00459 );
00460
00461 template<class Type>
00462 tmp<tetFemMatrix<Type> > operator+
00463 (
00464 const tmp<GeometricField<Type, tetPolyPatchField, elementMesh> >&,
00465 const tetFemMatrix<Type>&
00466 );
00467
00468 template<class Type>
00469 tmp<tetFemMatrix<Type> > operator+
00470 (
00471 const tmp<GeometricField<Type, tetPolyPatchField, elementMesh> >&,
00472 const tmp<tetFemMatrix<Type> >&
00473 );
00474
00475 template<class Type>
00476 tmp<tetFemMatrix<Type> > operator-
00477 (
00478 const tetFemMatrix<Type>&,
00479 const GeometricField<Type, tetPolyPatchField, elementMesh>&
00480 );
00481
00482 template<class Type>
00483 tmp<tetFemMatrix<Type> > operator-
00484 (
00485 const tmp<tetFemMatrix<Type> >&,
00486 const GeometricField<Type, tetPolyPatchField, elementMesh>&
00487 );
00488
00489 template<class Type>
00490 tmp<tetFemMatrix<Type> > operator-
00491 (
00492 const tetFemMatrix<Type>&,
00493 const tmp<GeometricField<Type, tetPolyPatchField, elementMesh> >&
00494 );
00495
00496 template<class Type>
00497 tmp<tetFemMatrix<Type> > operator-
00498 (
00499 const tmp<tetFemMatrix<Type> >&,
00500 const tmp<GeometricField<Type, tetPolyPatchField, elementMesh> >&
00501 );
00502
00503 template<class Type>
00504 tmp<tetFemMatrix<Type> > operator-
00505 (
00506 const GeometricField<Type, tetPolyPatchField, elementMesh>&,
00507 const tetFemMatrix<Type>&
00508 );
00509
00510 template<class Type>
00511 tmp<tetFemMatrix<Type> > operator-
00512 (
00513 const GeometricField<Type, tetPolyPatchField, elementMesh>&,
00514 const tmp<tetFemMatrix<Type> >&
00515 );
00516
00517 template<class Type>
00518 tmp<tetFemMatrix<Type> > operator-
00519 (
00520 const tmp<GeometricField<Type, tetPolyPatchField, elementMesh> >&,
00521 const tetFemMatrix<Type>&
00522 );
00523
00524 template<class Type>
00525 tmp<tetFemMatrix<Type> > operator-
00526 (
00527 const tmp<GeometricField<Type, tetPolyPatchField, elementMesh> >&,
00528 const tmp<tetFemMatrix<Type> >&
00529 );
00530
00531 template<class Type>
00532 tmp<tetFemMatrix<Type> > operator+
00533 (
00534 const tmp<tetFemMatrix<Type> >&,
00535 const dimensioned<Type>&
00536 );
00537
00538 template<class Type>
00539 tmp<tetFemMatrix<Type> > operator+
00540 (
00541 const dimensioned<Type>&,
00542 const tmp<tetFemMatrix<Type> >&
00543 );
00544
00545 template<class Type>
00546 tmp<tetFemMatrix<Type> > operator-
00547 (
00548 const tmp<tetFemMatrix<Type> >&,
00549 const dimensioned<Type>&
00550 );
00551
00552 template<class Type>
00553 tmp<tetFemMatrix<Type> > operator-
00554 (
00555 const dimensioned<Type>&,
00556 const tmp<tetFemMatrix<Type> >&
00557 );
00558
00559 template<class Type>
00560 tmp<tetFemMatrix<Type> > operator==
00561 (
00562 const tetFemMatrix<Type>&,
00563 const GeometricField<Type, tetPolyPatchField, elementMesh>&
00564 );
00565
00566 template<class Type>
00567 tmp<tetFemMatrix<Type> > operator==
00568 (
00569 const tmp<tetFemMatrix<Type> >&,
00570 const GeometricField<Type, tetPolyPatchField, elementMesh>&
00571 );
00572
00573 template<class Type>
00574 tmp<tetFemMatrix<Type> > operator==
00575 (
00576 const tetFemMatrix<Type>&,
00577 const tmp<GeometricField<Type, tetPolyPatchField, elementMesh> >&
00578 );
00579
00580 template<class Type>
00581 tmp<tetFemMatrix<Type> > operator==
00582 (
00583 const tmp<tetFemMatrix<Type> >&,
00584 const tmp<GeometricField<Type, tetPolyPatchField, elementMesh> >&
00585 );
00586
00587 template<class Type>
00588 tmp<tetFemMatrix<Type> > operator==
00589 (
00590 const tetFemMatrix<Type>&,
00591 const dimensioned<Type>&
00592 );
00593
00594 template<class Type>
00595 tmp<tetFemMatrix<Type> > operator==
00596 (
00597 const tmp<tetFemMatrix<Type> >&,
00598 const dimensioned<Type>&
00599 );
00600
00601
00602 template<class Type>
00603 tmp<tetFemMatrix<Type> > operator*
00604 (
00605 const dimensioned<scalar>&,
00606 const tetFemMatrix<Type>&
00607 );
00608
00609 template<class Type>
00610 tmp<tetFemMatrix<Type> > operator*
00611 (
00612 const dimensioned<scalar>&,
00613 const tmp<tetFemMatrix<Type> >&
00614 );
00615
00616
00617
00618
00619 }
00620
00621
00622
00623 #ifdef NoRepository
00624 # include "tetFemMatrix.C"
00625 # include "tetFemMatrixSolve.C"
00626 # include "tetFemMatrixTools.C"
00627 # include "tetFemMatrixCheck.C"
00628 #endif
00629
00630
00631
00632 #endif
00633
00634