MAIA bb96820c
Multiphysics at AIA
Loading...
Searching...
No Matches
fcsolver.h
Go to the documentation of this file.
1// Copyright (C) 2024 The m-AIA AUTHORS
2//
3// This file is part of m-AIA (https://git.rwth-aachen.de/aia/m-AIA/m-AIA)
4//
5// SPDX-License-Identifier: LGPL-3.0-only
6
7#ifndef FCSOLVER_H
8#define FCSOLVER_H
9
11#include "GRID/cartesiangrid.h"
14#include "POST/postprocessing.h"
15#include "UTIL/functions.h"
16#include "cartesiansolver.h"
17#include "fcbndrycnd.h"
18#include "fccellcollector.h"
19#include "fcdescriptor.h"
20#include "solver.h"
21#include "variables.h"
22
26template <MInt nDim_>
27class FcSolver : public maia::CartesianSolver<nDim_, FcSolver<nDim_>> {
28 template <MInt nDim>
29 friend class FcBndryCnd;
30
31 public:
32 static constexpr MInt nDim = nDim_;
33
34 // Type for cell properties
38 using Grid = typename CartesianSolver::Grid;
39 using GridProxy = typename CartesianSolver::GridProxy;
40
41 // used solver
42 using CartesianSolver::domainId;
43 using CartesianSolver::domainOffset;
44 using CartesianSolver::grid;
45 using CartesianSolver::haloCell;
46 using CartesianSolver::haloCellId;
47 using CartesianSolver::m_bandWidth;
48 using CartesianSolver::m_freeIndices;
49 using CartesianSolver::m_innerBandWidth;
50 using CartesianSolver::m_Ma;
51 using CartesianSolver::m_outerBandWidth;
52 using CartesianSolver::m_Re;
53 using CartesianSolver::m_residualInterval;
54 using CartesianSolver::m_restartFile;
55 using CartesianSolver::m_restartInterval;
56 using CartesianSolver::m_solutionInterval;
57 using CartesianSolver::m_solverId;
58 using CartesianSolver::maxLevel;
59 using CartesianSolver::maxNoGridCells;
60 using CartesianSolver::maxUniformRefinementLevel;
61 using CartesianSolver::minLevel;
62 using CartesianSolver::mpiComm;
63 using CartesianSolver::neighborDomain;
64 using CartesianSolver::noDomains;
65 using CartesianSolver::noHaloCells;
66 using CartesianSolver::noNeighborDomains;
67 using CartesianSolver::noWindowCells;
68 using CartesianSolver::outputDir;
69 using CartesianSolver::reductionFactor;
70 using CartesianSolver::restartDir;
71 using CartesianSolver::solverId;
72 using CartesianSolver::solverMethod;
73 using CartesianSolver::updateDomainInfo;
74 using CartesianSolver::windowCell;
75 using CartesianSolver::windowCellId;
77
78 MInt noInternalCells() const override { return grid().noInternalCells(); }
79
81 MBool a_isBndryCell(const MInt cellId) const { return a_hasProperty(cellId, SolverCell::IsBndryCell); }
82
84 maia::fc::cell::BitsetType::reference a_isBndryCell(const MInt cellId) {
85 return a_hasProperty(cellId, SolverCell::IsBndryCell);
86 }
87
89 MBool a_isWindow(const MInt cellId) const { return m_cells.hasProperty(cellId, SolverCell::IsWindow); }
90
92 maia::fc::cell::BitsetType::reference a_isWindow(const MInt cellId) {
93 return m_cells.hasProperty(cellId, SolverCell::IsWindow);
94 }
95
97 MFloat& a_alpha(const MInt cellId) { return m_cells.alpha(cellId); }
98
100 MFloat a_alpha(const MInt cellId) const { return m_cells.alpha(cellId); }
101
103 MFloat& a_poissonRatio(const MInt cellId) { return m_cells.poissonRatio(cellId); }
104
106 MFloat a_poissonRatio(const MInt cellId) const { return m_cells.poissonRatio(cellId); }
107
109 MFloat& a_invJacobian(const MInt cellId) { return m_cells.invJacobian(cellId); }
110
112 MFloat a_invJacobian(const MInt cellId) const { return m_cells.invJacobian(cellId); }
113
115 MFloat& a_nodePosition(const MInt cellId, const MInt dir) { return m_cells.nodePosition(cellId, dir); }
116
118 MFloat a_nodePosition(const MInt cellId, const MInt dir) const { return m_cells.nodePosition(cellId, dir); }
119
121 MFloat& a_dGamma(const MInt cellId, const MInt node) { return m_cells.deltaGamma(cellId, node); }
122
124 MFloat a_dGamma(const MInt cellId, const MInt node) const { return m_cells.deltaGamma(cellId, node); }
125
127 MFloat& a_epsilonBarP(const MInt cellId, const MInt node) { return m_cells.epsilonBarP(cellId, node); }
128
130 MFloat a_epsilonBarP(const MInt cellId, const MInt node) const { return m_cells.epsilonBarP(cellId, node); }
131
133 MFloat& a_elementDispl(const MInt cellId, const MInt dir) { return m_cells.elementDisplacements(cellId, dir); }
134
136 MFloat a_elementDispl(const MInt cellId, const MInt dir) const { return m_cells.elementDisplacements(cellId, dir); }
137
139 MFloat& a_elementStrains(const MInt cellId, const MInt dir) { return m_cells.elementStrains(cellId, dir); }
140
142 MFloat a_elementStrains(const MInt cellId, const MInt dir) const { return m_cells.elementStrains(cellId, dir); }
143
145 MFloat& a_nodalStrains(const MInt cellId, const MInt node, const MInt dir) {
146 return m_cells.nodalStrains(cellId, node, dir);
147 }
148
150 MFloat a_nodalStrains(const MInt cellId, const MInt node, const MInt dir) const {
151 return m_cells.nodalStrains(cellId, node, dir);
152 }
153
155 MFloat a_elementDevStrains(const MInt cellId, const MInt dir) {
156 if(dir < nDim) {
157 MFloat epsVol = getVolumetricStrains(&a_elementStrains(cellId, 0));
158 return m_cells.elementStrains(cellId, dir) - epsVol;
159 }
160 return m_cells.elementStrains(cellId, dir);
161 }
162
164 MFloat a_nodalDevStrains(const MInt cellId, const MInt node, const MInt dir) {
165 if(dir < nDim) {
166 MFloat epsVol = getVolumetricStrains(&a_nodalStrains(cellId, node, 0));
167 return m_cells.nodalStrains(cellId, node, dir) - epsVol;
168 }
169 return m_cells.nodalStrains(cellId, node, dir);
170 }
171
173 MFloat& a_elementStresses(const MInt cellId, const MInt dir) { return m_cells.elementStresses(cellId, dir); }
174
176 MFloat a_elementStresses(const MInt cellId, const MInt dir) const { return m_cells.elementStresses(cellId, dir); }
177
179 MFloat& a_nodalStresses(const MInt cellId, const MInt node, const MInt dir) {
180 return m_cells.nodalStresses(cellId, node, dir);
181 }
182
184 MFloat a_nodalStresses(const MInt cellId, const MInt node, const MInt dir) const {
185 return m_cells.nodalStresses(cellId, node, dir);
186 }
187
189 MFloat a_elementDevStresses(const MInt cellId, const MInt dir) {
190 if(dir < nDim) {
192 return m_cells.elementStresses(cellId, dir) - hsp;
193 }
194 return m_cells.elementStresses(cellId, dir);
195 }
196
198 MFloat a_nodalDevStresses(const MInt cellId, const MInt node, const MInt dir) {
199 if(dir < nDim) {
200 MFloat hsp = getHydrostaticPressure(&a_nodalStresses(cellId, node, 0));
201 return m_cells.nodalStresses(cellId, node, dir) - hsp;
202 }
203 return m_cells.nodalStresses(cellId, node, dir);
204 }
205
207 MBool a_hasProperty(const MInt cellId, const Cell p) const { return grid().tree().hasProperty(cellId, p); }
208
210 maia::fc::cell::BitsetType::reference a_hasProperty(const MInt cellId, const SolverCell p) {
211 return m_cells.hasProperty(cellId, p);
212 }
213
215 MBool a_hasProperty(const MInt cellId, const SolverCell p) const { return m_cells.hasProperty(cellId, p); }
216
218 MBool a_needsSubCells(const MInt cellId) const { return a_hasProperty(cellId, SolverCell::NeedsSubCells); }
219
221 maia::fc::cell::BitsetType::reference a_needsSubCells(const MInt cellId) {
222 return a_hasProperty(cellId, SolverCell::NeedsSubCells);
223 }
224
226 MInt& a_noNodes(const MInt cellId) { return m_cells.noNodesPerCell(cellId); }
227
229 MInt a_noNodes(const MInt cellId) const { return m_cells.noNodesPerCell(cellId); }
230
232 MInt& a_bndId(const MInt cellId) { return m_cells.bndId(cellId); }
233
235 MInt a_bndId(const MInt cellId) const { return m_cells.bndId(cellId); }
236
238 MInt& a_pRfnmnt(const MInt cellId) { return m_cells.pRfnmnt(cellId); }
239
241 MInt a_pRfnmnt(const MInt cellId) const { return m_cells.pRfnmnt(cellId); }
242
244 MInt& a_maxSubCellLvl(const MInt cellId) { return m_cells.maxSubCellLvl(cellId); }
245
247 MInt a_maxSubCellLvl(const MInt cellId) const { return m_cells.maxSubCellLvl(cellId); }
248
250 MInt& a_nodeIdsLocal(const MInt cellId, const MInt nodeDir) { return m_cells.nodeIdsLoc(cellId, nodeDir); }
251
253 MInt a_nodeIdsLocal(const MInt cellId, const MInt nodeDir) const { return m_cells.nodeIdsLoc(cellId, nodeDir); }
254
256 MInt& a_nodeIdsGlobal(const MInt cellId, const MInt nodeDir) { return m_cells.nodeIdsGlob(cellId, nodeDir); }
257
259 MInt a_nodeIdsGlobal(const MInt cellId, const MInt nodeDir) const { return m_cells.nodeIdsGlob(cellId, nodeDir); }
260
261
262 MFloat c_cellLengthAtCell(const MInt cellId) const { return grid().cellLengthAtLevel(c_level(cellId)); }
263
264 MFloat c_cellLengthAtLevel(const MInt level) const { return grid().cellLengthAtLevel(level); }
265
266 MFloat a_jacobianMatrix(const MInt cellId) const {
267 MInt level = c_level(cellId);
268 level++;
269 return grid().cellLengthAtLevel(level);
270 }
271
272 // a_coordinateG
274 const MFloat& c_coordinate(const MInt gCellId, const MInt dim) const {
275 return grid().tree().coordinate(gCellId, dim);
276 }
277
279 MInt& c_neighborId(const MInt cellId, const MInt dir) {
280 // Note: use neighbor list instead of grid().m_tree, also includes diagonal neighbors
281 return grid().neighborList(cellId, dir);
282 }
283
285 MInt c_neighborId(const MInt cellId, const MInt dir) const {
286 // Note: use neighbor list instead of grid().m_tree, also includes diagonal neighbors
287 return grid().neighborList(cellId, dir);
288 }
289
291 MInt a_hasNeighbor(const MInt cellId, const MInt dir) const {
292 // Note: use neighbor list instead of grid().m_tree, also includes diagonal neighbors
293 return static_cast<MInt>(grid().neighborList(cellId, dir) > -1);
294 }
295
296 MBool a_isHalo(const MInt cellId) const { return m_cells.hasProperty(cellId, SolverCell::IsHalo); }
297
298 maia::fc::cell::BitsetType::reference a_isHalo(const MInt cellId) {
299 // ENSURE_VALID_GCELLID(gCellId);
300 return m_cells.hasProperty(cellId, SolverCell::IsHalo);
301 }
302
304 MBool a_isActive(const MInt cellId) const { return a_hasProperty(cellId, SolverCell::IsActive); }
305
307 maia::fc::cell::BitsetType::reference a_isActive(const MInt cellId) {
308 return a_hasProperty(cellId, SolverCell::IsActive);
309 }
310
312 MBool a_wasActive(const MInt cellId) const { return a_hasProperty(cellId, SolverCell::WasActive); }
313
315 maia::fc::cell::BitsetType::reference a_wasActive(const MInt cellId) {
316 return a_hasProperty(cellId, SolverCell::WasActive);
317 }
318
319 void a_resetPropertiesSolver(const MInt cellId) { m_cells.resetProperties(cellId); }
320
321 MInt c_globalId(const MInt cellId) const { return grid().tree().globalId(cellId); }
322
323 MInt getIdAtPoint(const MFloat* point, MBool NotUsed(globalUnique = false)) {
324 return grid().raw().findContainingLeafCell(point, nullptr, solverId());
325 }
326
328 MFloat epsV = F0;
329 for(MInt d = 0; d < nDim; d++) {
330 epsV += strains[d];
331 }
332 return (epsV * F1B3);
333 }
334
336 MFloat hydrostaticPressure = F0;
337 for(MInt d = 0; d < nDim; d++) {
338 hydrostaticPressure += stresses[d];
339 }
340 return (hydrostaticPressure * F1B3);
341 }
342
344 MInt c_noCells() const { return grid().tree().size(); }
345
346 MInt c_level(const MInt cellId) const { return grid().tree().level(cellId); }
347
348 MInt c_noChildren(const MInt cellId) const { return grid().tree().noChildren(cellId); }
349
350 MBool c_isLeafCell(const MInt cellId) const { return grid().tree().isLeafCell(cellId); }
351
352 MInt c_childId(const MInt cellId, const MInt childNumber) const { return grid().tree().child(cellId, childNumber); }
353
354 MInt c_parentId(const MInt cellId) const { return grid().tree().parent(cellId); }
355
356
357 static constexpr const MInt m_noDirs = 2 * nDim;
358
359 FcSolver<nDim_>(MInt id, GridProxy& gridProxy_, Geometry<nDim>& geometry_, const MPI_Comm comm);
360
361 ~FcSolver() override;
362
363 MBool isActive() const override { return grid().isActive(); }
366
368
369 void initTimer();
374 void exchangeNodeIds(MInt currentDomain);
375 void exchangeVector(MFloat* vector);
383
385 void getDisplacementsAtPoint(const MInt cellId, const MFloat* z, const MFloat* displ, MFloat* result);
387 void getStrainsAtPoint(const MInt cellId, const MFloat* z, const MFloat* displ, MFloat* strains);
389 void getStressesAtPoint(const MInt cellId, const MFloat* z, const MFloat* displ, MFloat* stresses);
392
393 void interpolateGeometry(const MInt pCellId, const MFloat* x, MFloat* z);
394 void transformToLocal(const MInt pCellId, const MFloat* z, MFloat* x);
395 void interpolateSubCellGeometry(const MInt pCellId, const MFloat* z, MFloat* x, const MInt subCellLevel,
396 const MFloat* subCellCoord);
397 void getCoordinatesOfNode(MInt node, MInt cell, MFloat* coordinates);
398
401 void getMaterialTensor(MFloatScratchSpace& C, const MInt pCellId, const MInt node = -1);
402 void getStrainInterpolationMatrix(MFloatScratchSpace& Be, const MInt pCellId, const MFloat* z);
403 void getNodalStiffnessMatrix(const MInt pCellId, const MInt node, MFloatScratchSpace& Ke, MInt* nodePos, MFloat* z,
404 MFloat determinant, const MFloat alpha, const MInt subCellLevel);
405 void getElementMatrix(MFloatScratchSpace& Ke, const MInt pCellId, const MFloat alpha, const MInt subCellLevel,
406 const MFloat* subCellCoord = nullptr);
407
410
414 void resetDisplacements(const MInt mode = -1);
416 void resetLoadVector(const MInt mode = -1);
418 void updateLoadVector(const MFloat lambda = F1);
419
420 // DEBUG FUCTIONS:
421 void interpolateGeometryDebug(const MInt pCellId, const MFloat* z, MFloat* x);
423 MFloatScratchSpace& L_coef_lagrange);
424 void getJacobiMatrixDebug(const MInt pCellId, const MFloat* z, MFloatScratchSpace& jacobi_lagrange);
425 void getStrainInterpolationMatrixDebug(const MInt pCellId, const MFloat* z, MFloatScratchSpace& strain_lagrange);
427 void lagrangianPointsJacobi(const MInt pCellId, const MFloat* z, MFloatScratchSpace& x);
428 void solveMatrixIteratively(MFloat* A_coeff, MInt** pos, const MInt n);
429 void solveMatrixIterativelyPreCon(MFloat* A_coeff, MInt** pos, const MInt n, const MInt m, MFloat* b, MFloat* x);
430
432 MFloat time() const override { return m_time; }
433
435
437 constexpr const Geom& geometry() const { return *m_geometry; }
438
440
441 void rhs();
442 void rhsBnd();
443 void lhsBnd();
444 void initSolver() override;
445 void finalizeInitSolver() override;
446 void preTimeStep() override;
447 MBool solutionStep() override;
448 void lhs();
449 void saveSolverSolution(MBool forceOutput, const MBool finalTimeStep) override;
450 MBool prepareRestart(MBool writeRestart, MBool& writeGridRestart) override;
451 void reIntAfterRestart(MBool doneRestart);
452 void writeRestartFile(const MBool writeRestart, const MBool writeBackup, const MString gridFileName,
453 MInt* recalcIdTree) override;
454 void saveRestartStrainsOnly(const MChar* fileName, const MChar* gridInputFileName, MInt* recalcIdTree = nullptr);
455 void setCellWeights(MFloat* solverCellWeight) override;
457 m_log << "Called LsCartesianSolver::resetExternalSources without Implementation" << std::endl;
458 }
460 m_log << "Called LsCartesianSolver::exchangeExternalSources without Implementation" << std::endl;
461 }
462
463 virtual void cleanUp(){};
464
465 void postTimeStep() override; // until now it is left unused
466
467 protected:
468 // Timers
469 struct {
480
483 Geom& geometry() { return *m_geometry; }
485
486 FcBndryCnd<nDim>* m_bndryCnd = nullptr; // Pointer to the boundary conditions
487
489
490 public:
494
495 private:
496 // Number of variables
497 static constexpr MInt m_noStrains = (nDim == 2) ? (nDim + 1) : (nDim * 2);
498
509 MFloat m_E = 100000.0;
511 MFloat m_eps = 1e-12;
520
521 protected:
535
538
539 std::map<std::pair<MInt, MInt>, MFloat> m_globalStiffnessMatrix;
540 std::map<std::pair<MInt, MInt>, MFloat> m_globalBndryMatrix;
541 std::map<std::pair<MInt, MInt>, MFloat> m_finalGlobalMatrix;
542
543 public:
544 MInt a_noCells() const { return m_cells.size(); }
545
546 protected:
549
550 // Pointer to memory allocated by Alloc for storing the recalculated ids
551 MInt* m_recalcIds = nullptr;
552};
553#endif
GridCell
Grid cell Property Labels.
This class represents a structure solver using the Finite Cell Method.
Definition: fcsolver.h:27
void allocateNodeVectors()
MFloat m_eps
Definition: fcsolver.h:511
maia::fc::cell::BitsetType::reference a_hasProperty(const MInt cellId, const SolverCell p)
Returns solver cell property p of the cell cellId.
Definition: fcsolver.h:210
virtual void cleanUp()
Definition: fcsolver.h:463
MFloat a_nodalStrains(const MInt cellId, const MInt node, const MInt dir) const
Returns the nodal strains dir from the stain matrix of node node of cell cellId.
Definition: fcsolver.h:150
void solveSystemOfEquations()
static constexpr MInt nDim
Definition: fcsolver.h:32
MBool a_hasProperty(const MInt cellId, const Cell p) const
Returns property p of the cell cellId.
Definition: fcsolver.h:207
struct FcSolver::@6 m_t
MFloat a_dGamma(const MInt cellId, const MInt node) const
Returns delta gamma of node node of the cell cellId.
Definition: fcsolver.h:124
void solveMatrixIteratively(MFloat *A_coeff, MInt **pos, const MInt n)
void resetExternalSources()
Definition: fcsolver.h:456
void updateCellCollectorFromGrid()
typename maia::grid::tree::Tree< nDim >::Cell Cell
Definition: fcsolver.h:35
MBool a_hasProperty(const MInt cellId, const SolverCell p) const
Returns solver cell property p of the cell cellId.
Definition: fcsolver.h:215
MFloat a_alpha(const MInt cellId) const
Returns alpha of the cell cellId.
Definition: fcsolver.h:100
void consistencyCheck()
MInt a_nodeIdsLocal(const MInt cellId, const MInt nodeDir) const
Returns node ids of the cell cellId.
Definition: fcsolver.h:253
MFloat & a_epsilonBarP(const MInt cellId, const MInt node)
Returns epsilon bar of node node of the cell cellId.
Definition: fcsolver.h:127
MInt a_noCells() const
Definition: fcsolver.h:544
MInt displacementBC
Definition: fcsolver.h:476
MFloat a_elementDevStresses(const MInt cellId, const MInt dir)
Returns the deviatoric stress dir from the stress matrix of the cell cellId.
Definition: fcsolver.h:189
MInt m_polyDeg
Definition: fcsolver.h:503
typename CartesianSolver::GridProxy GridProxy
Definition: fcsolver.h:39
void initSolver() override
void postTimeStep() override
MBool m_isThermal
Definition: fcsolver.h:510
void setCellWeights(MFloat *solverCellWeight) override
Set cell weights.
MFloat * m_nodalLoadVector
Definition: fcsolver.h:524
void fillDisplacementVectorWithCoords()
void reIntAfterRestart(MBool doneRestart)
void saveRestartStrainsOnly(const MChar *fileName, const MChar *gridInputFileName, MInt *recalcIdTree=nullptr)
void getMaterialTensor(MFloatScratchSpace &C, const MInt pCellId, const MInt node=-1)
MBool m_first
Definition: fcsolver.h:507
MFloat & a_dGamma(const MInt cellId, const MInt node)
Returns delta gamma of node node of the cell cellId.
Definition: fcsolver.h:121
void initJacobianMatrix()
void getStrainInterpolationMatrix(MFloatScratchSpace &Be, const MInt pCellId, const MFloat *z)
MBool m_printEigenValues
Definition: fcsolver.h:515
void saveSolverSolution(MBool forceOutput, const MBool finalTimeStep) override
MFloat * m_bndryMatCompressed
Definition: fcsolver.h:533
MFloat getHydrostaticPressure(const MFloat *stresses)
Definition: fcsolver.h:335
MFloat * m_totalNodalDisplacements
Definition: fcsolver.h:523
void createCompressedMatrix()
MInt a_bndId(const MInt cellId) const
Returns bndId of the cell cellId.
Definition: fcsolver.h:235
MInt a_maxSubCellLvl(const MInt cellId) const
Returns pRfnmnt of the cell cellId.
Definition: fcsolver.h:247
void computeAssembledSystemMatrix(MFloatScratchSpace &Ke, const MInt pCellId)
void createElementToNodeMappingGlobal()
void createElementToNodeMapping()
void exchangeVector(MFloat *vector)
void calcElementDisplacements()
MFloat a_nodalStresses(const MInt cellId, const MInt node, const MInt dir) const
Returns the nodal stress dir from the stress matrix of node node of cell cellId.
Definition: fcsolver.h:184
MInt m_totalNoNodes
Definition: fcsolver.h:499
MFloat a_elementDevStrains(const MInt cellId, const MInt dir)
Returns the deviatoric strain dir from the strain matrix of the cell cellId.
Definition: fcsolver.h:155
MFloat a_elementStrains(const MInt cellId, const MInt dir) const
Returns the elment strain dir from the strain matrix of the cell cellId.
Definition: fcsolver.h:142
maia::fc::cell::BitsetType::reference a_isActive(const MInt cellId)
Returns isActive of the cell CellId.
Definition: fcsolver.h:307
void getInternalLoadsFromStresses()
MInt subCellInt
Definition: fcsolver.h:474
MInt m_noLoadSteps
Definition: fcsolver.h:513
void getReactionForces()
MInt & a_pRfnmnt(const MInt cellId)
Returns pRfnmnt of the cell cellId.
Definition: fcsolver.h:238
void lhsBnd()
MFloat m_alpha
Definition: fcsolver.h:516
void rhsBnd()
MInt m_noHaloNodes
Definition: fcsolver.h:502
void getStressesAtPoint(const MInt cellId, const MFloat *z, const MFloat *displ, MFloat *stresses)
MString m_fcInterpolationMethod
Definition: fcsolver.h:514
MInt & a_nodeIdsGlobal(const MInt cellId, const MInt nodeDir)
Returns node ids of the cell cellId.
Definition: fcsolver.h:256
void getDisplacementInterpolationMatrix(const MInt pCellId, const MFloat *z, MFloatScratchSpace &x)
MFloat m_analyticSolution
Definition: fcsolver.h:506
MFloat time() const override
Return number of variables.
Definition: fcsolver.h:432
MInt m_maxNoIterations
Definition: fcsolver.h:512
MInt * m_localToGlobalId
Definition: fcsolver.h:528
void initTimer()
MInt c_parentId(const MInt cellId) const
Definition: fcsolver.h:354
void getNodalStiffnessMatrix(const MInt pCellId, const MInt node, MFloatScratchSpace &Ke, MInt *nodePos, MFloat *z, MFloat determinant, const MFloat alpha, const MInt subCellLevel)
std::map< std::pair< MInt, MInt >, MFloat > m_globalBndryMatrix
Definition: fcsolver.h:540
void setGlobalNodeIds()
Geometry< nDim > * m_geometry
Definition: fcsolver.h:484
void resetDisplacements(const MInt mode=-1)
MFloat & a_nodalStrains(const MInt cellId, const MInt node, const MInt dir)
Returns the nodal strains dir from the stain matrix of node node of cell cellId.
Definition: fcsolver.h:145
MFloat getVolumetricStrains(const MFloat *strains)
Definition: fcsolver.h:327
GeometryIntersection< nDim > * m_geometryIntersection
Definition: fcsolver.h:439
MBool m_addingPenalties
Definition: fcsolver.h:517
static constexpr MInt m_noStrains
Definition: fcsolver.h:497
MInt calcStiffMat
Definition: fcsolver.h:472
void rhs()
void a_resetPropertiesSolver(const MInt cellId)
Definition: fcsolver.h:319
MFloat & a_elementStrains(const MInt cellId, const MInt dir)
Returns the element strain dir from the stain matrix of the cell cellId.
Definition: fcsolver.h:139
MFloat & a_alpha(const MInt cellId)
Returns alpha of the cell cellId.
Definition: fcsolver.h:97
void calculateStiffnessMatrix()
MFloat & a_invJacobian(const MInt cellId)
Returns inverse Jacobian of the cell cellId.
Definition: fcsolver.h:109
void getCoordinatesOfNode(MInt node, MInt cell, MFloat *coordinates)
MBool a_isBndryCell(const MInt cellId) const
Returns isBndryCell of the cell CellId.
Definition: fcsolver.h:81
MInt c_noChildren(const MInt cellId) const
Definition: fcsolver.h:348
void resetLoadVector(const MInt mode=-1)
MFloat m_time
Definition: fcsolver.h:488
MInt a_nodeIdsGlobal(const MInt cellId, const MInt nodeDir) const
Returns node ids of the cell cellId.
Definition: fcsolver.h:259
constexpr const Geom & geometry() const
Access the solver's geometry.
Definition: fcsolver.h:437
MInt * m_globalToLocalId
Definition: fcsolver.h:529
MInt m_totalNoNodesGlobal
Definition: fcsolver.h:500
void interpolateGeometry(const MInt pCellId, const MFloat *x, MFloat *z)
void correctGlobalNodeIds()
MFloat & a_elementDispl(const MInt cellId, const MInt dir)
Returns the displacement dir of the cell cellId.
Definition: fcsolver.h:133
Geom & geometry()
Access the solver's geometry (non-const version)
Definition: fcsolver.h:483
MFloat a_nodePosition(const MInt cellId, const MInt dir) const
Returns the element dir from the legendre points of the cell cellId.
Definition: fcsolver.h:118
MInt solving
Definition: fcsolver.h:477
MBool a_needsSubCells(const MInt cellId) const
Returns needsSubCells of the cell CellId.
Definition: fcsolver.h:218
void averageTimer()
MFloat * m_externalLoadVector
Definition: fcsolver.h:525
MFloat a_elementDispl(const MInt cellId, const MInt dir) const
Returns the element displacement dir of the cell cellId.
Definition: fcsolver.h:136
void getStrainsAtPoint(const MInt cellId, const MFloat *z, const MFloat *displ, MFloat *strains)
MFloat c_cellLengthAtLevel(const MInt level) const
Definition: fcsolver.h:264
FcBndryCnd< nDim > * m_bndryCnd
Definition: fcsolver.h:486
MInt c_childId(const MInt cellId, const MInt childNumber) const
Definition: fcsolver.h:352
void transformToLocal(const MInt pCellId, const MFloat *z, MFloat *x)
MInt initSolver
Definition: fcsolver.h:471
MInt c_noCells() const
Returns the number of grid-cells.
Definition: fcsolver.h:344
void consistencyCheck2()
void deactivateCells()
MBool m_testRun
Definition: fcsolver.h:505
void exchangeExternalSources()
Definition: fcsolver.h:459
MFloat m_E
Definition: fcsolver.h:509
MInt c_neighborId(const MInt cellId, const MInt dir) const
Returns the neighbor id of the cell cellId for direction dir.
Definition: fcsolver.h:285
~FcSolver() override
std::map< std::pair< MInt, MInt >, MFloat > m_globalStiffnessMatrix
Definition: fcsolver.h:539
maia::fc::cell::BitsetType::reference a_isHalo(const MInt cellId)
Definition: fcsolver.h:298
void reorderLocalNodeIds()
void exchangeNodeIds(MInt currentDomain)
void updateLoadVector(const MFloat lambda=F1)
void computeAssembledBndryMatrix(MFloatScratchSpace &Bndry, const MInt pCellId)
MBool solutionStep() override
void finalizeInitSolver() override
MBool a_isWindow(const MInt cellId) const
Returns isInterface of the cell CellId.
Definition: fcsolver.h:89
MInt exchange
Definition: fcsolver.h:478
void interpolateSubCellGeometry(const MInt pCellId, const MFloat *z, MFloat *x, const MInt subCellLevel, const MFloat *subCellCoord)
typename CartesianSolver::Grid Grid
Definition: fcsolver.h:38
MBool m_adaptation
Definition: fcsolver.h:493
void updateDisplacements()
maia::fc::cell::BitsetType::reference a_wasActive(const MInt cellId)
Returns isActive of the cell CellId.
Definition: fcsolver.h:315
MInt & a_bndId(const MInt cellId)
Returns bndId of the cell cellId.
Definition: fcsolver.h:232
MBool m_useEigen
Definition: fcsolver.h:519
void writeRestartFile(const MBool writeRestart, const MBool writeBackup, const MString gridFileName, MInt *recalcIdTree) override
typename maia::CartesianSolver< nDim, FcSolver > CartesianSolver
Definition: fcsolver.h:37
MInt & a_maxSubCellLvl(const MInt cellId)
Returns pRfnmnt of the cell cellId.
Definition: fcsolver.h:244
MFloat * m_reactionForceVector
Definition: fcsolver.h:527
MFloat a_nodalDevStresses(const MInt cellId, const MInt node, const MInt dir)
Returns the nodal deviatoric stress dir from the stress matrix of node node of cell cellId.
Definition: fcsolver.h:198
void lhs()
void getDerivativeOfDisplacementInterpolationMatrix(const MInt pCellId, const MFloat *z, MFloatScratchSpace &x)
MInt forceBC
Definition: fcsolver.h:475
MInt & a_noNodes(const MInt cellId)
Returns number of elements of the cell cellId.
Definition: fcsolver.h:226
MBool m_solveSoEIteratively
Definition: fcsolver.h:518
MInt ** m_compressionIndexSys
Definition: fcsolver.h:532
MInt m_noInternalNodes
Definition: fcsolver.h:501
MFloat * m_nodalDisplacements
Definition: fcsolver.h:522
maia::fc::cell::BitsetType::reference a_isWindow(const MInt cellId)
Returns isInterface of the cell CellId.
Definition: fcsolver.h:92
MInt * m_globalNodeIdOffsets
Definition: fcsolver.h:530
MInt c_globalId(const MInt cellId) const
Definition: fcsolver.h:321
MInt solver
Definition: fcsolver.h:470
MInt a_hasNeighbor(const MInt cellId, const MInt dir) const
Returns noNeighborIds of the cell CellId for direction dir.
Definition: fcsolver.h:291
void calcElementStrains()
MFloat m_poissonRatio
Definition: fcsolver.h:504
MFloat m_volume
Definition: fcsolver.h:508
MInt c_level(const MInt cellId) const
Definition: fcsolver.h:346
void getElementMatrix(MFloatScratchSpace &Ke, const MInt pCellId, const MFloat alpha, const MInt subCellLevel, const MFloat *subCellCoord=nullptr)
MFloat & a_nodePosition(const MInt cellId, const MInt dir)
Returns the element dir from the legendre points of the cell cellId.
Definition: fcsolver.h:115
maia::fc::collector::FcCellCollector< nDim > m_cells
Collector for Fc cells.
Definition: fcsolver.h:548
MBool a_wasActive(const MInt cellId) const
Returns isActive of the cell CellId.
Definition: fcsolver.h:312
static constexpr const MInt m_noDirs
Definition: fcsolver.h:357
MInt & c_neighborId(const MInt cellId, const MInt dir)
Returns the neighbor id of the cell cellId for direction dir.
Definition: fcsolver.h:279
MInt noInternalCells() const override
Return the number of internal cells within this solver.
Definition: fcsolver.h:78
MBool a_isHalo(const MInt cellId) const
Definition: fcsolver.h:296
MInt * m_recalcIds
Definition: fcsolver.h:551
MFloat & a_poissonRatio(const MInt cellId)
Returns poisson Ratio of the cell cellId.
Definition: fcsolver.h:103
void preTimeStep() override
MFloat a_epsilonBarP(const MInt cellId, const MInt node) const
Returns epsilon bar of node node of the cell cellId.
Definition: fcsolver.h:130
void interpolateGeometryDebug(const MInt pCellId, const MFloat *z, MFloat *x)
MInt & a_nodeIdsLocal(const MInt cellId, const MInt nodeDir)
Returns node ids of the cell cellId.
Definition: fcsolver.h:250
const MFloat & c_coordinate(const MInt gCellId, const MInt dim) const
Returns the coordinate of the cell cellId for direction dim.
Definition: fcsolver.h:274
MBool isActive() const override
Definition: fcsolver.h:363
void setIntegrationWeights()
MFloat & a_elementStresses(const MInt cellId, const MInt dir)
Returns the element stress dir from the stress matrix of the cell cellId.
Definition: fcsolver.h:173
void getStrainInterpolationMatrixDebug(const MInt pCellId, const MFloat *z, MFloatScratchSpace &strain_lagrange)
MInt getIdAtPoint(const MFloat *point, MBool NotUsed(globalUnique=false))
Definition: fcsolver.h:323
MInt a_noNodes(const MInt cellId) const
Returns number of elements of the cell cellId.
Definition: fcsolver.h:229
void lagrangianPointsJacobi(const MInt pCellId, const MFloat *z, MFloatScratchSpace &x)
void getDisplacementInterpolationMatrixDebug(const MInt pCellId, const MFloat *z, MFloatScratchSpace &L_coef_lagrange)
MBool a_isActive(const MInt cellId) const
Returns isActive of the cell CellId.
Definition: fcsolver.h:304
std::map< std::pair< MInt, MInt >, MFloat > m_finalGlobalMatrix
Definition: fcsolver.h:541
MFloat & a_nodalStresses(const MInt cellId, const MInt node, const MInt dir)
Returns the nodal stress dir from the stress matrix of node node of cell cellId.
Definition: fcsolver.h:179
MFloat ** m_gaussPoints
Definition: fcsolver.h:536
MFloat a_poissonRatio(const MInt cellId) const
Returns poisson Ratio of the cell cellId.
Definition: fcsolver.h:106
maia::fc::cell::BitsetType::reference a_needsSubCells(const MInt cellId)
Returns needsSubCells of the cell CellId.
Definition: fcsolver.h:221
void getDisplacementsAtPoint(const MInt cellId, const MFloat *z, const MFloat *displ, MFloat *result)
void calcElementStresses()
MInt a_pRfnmnt(const MInt cellId) const
Returns pRfnmnt of the cell cellId.
Definition: fcsolver.h:241
void solveMatrixIterativelyPreCon(MFloat *A_coeff, MInt **pos, const MInt n, const MInt m, MFloat *b, MFloat *x)
MFloat c_cellLengthAtCell(const MInt cellId) const
Definition: fcsolver.h:262
MFloat ** m_gaussWeights
Definition: fcsolver.h:537
MFloat a_invJacobian(const MInt cellId) const
Returns inverse Jacobian of the cell cellId.
Definition: fcsolver.h:112
MInt ** m_compressionIndexBndry
Definition: fcsolver.h:534
void getJacobiMatrixDebug(const MInt pCellId, const MFloat *z, MFloatScratchSpace &jacobi_lagrange)
void resetActiveState()
MInt solutionStep
Definition: fcsolver.h:473
MBool prepareRestart(MBool writeRestart, MBool &writeGridRestart) override
Prepare the solvers for a grid-restart.
MFloat a_jacobianMatrix(const MInt cellId) const
Definition: fcsolver.h:266
MFloat * m_internalLoadVector
Definition: fcsolver.h:526
MBool m_adaptationSinceLastRestart
Definition: fcsolver.h:491
MBool m_adaptationSinceLastSolution
Definition: fcsolver.h:492
MFloat * m_sysMatCompressed
Definition: fcsolver.h:531
MFloat a_nodalDevStrains(const MInt cellId, const MInt node, const MInt dir)
Returns the nodal deviatoric strain dir from the strain matrix of node node of cell cellId.
Definition: fcsolver.h:164
MFloat a_elementStresses(const MInt cellId, const MInt dir) const
Returns the element stress dir from the stress matrix of the cell cellId.
Definition: fcsolver.h:176
MBool m_nonBlockingComm
Definition: fcsolver.h:481
void assembleFinalMatrix()
maia::fc::cell::BitsetType::reference a_isBndryCell(const MInt cellId)
Returns isBndryCell of the cell CellId.
Definition: fcsolver.h:84
MBool c_isLeafCell(const MInt cellId) const
Definition: fcsolver.h:350
This class is a ScratchSpace.
Definition: scratch.h:758
MInt solverId() const
Return the solverId.
Definition: solver.h:425
Class that represents FC cell collector.
FcCell
FC cell Property Labels.
InfoOutFile m_log
int32_t MInt
Definition: maiatypes.h:62
std::basic_string< char > MString
Definition: maiatypes.h:55
double MFloat
Definition: maiatypes.h:52
bool MBool
Definition: maiatypes.h:58
char MChar
Definition: maiatypes.h:56
LB lattice descriptor for arrays depending on D.
Definition: fcdescriptor.h:168