-
Notifications
You must be signed in to change notification settings - Fork 284
[Core] Add PMultigridBuilderAndSolver
#13276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 128 commits
eee0b78
fb5fac0
a14f613
a198982
7aa8eda
2819cbc
9d36f12
ee5d873
12cbe77
c48afcb
bce87b8
47c6707
c2cedc3
92fb9bc
2938413
ed9e1e9
c6d2466
ecce8b7
37eca59
f24354b
5f97354
f4a100a
d8aadfa
4dc9019
2e910ec
64e3c35
7db0ce4
a6a0725
49d18af
d688e8c
a212885
a1289d7
bc814a5
60195d2
d353b03
81913aa
0962e30
4ea9661
ff261cd
3ab7c25
080550c
8aa9305
bd5ad29
fa35892
fcc9d8f
712d64e
2b7b515
7d16e25
f3d4584
49aa389
a267d40
d8f1237
4fbb6a3
2301dab
94c2554
df96c56
e39a390
1c0fcac
224d5a2
6ad494f
9be5cbb
837d39a
479191f
dd4768a
c9c304a
37d8c2b
8fdebe9
8c310e4
f822f7c
ecb578b
b313b6c
b494ecd
67b9f8c
e4e8fb5
a130137
12828bd
6102498
38c8956
b45091c
3fe4f7c
7f8007d
ac60143
0f5dc94
4cba87a
4fe757d
3321333
37d151c
9271289
9581c01
44f8eb8
1635f17
faf8660
3bbcd45
68c27db
7460d2b
d34079b
55a304a
6482876
3ef0667
8165fab
a8933e3
661b465
5570366
75dccc3
d0742f0
4dbda6a
3e8796d
46e469d
f5e343e
33198c7
e8777cc
0b38806
d0d97ce
e741e60
21e9726
0a5a095
5cf6e48
ae314ec
a50b928
2050106
8e780c6
d13f992
9871049
ceae677
b708dc4
7f567ad
1b77f80
c69adba
d22a90c
ad4ca25
4894b71
0fb562d
638f752
99c6e29
be285e7
6c708b3
b3fd289
3d365a7
b26d015
b7c0208
8e1a5da
8e8a3cc
af17a0c
a407fe6
040b6fc
0d7d15e
c071bce
89d4bea
27a4014
94266e0
76ebd40
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,335 @@ | ||||||||||
| // | / | | ||||||||||
| // ' / __| _` | __| _ \ __| | ||||||||||
| // . \ | ( | | ( |\__ ` | ||||||||||
| // _|\_\_| \__,_|\__|\___/ ____/ | ||||||||||
| // Multi-Physics | ||||||||||
| // | ||||||||||
| // License: BSD License | ||||||||||
| // Kratos default license: kratos/license.txt | ||||||||||
| // | ||||||||||
| // Main authors: Máté Kelemen | ||||||||||
| // | ||||||||||
|
|
||||||||||
| // Project includes | ||||||||||
| #include "custom_constraints/link_constraint.hpp" // LinkConstraint | ||||||||||
| #include "includes/define.h" | ||||||||||
| #include "includes/process_info.h" | ||||||||||
| #include "includes/variables.h" // DISPLACEMENT_X, DISPLACEMENT_Y, DISPLACEMENT_Z | ||||||||||
| #include "includes/serializer.h" // Serializer | ||||||||||
| #include "includes/variables.h" // CONSTITUTIVE_MATRIX, INTERNAL_FORCES_VECTOR | ||||||||||
|
|
||||||||||
| // STL includes | ||||||||||
| #include <algorithm> // std::max_element, std::equal, std::transform | ||||||||||
|
|
||||||||||
|
|
||||||||||
| namespace Kratos { | ||||||||||
|
|
||||||||||
|
|
||||||||||
| struct LinkConstraint::Impl | ||||||||||
| { | ||||||||||
| using ValueType = double; | ||||||||||
|
|
||||||||||
| static void ComputeRelationMatrix(LinkConstraint::MatrixType& rRelationMatrix, | ||||||||||
| LinkConstraint::MatrixType& rHessian, | ||||||||||
| LinkConstraint::VectorType& rConstraintGaps, | ||||||||||
| const std::array<ValueType,6>& rLastPositions, | ||||||||||
| const std::array<ValueType,6>& rLastDisplacements, | ||||||||||
| const unsigned Dimensions) | ||||||||||
| { | ||||||||||
| // Make sure we don't try to allocate an underflown unsigned integer. | ||||||||||
| KRATOS_ERROR_IF_NOT(Dimensions); | ||||||||||
matekelemen marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||||
|
|
||||||||||
| // Set output sizes. | ||||||||||
| rRelationMatrix.resize(1, 2 * Dimensions); | ||||||||||
| rHessian.resize(2 * Dimensions, 2 * Dimensions); | ||||||||||
|
||||||||||
| rRelationMatrix.resize(1, 2 * Dimensions); | |
| rHessian.resize(2 * Dimensions, 2 * Dimensions); | |
| noalias(rRelationMatrix) = ZeroMatrix(1, 2 * Dimensions); | |
| noalias(rHessian) = ZeroMatrix(2 * Dimensions, 2 * Dimensions); |
This is more readable as well than using the std::fill in my opinion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe, but that's always allocating new memory, while resizing does not if the size is already correct. I should have set preserve = false though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, ZeroMatrix does not allocate.
Uh oh!
There was an error while loading. Please reload this page.