BELFEM 0.9.0
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 // relaxation parameter for Newton-Raphson
90 real mOmega = 0.9;
91
92 // penalty factor for weak BC
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
291 Vector< real > mNormal3D = { 0., 0., 0. };
292
294
297
300
303
306
307//------------------------------------------------------------------------------
308 public:
309//------------------------------------------------------------------------------
310
311 // The symmetry default is UNSYMMETRIC on purpose, and must stay
312 // that way. BELFEM assembles and stores the FULL matrix, while
313 // MUMPS with SYM != 0 ( PositiveDefiniteSymmetric = SYM 1,
314 // GeneralSymmetric = SYM 2 ) expects only ONE half of it. Either
315 // half will do -- the user guide 5.5.1 §5.2.2.1 accepts the lower
316 // or the upper triangle including the diagonal -- but only one,
317 // because "duplicate entries are summed" applies to the symmetric
318 // pair: "if both aij and aji are provided, they will be summed".
319 // Handing MUMPS the full matrix under SYM != 0 therefore
320 // factorizes A with every OFF-DIAGONAL DOUBLED and the diagonal
321 // counted once, which is a different operator. Until
322 // 2026-08-29 it did so SILENTLY: measured on the eigen path,
323 // ||Ax-b||/||b|| = 7.4e16 and a "converged" lambda_min of -2.5e-19
324 // against a true 2.46e-6, with the eigensolver reporting success.
325 // cl_SolverMUMPS.cpp now refuses SYM != 0 with an always-active
326 // error, so that particular failure is loud rather than silent --
327 // but the default belongs here regardless, because this is where
328 // an IWG that never thinks about symmetry gets its answer.
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 // Symmetric must therefore be an explicit, deliberate choice by a
339 // caller that has arranged to supply one half -- never something an
340 // IWG inherits by forgetting to pass an argument. That is not
341 // hypothetical: deriving straight from this class is the DOCUMENTED
342 // extension point for a user writing their own IWG
343 // ( dof_manager_usage_guide.md, "class IWG_Custom : public IWG" ),
344 // and every in-tree IWG happens to reach Unsymmetric only through
345 // IWG_Timestep's own default. A user following the guide never
346 // passes this argument, so before 2026-08-29 the documented path
347 // handed them SYM = 1 and a silently wrong factorization.
348 // This class OWNS the DofTable* held in mBlockDofs, mSideSetDofs
349 // and mSideSetOnlyDofs -- allocated with new, deleted in the
350 // destructor. The implicit copy would shallow-copy those pointers
351 // and double-free them, so copying and moving are deleted rather
352 // than left to the compiler. Deep-copy semantics are not wanted:
353 // an IWG is created once, linked, and used in place.
354 IWG( const IWG & ) = delete ;
355 IWG & operator=( const IWG & ) = delete ;
356 IWG( IWG && ) = delete ;
357 IWG & operator=( IWG && ) = delete ;
358
359 IWG( const IwgType aType,
360 const ModelDimensionality aDimensionality,
361 const IwgMode aMode=IwgMode::Iterative,
362 const SymmetryMode aSymmetryMode=SymmetryMode::Unsymmetric,
363 const DofMode aDofMode=DofMode::AllBlocksEqual,
364 const SideSetDofLinkMode aSideSetDofLinkMode=SideSetDofLinkMode::FacetOnly );
365
366//------------------------------------------------------------------------------
367
368 virtual ~IWG() ;
369
370//------------------------------------------------------------------------------
371
377 void
378 select_blocks( const Vector< id_t > & aBlockIDs );
379
380 void
381 select_block( const id_t aBlockID );
382
383//------------------------------------------------------------------------------
384
390 void
391 select_sidesets( const Vector< id_t > & aSidesetIDs );
392
393//------------------------------------------------------------------------------
394
398 const Vector< id_t > &
399 selected_blocks() const ;
400
401//------------------------------------------------------------------------------
402
406 const Vector< id_t > &
407 selected_sidesets() const ;
408
409//------------------------------------------------------------------------------
410
411 virtual void
413 Element * aElement,
414 Matrix< real > & aJacobian );
415
416//------------------------------------------------------------------------------
417
418 virtual void
420 Element * aElement,
421 Matrix< real > & aJacobian,
422 Vector< real > & aRHS );
423
424//------------------------------------------------------------------------------
425
426 // convection term, eg for heat load
427 virtual void
429 Element * aElement,
430 Vector< real > & aConvection );
431
432//------------------------------------------------------------------------------
433
434 // convection term with alpha boundary condition
435 virtual void
437 Element * aElement,
438 Matrix< real > & aJacobian,
439 Vector< real > & aRHS );
440
441//------------------------------------------------------------------------------
442
443 virtual void
445 Element * aElement,
446 Vector< real > & aRHS );
447
448
449//------------------------------------------------------------------------------
450
451 virtual void
453 Element * aElement,
454 Matrix< real > & aRHS );
455
456//------------------------------------------------------------------------------
457
458 virtual void
459 link_to_group( Group * aGroup );
460
461//------------------------------------------------------------------------------
462
466 const Cell< string > &
467 dof_fields() const ;
468
469//------------------------------------------------------------------------------
470
474 const Cell< string > &
475 flux_fields() const;
476
477//------------------------------------------------------------------------------
478
482 const Cell< string > &
483 tensor_fields() const;
484
485//------------------------------------------------------------------------------
486
490 const Cell< string > &
491 other_fields() const;
492
493//------------------------------------------------------------------------------
494
498 const Cell< string > &
499 all_fields() const ;
500
501//------------------------------------------------------------------------------
502
506 const string &
507 field( const index_t aIndex ) const ;
508
509//------------------------------------------------------------------------------
510
514 index_t
515 number_of_fields() const ;
516
517//------------------------------------------------------------------------------
518
523 uint
525
526//------------------------------------------------------------------------------
527
528 uint
529 number_of_dofs_per_node( const id_t aBlockID ) const ;
530
531//------------------------------------------------------------------------------
532
533 uint
534 number_of_dofs_per_node_on_sideset( const id_t aSideSetID ) const ;
535
536//------------------------------------------------------------------------------
537
538
539 uint
540 number_of_dofs_per_edge( const id_t aBlockID ) const ;
541
542//------------------------------------------------------------------------------
543
544 uint
545 number_of_dofs_per_face( const id_t aBlockID ) const ;
546
547//------------------------------------------------------------------------------
548
549 uint
550 number_of_dofs_per_cell( const id_t aBlockID ) const ;
551
552//------------------------------------------------------------------------------
553
554 virtual uint
555 number_of_dofs_per_element( Block * aBlock ) const ;
556
557//------------------------------------------------------------------------------
558
559 uint
560 number_of_nodes_per_element( SideSet * aSideSet ) const ;
561
562//------------------------------------------------------------------------------
563
564 uint
565 number_of_edges_per_element( SideSet * aSideSet ) const ;
566
567//------------------------------------------------------------------------------
568
569 uint
570 number_of_faces_per_element( SideSet * aSideSet ) const ;
571
572//------------------------------------------------------------------------------
573
574 virtual uint
575 number_of_dofs_per_element( SideSet * aSideSet ) const ;
576
577//------------------------------------------------------------------------------
578
579 uint
580 number_of_lambda_dofs( const id_t aSideSetID ) const ;
581
582//------------------------------------------------------------------------------
583
584 const Vector< index_t > &
585 dofs_per_node( const id_t aBlockID ) const ;
586
587//------------------------------------------------------------------------------
588
589 const Vector< index_t > &
590 dofs_per_edge( const id_t aBlockID ) const ;
591
592//------------------------------------------------------------------------------
593
594 const Vector< index_t > &
595 dofs_per_face( const id_t aBlockID ) const ;
596
597//------------------------------------------------------------------------------
598
599 const Vector< index_t > &
600 dofs_per_cell( const id_t aBlockID ) const ;
601
602//------------------------------------------------------------------------------
603
604 // Vector< index_t > &
605 // lambda_dofs( const id_t aSideSetID );
606
607//------------------------------------------------------------------------------
608
609 const Vector< index_t > &
610 lambda_dofs( const id_t aSideSetID ) const ;
611
612//------------------------------------------------------------------------------
613
614 const Vector< index_t > &
615 dofs_per_node_on_sideset( const id_t aSideSetID, const bool aSideSetOnly = false ) const ;
616
617//------------------------------------------------------------------------------
618
619 const Vector< index_t > &
620 dofs_per_edge_on_sideset( const id_t aSideSetID, const bool aSideSetOnly = false ) const ;
621
622//------------------------------------------------------------------------------
623
624 const Vector< index_t > &
625 dofs_per_face_on_sideset( const id_t aSideSetID, const bool aSideSetOnly = false ) const ;
626
627//------------------------------------------------------------------------------
628
629 const Vector< index_t > &
630 dofs_per_cell_on_sideset( const id_t , const bool aSideSetOnly = false ) const ;
631
632//------------------------------------------------------------------------------
633
634 const Vector< index_t > &
635 dof_entity_types() const ;
636
637//------------------------------------------------------------------------------
638
639 const Vector< index_t > &
640 default_dof_types() const ;
641
642//------------------------------------------------------------------------------
643
647 index_t
648 edge_multiplicity() const ;
649
650//------------------------------------------------------------------------------
651
655 index_t
656 face_multiplicity() const ;
657
658//------------------------------------------------------------------------------
659
663 index_t
664 cell_multiplicity() const ;
665
666//------------------------------------------------------------------------------
667
668 index_t
669 edge_field_index( const index_t aDofType ) const;
670
671//------------------------------------------------------------------------------
672
673 index_t
674 face_field_index( const index_t aDofType ) const;
675
676//------------------------------------------------------------------------------
677
683 inline const Vector< index_t > &
684 dofs_per_sideset( const id_t aSidesetID ) const ;
685
686//------------------------------------------------------------------------------
687
688 uint
689 num_rhs_cols() const;
690
691//------------------------------------------------------------------------------
692
693 void
694 virtual set_field( DofManagerBase * aField );
695
696//------------------------------------------------------------------------------
697
701 IwgType
702 type() const ;
703
704//------------------------------------------------------------------------------
705
710 model_dimensionality() const ;
711
712//------------------------------------------------------------------------------
713
717 void
719
720//------------------------------------------------------------------------------
721
726 interpolation_type() const ;
727
728//------------------------------------------------------------------------------
729
733 IwgMode
734 mode() const ;
735
736//------------------------------------------------------------------------------
737
741 real
742 omega() const;
743
744//------------------------------------------------------------------------------
745
749 void
750 set_omega( const real & aOmega );
751
752//------------------------------------------------------------------------------
753
757 void
758 set_penalty( const real aPsi, const uint aIndex=0 );
759
760//------------------------------------------------------------------------------
761
765 real
766 penalty( const uint aIndex ) const;
767
768//------------------------------------------------------------------------------
769
774 symmetry_mode() const;
775
776//------------------------------------------------------------------------------
777
781 void
782 set_num_rhs_cols( const uint & aNumRhsCols );
783
784//------------------------------------------------------------------------------
785
786 virtual void
787 set_wetted_sidesets( const Vector< id_t > & aSideSets );
788
789//------------------------------------------------------------------------------
790
791 const Vector< id_t > &
792 wetted_sidesets() const ;
793
794//------------------------------------------------------------------------------
795
796 // timestep, if this is a transient problem
797 real &
798 delta_time() ;
799
800//---------------------------------------------------------------------------------
801
802 uint &
803 time_loop() ;
804
805//------------------------------------------------------------------------------
806
811 void
812 add_fields( const Cell< string > & aFieldLabels );
813
814//------------------------------------------------------------------------------
815
819 bool
820 has_convection() const ;
821
822//------------------------------------------------------------------------------
823
828 virtual void
830 Element * aElement,
831 const uint aDirection,
832 Matrix< real > & aJacobian );
833
834//------------------------------------------------------------------------------
835
836 const Matrix< real > &
837 N( const uint & aIntegrationPoint );
838
839//------------------------------------------------------------------------------
840
841 void
843 const Vector< id_t > & aBlockIDs,
844 const Cell< DomainType > & aBlockTypes ) ;
845
846//------------------------------------------------------------------------------
847
848 void
850 const Vector< id_t > & aSideSetIDs,
851 const Cell< DomainType > & aSideSetTypes ) ;
852
853//------------------------------------------------------------------------------
854
856 block_type( const id_t aID ) const ;
857
858//------------------------------------------------------------------------------
859
861 sideset_type( const id_t aID ) const ;
862
863//------------------------------------------------------------------------------
864
869 block_activation_mode( const DomainType aType ) const ;
870
871//------------------------------------------------------------------------------
872
877 sideset_activation_mode( const DomainType aType ) const ;
878
879//------------------------------------------------------------------------------
880
881 virtual void
882 initialize();
883
884//------------------------------------------------------------------------------
885
886 virtual void
887 initialize( const IwgType aType );
888
889//------------------------------------------------------------------------------
890
891 bool
892 is_initialized() const ;
893
894 inline bool
895 enrich_sidesets() const ;
896
897//------------------------------------------------------------------------------
898
904 virtual int
905 check_mesh( Mesh * aMesh, const proc_t aMasterRank=0 );
906
907//------------------------------------------------------------------------------
908
912 void
913 hide_fields_from_exodus( Mesh * aMesh );
914
915//-----------------------------------------------------------------------------
916
920 virtual bool
921 has_edge_dofs() const ;
922
923//-----------------------------------------------------------------------------
924
928 uint
929 lambda_multiplicity() const ;
930
931//-----------------------------------------------------------------------------
932
937 sideset_dof_link_mode() const ;
938
939//-----------------------------------------------------------------------------
940
944 void
945 set_algorithm( const SolverAlgorithm aAlgorithm );
946
947//-----------------------------------------------------------------------------
948
953 algorithm() const ;
954
955//------------------------------------------------------------------------------
956
961 virtual void
962 shift_fields();
963
964//------------------------------------------------------------------------------
965
970 virtual void
971 reset_fields();
972
973//------------------------------------------------------------------------------
974
975 void
977 Element * aElement,
978 Cell< string > & aFieldLabels,
979 Matrix< real > & aData );
980
981//------------------------------------------------------------------------------
982
983 void
985 Element * aElement,
986 const string & aFieldLabel );
987
988//------------------------------------------------------------------------------
989
990 void
992 Element * aElement,
993 const Cell< string > & aFieldLabels );
994
995//------------------------------------------------------------------------------
996
997 // todo: old function, should be obsolete soon
998 void
1000 Element * aElement,
1001 const string & aFieldLabel,
1002 Vector< real > & aData );
1003
1004//------------------------------------------------------------------------------
1005
1006 // todo: old function, should be obsolete soon
1007 void
1009 Element * aElement,
1010 const string & aFieldLabel,
1011 Vector< real > & aData,
1012 uint & aOffset );
1013
1014//------------------------------------------------------------------------------
1015
1016 void
1018 Element * aElement,
1019 const string & aEdgeFieldLabel,
1020 Vector< real > & aData );
1021
1022//------------------------------------------------------------------------------
1023
1024 void
1026 Element * aElement,
1027 const string & aEdgeFieldLabel,
1028 const string & aFaceFieldLabel,
1029 Vector< real > & aData );
1030
1031//------------------------------------------------------------------------------
1032
1033 void
1035 Element * aElement,
1036 const string & aFieldLabel,
1037 real & aData ) ;
1038
1039//------------------------------------------------------------------------------
1040
1044 uint
1045 doftype( const string & aDofLabel ) const ;
1046
1047//---------------------------------------------------------------------------------
1048
1053 void
1054 unique_and_rearrange( Cell< string > & aDofs, const bool aMakeMap=false );
1055
1056//---------------------------------------------------------------------------------
1057
1061 bool
1063
1064//---------------------------------------------------------------------------------
1065
1069 bool
1071
1072//---------------------------------------------------------------------------------
1073
1074 virtual void
1075 compute_mkf( Element * aElement );
1076
1077//------------------------------------------------------------------------------
1078
1079 virtual TimestepMatrices *
1080 matrices();
1081
1082//------------------------------------------------------------------------------
1083
1087 void
1088 print_dofs( Element * aElement, const bool aLocal=false );
1089
1090//---------------------------------------------------------------------------------
1091
1095 const string &
1096 dof_label( const index_t aDofIndex );
1097
1098//---------------------------------------------------------------------------------
1102 Calculator *
1103 calc();
1104
1105//------------------------------------------------------------------------------
1106 // these nodes contain for example currents in maxwell cuts
1107
1108 void
1110
1111 void
1113
1116
1119
1120 index_t
1121 abstract_dof_type() const ;
1122
1123 virtual void
1125
1126//------------------------------------------------------------------------------
1127
1128 virtual void
1130
1131 uint
1132 get_field_index( const uint aDofType ) const ;
1133
1134//------------------------------------------------------------------------------
1135
1136 virtual void
1138
1139//------------------------------------------------------------------------------
1140
1141 void
1142 set_abstract_dof_type( const uint aDofType );
1143
1144
1145
1146//------------------------------------------------------------------------------
1147
1148 // set the timestepping method
1149 virtual void
1151 const EulerMethod aMethod,
1152 const bool aHaveStiffness=true );
1153
1154 // return the timestepping method
1155 virtual EulerMethod
1156 method() const ;
1157
1158//------------------------------------------------------------------------------
1159
1160 virtual uint
1161 timestepping_order() const ;
1162
1163//------------------------------------------------------------------------------
1164 protected:
1165//------------------------------------------------------------------------------
1166
1170 void
1172
1173//------------------------------------------------------------------------------
1174
1178 void
1180
1181//------------------------------------------------------------------------------
1182
1186 void
1188
1189//------------------------------------------------------------------------------
1194 virtual void
1195 assign_dofs_per_block( const Vector< id_t > & aBlockIDs );
1196
1197//------------------------------------------------------------------------------
1198
1203 virtual void
1204 assign_dofs_per_sideset( const Vector< id_t > & aSideSetIDs );
1205
1206//------------------------------------------------------------------------------
1207
1217 virtual void
1219
1220//------------------------------------------------------------------------------
1221
1222 virtual void
1223 allocate_work_matrices( Group * aGroup );
1224
1225//------------------------------------------------------------------------------
1226
1230 void
1231 collect_nodes_on_wetted_sitdesets( Mesh * aMesh, const Vector< id_t > & aSideSets );
1232
1233//------------------------------------------------------------------------------
1234
1235 void
1237
1238//------------------------------------------------------------------------------
1239
1240 void
1242
1243//------------------------------------------------------------------------------
1244
1245 void
1246 collect_node_coords( Element * aElement, Matrix< real > & aX );
1247
1248//------------------------------------------------------------------------------
1249 private:
1250//------------------------------------------------------------------------------
1251
1252 void
1253 create_doftype_map() ;
1254
1255//---------------------------------------------------------------------------------
1256
1257 void
1258 concatenate_field_lists();
1259
1260//---------------------------------------------------------------------------------
1261
1262 void
1263 create_block_dof_tables( const uint aNumBlocks );
1264
1265//---------------------------------------------------------------------------------
1266
1267 void
1268 create_sideset_dof_tables( const uint aNumSideSets );
1269
1270//---------------------------------------------------------------------------------
1271
1272 void
1273 count_sideset_dofs_per_sideset(
1274 Vector< index_t > & aDofsPerSideSet,
1275 DofTable * aDofTable,
1276 Vector< uint > & aCount,
1278 const bool aUseBitset );
1279
1280//---------------------------------------------------------------------------------
1281 };
1282//------------------------------------------------------------------------------
1283
1284 inline const Vector< id_t > &
1286 {
1287 return mBlockIDs ;
1288 }
1289
1290//------------------------------------------------------------------------------
1291
1292 inline const Vector< id_t > &
1294 {
1295 return mSideSetIDs ;
1296 }
1297
1298//------------------------------------------------------------------------------
1299
1300 inline bool
1302 {
1303 return mHasConvection ;
1304 }
1305
1306//------------------------------------------------------------------------------
1307
1308 inline const Cell< string > &
1310 {
1311 return mDofFields ;
1312 }
1313
1314
1315//------------------------------------------------------------------------------
1316
1317 inline const Cell< string > &
1319 {
1320 return mFluxFields ;
1321 }
1322
1323//------------------------------------------------------------------------------
1324
1325 inline const Cell< string > &
1327 {
1328 return mTensorFields ;
1329 }
1330
1331//------------------------------------------------------------------------------
1332
1333 inline const Cell< string > &
1335 {
1336 return mOtherFields ;
1337 }
1338
1339//------------------------------------------------------------------------------
1340
1341 inline const Cell< string > &
1343 {
1344 return mAllFields ;
1345 }
1346
1347//------------------------------------------------------------------------------
1348
1349 inline const string &
1350 IWG::field( const index_t aIndex ) const
1351 {
1352 return mAllFields( aIndex );
1353 }
1354
1355//------------------------------------------------------------------------------
1356
1357 inline index_t
1359 {
1360 return mAllFields.size() ;
1361 }
1362
1363//------------------------------------------------------------------------------
1364
1365 inline real
1367 {
1368 return mOmega ;
1369 }
1370
1371//------------------------------------------------------------------------------
1372
1373 inline real
1374 IWG::penalty( const uint aIndex ) const
1375 {
1376 return mPenalty( aIndex ) ;
1377 }
1378
1379//------------------------------------------------------------------------------
1380
1381 inline uint
1382 IWG::number_of_dofs_per_node( const id_t aBlockID ) const
1383 {
1384 return mBlockDofs( mBlockIndices( aBlockID ) )->Node.length() ;
1385 }
1386
1387//------------------------------------------------------------------------------
1388
1389 inline uint
1391 {
1392 return mSideSetDofs( mSideSetIndices( aSideSetID ) )->Node.length() ;
1393 }
1394
1395//------------------------------------------------------------------------------
1396
1397 inline uint
1398 IWG::number_of_dofs_per_edge( const id_t aBlockID ) const
1399 {
1400 return mBlockDofs( mBlockIndices( aBlockID ) )->Edge.length() * mEdgeDofMultiplicity ;
1401 }
1402
1403//------------------------------------------------------------------------------
1404
1405 inline uint
1406 IWG::number_of_dofs_per_face( const id_t aBlockID ) const
1407 {
1408 return mBlockDofs( mBlockIndices( aBlockID ) )->Face.length() * mFaceDofMultiplicity ;
1409 }
1410
1411//------------------------------------------------------------------------------
1412
1413 inline uint
1414 IWG::number_of_dofs_per_cell( const id_t aBlockID ) const
1415 {
1416 return mBlockDofs( mBlockIndices( aBlockID ) )->Cell.length() * mCellDofMultiplicity ;
1417 }
1418
1419//------------------------------------------------------------------------------
1420
1421 inline const Vector< index_t > &
1422 IWG::dofs_per_node( const id_t aBlockID ) const
1423 {
1424 return mBlockDofs( mBlockIndices( aBlockID ) )->Node;
1425 }
1426
1427//------------------------------------------------------------------------------
1428
1429 inline const Vector< index_t > &
1430 IWG::dofs_per_edge( const id_t aBlockID ) const
1431 {
1432 return mBlockDofs( mBlockIndices( aBlockID ) )->Edge;
1433 }
1434
1435//------------------------------------------------------------------------------
1436
1437 inline const Vector< index_t > &
1438 IWG::dofs_per_face( const id_t aBlockID ) const
1439 {
1440 return mBlockDofs( mBlockIndices( aBlockID ) )->Face;
1441 }
1442
1443//------------------------------------------------------------------------------
1444
1445 inline index_t
1447 {
1448 return mEdgeDofMultiplicity ;
1449 }
1450
1451//------------------------------------------------------------------------------
1452
1453 inline index_t
1455 {
1456 return mFaceDofMultiplicity ;
1457 }
1458
1459//------------------------------------------------------------------------------
1460
1461 inline index_t
1463 {
1464 return mCellDofMultiplicity ;
1465 }
1466
1467//------------------------------------------------------------------------------
1468
1469 inline const Vector< index_t > &
1470 IWG::dofs_per_cell( const id_t aBlockID ) const
1471 {
1472 return mBlockDofs( mBlockIndices( aBlockID ) )->Cell;
1473 }
1474
1475//------------------------------------------------------------------------------
1476
1477 // inline Vector< index_t > &
1478 //IWG::lambda_dofs( const id_t aSideSetID )
1479 //{
1480 // return mSideSetLambdaDofs( mSideSetIndices( aSideSetID ) );
1481 //}
1482
1483//------------------------------------------------------------------------------
1484
1485 inline const Vector< index_t > &
1486 IWG::dofs_per_node_on_sideset( const id_t aSideSetID, const bool aSideSetOnly ) const
1487 {
1488 return aSideSetOnly ?
1489 mSideSetOnlyDofs( mSideSetIndices( aSideSetID ) )->Node :
1490 mSideSetDofs( mSideSetIndices( aSideSetID ) )->Node ;
1491 }
1492
1493//------------------------------------------------------------------------------
1494
1495 inline const Vector< index_t > &
1496 IWG::dofs_per_edge_on_sideset( const id_t aSideSetID, const bool aSideSetOnly ) const
1497 {
1498 return aSideSetOnly ?
1499 mSideSetOnlyDofs( mSideSetIndices( aSideSetID ) )->Edge :
1500 mSideSetDofs( mSideSetIndices( aSideSetID ) )->Edge ;
1501 }
1502
1503//------------------------------------------------------------------------------
1504
1505 inline const Vector< index_t > &
1506 IWG::dofs_per_face_on_sideset( const id_t aSideSetID, const bool aSideSetOnly ) const
1507 {
1508 return aSideSetOnly ?
1509 mSideSetOnlyDofs( mSideSetIndices( aSideSetID ) )->Face :
1510 mSideSetDofs( mSideSetIndices( aSideSetID ) )->Face ;
1511 }
1512
1513//------------------------------------------------------------------------------
1514
1515 inline const Vector< index_t > &
1516 IWG::dofs_per_cell_on_sideset( const id_t aSideSetID, const bool aSideSetOnly ) const
1517 {
1518 return aSideSetOnly ?
1519 mSideSetOnlyDofs( mSideSetIndices( aSideSetID ) )->Cell :
1520 mSideSetDofs( mSideSetIndices( aSideSetID ) )->Cell ;
1521 }
1522
1523//------------------------------------------------------------------------------
1524
1525 inline const Vector< index_t > &
1526 IWG::lambda_dofs( const id_t aSideSetID ) const
1527 {
1528 return mSideSetDofs( mSideSetIndices( aSideSetID ) )->Lambda ;
1529 }
1530
1531//------------------------------------------------------------------------------
1532
1533 inline const Vector< index_t > &
1535 {
1536 return mDofEntityTypes ;
1537 }
1538
1539//------------------------------------------------------------------------------
1540
1541 inline const Vector< index_t > &
1543 {
1544 return mDefaultDofTypes ;
1545 }
1546
1547//------------------------------------------------------------------------------
1548
1549 inline index_t
1550 IWG::edge_field_index( const index_t aDofType ) const
1551 {
1552 return mEdgeFieldIndices( aDofType );
1553 }
1554
1555//------------------------------------------------------------------------------
1556
1557 inline index_t
1558 IWG::face_field_index( const index_t aDofType ) const
1559 {
1560 return mFaceFieldIndices( aDofType );
1561 }
1562
1563//------------------------------------------------------------------------------
1564
1565 inline const Vector< index_t > &
1566 IWG::dofs_per_sideset( const id_t aSidesetID ) const
1567 {
1568 return mDofsPerSideSet( mSideSetIndices( aSidesetID ) );
1569 }
1570
1571//------------------------------------------------------------------------------
1572
1573 inline bool
1575 {
1576 return mIsInitialized ;
1577 }
1578
1579//------------------------------------------------------------------------------
1580
1581 inline bool
1583 {
1584 return mEnrichSideSets ;
1585 }
1586
1587//------------------------------------------------------------------------------
1588
1589 inline int
1590 IWG::check_mesh( Mesh * aMesh, const proc_t aMasterRank )
1591 {
1592 return aMesh == nullptr ? 1 : 0 ;
1593 }
1594
1595
1596//------------------------------------------------------------------------------
1597
1598 inline bool
1600 {
1601 return false ;
1602 }
1603
1604//------------------------------------------------------------------------------
1605
1606 inline uint
1608 {
1609 return mLambdaDofMultiplicity ;
1610 }
1611
1612//------------------------------------------------------------------------------
1613
1614 inline SideSetDofLinkMode
1616 {
1617 return mSideSetDofLinkMode ;
1618 }
1619
1620//------------------------------------------------------------------------------
1621
1622 inline SolverAlgorithm
1624 {
1625 return mSolverAlgorithm ;
1626 }
1627
1628//------------------------------------------------------------------------------
1629
1630 inline uint
1631 IWG::doftype( const string & aDofLabel ) const
1632 {
1633 if( mDofTypeMap.key_exists( aDofLabel ) )
1634 {
1635 return mDofTypeMap( aDofLabel );
1636 }
1637 else
1638 {
1639 return BELFEM_UINT_MAX ;
1640 }
1641 }
1642
1643//------------------------------------------------------------------------------
1644
1645 inline bool
1650
1651
1652//---------------------------------------------------------------------------------
1653
1654 inline bool
1656 {
1658 }
1659
1660//---------------------------------------------------------------------------------
1661
1662 inline const string &
1663 IWG::dof_label( const index_t aDofIndex )
1664 {
1665 return mDofLabels( aDofIndex );
1666 }
1667
1668//---------------------------------------------------------------------------------
1669
1670 inline uint &
1672 {
1673 return mTimeLoop ;
1674 }
1675
1676//------------------------------------------------------------------------------
1677
1678 inline void
1680 {
1681 mInterpolationType = aType ;
1682 }
1683
1684//------------------------------------------------------------------------------
1685
1686 inline InterpolationType
1688 {
1689 return mInterpolationType ;
1690 }
1691
1692//------------------------------------------------------------------------------
1693
1694 inline Calculator *
1696 {
1697 return mCalc ;
1698 }
1699
1700//------------------------------------------------------------------------------
1701
1702 inline Cell< mesh::Node * > &
1704 {
1705 return mAbstractNodes ;
1706 }
1707
1708
1709 inline index_t
1711 {
1712 return mAbstractDofType ;
1713 }
1714
1715 inline Cell< mesh::Node * > &
1717 {
1718 return mOrphanedNodes ;
1719 }
1720
1721 inline uint
1722 IWG::get_field_index( const uint aDofType ) const
1723 {
1724 return mDofFieldMap( aDofType );
1725 }
1726
1727//---------------------------------------------------------------------------------
1728 }
1729}
1730#endif //BELFEM_CL_IWG_HPP
Compile-time fixed-size bitset.
Definition cl_Bitset.hpp:32
size_t size() const
return the size of the Cell
Definition cl_Cell.hpp:181
bool key_exists(const Key &aKey) const
Definition cl_Map.hpp:161
Base class for all materials in BELFEM.
Definition cl_Material.hpp:279
Top-level container for all mesh entities.
Definition cl_Mesh.hpp:60
Definition cl_FEM_Block.hpp:35
Definition cl_FEM_Calculator.hpp:600
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
called by dof manager
Definition cl_IWG.hpp:1655
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:2228
Cell< DofTable * > mSideSetOnlyDofs
Definition cl_IWG.hpp:249
IwgMode mode() const
return the calculation mode of this IWG
Definition cl_IWG.cpp:231
uint number_of_dofs_per_node() const
DEPRECATED!
Definition cl_IWG.cpp:735
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:1703
uint mNumberOfNodesPerMaster
Definition cl_IWG.hpp:163
void collect_lambda_data(Element *aElement, const string &aFieldLabel, real &aData)
Definition cl_IWG.cpp:1007
index_t cell_multiplicity() const
tells how many dofs sit on one cell
Definition cl_IWG.hpp:1462
DomainType block_type(const id_t aID) const
Definition cl_IWG.cpp:2093
void count_dofs_per_block()
Definition cl_IWG.cpp:1514
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:1516
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
called by dof manager
Definition cl_IWG.hpp:1646
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:299
uint & time_loop()
Definition cl_IWG.hpp:1671
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)
Definition cl_IWG.cpp:317
Cell< string > mTensorFields
Definition cl_IWG.hpp:188
SolverAlgorithm algorithm() const
returns the solver algorithm
Definition cl_IWG.hpp:1623
Cell< string > mDofFields
Definition cl_IWG.hpp:182
index_t number_of_fields() const
return the number of connected fiends
Definition cl_IWG.hpp:1358
Vector< id_t > mWettedSidesets
Definition cl_IWG.hpp:202
const string & field(const index_t aIndex) const
return the names of a specific field
Definition cl_IWG.hpp:1350
Cell< string > mFluxFields
Definition cl_IWG.hpp:185
const Cell< string > & flux_fields() const
return the names of the flux fields
Definition cl_IWG.hpp:1318
const Vector< id_t > & selected_sidesets() const
returns the list of selected sidesets
Definition cl_IWG.hpp:1293
DofTable mAbstractNodeTable
Definition cl_IWG.hpp:304
virtual void compute_rhs(Element *aElement, Vector< real > &aRHS)
Definition cl_IWG.cpp:327
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:2108
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:291
void delete_block_dof_tables()
Tidy up memory.Called by destructor.
Definition cl_IWG.cpp:1796
virtual void reset_fields()
called by main file to copy fields from last timestep eg.
Definition cl_IWG.cpp:1788
Map< id_t, DomainType > mBlockTypes
Definition cl_IWG.hpp:273
const Cell< string > & all_fields() const
return the names of all fields
Definition cl_IWG.hpp:1342
uint get_field_index(const uint aDofType) const
Definition cl_IWG.hpp:1722
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:1829
uint mNumberOfNodesPerElement
Definition cl_IWG.hpp:162
virtual void allocate_work_matrices(Group *aGroup)
Definition cl_IWG.cpp:1025
GroupActivationMode block_activation_mode(const DomainType aType) const
returns the activation mode for a block based on its domain type
Definition cl_IWG.cpp:2135
uint mNumberOfRhsEdgeDofsPerElement
Definition cl_IWG.hpp:179
bool has_convection() const
tells if this field has an alpha boundary condition
Definition cl_IWG.hpp:1301
void set_sidesets(const Vector< id_t > &aSideSetIDs, const Cell< DomainType > &aSideSetTypes)
Definition cl_IWG.cpp:1732
void collect_node_data(Element *aElement, Cell< string > &aFieldLabels, Matrix< real > &aData)
Definition cl_IWG.cpp:760
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:85
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:572
uint number_of_lambda_dofs(const id_t aSideSetID) const
Definition cl_IWG.cpp:723
IwgType type() const
return the type of this IWG
Definition cl_IWG.cpp:215
index_t edge_field_index(const index_t aDofType) const
Definition cl_IWG.hpp:1550
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:1582
uint number_of_dofs_per_node_on_sideset(const id_t aSideSetID) const
Definition cl_IWG.hpp:1390
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:605
const Vector< index_t > & default_dof_types() const
Definition cl_IWG.hpp:1542
virtual void set_timestepping_method(const EulerMethod aMethod, const bool aHaveStiffness=true)
Definition cl_IWG.cpp:2167
void set_num_rhs_cols(const uint &aNumRhsCols)
special function, must be called before init->jacobian() is called
Definition cl_IWG.cpp:109
index_t mAbstractDofType
Definition cl_IWG.hpp:305
virtual void initialize()
Definition cl_IWG.cpp:1159
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
normal, if this is a 2d problem, todo: delete
Definition cl_IWG.hpp:288
void set_omega(const real &aOmega)
set the relaxation parameter
Definition cl_IWG.cpp:1063
virtual bool has_edge_dofs() const
flag telling if the IWG has edge dofs
Definition cl_IWG.hpp:1599
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:1590
const Vector< index_t > & dofs_per_edge(const id_t aBlockID) const
Definition cl_IWG.hpp:1430
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)
Definition cl_IWG.cpp:383
void select_blocks(const Vector< id_t > &aBlockIDs)
the blocks are selected over the IWG object.
Definition cl_IWG.cpp:265
virtual uint timestepping_order() const
Definition cl_IWG.cpp:2212
const Vector< index_t > & dofs_per_face_on_sideset(const id_t aSideSetID, const bool aSideSetOnly=false) const
Definition cl_IWG.hpp:1506
bool mComputeJacobianOnBlock
Definition cl_IWG.hpp:105
void select_block(const id_t aBlockID)
Definition cl_IWG.cpp:239
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:1326
real penalty(const uint aIndex) const
get penalty parameter
Definition cl_IWG.hpp:1374
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)
set the interpolation type of node elements
Definition cl_IWG.hpp:1679
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:911
virtual void compute_mkf(Element *aElement)
Definition cl_IWG.cpp:356
const Vector< index_t > & dofs_per_node(const id_t aBlockID) const
Definition cl_IWG.hpp:1422
const Vector< index_t > & dofs_per_edge_on_sideset(const id_t aSideSetID, const bool aSideSetOnly=false) const
Definition cl_IWG.hpp:1496
const Vector< index_t > & dofs_per_node_on_sideset(const id_t aSideSetID, const bool aSideSetOnly=false) const
Definition cl_IWG.hpp:1486
uint lambda_multiplicity() const
if this number is > 0, we have langrande dofs such as contact
Definition cl_IWG.hpp:1607
IWG & operator=(const IWG &)=delete
virtual TimestepMatrices * matrices()
Definition cl_IWG.cpp:364
index_t abstract_dof_type() const
Definition cl_IWG.hpp:1710
InterpolationType interpolation_type() const
return the interpolation type of node elements
Definition cl_IWG.hpp:1687
index_t edge_multiplicity() const
tells how many dofs sit on one edge
Definition cl_IWG.hpp:1446
Calculator * calc()
Definition cl_IWG.hpp:1695
virtual void shift_fields()
called by main file to copy fields into last timestep eg.
Definition cl_IWG.cpp:1780
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:1106
const Vector< id_t > & wetted_sidesets() const
Definition cl_IWG.cpp:207
Cell< Dof * > mAbstractNodeDofs
list with special dofs that sit on abstract nodes
Definition cl_IWG.hpp:302
const Vector< index_t > & dofs_per_face(const id_t aBlockID) const
Definition cl_IWG.hpp:1438
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:1147
virtual void compute_convection(Element *aElement, Vector< real > &aConvection)
Definition cl_IWG.cpp:373
Vector< real > mNormal3D
normal, if this is a 3d problem, todo: delete
Definition cl_IWG.hpp:291
real & delta_time()
Definition cl_IWG.cpp:1098
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:1566
uint number_of_dofs_per_cell(const id_t aBlockID) const
Definition cl_IWG.hpp:1414
real omega() const
get relaxation parameter
Definition cl_IWG.hpp:1366
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:2175
virtual void create_custom_vectors_and_matrices(Calculator *aCalc)
Definition cl_IWG.cpp:2220
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:2123
uint num_rhs_cols() const
Definition cl_IWG.cpp:743
virtual void assign_dofs_per_block(const Vector< id_t > &aBlockIDs)
this function assumes that all blocks are treated equally.
Definition cl_IWG.cpp:1494
real mDeltaTime
Definition cl_IWG.hpp:205
const Vector< index_t > & lambda_dofs(const id_t aSideSetID) const
Definition cl_IWG.hpp:1526
const Vector< id_t > & selected_blocks() const
returns the list of selected blocks
Definition cl_IWG.hpp:1285
Mesh * mMesh
Definition cl_IWG.hpp:137
virtual void set_wetted_sidesets(const Vector< id_t > &aSideSets)
Definition cl_IWG.cpp:117
index_t face_field_index(const index_t aDofType) const
Definition cl_IWG.hpp:1558
const Cell< string > & dof_fields() const
return the names of the potential fields
Definition cl_IWG.hpp:1309
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:155
void hide_fields_from_exodus(Mesh *aMesh)
hides fields that are not to be saved to exodus
Definition cl_IWG.cpp:1766
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:1715
SideSetDofLinkMode sideset_dof_link_mode() const
return the dof linking mode for sideset
Definition cl_IWG.hpp:1615
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:1470
void count_dofs_per_sideset()
Definition cl_IWG.cpp:1629
uint doftype(const string &aDofLabel) const
return the type id of a dof
Definition cl_IWG.hpp:1631
ModelDimensionality model_dimensionality() const
return the dimensionality of this IWG
Definition cl_IWG.cpp:223
uint mNumberOfDofsPerEdge
Definition cl_IWG.hpp:146
InterpolationType mInterpolationType
Definition cl_IWG.hpp:293
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:1406
Cell< mesh::Node * > mAbstractNodes
abstract nodes needed for cut BCs in MAXWELL
Definition cl_IWG.hpp:296
bool is_initialized() const
Definition cl_IWG.hpp:1574
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:347
uint mNumberOfDofsPerNode
Definition cl_IWG.hpp:145
Cell< mesh::Node * > & abstract_nodes()
Definition cl_IWG.hpp:1703
DofManagerBase * mField
Definition cl_IWG.hpp:138
Cell< mesh::Node * > & orphaned_nodes()
Definition cl_IWG.hpp:1716
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:1454
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:1504
void set_penalty(const real aPsi, const uint aIndex=0)
set the penalty parameter
Definition cl_IWG.cpp:1073
uint mNumberOfRhsDofsPerEdge
Definition cl_IWG.hpp:148
virtual uint number_of_dofs_per_element(Block *aBlock) const
Definition cl_IWG.cpp:509
void set_abstract_nodes(Cell< mesh::Node * > &aNodes)
Definition cl_IWG.cpp:1083
void delete_sideset_dof_tables()
Tidy up memory.Called by destructor.
Definition cl_IWG.cpp:1808
uint number_of_nodes_per_element(SideSet *aSideSet) const
Definition cl_IWG.cpp:526
bool mHasConvection
Definition cl_IWG.hpp:211
virtual void set_field(DofManagerBase *aField)
Definition cl_IWG.cpp:751
void print_dofs(Element *aElement, const bool aLocal=false)
for debugging
Definition cl_IWG.cpp:2006
const string & dof_label(const index_t aDofIndex)
for debugging
Definition cl_IWG.hpp:1663
SymmetryMode symmetry_mode() const
flag telling if matrices are symmetric
Definition cl_IWG.cpp:101
uint number_of_dofs_per_edge(const id_t aBlockID) const
Definition cl_IWG.hpp:1398
virtual EulerMethod method() const
Definition cl_IWG.cpp:2204
index_t mEdgeDofMultiplicity
Definition cl_IWG.hpp:257
void set_abstract_dof_type(const uint aDofType)
Definition cl_IWG.cpp:2196
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:2151
const Cell< string > & other_fields() const
return the names of the other fields
Definition cl_IWG.hpp:1334
const Vector< index_t > & dof_entity_types() const
Definition cl_IWG.hpp:1534
const Matrix< real > & N(const uint &aIntegrationPoint)
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:1090
const proc_t mCommRank
Definition cl_IWG.hpp:87
void collect_node_coords(Element *aElement, Matrix< real > &aX)
Definition cl_IWG.cpp:1749
IWG & operator=(IWG &&)=delete
Definition cl_FEM_SideSet.hpp:60
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:80