BELFEM 0.9.3
Berkeley Lab Finite Element Framework
Loading...
Searching...
No Matches
cl_IWG.hpp
Go to the documentation of this file.
1/*
2 * BELFEM -- The Berkeley Lab Finite Element Framework
3 * Copyright (c) 2026, The Regents of the University of California,
4 * through Lawrence Berkeley National Laboratory (subject to receipt of any required
5 * approvals from the U.S. Dept. of Energy). All rights reserved.
6 *
7 * Developers: Christian Messe, Gregory Giard
8 *
9 * See the top-level LICENSE file for the complete license and disclaimer.
10 */
11
12#ifndef BELFEM_CL_IWG_HPP
13#define BELFEM_CL_IWG_HPP
14
15#include "typedefs.hpp"
16#include "cl_Bitset.hpp"
17
18#include "cl_Vector.hpp"
19#include "cl_Matrix.hpp"
20#include "cl_Mesh.hpp"
21#include "cl_Material.hpp"
22#include "en_IWGs.hpp"
23#include "en_SolverEnums.hpp"
25#include "en_DomainType.hpp"
28
29#define BELFEM_MAX_DOFTYPES 32
30#define BELFEM_MAX_NUMPROCS 128
31//#define BELFEM_FERROAIR_ENRICHED
32
33namespace belfem
34{
35 class Mesh;
36
37 enum class DofMode
38 {
41 UNDEFINED = 2
42 };
43
44
45
46 namespace fem
47 {
48 class Dof ;
49 class DofManagerBase;
50 class Group;
51 class Block ;
52 class SideSet ;
53 class Element;
54 class BoundaryCondition ;
55 class Calculator ;
56
57//------------------------------------------------------------------------------
58
70
71//------------------------------------------------------------------------------
72
80 class IWG
81 {
82//------------------------------------------------------------------------------
83 protected:
84//------------------------------------------------------------------------------
85
86 // rank of this proc
88
89 // Newton relaxation factor, dimensionless; the setter does not clamp it
90 real mOmega = 0.9;
91
92 // Penalty factors of the weak boundary conditions, one per slot
94
96 bool mIsInitialized = false ;
97
100 bool mEnrichSideSets = false ;
101
104
106
113
116
119
122
123
126
129
132
136
137 Mesh * mMesh = nullptr;
139 Group * mGroup = nullptr;
140 Calculator * mCalc = nullptr ;
141
142 const Material * mMaterial = nullptr;
143
144
146 uint mNumberOfDofsPerEdge = 0 ; // counts dofs on LHS
147 uint mNumberOfDofsPerFace = 0 ; // counts dofs on LHS
148 uint mNumberOfRhsDofsPerEdge = 0 ; // counts dofs on RHS, needed for L2
149 uint mNumberOfRhsDofsPerFace = 0 ; // counts dofs on RHS, needed for L2
151
152 // dimension for N. Sentinel-initialized like mNumberOfNodesPerElement
153 // below: derived constructors set this, but not all of them do it
154 // before something reads it, and an indeterminate uint here reads
155 // as a plausible dimension rather than as garbage
157
158 // dimension for B
160
161 // matrix size
165
168
172
174
175 // in this context, face dofs also count as edge dofs
177
178 // needed for L2 projection
180
181 // label of DOF fields, has dimension of mNumberOfDofsPerNode
183
184 // label of Flux fields, has dimension of mNumberOfDofsPerNode
186
187 // special purpose if RHS is a matrix
189
190 // All the other fields
192
194
195 // list of fields that are not to be saved
197
198 // number of columns for rhs side
200
201 // sideset is needed for convective terms, these are the FEM ones
203
204 // timestep
206
207 // vector with indices for nodes on wetted surfaces
209
210 // alpha is a special boundary condition for convective flow
211 bool mHasConvection = false ;
212
213 // list of selected block ids
215
216 // list of selected sideset IDs
218
219 // lookup table for block indices
221
222 // lookup table for sideset indices
224
225 // map for dof types
228
229 // default dof types, assumes all dofs are on all selected blocks
231
232 // this contains the entity types for the dofs
234
235 // table containing elements per block and entity
237
238 // table containing elements per sideset and entity
240
243
246
250
253
254 // non-node DOFs need to be handled differently
255 // the multiplicity depends on the order of the edge element
256 // we assume linear elements for now
261
263
266
270
274
277
280
283
286
289 Vector< real > mNormal3D = { 0., 0., 0. };
290
292
295
298
301
304
305//------------------------------------------------------------------------------
306 public:
307//------------------------------------------------------------------------------
308
309 // This class OWNS the DofTable* held in mBlockDofs, mSideSetDofs
310 // and mSideSetOnlyDofs -- allocated with new, deleted in the
311 // destructor. The implicit copy would shallow-copy those pointers
312 // and double-free them, so copying and moving are deleted rather
313 // than left to the compiler. Deep-copy semantics are not wanted:
314 // an IWG is created once, linked, and used in place.
315 IWG( const IWG & ) = delete ;
316 IWG & operator=( const IWG & ) = delete ;
317 IWG( IWG && ) = delete ;
318 IWG & operator=( IWG && ) = delete ;
319
320 // The symmetry default is UNSYMMETRIC on purpose, and must stay
321 // that way. BELFEM supplies MUMPS with the full matrix. With
322 // SYM != 0 ( PositiveDefiniteSymmetric = SYM 1;
323 // GeneralSymmetric = SYM 2 ), MUMPS sums each off-diagonal pair
324 // and factorizes a different matrix. cl_SolverMUMPS.cpp rejects
325 // symmetric modes. The default still belongs here, because this
326 // is where an IWG that never thinks about symmetry gets its
327 // answer. See src/sparse/doc/sparse_usage_guide.md,
328 // "Exploit Symmetry".
329 //
330 // Scope, deliberately narrow: the mode set here travels to the
331 // solver on the ordinary DofManager solve path
332 // ( cl_FEM_DofMgr_SolverData.cpp, set_symmetry_mode from the
333 // active IWG ). It is NOT universal -- the eigenvalue
334 // shift-invert path overrides it with Unsymmetric of its own
335 // accord, and the triangle requirement is MUMPS's, not a property
336 // of every backend that reads SymmetryMode.
337 //
338 // A caller must choose Symmetric explicitly and supply one matrix
339 // triangle. An IWG must not inherit it by omitting an argument.
340 // The user guide documents deriving IWG_Custom from this class
341 // ( dof_manager_usage_guide.md, "class IWG_Custom : public IWG" ).
342 // A user following the guide does not pass this argument. A
343 // symmetric default would therefore hand them SYM = 1 and a
344 // silently wrong factorization.
345 IWG( const IwgType aType,
346 const ModelDimensionality aDimensionality,
347 const IwgMode aMode=IwgMode::Iterative,
348 const SymmetryMode aSymmetryMode=SymmetryMode::Unsymmetric,
349 const DofMode aDofMode=DofMode::AllBlocksEqual,
350 const SideSetDofLinkMode aSideSetDofLinkMode=SideSetDofLinkMode::FacetOnly );
351
352//------------------------------------------------------------------------------
353
354 virtual ~IWG() ;
355
356//------------------------------------------------------------------------------
357
363 void
364 select_blocks( const Vector< id_t > & aBlockIDs );
365
366 void
367 select_block( const id_t aBlockID );
368
369//------------------------------------------------------------------------------
370
376 void
377 select_sidesets( const Vector< id_t > & aSidesetIDs );
378
379//------------------------------------------------------------------------------
380
384 const Vector< id_t > &
385 selected_blocks() const ;
386
387//------------------------------------------------------------------------------
388
392 const Vector< id_t > &
393 selected_sidesets() const ;
394
395//------------------------------------------------------------------------------
396
402 virtual void
404 Element * aElement,
405 Matrix< real > & aJacobian );
406
407//------------------------------------------------------------------------------
408
409 virtual void
411 Element * aElement,
412 Matrix< real > & aJacobian,
413 Vector< real > & aRHS );
414
415//------------------------------------------------------------------------------
416
417 // convection term, eg for heat load
418 virtual void
420 Element * aElement,
421 Vector< real > & aConvection );
422
423//------------------------------------------------------------------------------
424
425 // convection term with alpha boundary condition
426 virtual void
428 Element * aElement,
429 Matrix< real > & aJacobian,
430 Vector< real > & aRHS );
431
432//------------------------------------------------------------------------------
433
434 virtual void
436 Element * aElement,
437 Vector< real > & aRHS );
438
439
440//------------------------------------------------------------------------------
441
442 virtual void
444 Element * aElement,
445 Matrix< real > & aRHS );
446
447//------------------------------------------------------------------------------
448
451 virtual void
452 link_to_group( Group * aGroup );
453
454//------------------------------------------------------------------------------
455
456 const Cell< string > &
457 dof_fields() const ;
458
459//------------------------------------------------------------------------------
460
461 const Cell< string > &
462 flux_fields() const;
463
464//------------------------------------------------------------------------------
465
469 const Cell< string > &
470 tensor_fields() const;
471
472//------------------------------------------------------------------------------
473
474 const Cell< string > &
475 other_fields() const;
476
477//------------------------------------------------------------------------------
478
479 const Cell< string > &
480 all_fields() const ;
481
482//------------------------------------------------------------------------------
483
484 const string &
485 field( const index_t aIndex ) const ;
486
487//------------------------------------------------------------------------------
488
489 index_t
490 number_of_fields() const ;
491
492//------------------------------------------------------------------------------
493
499 uint
501
502//------------------------------------------------------------------------------
503
504 uint
505 number_of_dofs_per_node( const id_t aBlockID ) const ;
506
507//------------------------------------------------------------------------------
508
509 uint
510 number_of_dofs_per_node_on_sideset( const id_t aSideSetID ) const ;
511
512//------------------------------------------------------------------------------
513
514
515 uint
516 number_of_dofs_per_edge( const id_t aBlockID ) const ;
517
518//------------------------------------------------------------------------------
519
520 uint
521 number_of_dofs_per_face( const id_t aBlockID ) const ;
522
523//------------------------------------------------------------------------------
524
525 uint
526 number_of_dofs_per_cell( const id_t aBlockID ) const ;
527
528//------------------------------------------------------------------------------
529
530 virtual uint
531 number_of_dofs_per_element( Block * aBlock ) const ;
532
533//------------------------------------------------------------------------------
534
535 uint
536 number_of_nodes_per_element( SideSet * aSideSet ) const ;
537
538//------------------------------------------------------------------------------
539
540 uint
541 number_of_edges_per_element( SideSet * aSideSet ) const ;
542
543//------------------------------------------------------------------------------
544
545 uint
546 number_of_faces_per_element( SideSet * aSideSet ) const ;
547
548//------------------------------------------------------------------------------
549
550 virtual uint
551 number_of_dofs_per_element( SideSet * aSideSet ) const ;
552
553//------------------------------------------------------------------------------
554
555 uint
556 number_of_lambda_dofs( const id_t aSideSetID ) const ;
557
558//------------------------------------------------------------------------------
559
560 const Vector< index_t > &
561 dofs_per_node( const id_t aBlockID ) const ;
562
563//------------------------------------------------------------------------------
564
565 const Vector< index_t > &
566 dofs_per_edge( const id_t aBlockID ) const ;
567
568//------------------------------------------------------------------------------
569
570 const Vector< index_t > &
571 dofs_per_face( const id_t aBlockID ) const ;
572
573//------------------------------------------------------------------------------
574
575 const Vector< index_t > &
576 dofs_per_cell( const id_t aBlockID ) const ;
577
578//------------------------------------------------------------------------------
579
580
581//------------------------------------------------------------------------------
582
583 const Vector< index_t > &
584 lambda_dofs( const id_t aSideSetID ) const ;
585
586//------------------------------------------------------------------------------
587
588 const Vector< index_t > &
589 dofs_per_node_on_sideset( const id_t aSideSetID, const bool aSideSetOnly = false ) const ;
590
591//------------------------------------------------------------------------------
592
593 const Vector< index_t > &
594 dofs_per_edge_on_sideset( const id_t aSideSetID, const bool aSideSetOnly = false ) const ;
595
596//------------------------------------------------------------------------------
597
598 const Vector< index_t > &
599 dofs_per_face_on_sideset( const id_t aSideSetID, const bool aSideSetOnly = false ) const ;
600
601//------------------------------------------------------------------------------
602
603 const Vector< index_t > &
604 dofs_per_cell_on_sideset( const id_t , const bool aSideSetOnly = false ) const ;
605
606//------------------------------------------------------------------------------
607
608 const Vector< index_t > &
609 dof_entity_types() const ;
610
611//------------------------------------------------------------------------------
612
613 const Vector< index_t > &
614 default_dof_types() const ;
615
616//------------------------------------------------------------------------------
617
621 index_t
622 edge_multiplicity() const ;
623
624//------------------------------------------------------------------------------
625
629 index_t
630 face_multiplicity() const ;
631
632//------------------------------------------------------------------------------
633
637 index_t
638 cell_multiplicity() const ;
639
640//------------------------------------------------------------------------------
641
642 index_t
643 edge_field_index( const index_t aDofType ) const;
644
645//------------------------------------------------------------------------------
646
647 index_t
648 face_field_index( const index_t aDofType ) const;
649
650//------------------------------------------------------------------------------
651
657 inline const Vector< index_t > &
658 dofs_per_sideset( const id_t aSidesetID ) const ;
659
660//------------------------------------------------------------------------------
661
662 uint
663 num_rhs_cols() const;
664
665//------------------------------------------------------------------------------
666
667 void
668 virtual set_field( DofManagerBase * aField );
669
670//------------------------------------------------------------------------------
671
675 void
676 detach_field( const DofManagerBase * aField );
677
678//------------------------------------------------------------------------------
679
680 IwgType
681 type() const ;
682
683//------------------------------------------------------------------------------
684
686 model_dimensionality() const ;
687
688//------------------------------------------------------------------------------
689
690 void
692
693//------------------------------------------------------------------------------
694
696 interpolation_type() const ;
697
698//------------------------------------------------------------------------------
699
700 IwgMode
701 mode() const ;
702
703//------------------------------------------------------------------------------
704
709 real
710 omega() const;
711
712//------------------------------------------------------------------------------
713
718 void
719 set_omega( const real & aOmega );
720
721//------------------------------------------------------------------------------
722
727 void
728 set_penalty( const real aPsi, const uint aIndex=0 );
729
730//------------------------------------------------------------------------------
731
732 real
733 penalty( const uint aIndex ) const;
734
735//------------------------------------------------------------------------------
736
741 symmetry_mode() const;
742
743//------------------------------------------------------------------------------
744
748 void
749 set_num_rhs_cols( const uint & aNumRhsCols );
750
751//------------------------------------------------------------------------------
752
753 virtual void
754 set_wetted_sidesets( const Vector< id_t > & aSideSets );
755
756//------------------------------------------------------------------------------
757
758 const Vector< id_t > &
759 wetted_sidesets() const ;
760
761//------------------------------------------------------------------------------
762
763 // timestep [s] of a transient problem; writable
764 real &
765 delta_time() ;
766
767//---------------------------------------------------------------------------------
768
769 uint &
770 time_loop() ;
771
772//------------------------------------------------------------------------------
773
778 void
779 add_fields( const Cell< string > & aFieldLabels );
780
781//------------------------------------------------------------------------------
782
786 bool
787 has_convection() const ;
788
789//------------------------------------------------------------------------------
790
795 virtual void
797 Element * aElement,
798 const uint aDirection,
799 Matrix< real > & aJacobian );
800
801//------------------------------------------------------------------------------
802
803 void
805 const Vector< id_t > & aBlockIDs,
806 const Cell< DomainType > & aBlockTypes ) ;
807
808//------------------------------------------------------------------------------
809
810 void
812 const Vector< id_t > & aSideSetIDs,
813 const Cell< DomainType > & aSideSetTypes ) ;
814
815//------------------------------------------------------------------------------
816
818 block_type( const id_t aID ) const ;
819
820//------------------------------------------------------------------------------
821
823 sideset_type( const id_t aID ) const ;
824
825//------------------------------------------------------------------------------
826
831 block_activation_mode( const DomainType aType ) const ;
832
833//------------------------------------------------------------------------------
834
839 sideset_activation_mode( const DomainType aType ) const ;
840
841//------------------------------------------------------------------------------
842
843 virtual void
844 initialize();
845
846//------------------------------------------------------------------------------
847
848 virtual void
849 initialize( const IwgType aType );
850
851//------------------------------------------------------------------------------
852
853 bool
854 is_initialized() const ;
855
856 inline bool
857 enrich_sidesets() const ;
858
859//------------------------------------------------------------------------------
860
866 virtual int
867 check_mesh( Mesh * aMesh, const proc_t aMasterRank=0 );
868
869//------------------------------------------------------------------------------
870
874 void
875 hide_fields_from_exodus( Mesh * aMesh );
876
877//-----------------------------------------------------------------------------
878
882 virtual bool
883 has_edge_dofs() const ;
884
885//-----------------------------------------------------------------------------
886
890 uint
891 lambda_multiplicity() const ;
892
893//-----------------------------------------------------------------------------
894
899 sideset_dof_link_mode() const ;
900
901//-----------------------------------------------------------------------------
902
906 void
907 set_algorithm( const SolverAlgorithm aAlgorithm );
908
909//-----------------------------------------------------------------------------
910
915 algorithm() const ;
916
917//------------------------------------------------------------------------------
918
923 virtual void
924 shift_fields();
925
926//------------------------------------------------------------------------------
927
932 virtual void
933 reset_fields();
934
935//------------------------------------------------------------------------------
936
939 void
941 Element * aElement,
942 Cell< string > & aFieldLabels,
943 Matrix< real > & aData );
944
945//------------------------------------------------------------------------------
946
947 void
949 Element * aElement,
950 const string & aFieldLabel );
951
952//------------------------------------------------------------------------------
953
954 void
956 Element * aElement,
957 const Cell< string > & aFieldLabels );
958
959//------------------------------------------------------------------------------
960
961 // TODO(cm): retire both collect_node_data overloads; the remaining
962 // caller is cl_FEM_Calculator.cpp
963 void
965 Element * aElement,
966 const string & aFieldLabel,
967 Vector< real > & aData );
968
969//------------------------------------------------------------------------------
970
971 // TODO(cm): retire this overload once the caller named above no
972 // longer uses collect_node_data. aData must hold
973 // aOffset + number_of_nodes() entries; aOffset is advanced past
974 // the appended values.
975 void
977 Element * aElement,
978 const string & aFieldLabel,
979 Vector< real > & aData,
980 uint & aOffset );
981
982//------------------------------------------------------------------------------
983
984 void
986 Element * aElement,
987 const string & aEdgeFieldLabel,
988 Vector< real > & aData );
989
990//------------------------------------------------------------------------------
991
992 void
994 Element * aElement,
995 const string & aEdgeFieldLabel,
996 const string & aFaceFieldLabel,
997 Vector< real > & aData );
998
999//------------------------------------------------------------------------------
1000
1001 void
1003 Element * aElement,
1004 const string & aFieldLabel,
1005 real & aData ) ;
1006
1007//------------------------------------------------------------------------------
1008
1012 uint
1013 doftype( const string & aDofLabel ) const ;
1014
1015//---------------------------------------------------------------------------------
1016
1021 void
1022 unique_and_rearrange( Cell< string > & aDofs, const bool aMakeMap=false );
1023
1024//---------------------------------------------------------------------------------
1025
1026 bool
1028
1029//---------------------------------------------------------------------------------
1030
1031 bool
1033
1034//---------------------------------------------------------------------------------
1035
1036 virtual void
1037 compute_mkf( Element * aElement );
1038
1039//------------------------------------------------------------------------------
1040
1043 virtual TimestepMatrices *
1044 matrices();
1045
1046//------------------------------------------------------------------------------
1047
1051 void
1052 print_dofs( Element * aElement, const bool aLocal=false );
1053
1054//---------------------------------------------------------------------------------
1055
1059 const string &
1060 dof_label( const index_t aDofIndex );
1061
1062//---------------------------------------------------------------------------------
1069 Calculator *
1070 calc();
1071
1072//------------------------------------------------------------------------------
1073 // This list holds nodes that carry, for example, the currents of
1074 // Maxwell cuts. The pointer list is copied; the mesh owns the nodes.
1075
1076 void
1078
1079 void
1081
1084
1087
1088 index_t
1089 abstract_dof_type() const ;
1090
1091 virtual void
1093
1094//------------------------------------------------------------------------------
1095
1096 virtual void
1098
1099 uint
1100 get_field_index( const uint aDofType ) const ;
1101
1102//------------------------------------------------------------------------------
1103
1104 virtual void
1106
1107//------------------------------------------------------------------------------
1108
1109 void
1110 set_abstract_dof_type( const uint aDofType );
1111
1112
1113
1114//------------------------------------------------------------------------------
1115
1116 // set the timestepping method
1117 virtual void
1119 const EulerMethod aMethod,
1120 const bool aHaveStiffness=true );
1121
1122 // return the timestepping method
1123 virtual EulerMethod
1124 method() const ;
1125
1126//------------------------------------------------------------------------------
1127
1128 virtual uint
1129 timestepping_order() const ;
1130
1131//------------------------------------------------------------------------------
1132 protected:
1133//------------------------------------------------------------------------------
1134
1138 void
1140
1141//------------------------------------------------------------------------------
1142
1143 void
1145
1146//------------------------------------------------------------------------------
1147
1148 void
1150
1151//------------------------------------------------------------------------------
1156 virtual void
1157 assign_dofs_per_block( const Vector< id_t > & aBlockIDs );
1158
1159//------------------------------------------------------------------------------
1160
1165 virtual void
1166 assign_dofs_per_sideset( const Vector< id_t > & aSideSetIDs );
1167
1168//------------------------------------------------------------------------------
1169
1179 virtual void
1181
1182//------------------------------------------------------------------------------
1183
1188 virtual void
1189 allocate_work_matrices( Group * aGroup );
1190
1191//------------------------------------------------------------------------------
1192
1196 void
1197 collect_nodes_on_wetted_sitdesets( Mesh * aMesh, const Vector< id_t > & aSideSets );
1198
1199//------------------------------------------------------------------------------
1200
1201 void
1203
1204//------------------------------------------------------------------------------
1205
1206 void
1208
1209//------------------------------------------------------------------------------
1210
1215 void
1216 collect_node_coords( Element * aElement, Matrix< real > & aX );
1217
1218//------------------------------------------------------------------------------
1219 private:
1220//------------------------------------------------------------------------------
1221
1222 void
1223 create_doftype_map() ;
1224
1225//---------------------------------------------------------------------------------
1226
1227 void
1228 concatenate_field_lists();
1229
1230//---------------------------------------------------------------------------------
1231
1232 void
1233 create_block_dof_tables( const uint aNumBlocks );
1234
1235//---------------------------------------------------------------------------------
1236
1237 void
1238 create_sideset_dof_tables( const uint aNumSideSets );
1239
1240//---------------------------------------------------------------------------------
1241
1242 void
1243 count_sideset_dofs_per_sideset(
1244 Vector< index_t > & aDofsPerSideSet,
1245 DofTable * aDofTable,
1246 Vector< uint > & aCount,
1248 const bool aUseBitset );
1249
1250//---------------------------------------------------------------------------------
1251 };
1252//------------------------------------------------------------------------------
1253
1254 inline const Vector< id_t > &
1256 {
1257 return mBlockIDs ;
1258 }
1259
1260//------------------------------------------------------------------------------
1261
1262 inline const Vector< id_t > &
1264 {
1265 return mSideSetIDs ;
1266 }
1267
1268//------------------------------------------------------------------------------
1269
1270 inline bool
1272 {
1273 return mHasConvection ;
1274 }
1275
1276//------------------------------------------------------------------------------
1277
1278 inline const Cell< string > &
1280 {
1281 return mDofFields ;
1282 }
1283
1284
1285//------------------------------------------------------------------------------
1286
1287 inline const Cell< string > &
1289 {
1290 return mFluxFields ;
1291 }
1292
1293//------------------------------------------------------------------------------
1294
1295 inline const Cell< string > &
1297 {
1298 return mTensorFields ;
1299 }
1300
1301//------------------------------------------------------------------------------
1302
1303 inline const Cell< string > &
1305 {
1306 return mOtherFields ;
1307 }
1308
1309//------------------------------------------------------------------------------
1310
1311 inline const Cell< string > &
1313 {
1314 return mAllFields ;
1315 }
1316
1317//------------------------------------------------------------------------------
1318
1319 inline const string &
1320 IWG::field( const index_t aIndex ) const
1321 {
1322 return mAllFields( aIndex );
1323 }
1324
1325//------------------------------------------------------------------------------
1326
1327 inline index_t
1329 {
1330 return mAllFields.size() ;
1331 }
1332
1333//------------------------------------------------------------------------------
1334
1335 inline real
1337 {
1338 return mOmega ;
1339 }
1340
1341//------------------------------------------------------------------------------
1342
1343 inline real
1344 IWG::penalty( const uint aIndex ) const
1345 {
1346 return mPenalty( aIndex ) ;
1347 }
1348
1349//------------------------------------------------------------------------------
1350
1351 inline uint
1352 IWG::number_of_dofs_per_node( const id_t aBlockID ) const
1353 {
1354 return mBlockDofs( mBlockIndices( aBlockID ) )->Node.length() ;
1355 }
1356
1357//------------------------------------------------------------------------------
1358
1359 inline uint
1361 {
1362 return mSideSetDofs( mSideSetIndices( aSideSetID ) )->Node.length() ;
1363 }
1364
1365//------------------------------------------------------------------------------
1366
1367 inline uint
1368 IWG::number_of_dofs_per_edge( const id_t aBlockID ) const
1369 {
1370 return mBlockDofs( mBlockIndices( aBlockID ) )->Edge.length() * mEdgeDofMultiplicity ;
1371 }
1372
1373//------------------------------------------------------------------------------
1374
1375 inline uint
1376 IWG::number_of_dofs_per_face( const id_t aBlockID ) const
1377 {
1378 return mBlockDofs( mBlockIndices( aBlockID ) )->Face.length() * mFaceDofMultiplicity ;
1379 }
1380
1381//------------------------------------------------------------------------------
1382
1383 inline uint
1384 IWG::number_of_dofs_per_cell( const id_t aBlockID ) const
1385 {
1386 return mBlockDofs( mBlockIndices( aBlockID ) )->Cell.length() * mCellDofMultiplicity ;
1387 }
1388
1389//------------------------------------------------------------------------------
1390
1391 inline const Vector< index_t > &
1392 IWG::dofs_per_node( const id_t aBlockID ) const
1393 {
1394 return mBlockDofs( mBlockIndices( aBlockID ) )->Node;
1395 }
1396
1397//------------------------------------------------------------------------------
1398
1399 inline const Vector< index_t > &
1400 IWG::dofs_per_edge( const id_t aBlockID ) const
1401 {
1402 return mBlockDofs( mBlockIndices( aBlockID ) )->Edge;
1403 }
1404
1405//------------------------------------------------------------------------------
1406
1407 inline const Vector< index_t > &
1408 IWG::dofs_per_face( const id_t aBlockID ) const
1409 {
1410 return mBlockDofs( mBlockIndices( aBlockID ) )->Face;
1411 }
1412
1413//------------------------------------------------------------------------------
1414
1415 inline index_t
1417 {
1418 return mEdgeDofMultiplicity ;
1419 }
1420
1421//------------------------------------------------------------------------------
1422
1423 inline index_t
1425 {
1426 return mFaceDofMultiplicity ;
1427 }
1428
1429//------------------------------------------------------------------------------
1430
1431 inline index_t
1433 {
1434 return mCellDofMultiplicity ;
1435 }
1436
1437//------------------------------------------------------------------------------
1438
1439 inline const Vector< index_t > &
1440 IWG::dofs_per_cell( const id_t aBlockID ) const
1441 {
1442 return mBlockDofs( mBlockIndices( aBlockID ) )->Cell;
1443 }
1444
1445//------------------------------------------------------------------------------
1446
1447 // inline Vector< index_t > &
1448 //IWG::lambda_dofs( const id_t aSideSetID )
1449 //{
1450 // return mSideSetLambdaDofs( mSideSetIndices( aSideSetID ) );
1451 //}
1452
1453//------------------------------------------------------------------------------
1454
1455 inline const Vector< index_t > &
1456 IWG::dofs_per_node_on_sideset( const id_t aSideSetID, const bool aSideSetOnly ) const
1457 {
1458 return aSideSetOnly ?
1459 mSideSetOnlyDofs( mSideSetIndices( aSideSetID ) )->Node :
1460 mSideSetDofs( mSideSetIndices( aSideSetID ) )->Node ;
1461 }
1462
1463//------------------------------------------------------------------------------
1464
1465 inline const Vector< index_t > &
1466 IWG::dofs_per_edge_on_sideset( const id_t aSideSetID, const bool aSideSetOnly ) const
1467 {
1468 return aSideSetOnly ?
1469 mSideSetOnlyDofs( mSideSetIndices( aSideSetID ) )->Edge :
1470 mSideSetDofs( mSideSetIndices( aSideSetID ) )->Edge ;
1471 }
1472
1473//------------------------------------------------------------------------------
1474
1475 inline const Vector< index_t > &
1476 IWG::dofs_per_face_on_sideset( const id_t aSideSetID, const bool aSideSetOnly ) const
1477 {
1478 return aSideSetOnly ?
1479 mSideSetOnlyDofs( mSideSetIndices( aSideSetID ) )->Face :
1480 mSideSetDofs( mSideSetIndices( aSideSetID ) )->Face ;
1481 }
1482
1483//------------------------------------------------------------------------------
1484
1485 inline const Vector< index_t > &
1486 IWG::dofs_per_cell_on_sideset( const id_t aSideSetID, const bool aSideSetOnly ) const
1487 {
1488 return aSideSetOnly ?
1489 mSideSetOnlyDofs( mSideSetIndices( aSideSetID ) )->Cell :
1490 mSideSetDofs( mSideSetIndices( aSideSetID ) )->Cell ;
1491 }
1492
1493//------------------------------------------------------------------------------
1494
1495 inline const Vector< index_t > &
1496 IWG::lambda_dofs( const id_t aSideSetID ) const
1497 {
1498 return mSideSetDofs( mSideSetIndices( aSideSetID ) )->Lambda ;
1499 }
1500
1501//------------------------------------------------------------------------------
1502
1503 inline const Vector< index_t > &
1505 {
1506 return mDofEntityTypes ;
1507 }
1508
1509//------------------------------------------------------------------------------
1510
1511 inline const Vector< index_t > &
1513 {
1514 return mDefaultDofTypes ;
1515 }
1516
1517//------------------------------------------------------------------------------
1518
1519 inline index_t
1520 IWG::edge_field_index( const index_t aDofType ) const
1521 {
1522 return mEdgeFieldIndices( aDofType );
1523 }
1524
1525//------------------------------------------------------------------------------
1526
1527 inline index_t
1528 IWG::face_field_index( const index_t aDofType ) const
1529 {
1530 return mFaceFieldIndices( aDofType );
1531 }
1532
1533//------------------------------------------------------------------------------
1534
1535 inline const Vector< index_t > &
1536 IWG::dofs_per_sideset( const id_t aSidesetID ) const
1537 {
1538 return mDofsPerSideSet( mSideSetIndices( aSidesetID ) );
1539 }
1540
1541//------------------------------------------------------------------------------
1542
1543 inline bool
1545 {
1546 return mIsInitialized ;
1547 }
1548
1549//------------------------------------------------------------------------------
1550
1551 inline bool
1553 {
1554 return mEnrichSideSets ;
1555 }
1556
1557//------------------------------------------------------------------------------
1558
1559 inline int
1560 IWG::check_mesh( Mesh * aMesh, const proc_t aMasterRank )
1561 {
1562 return aMesh == nullptr ? 1 : 0 ;
1563 }
1564
1565
1566//------------------------------------------------------------------------------
1567
1568 inline bool
1570 {
1571 return false ;
1572 }
1573
1574//------------------------------------------------------------------------------
1575
1576 inline uint
1578 {
1579 return mLambdaDofMultiplicity ;
1580 }
1581
1582//------------------------------------------------------------------------------
1583
1584 inline SideSetDofLinkMode
1586 {
1587 return mSideSetDofLinkMode ;
1588 }
1589
1590//------------------------------------------------------------------------------
1591
1592 inline SolverAlgorithm
1594 {
1595 return mSolverAlgorithm ;
1596 }
1597
1598//------------------------------------------------------------------------------
1599
1600 inline uint
1601 IWG::doftype( const string & aDofLabel ) const
1602 {
1603 if( mDofTypeMap.key_exists( aDofLabel ) )
1604 {
1605 return mDofTypeMap( aDofLabel );
1606 }
1607 else
1608 {
1609 return BELFEM_UINT_MAX ;
1610 }
1611 }
1612
1613//------------------------------------------------------------------------------
1614
1615 inline bool
1620
1621
1622//---------------------------------------------------------------------------------
1623
1624 inline bool
1626 {
1628 }
1629
1630//---------------------------------------------------------------------------------
1631
1632 inline const string &
1633 IWG::dof_label( const index_t aDofIndex )
1634 {
1635 return mDofLabels( aDofIndex );
1636 }
1637
1638//---------------------------------------------------------------------------------
1639
1640 inline uint &
1642 {
1643 return mTimeLoop ;
1644 }
1645
1646//------------------------------------------------------------------------------
1647
1648 inline void
1650 {
1651 mInterpolationType = aType ;
1652 }
1653
1654//------------------------------------------------------------------------------
1655
1656 inline InterpolationType
1658 {
1659 return mInterpolationType ;
1660 }
1661
1662//------------------------------------------------------------------------------
1663
1664 inline Calculator *
1666 {
1667 return mCalc ;
1668 }
1669
1670//------------------------------------------------------------------------------
1671
1672 inline Cell< mesh::Node * > &
1674 {
1675 return mAbstractNodes ;
1676 }
1677
1678
1679 inline index_t
1681 {
1682 return mAbstractDofType ;
1683 }
1684
1685 inline Cell< mesh::Node * > &
1687 {
1688 return mOrphanedNodes ;
1689 }
1690
1691 inline uint
1692 IWG::get_field_index( const uint aDofType ) const
1693 {
1694 return mDofFieldMap( aDofType );
1695 }
1696
1697//---------------------------------------------------------------------------------
1698 }
1699}
1700#endif //BELFEM_CL_IWG_HPP
Compile-time fixed-size bitset.
Definition cl_Bitset.hpp:32
size_t size() const
Definition cl_Cell.hpp:189
bool key_exists(const Key &aKey) const
Definition cl_Map.hpp:161
Base class for all materials in BELFEM.
Definition cl_Material.hpp:270
Top-level container for all mesh entities.
Definition cl_Mesh.hpp:60
Definition cl_FEM_Block.hpp:35
Definition cl_FEM_Calculator.hpp:596
abstract interface of the dof manager as seen by the group classes and the IWG; DofManager is its onl...
Definition cl_FEM_DofManagerBase.hpp:44
Definition cl_FEM_Element.hpp:41
Definition cl_FEM_Group.hpp:45
bool compute_jacobian_on_block() const
Definition cl_IWG.hpp:1625
uint mTimeLoop
value for timeloop, needed if we don't want to write every timestep
Definition cl_IWG.hpp:103
bool mEnrichSideSets
Definition cl_IWG.hpp:100
virtual void custom_postprocess()
Definition cl_IWG.cpp:2106
Cell< DofTable * > mSideSetOnlyDofs
Definition cl_IWG.hpp:249
IwgMode mode() const
Definition cl_IWG.cpp:210
uint number_of_dofs_per_node() const
TODO(cm): retire number_of_dofs_per_node() for the block-scoped overload below.
Definition cl_IWG.cpp:696
virtual void compute_boundary_flux_matrix(Element *aElement, const uint aDirection, Matrix< real > &aJacobian)
special function to compute the boundary flux in magnetics impose zero as weak BC
Definition cl_IWG.cpp:1591
uint mNumberOfNodesPerMaster
Definition cl_IWG.hpp:163
void collect_lambda_data(Element *aElement, const string &aFieldLabel, real &aData)
Definition cl_IWG.cpp:955
index_t cell_multiplicity() const
tells how many dofs sit on one cell
Definition cl_IWG.hpp:1432
DomainType block_type(const id_t aID) const
Definition cl_IWG.cpp:1972
void count_dofs_per_block()
Definition cl_IWG.cpp:1429
uint mNumberOfThinShellLayers
Definition cl_IWG.hpp:150
const Vector< index_t > & dofs_per_cell_on_sideset(const id_t, const bool aSideSetOnly=false) const
Definition cl_IWG.hpp:1486
Vector< index_t > mNodesOnWettedSidesets
Definition cl_IWG.hpp:208
Cell< string > mOtherFields
Definition cl_IWG.hpp:191
Vector< index_t > mDefaultDofTypes
Definition cl_IWG.hpp:230
bool compute_jacobian_on_sideset() const
Definition cl_IWG.hpp:1616
void detach_field(const DofManagerBase *aField)
forgets aField if it is the linked one.
Definition cl_IWG.cpp:721
Cell< mesh::Node * > mOrphanedNodes
nodes that belong to no active element but still carry a phi dof ( see Mesh::orphaned_nodes() )
Definition cl_IWG.hpp:297
uint & time_loop()
Definition cl_IWG.hpp:1641
Map< DomainType, GroupActivationMode > mBlockActivationModes
maps domain types to activation modes for blocks
Definition cl_IWG.hpp:282
Vector< real > mPenalty
Definition cl_IWG.hpp:93
uint mNumberOfEdgeDofsPerElement
Definition cl_IWG.hpp:176
virtual void compute_jacobian(Element *aElement, Matrix< real > &aJacobian)
The caller provides aJacobian, sized number_of_dofs_per_element() squared, in the element's local dof...
Definition cl_IWG.cpp:287
Cell< string > mTensorFields
Definition cl_IWG.hpp:188
SolverAlgorithm algorithm() const
returns the solver algorithm
Definition cl_IWG.hpp:1593
Cell< string > mDofFields
Definition cl_IWG.hpp:182
index_t number_of_fields() const
Definition cl_IWG.hpp:1328
Vector< id_t > mWettedSidesets
Definition cl_IWG.hpp:202
const string & field(const index_t aIndex) const
Definition cl_IWG.hpp:1320
Cell< string > mFluxFields
Definition cl_IWG.hpp:185
const Cell< string > & flux_fields() const
Definition cl_IWG.hpp:1288
const Vector< id_t > & selected_sidesets() const
returns the list of selected sidesets
Definition cl_IWG.hpp:1263
DofTable mAbstractNodeTable
Definition cl_IWG.hpp:302
virtual void compute_rhs(Element *aElement, Vector< real > &aRHS)
Definition cl_IWG.cpp:297
uint mNumberOfEdgesPerElement
Definition cl_IWG.hpp:166
uint mNumberOfNodesPerSlave
Definition cl_IWG.hpp:164
uint mNumberOfDofsPerFace
Definition cl_IWG.hpp:147
const SideSetDofLinkMode mSideSetDofLinkMode
mode how sidesets are linked
Definition cl_IWG.hpp:131
DomainType sideset_type(const id_t aID) const
Definition cl_IWG.cpp:1987
Map< id_t, DomainType > mSideSetTypes
links sideset IDs with the designated types
Definition cl_IWG.hpp:276
Cell< DofTable * > mSideSetDofs
contains the sideset dofs
Definition cl_IWG.hpp:245
Cell< string > mHiddenFields
Definition cl_IWG.hpp:196
void select_sidesets(const Vector< id_t > &aSidesetIDs)
the sidesets are selected over the IWG object.
Definition cl_IWG.cpp:264
void delete_block_dof_tables()
Definition cl_IWG.cpp:1688
virtual void reset_fields()
called by main file to copy fields from last timestep eg.
Definition cl_IWG.cpp:1680
Map< id_t, DomainType > mBlockTypes
Definition cl_IWG.hpp:273
const Cell< string > & all_fields() const
Definition cl_IWG.hpp:1312
uint get_field_index(const uint aDofType) const
Definition cl_IWG.hpp:1692
Cell< string > mAllFields
Definition cl_IWG.hpp:193
void unique_and_rearrange(Cell< string > &aDofs, const bool aMakeMap=false)
makes sure that dof list is unique and also creares dofmap must be accessible by Mawell_FieldList as ...
Definition cl_IWG.cpp:1721
uint mNumberOfNodesPerElement
Definition cl_IWG.hpp:162
virtual void allocate_work_matrices(Group *aGroup)
Sizes the group's node-coordinate work matrix before its element loop.
Definition cl_IWG.cpp:972
GroupActivationMode block_activation_mode(const DomainType aType) const
returns the activation mode for a block based on its domain type
Definition cl_IWG.cpp:2014
uint mNumberOfRhsEdgeDofsPerElement
Definition cl_IWG.hpp:179
bool has_convection() const
tells if this field has an alpha boundary condition
Definition cl_IWG.hpp:1271
void set_sidesets(const Vector< id_t > &aSideSetIDs, const Cell< DomainType > &aSideSetTypes)
Definition cl_IWG.cpp:1620
void collect_node_data(Element *aElement, Cell< string > &aFieldLabels, Matrix< real > &aData)
The caller pre-sizes aData.
Definition cl_IWG.cpp:732
Map< uint, uint > mDofFieldMap
Definition cl_IWG.hpp:227
void set_algorithm(const SolverAlgorithm aAlgorithm)
sets the mode for the solver algorithm
Definition cl_IWG.cpp:82
bool mComputeJacobianOnSideset
Definition cl_IWG.hpp:112
SymmetryMode mSymmetryMode
needed for the solver
Definition cl_IWG.hpp:125
uint number_of_edges_per_element(SideSet *aSideSet) const
Definition cl_IWG.cpp:536
uint number_of_lambda_dofs(const id_t aSideSetID) const
Definition cl_IWG.cpp:684
IwgType type() const
Definition cl_IWG.cpp:194
index_t edge_field_index(const index_t aDofType) const
Definition cl_IWG.hpp:1520
Calculator * mCalc
Definition cl_IWG.hpp:140
void delete_boundary_conditions()
Reserved; not defined and not called by the destructor.
bool enrich_sidesets() const
Definition cl_IWG.hpp:1552
uint number_of_dofs_per_node_on_sideset(const id_t aSideSetID) const
Definition cl_IWG.hpp:1360
Map< string, uint > mDofMap
Definition cl_IWG.hpp:262
Cell< Vector< index_t > > mDofsPerSideSet
Definition cl_IWG.hpp:239
uint number_of_faces_per_element(SideSet *aSideSet) const
Definition cl_IWG.cpp:568
const Vector< index_t > & default_dof_types() const
Definition cl_IWG.hpp:1512
virtual void set_timestepping_method(const EulerMethod aMethod, const bool aHaveStiffness=true)
Definition cl_IWG.cpp:2046
void set_num_rhs_cols(const uint &aNumRhsCols)
special function, must be called before init->jacobian() is called
Definition cl_IWG.cpp:104
index_t mAbstractDofType
Definition cl_IWG.hpp:303
virtual void initialize()
Definition cl_IWG.cpp:1097
const ModelDimensionality mDimensionality
this enum tells which dimensionality we have
Definition cl_IWG.hpp:118
Cell< DofTable * > mBlockDofs
contains the block dofs
Definition cl_IWG.hpp:242
Vector< real > mNormal2D
TODO(cm): mNormal2D and mNormal3D have no reader; delete both.
Definition cl_IWG.hpp:288
void set_omega(const real &aOmega)
All ranks must call it.
Definition cl_IWG.cpp:1003
virtual bool has_edge_dofs() const
flag telling if the IWG has edge dofs
Definition cl_IWG.hpp:1569
virtual int check_mesh(Mesh *aMesh, const proc_t aMasterRank=0)
This routine makes sure that the mesh fulfills the requirements.
Definition cl_IWG.hpp:1560
const Vector< index_t > & dofs_per_edge(const id_t aBlockID) const
Definition cl_IWG.hpp:1400
Vector< id_t > mBlockIDs
Definition cl_IWG.hpp:214
Vector< id_t > mSideSetIDs
Definition cl_IWG.hpp:217
Group * mGroup
Definition cl_IWG.hpp:139
bool mIsInitialized
flag telling if we have been initialized
Definition cl_IWG.hpp:96
virtual void link_to_group(Group *aGroup)
The IWG borrows the group, its calculator and the pointers reachable from them.
Definition cl_IWG.cpp:353
void select_blocks(const Vector< id_t > &aBlockIDs)
the blocks are selected over the IWG object.
Definition cl_IWG.cpp:241
virtual uint timestepping_order() const
Definition cl_IWG.cpp:2090
const Vector< index_t > & dofs_per_face_on_sideset(const id_t aSideSetID, const bool aSideSetOnly=false) const
Definition cl_IWG.hpp:1476
bool mComputeJacobianOnBlock
Definition cl_IWG.hpp:105
void select_block(const id_t aBlockID)
Definition cl_IWG.cpp:218
const IwgMode mMode
this enum tells if we have to perform a Newton-Raphson
Definition cl_IWG.hpp:121
uint mNumberOfFacesPerElement
Definition cl_IWG.hpp:167
const Cell< string > & tensor_fields() const
special purpose if RHS is a matrix
Definition cl_IWG.hpp:1296
real penalty(const uint aIndex) const
Definition cl_IWG.hpp:1344
Map< id_t, index_t > mBlockIndices
Definition cl_IWG.hpp:220
Map< string, uint > mDofTypeMap
Definition cl_IWG.hpp:226
Map< DomainType, GroupActivationMode > mSideSetActivationModes
maps domain types to activation modes for sidesets
Definition cl_IWG.hpp:285
IWG(const IWG &)=delete
uint mNumberOfRhsCols
Definition cl_IWG.hpp:199
void set_interpolation_type(const InterpolationType aType)
Definition cl_IWG.hpp:1649
uint mNumberOfDerivativeDimensions
Definition cl_IWG.hpp:159
index_t mCellDofMultiplicity
Definition cl_IWG.hpp:259
void collect_edge_data(Element *aElement, const string &aEdgeFieldLabel, Vector< real > &aData)
Definition cl_IWG.cpp:869
virtual void compute_mkf(Element *aElement)
Definition cl_IWG.cpp:326
const Vector< index_t > & dofs_per_node(const id_t aBlockID) const
Definition cl_IWG.hpp:1392
const Vector< index_t > & dofs_per_edge_on_sideset(const id_t aSideSetID, const bool aSideSetOnly=false) const
Definition cl_IWG.hpp:1466
const Vector< index_t > & dofs_per_node_on_sideset(const id_t aSideSetID, const bool aSideSetOnly=false) const
Definition cl_IWG.hpp:1456
uint lambda_multiplicity() const
if this number is > 0, we have langrande dofs such as contact
Definition cl_IWG.hpp:1577
IWG & operator=(const IWG &)=delete
virtual TimestepMatrices * matrices()
A timestep IWG returns the work matrices it owns.
Definition cl_IWG.cpp:334
index_t abstract_dof_type() const
Definition cl_IWG.hpp:1680
InterpolationType interpolation_type() const
Definition cl_IWG.hpp:1657
index_t edge_multiplicity() const
tells how many dofs sit on one edge
Definition cl_IWG.hpp:1416
Calculator * calc()
The group's calculator, borrowed and re-pointed by every link_to_group().
Definition cl_IWG.hpp:1665
virtual void shift_fields()
called by main file to copy fields into last timestep eg.
Definition cl_IWG.cpp:1672
void add_fields(const Cell< string > &aFieldLabels)
add additional non-dof fields to mOtherFields and mAllFields; a label "alpha" also sets mHasConvectio...
Definition cl_IWG.cpp:1050
const Vector< id_t > & wetted_sidesets() const
Definition cl_IWG.cpp:186
Cell< Dof * > mAbstractNodeDofs
list with special dofs that sit on abstract nodes
Definition cl_IWG.hpp:300
const Vector< index_t > & dofs_per_face(const id_t aBlockID) const
Definition cl_IWG.hpp:1408
Map< id_t, index_t > mSideSetIndices
Definition cl_IWG.hpp:223
virtual void compute_alpha_boundary_condition(Element *aElement, Matrix< real > &aJacobian, Vector< real > &aRHS)
Definition cl_IWG.cpp:1085
virtual void compute_convection(Element *aElement, Vector< real > &aConvection)
Definition cl_IWG.cpp:343
Vector< real > mNormal3D
Definition cl_IWG.hpp:289
real & delta_time()
Definition cl_IWG.cpp:1042
Vector< index_t > mDofEntityTypes
Definition cl_IWG.hpp:233
Vector< index_t > mFaceFieldIndices
Definition cl_IWG.hpp:252
const Vector< index_t > & dofs_per_sideset(const id_t aSidesetID) const
intended to be used for interface dof creation
Definition cl_IWG.hpp:1536
uint number_of_dofs_per_cell(const id_t aBlockID) const
Definition cl_IWG.hpp:1384
real omega() const
The Newton relaxation factor, dimensionless; 1 is an undamped step.
Definition cl_IWG.hpp:1336
real mOmega
Definition cl_IWG.hpp:90
Map< id_t, DomainType > mSideSetSubTypes
links sideset IDs with the designated types
Definition cl_IWG.hpp:279
virtual void collect_abstract_node_dofs()
Definition cl_IWG.cpp:2054
virtual void create_custom_vectors_and_matrices(Calculator *aCalc)
Definition cl_IWG.cpp:2098
uint mNumberOfRhsDofsPerFace
Definition cl_IWG.hpp:149
virtual void init_activation_maps()
populates the activation mode maps for blocks and sidesets based on domain types.
Definition cl_IWG.cpp:2002
uint num_rhs_cols() const
Definition cl_IWG.cpp:704
virtual void assign_dofs_per_block(const Vector< id_t > &aBlockIDs)
this function assumes that all blocks are treated equally.
Definition cl_IWG.cpp:1411
real mDeltaTime
Definition cl_IWG.hpp:205
const Vector< index_t > & lambda_dofs(const id_t aSideSetID) const
Definition cl_IWG.hpp:1496
const Vector< id_t > & selected_blocks() const
returns the list of selected blocks
Definition cl_IWG.hpp:1255
Mesh * mMesh
Definition cl_IWG.hpp:137
virtual void set_wetted_sidesets(const Vector< id_t > &aSideSets)
Definition cl_IWG.cpp:112
index_t face_field_index(const index_t aDofType) const
Definition cl_IWG.hpp:1528
const Cell< string > & dof_fields() const
Definition cl_IWG.hpp:1279
IWG(IWG &&)=delete
void collect_nodes_on_wetted_sitdesets(Mesh *aMesh, const Vector< id_t > &aSideSets)
populate the node indices for the nodes that sit on wetted sidesets
Definition cl_IWG.cpp:145
void hide_fields_from_exodus(Mesh *aMesh)
hides fields that are not to be saved to exodus
Definition cl_IWG.cpp:1658
index_t mLambdaDofMultiplicity
Definition cl_IWG.hpp:260
uint mNumberOfNodeDofsPerElement
Definition cl_IWG.hpp:173
uint mNumberOfSpatialDimensions
Definition cl_IWG.hpp:156
void set_blocks(const Vector< id_t > &aBlockIDs, const Cell< DomainType > &aBlockTypes)
Definition cl_IWG.cpp:1603
SideSetDofLinkMode sideset_dof_link_mode() const
return the dof linking mode for sideset
Definition cl_IWG.hpp:1585
const IwgType mType
this enum tells which equation object is used
Definition cl_IWG.hpp:115
const Vector< index_t > & dofs_per_cell(const id_t aBlockID) const
Definition cl_IWG.hpp:1440
void count_dofs_per_sideset()
Definition cl_IWG.cpp:1528
uint doftype(const string &aDofLabel) const
return the type id of a dof
Definition cl_IWG.hpp:1601
ModelDimensionality model_dimensionality() const
Definition cl_IWG.cpp:202
uint mNumberOfDofsPerEdge
Definition cl_IWG.hpp:146
InterpolationType mInterpolationType
Definition cl_IWG.hpp:291
Cell< Vector< index_t > > mDofsPerBlock
Definition cl_IWG.hpp:236
uint number_of_dofs_per_face(const id_t aBlockID) const
Definition cl_IWG.hpp:1376
Cell< mesh::Node * > mAbstractNodes
abstract nodes needed for cut BCs in MAXWELL
Definition cl_IWG.hpp:294
bool is_initialized() const
Definition cl_IWG.hpp:1544
index_t mFaceDofMultiplicity
Definition cl_IWG.hpp:258
virtual void compute_jacobian_and_rhs(Element *aElement, Matrix< real > &aJacobian, Vector< real > &aRHS)
Definition cl_IWG.cpp:317
uint mNumberOfDofsPerNode
Definition cl_IWG.hpp:145
Cell< mesh::Node * > & abstract_nodes()
Definition cl_IWG.hpp:1673
DofManagerBase * mField
Definition cl_IWG.hpp:138
Cell< mesh::Node * > & orphaned_nodes()
Definition cl_IWG.hpp:1686
Vector< index_t > mEdgeFieldIndices
Definition cl_IWG.hpp:251
const DofMode mDofMode
except maxwell, most IWGs are AllBlocksEqual
Definition cl_IWG.hpp:128
index_t face_multiplicity() const
tells how many dofs sit on one face
Definition cl_IWG.hpp:1424
SolverAlgorithm mSolverAlgorithm
Definition cl_IWG.hpp:135
virtual void assign_dofs_per_sideset(const Vector< id_t > &aSideSetIDs)
this function assumes that all sidesets are treated equally.
Definition cl_IWG.cpp:1420
void set_penalty(const real aPsi, const uint aIndex=0)
All ranks must call it.
Definition cl_IWG.cpp:1015
uint mNumberOfRhsDofsPerEdge
Definition cl_IWG.hpp:148
virtual uint number_of_dofs_per_element(Block *aBlock) const
Definition cl_IWG.cpp:475
void set_abstract_nodes(Cell< mesh::Node * > &aNodes)
Definition cl_IWG.cpp:1027
void delete_sideset_dof_tables()
Definition cl_IWG.cpp:1700
uint number_of_nodes_per_element(SideSet *aSideSet) const
Definition cl_IWG.cpp:491
bool mHasConvection
Definition cl_IWG.hpp:211
virtual void set_field(DofManagerBase *aField)
Definition cl_IWG.cpp:712
void print_dofs(Element *aElement, const bool aLocal=false)
for debugging
Definition cl_IWG.cpp:1888
const string & dof_label(const index_t aDofIndex)
for debugging
Definition cl_IWG.hpp:1633
SymmetryMode symmetry_mode() const
flag telling if matrices are symmetric
Definition cl_IWG.cpp:96
uint number_of_dofs_per_edge(const id_t aBlockID) const
Definition cl_IWG.hpp:1368
virtual EulerMethod method() const
Definition cl_IWG.cpp:2082
index_t mEdgeDofMultiplicity
Definition cl_IWG.hpp:257
void set_abstract_dof_type(const uint aDofType)
Definition cl_IWG.cpp:2074
const Material * mMaterial
Definition cl_IWG.hpp:142
GroupActivationMode sideset_activation_mode(const DomainType aType) const
returns the activation mode for a sideset based on its domain type
Definition cl_IWG.cpp:2030
const Cell< string > & other_fields() const
Definition cl_IWG.hpp:1304
const Vector< index_t > & dof_entity_types() const
Definition cl_IWG.hpp:1504
uint mNumberOfDofsPerElement
Definition cl_IWG.hpp:171
Cell< string > mDofLabels
needed for debug output
Definition cl_IWG.hpp:265
void set_orphaned_nodes(Cell< mesh::Node * > &aNodes)
Definition cl_IWG.cpp:1034
const proc_t mCommRank
Definition cl_IWG.hpp:87
void collect_node_coords(Element *aElement, Matrix< real > &aX)
Sizes aX to number_of_nodes x mNumberOfSpatialDimensions, the problem dimension the derived IWG's con...
Definition cl_IWG.cpp:1637
IWG & operator=(IWG &&)=delete
Definition cl_FEM_SideSet.hpp:64
Container for element-level DENSE matrices in transient nonlinear FEM.
Definition cl_TimestepMatrices.hpp:71
SolverAlgorithm
Definition en_FEM_SolverAlgorithm.hpp:20
@ UNDEFINED
Definition en_FEM_SolverAlgorithm.hpp:24
SideSetDofLinkMode
how the dofs of a sideset element are linked to its facet, master and slave elements ( six modes plus...
Definition en_IWG_SideSetDofLinkMode.hpp:25
@ FacetOnly
Definition en_IWG_SideSetDofLinkMode.hpp:26
GroupActivationMode
Defines how a fem::Block or fem::SideSet is activated based on its DomainType.
Definition en_FEM_GroupActivationMode.hpp:26
USER GUIDES:
Definition cl_Capacitor.cpp:16
IwgMode
Definition en_IWGs.hpp:81
@ Iterative
Definition en_IWGs.hpp:83
IwgType
Definition en_IWGs.hpp:64
InterpolationType
Definition Mesh_Enums.hpp:99
@ LAGRANGE
Definition Mesh_Enums.hpp:100
EulerMethod
Definition en_SolverEnums.hpp:47
DofMode
Definition cl_IWG.hpp:38
@ BlockSpecific
Definition cl_IWG.hpp:40
@ AllBlocksEqual
Definition cl_IWG.hpp:39
unsigned int uint
Definition typedefs.hpp:30
unsigned int id_t
Definition typedefs.hpp:41
ModelDimensionality
Definition en_IWGs.hpp:20
int proc_t
Definition commtypes.hpp:29
constexpr index_t gNoIndex
Definition typedefs.hpp:57
SymmetryMode
Definition en_SolverEnums.hpp:36
@ Unsymmetric
Definition en_SolverEnums.hpp:37
uint32_t index_t
Definition typedefs.hpp:52
double real
Definition typedefs.hpp:36
DomainType
Definition en_DomainType.hpp:20
the dof table contains the dofs per block and sideset
Definition cl_IWG.hpp:63
Vector< index_t > Cell
Definition cl_IWG.hpp:67
Vector< index_t > Node
Definition cl_IWG.hpp:64
Vector< index_t > Face
Definition cl_IWG.hpp:66
Vector< index_t > Edge
Definition cl_IWG.hpp:65
Vector< index_t > Lambda
Definition cl_IWG.hpp:68
#define BELFEM_UINT_MAX
Definition typedefs.hpp:79