Skip to content
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

Gaussian Process Buckling Constraints in Blade Stiffened Shell Constitutive Subclass #311

Merged
merged 124 commits into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
124 commits
Select commit Hold shift + click to select a range
cb844b5
demonstrate exploded views
sean-engelstad Dec 1, 2023
1d6b95c
Merge branch 'master' of github.com:sean-engelstad/tacs
sean-engelstad Mar 14, 2024
79d0b25
Merge branch 'master' of github.com:sean-engelstad/tacs
sean-engelstad Mar 20, 2024
b08f4bb
prototype of the TACSGPBladestiffenedshellconstitutive class
sean-engelstad Apr 24, 2024
d562b8e
prototype closed-form buckling constraints
sean-engelstad Apr 24, 2024
c64fa39
Merge branch 'smdogroup:master' into GPbladeconstitutive
sean-engelstad Apr 25, 2024
fd9b400
outline of TACS assembler subroutine to compute panel dimensions
sean-engelstad Apr 25, 2024
4b491c2
merge
sean-engelstad Apr 25, 2024
7caf055
prototype panel dimensions computation
sean-engelstad Apr 25, 2024
2ce3da9
Merge branch 'master' of github.com:sean-engelstad/tacs
sean-engelstad Apr 27, 2024
89bff20
Merge branch 'GPbladeconstitutive' of github.com:sean-engelstad/tacs …
sean-engelstad Apr 27, 2024
1e4f69b
prototype computePanelDimensions routine
sean-engelstad Apr 28, 2024
84fe3e3
Merge branch 'GPbladeconstitutive' of github.com:sean-engelstad/tacs …
sean-engelstad Apr 28, 2024
759d89c
update failure criterion with new buckling constraints
sean-engelstad Apr 29, 2024
8daadd7
update GP blade stiffened
sean-engelstad Apr 29, 2024
4aa1605
cleanup mass moment and MOI calls
sean-engelstad Apr 29, 2024
29db0a9
clang-format and add setPanelLength and width subroutines
sean-engelstad Apr 29, 2024
990e217
clang format
sean-engelstad Apr 29, 2024
431f0f8
remove computePanelDimensions
sean-engelstad Apr 29, 2024
1056078
add panel width constraint
sean-engelstad Apr 29, 2024
8c472d4
prototype of panel width constraint
sean-engelstad May 1, 2024
e57a425
remove needsPanelDimensions
sean-engelstad May 1, 2024
4fba62f
update the failure sensitivities for GP constitutive
sean-engelstad May 1, 2024
df1df93
update gaussian process folder
sean-engelstad May 10, 2024
92acbd3
Merge branch 'GPbladeconstitutive' of github.com:sean-engelstad/tacs …
sean-engelstad May 10, 2024
ceb3056
update GP Model.h file
sean-engelstad May 10, 2024
db4982a
demo gaussian process models
sean-engelstad May 12, 2024
b42be20
prototype for GP buckling constraints and full GP failure criterion
sean-engelstad May 13, 2024
f0b6fc5
add tests of each nondimensional parameter and critical load
sean-engelstad May 13, 2024
1535d94
begin making the unittest for TACS GP blade stiffened shell constitut…
sean-engelstad May 13, 2024
7e09d9a
clang reformat
sean-engelstad May 13, 2024
bc18519
update makefile to compile TACSGPBlade stiffened
sean-engelstad May 13, 2024
2e3cd56
successfully compiling versions of the GP Model and GP constitutive c…
sean-engelstad May 13, 2024
3bd471b
add cython code for GP blade stiffened constitutive and the GP models
sean-engelstad May 13, 2024
363a354
first compiling cython objects for GP models and constitutive
sean-engelstad May 13, 2024
b1f5d4e
prototype for python level constitutive test on GP constitutive class
sean-engelstad May 13, 2024
619d581
change subclass structure for gp constitutive at the cython level
sean-engelstad May 13, 2024
334560e
fix GP model pointers in Cython constructor of GP const
sean-engelstad May 13, 2024
8a3235a
first fully running prototype of the test_gp_blade_shell_constitutive
sean-engelstad May 13, 2024
cd76427
fix all nondimensional parameter tests
sean-engelstad May 13, 2024
ee64c8b
working closed-form internal tests
sean-engelstad May 14, 2024
cb21872
clang-format
sean-engelstad May 14, 2024
447d6a4
save current progress on fixing ML kernel derivatives
sean-engelstad May 14, 2024
04ec185
fix the ML internal tests
sean-engelstad May 14, 2024
31ba675
save progress on fixing axial global critical ML load
sean-engelstad May 14, 2024
0c7f294
working internal tests with ML buckling constraints in the loop!
sean-engelstad May 15, 2024
1d3bd19
add TACS prefix to all C++ GaussianProcessModel classes
sean-engelstad May 15, 2024
33432d0
add from_csv methods to build the GP models
sean-engelstad May 15, 2024
84ed5a1
add stiffenerCripplingStiffness routine for stiffener crippling load
sean-engelstad May 15, 2024
5286c0b
working fail strain sens derivs in TACSGPBladeStiffenedShellConstitut…
sean-engelstad May 15, 2024
8a711f2
fixed all but stiffener crippling failDV sens now
sean-engelstad May 15, 2024
663eb62
all gp constitutive tests pass now!
sean-engelstad May 16, 2024
fde8e71
remove default print statements from gp blade tests
sean-engelstad May 16, 2024
306ead0
fix a Newton iteration bug in the shear closed-form solution
sean-engelstad May 16, 2024
60ceee7
add closed-form demo example
sean-engelstad May 16, 2024
fe2f8fa
undo free GP pointers bug
sean-engelstad May 16, 2024
3b80e00
setkS
sean-engelstad May 16, 2024
6f3d4e5
change transverse shear parameter formula
sean-engelstad May 17, 2024
f926e77
clang-format
sean-engelstad May 17, 2024
f5446d8
change zeta transformed parameter again
sean-engelstad May 17, 2024
a1f16fa
fix jacobian of new zeta parameter
sean-engelstad May 18, 2024
9eb9286
Merge branch 'GPbladeconstitutive' of github.com:sean-engelstad/tacs …
sean-engelstad May 18, 2024
26abe22
fix bug in reading in the csv archived model data
sean-engelstad May 19, 2024
82d9b13
updated the closed form and axialGP examples
sean-engelstad May 19, 2024
f865740
change xi value in demo scripts
sean-engelstad May 20, 2024
2293ef7
update GP blade constitutive parameters
sean-engelstad May 22, 2024
a010f6f
fix the derivatives for the corrected shear closed-form solution
sean-engelstad May 22, 2024
64d1833
update panel length and width constraints for F2F compatibility
sean-engelstad May 22, 2024
b2245a7
black reformat
sean-engelstad May 22, 2024
1213edb
Merge branch 'GPbladeconstitutive' of github.com:sean-engelstad/tacs …
sean-engelstad May 24, 2024
eac77dc
add TACSPanelGPs class to improve the runtime
sean-engelstad May 24, 2024
a79d56f
fix reset saved data check
sean-engelstad May 24, 2024
a4cc41f
running ML optimization although one derivative doesn't work
sean-engelstad May 24, 2024
a94848e
update nondim shear solution
sean-engelstad May 26, 2024
61623fa
Merge branch 'GPbladeconstitutive' of github.com:sean-engelstad/tacs …
sean-engelstad May 28, 2024
7338bb7
Merge branch 'GPbladeconstitutive' of github.com:sean-engelstad/tacs …
sean-engelstad May 29, 2024
29a4b80
update the tacs constituve pxd file
sean-engelstad May 29, 2024
1f051ac
Merge branch 'GPbladeconstitutive' of github.com:sean-engelstad/tacs …
sean-engelstad May 29, 2024
c388ea2
fix gamma for shear case and crippling load
sean-engelstad Jun 3, 2024
babe9eb
fix memory leaks!
sean-engelstad Jun 4, 2024
a2d13ee
fix all bug failDV ML test so far
sean-engelstad Jun 4, 2024
dc1b852
fix derivatives after removing memory leaks
sean-engelstad Jun 5, 2024
4efda5c
fix unittests and add some debug DV printouts
sean-engelstad Jun 8, 2024
d2b9304
fix kernels to match kernel option 9 in ml_buckling
sean-engelstad Jun 13, 2024
bebaba2
improved analytic shear surrogate model for intermediate aspect ratios
sean-engelstad Jun 17, 2024
f27d1f6
update panel length
sean-engelstad Jun 24, 2024
22fd6af
update unittests
sean-engelstad Jun 30, 2024
4eddfe5
change name from test to check in examples folder
sean-engelstad Jun 30, 2024
af56106
remove print statements
sean-engelstad Jun 30, 2024
1bfd52f
turn off setKS weight into ML model
sean-engelstad Aug 18, 2024
3282a39
improvements to ML buckling model
sean-engelstad Aug 28, 2024
07ddcfb
Merge branch 'GPbladeconstitutive' of github.com:sean-engelstad/tacs …
sean-engelstad Aug 28, 2024
c51dba7
update pyproject.toml also
sean-engelstad Aug 29, 2024
78581cb
add component input to average stresses in TACS assembler
sean-engelstad Sep 1, 2024
fba8bb6
update shear closed-form with lowAR pred
sean-engelstad Sep 5, 2024
490e34a
add TACS blade stiffened shell optimization example for gp-const
sean-engelstad Sep 6, 2024
9d342dc
fix closed-form shear loads soft_max to soft_min
sean-engelstad Sep 6, 2024
b8cdffb
update the way panel D matrix is computed with centroid
sean-engelstad Sep 16, 2024
3822b4b
Merge branch 'GPbladeconstitutive' of github.com:sean-engelstad/tacs …
sean-engelstad Sep 16, 2024
64d7c0b
working derivatives tests and buckling benchmark!
sean-engelstad Sep 17, 2024
30bb7e4
add ability to see failure values
sean-engelstad Sep 18, 2024
97e7150
remove printout
sean-engelstad Sep 18, 2024
7cb4e30
update the GP local buckling constraints
sean-engelstad Sep 22, 2024
92a05f9
fix new memory leak
sean-engelstad Sep 24, 2024
32a7aa1
update gp stiffened plate examples
sean-engelstad Sep 24, 2024
e61ade6
merge with Ali's PR
sean-engelstad Oct 8, 2024
a2ec8a9
working derivative tests after merge with Ali's blade stiffened updates
sean-engelstad Oct 8, 2024
e020e43
add way to change stiffener crippling prediction mode
sean-engelstad Oct 8, 2024
d71c8ee
working functors
sean-engelstad Oct 8, 2024
e3be2cd
fix bug in constructing GPbladeconstitutive
sean-engelstad Oct 8, 2024
a97be46
fix introduced shear loads bug
sean-engelstad Oct 8, 2024
3a8809a
fix complex step test and black reformat
sean-engelstad Oct 8, 2024
6bb23a5
clang google format
sean-engelstad Oct 8, 2024
e80be6d
clang format
sean-engelstad Oct 9, 2024
5ca229b
clang format headers
sean-engelstad Oct 9, 2024
bc7d5fc
remove extra print statement
sean-engelstad Oct 9, 2024
1530a40
switch from functors to virtual and overridden methods
sean-engelstad Oct 9, 2024
4d3aa62
documentation for the TACS GP constitutive class in constitutive.pyx
sean-engelstad Oct 12, 2024
0f71226
fix the documentation for local mode buckling predictions
sean-engelstad Oct 12, 2024
cbe7a3d
address new and delete[] issues, docstrings, cleanup examples, etc.
sean-engelstad Oct 18, 2024
7524984
remove redundant methods in constitutive.pyx
sean-engelstad Oct 21, 2024
eab0fb1
add cptrs in constitutive.pyx to make integration tests pass
sean-engelstad Oct 21, 2024
384fbdc
update docs and docstrings
sean-engelstad Oct 22, 2024
d2e7922
fix panel width docs
sean-engelstad Oct 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
working fail strain sens derivs in TACSGPBladeStiffenedShellConstitut…
…ive class
  • Loading branch information
sean-engelstad committed May 15, 2024
commit 5286c0b68086e7e6e64ed196d85a533ff1eb4748
219 changes: 61 additions & 158 deletions src/constitutive/TACSGPBladeStiffenedShellConstitutive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,14 @@ TACSGPBladeStiffenedShellConstitutive::
// Override Failure constraint and sensitivities
// ==============================================================================

TacsScalar TACSGPBladeStiffenedShellConstitutive::evalFailure(
int elemIndex, const double pt[], const TacsScalar X[],
const TacsScalar e[]) {
TacsScalar fails[this->NUM_FAILURES];
TacsScalar aggFail = this->computeFailureValues(e, fails);
return aggFail;
}

// Compute the failure values for each failure mode of the stiffened panel
TacsScalar TACSGPBladeStiffenedShellConstitutive::computeFailureValues(
const TacsScalar e[], TacsScalar fails[]) {
Expand Down Expand Up @@ -179,16 +187,6 @@ TacsScalar TACSGPBladeStiffenedShellConstitutive::computeFailureValues(
panelStress[2], N12CritLocal);

// --- #4 - Stiffener crippling ---
// compute the A,B,D matrices of the stiffener in strain
TacsScalar stiffenerStiffness[NUM_TANGENT_STIFFNESS_ENTRIES],
stiffenerStress[NUM_STRESSES];
this->computeStiffenerStiffness(stiffenerStiffness);
this->computeStiffenerStress(stiffenerStrain, stiffenerStress);

const TacsScalar* As;
this->extractTangentStiffness(stiffenerStiffness, &As, NULL, NULL, NULL,
NULL);

// compute D matrix of the stiffener (treating it like a panel for crippling)
TacsScalar stiffenerCripplingStiffness[NUM_TANGENT_STIFFNESS_ENTRIES];
const TacsScalar *As_crippling, *Ds_crippling;
Expand All @@ -212,14 +210,17 @@ TacsScalar TACSGPBladeStiffenedShellConstitutive::computeFailureValues(
genPoiss = computeGeneralizedPoissonsRatio(D12s, D66s);
zetaStiff = computeTransverseShearParameter(A66s, A11s, bStiff, hStiff);

// Compute panel dimensions, material props and non-dimensional parameters
TacsScalar N1stiff, N1CritCrippling;
N1CritCrippling = computeStiffenerCripplingLoad(
// Compute stiffener in plane load and crippling failure index
TacsScalar A11s_beam;
TacsScalar N1CritCrippling = computeStiffenerCripplingLoad(
D11s, D22s, xiStiff, rho0Stiff, genPoiss, zetaStiff);
N1stiff = -stiffenerStress[0];
TacsScalar N1stiff = computeStiffenerInPlaneLoad(stiffenerStrain, &A11s_beam);
fails[4] = N1stiff / N1CritCrippling;
// --- End of computeFailuresValues subsections ---

// temporary only base on stiffener + panel stress (for debugging)
// fails[2] = fails[3] = fails[4] = 0.0;

// aggregate the failure across all 5 failures modes (0-4)
return ksAggregation(fails, this->NUM_FAILURES, this->ksWeight);
}
Expand All @@ -235,9 +236,6 @@ TacsScalar TACSGPBladeStiffenedShellConstitutive::evalFailureStrainSens(
TacsScalar panelFailSens[this->NUM_STRESSES];
fails[0] = this->evalPanelFailureStrainSens(e, panelFailSens);

printf("evalFailureStrainSens: fails[0] = %.4e\n", fails[0]);
printf("evalFailureStrainSens: panelFailSens = %.4e\n", panelFailSens);

// --- #1 - Stiffener material failure ---
TacsScalar stiffenerStrain[TACSBeamConstitutive::NUM_STRESSES],
stiffenerStrainSens[TACSBeamConstitutive::NUM_STRESSES],
Expand All @@ -247,10 +245,6 @@ TacsScalar TACSGPBladeStiffenedShellConstitutive::evalFailureStrainSens(
stiffenerStrainSens);
this->transformStrainSens(stiffenerStrainSens, stiffenerFailSens);

printf("evalFailureStrainSens: fails[1] = %.4e\n", fails[1]);
printf("evalFailureStrainSens: stiffenerFailSens = %.4e\n",
stiffenerFailSens);

// -- prelim to buckling constraints --
// compute the A,B,D matrices of the panel
TacsScalar panelStiffness[NUM_TANGENT_STIFFNESS_ENTRIES],
Expand Down Expand Up @@ -279,8 +273,6 @@ TacsScalar TACSGPBladeStiffenedShellConstitutive::evalFailureStrainSens(
xiPanel, gamma, zetaPanel);
N12CritGlobal = computeCriticalGlobalShearLoad(D11p, D22p, b, xiPanel,
rho0Panel, gamma, zetaPanel);
printf("evalFailureStrainSens: N1CritGlobal = %.4e\n", N1CritGlobal);
printf("evalFailureStrainSens: N12CritGlobal = %.4e\n", N12CritGlobal);

// combined failure criterion for axial + shear global mode buckling
// panelStress[0] is the panel in-plane load Nx, panelStress[2] is panel shear
Expand All @@ -291,13 +283,6 @@ TacsScalar TACSGPBladeStiffenedShellConstitutive::evalFailureStrainSens(
-panelStress[0], N1CritGlobal, panelStress[2], N12CritGlobal,
&N1GlobalSens, &N1CritGlobalSens, &N12GlobalSens, &N12CritGlobalSens);

printf("evalFailureStrainSens: fails[2] = %.4e\n", fails[2]);
printf("evalFailureStrainSens: N1GlobalSens = %.4e\n", N1GlobalSens);
printf("evalFailureStrainSens: N1CritGlobalSens = %.4e\n", N1CritGlobalSens);
printf("evalFailureStrainSens: N12GlobalSens = %.4e\n", N12GlobalSens);
printf("evalFailureStrainSens: N12CritGlobalSens = %.4e\n",
N12CritGlobalSens);

// --- #3 - Local panel buckling ---
TacsScalar N1CritLocal, N12CritLocal;

Expand All @@ -306,8 +291,6 @@ TacsScalar TACSGPBladeStiffenedShellConstitutive::evalFailureStrainSens(
computeCriticalLocalAxialLoad(D11p, D22p, rho0Panel, xiPanel, zetaPanel);
N12CritLocal =
computeCriticalLocalShearLoad(D11p, D22p, xiPanel, rho0Panel, zetaPanel);
printf("evalFailureStrainSens: N1CritLocal = %.4e\n", N1CritLocal);
printf("evalFailureStrainSens: N12CritLocal = %.4e\n", N12CritLocal);

// panelStress[0] is the panel in-plane load Nx, panelStress[2] is panel shear
// in-plane load Nxy
Expand All @@ -316,46 +299,14 @@ TacsScalar TACSGPBladeStiffenedShellConstitutive::evalFailureStrainSens(
-panelStress[0], N1CritLocal, panelStress[2], N12CritLocal, &N1LocalSens,
&N1CritLocalSens, &N12LocalSens, &N12CritLocalSens);

printf("evalFailureStrainSens: fails[3] = %.4e\n", fails[3]);
printf("evalFailureStrainSens: N1LocalSens = %.4e\n", N1LocalSens);
printf("evalFailureStrainSens: N1CritLocalSens = %.4e\n", N1CritLocalSens);
printf("evalFailureStrainSens: N12LocalSens = %.4e\n", N12LocalSens);
printf("evalFailureStrainSens: N12CritLocalSens = %.4e\n", N12CritLocalSens);

// --- #4 - Stiffener crippling ---
// compute the A,B,D matrices of the stiffener in strain
TacsScalar stiffenerStiffness[NUM_TANGENT_STIFFNESS_ENTRIES],
stiffenerStress[NUM_STRESSES];
this->computeStiffenerStiffness(stiffenerStiffness);
this->computeStiffenerStress(stiffenerStrain, stiffenerStress);

printf("evalFailureStrainSens: stiffenerStiffness[0] = %.4e\n",
stiffenerStiffness[0]);
printf("evalFailureStrainSens: stiffenerStiffness[12] = %.4e\n",
stiffenerStiffness[12]);
printf("evalFailureStrainSens: stiffenerStiffness[13] = %.4e\n",
stiffenerStiffness[13]);
printf("evalFailureStrainSens: stiffenerStiffness[15] = %.4e\n",
stiffenerStiffness[15]);
printf("evalFailureStrainSens: stiffenerStiffness[17] = %.4e\n",
stiffenerStiffness[17]);

const TacsScalar* As;
this->extractTangentStiffness(stiffenerStiffness, &As, NULL, NULL, NULL,
NULL);

// compute D matrix of the stiffener (treating it like a panel for crippling)
TacsScalar stiffenerCripplingStiffness[NUM_TANGENT_STIFFNESS_ENTRIES];
const TacsScalar *As_crippling, *Ds_crippling;
this->computeStiffenerCripplingStiffness(stiffenerCripplingStiffness);
this->extractTangentStiffness(stiffenerCripplingStiffness, &As_crippling,
NULL, &Ds_crippling, NULL, NULL);

// printf("evalFailureStrainSens: Ds[0] = %.4e\n", Ds[0]);
// printf("evalFailureStrainSens: Ds[1] = %.4e\n", Ds[1]);
// printf("evalFailureStrainSens: Ds[3] = %.4e\n", Ds[3]);
// printf("evalFailureStrainSens: Ds[5] = %.4e\n", Ds[5]);

TacsScalar A11s = As_crippling[0];
TacsScalar A66s = As_crippling[5];
TacsScalar D11s = Ds_crippling[0];
Expand All @@ -371,86 +322,51 @@ TacsScalar TACSGPBladeStiffenedShellConstitutive::evalFailureStrainSens(
xiStiff = computeGeneralizedRigidity(D11s, D22s, D12s, D66s);
genPoiss = computeGeneralizedPoissonsRatio(D12s, D66s);
zetaStiff = computeTransverseShearParameter(A66s, A11s, bStiff, hStiff);
printf("evalFailureStrainSens: D11s = %.4e\n", D11s);
printf("evalFailureStrainSens: D22s = %.4e\n", D22s);
printf("evalFailureStrainSens: D12s = %.4e\n", D12s);
printf("evalFailureStrainSens: D66s = %.4e\n", D66s);
printf("evalFailureStrainSens: a = %.4e\n", a);
printf("evalFailureStrainSens: bStiff = %.4e\n", bStiff);
printf("evalFailureStrainSens: xiStiff = %.4e\n", xiStiff);
printf("evalFailureStrainSens: rho0Stiff = %.4e\n", rho0Stiff);
printf("evalFailureStrainSens: genPoiss = %.4e\n", genPoiss);
printf("evalFailureStrainSens: zetaStiff = %.4e\n", zetaStiff);

// Compute panel dimensions, material props and non-dimensional parameters
TacsScalar N1stiff, N1CritCrippling;
N1CritCrippling = computeStiffenerCripplingLoad(
// Compute stiffener in plane load and crippling failure index
TacsScalar A11s_beam;
TacsScalar N1CritCrippling = computeStiffenerCripplingLoad(
D11s, D22s, xiStiff, rho0Stiff, genPoiss, zetaStiff);
N1stiff = -stiffenerStress[0];
TacsScalar N1stiff = computeStiffenerInPlaneLoad(stiffenerStrain, &A11s_beam);
fails[4] = N1stiff / N1CritCrippling;

printf("evalFailureStrainSens: stiffenerStress[0] = %.4e\n",
stiffenerStress[0]);
printf("evalFailureStrainSens: N1stiff = %.4e\n", N1stiff);
printf("evalFailureStrainSens: N1CritCrippling = %.4e\n", N1CritCrippling);
printf("evalFailureStrainSens: fails[4] = %.4e\n", fails[4]);
// --- End of computeFailuresValues subsections ---

// temporary only base on stiffener + panel stress (for debugging)
// fails[2] = fails[3] = fails[4] = 0.0;

// Compute the sensitivity of the aggregate failure value to the individual
// failure mode values
TacsScalar fail =
ksAggregationSens(fails, this->NUM_FAILURES, this->ksWeight, dKSdf);
printf("evalFailureStrainSens: dKSdf[0] = %.4e\n", dKSdf[0]);
printf("evalFailureStrainSens: dKSdf[1] = %.4e\n", dKSdf[1]);
printf("evalFailureStrainSens: dKSdf[2] = %.4e\n", dKSdf[2]);
printf("evalFailureStrainSens: dKSdf[3] = %.4e\n", dKSdf[3]);

// Compute the total sensitivity due to the panel and stiffener material
// failure
memset(sens, 0, this->NUM_STRESSES * sizeof(TacsScalar));
for (int ii = 0; ii < this->NUM_STRESSES; ii++) {
sens[ii] = dKSdf[0] * panelFailSens[ii] + dKSdf[1] * stiffenerFailSens[ii];
}
printf("evalFailureStrainSens: 1 - sens[0] = %.4e\n", sens[0]);
printf("evalFailureStrainSens: 1 - sens[1] = %.4e\n", sens[1]);
printf("evalFailureStrainSens: 1 - sens[2] = %.4e\n", sens[2]);
printf("evalFailureStrainSens: 1 - sens[3] = %.4e\n", sens[3]);

// Add sensitivites from the buckling criterion
// local buckling
N1LocalSens *= dKSdf[2];
N12LocalSens *= dKSdf[2];
sens[0] += N1LocalSens * -Ap[0] + N12LocalSens * Ap[2];
sens[1] += N1LocalSens * -Ap[1] + N12LocalSens * Ap[4];
sens[2] += N1LocalSens * -Ap[2] + N12LocalSens * Ap[5];
printf("evalFailureStrainSens: 2 - sens[0] = %.4e\n", sens[0]);
printf("evalFailureStrainSens: 2 - sens[1] = %.4e\n", sens[1]);
printf("evalFailureStrainSens: 2 - sens[2] = %.4e\n", sens[2]);
printf("evalFailureStrainSens: 2 - sens[3] = %.4e\n", sens[3]);

// Global buckling
// note here we don't use smeared stiffener properties as closed-form is not
// based on smearing approach for global buckling now..
N1GlobalSens *= dKSdf[3];
N12GlobalSens *= dKSdf[3];
// temporary only base on stiffener + panel stress (for debugging)
// Sensitivity from Global buckling
N1GlobalSens *= dKSdf[2];
N12GlobalSens *= dKSdf[2];
sens[0] += N1GlobalSens * -Ap[0] + N12GlobalSens * Ap[2];
sens[1] += N1GlobalSens * -Ap[1] + N12GlobalSens * Ap[4];
sens[2] += N1GlobalSens * -Ap[2] + N12GlobalSens * Ap[5];

printf("evalFailureStrainSens: 3 - sens[0] = %.4e\n", sens[0]);
printf("evalFailureStrainSens: 3 - sens[1] = %.4e\n", sens[1]);
printf("evalFailureStrainSens: 3 - sens[2] = %.4e\n", sens[2]);
printf("evalFailureStrainSens: 3 - sens[3] = %.4e\n", sens[3]);
// Sensitivity from local buckling
N1LocalSens *= dKSdf[3];
N12LocalSens *= dKSdf[3];
sens[0] += N1LocalSens * -Ap[0] + N12LocalSens * Ap[2];
sens[1] += N1LocalSens * -Ap[1] + N12LocalSens * Ap[4];
sens[2] += N1LocalSens * -Ap[2] + N12LocalSens * Ap[5];

// Stiffener crippling section:
// Sensitivity from stiffener crippling
TacsScalar N1stiffSens = dKSdf[4] / N1CritCrippling;
sens[0] += N1stiffSens * -As[0];
sens[1] += N1stiffSens * -As[1];
sens[2] += N1stiffSens * -As[2];

printf("evalFailureStrainSens: 4 - sens[0] = %.4e\n", sens[0]);
printf("evalFailureStrainSens: 4 - sens[1] = %.4e\n", sens[1]);
printf("evalFailureStrainSens: 4 - sens[2] = %.4e\n", sens[2]);
printf("evalFailureStrainSens: 4 - sens[3] = %.4e\n", sens[3]);
sens[0] += N1stiffSens * -A11s_beam;
TacsScalar z =
this->computeStiffenerCentroidHeight() - 0.5 * this->panelThick;
sens[3] += N1stiffSens * z * -A11s_beam;

return fail;
}
Expand Down Expand Up @@ -668,27 +584,6 @@ void TACSGPBladeStiffenedShellConstitutive::addFailureDVSens(
memset(Dssens, 0, 4 * sizeof(TacsScalar));
memset(Assens, 0, 4 * sizeof(TacsScalar));

// compute the A,B,D matrices of the stiffener in strain
TacsScalar stiffenerStiffness[NUM_TANGENT_STIFFNESS_ENTRIES],
stiffenerStress[NUM_STRESSES];
this->computeStiffenerStiffness(stiffenerStiffness);
this->computeStiffenerStress(stiffenerStrain, stiffenerStress);

printf("evalFailureStrainSens: stiffenerStiffness[0] = %.4e\n",
stiffenerStiffness[0]);
printf("evalFailureStrainSens: stiffenerStiffness[12] = %.4e\n",
stiffenerStiffness[12]);
printf("evalFailureStrainSens: stiffenerStiffness[13] = %.4e\n",
stiffenerStiffness[13]);
printf("evalFailureStrainSens: stiffenerStiffness[15] = %.4e\n",
stiffenerStiffness[15]);
printf("evalFailureStrainSens: stiffenerStiffness[17] = %.4e\n",
stiffenerStiffness[17]);

const TacsScalar* As;
this->extractTangentStiffness(stiffenerStiffness, &As, NULL, NULL, NULL,
NULL);

// compute D matrix of the stiffener (treating it like a panel for crippling)
TacsScalar stiffenerCripplingStiffness[NUM_TANGENT_STIFFNESS_ENTRIES];
const TacsScalar *As_crippling, *Ds_crippling;
Expand Down Expand Up @@ -716,27 +611,17 @@ void TACSGPBladeStiffenedShellConstitutive::addFailureDVSens(
xiStiff = computeGeneralizedRigidity(D11s, D22s, D12s, D66s);
genPoiss = computeGeneralizedPoissonsRatio(D12s, D66s);
zetaStiff = computeTransverseShearParameter(A66s, A11s, bStiff, hStiff);
printf("evalFailureStrainSens: D11s = %.4e\n", D11s);
printf("evalFailureStrainSens: D22s = %.4e\n", D22s);
printf("evalFailureStrainSens: D12s = %.4e\n", D12s);
printf("evalFailureStrainSens: D66s = %.4e\n", D66s);
printf("evalFailureStrainSens: a = %.4e\n", a);
printf("evalFailureStrainSens: bStiff = %.4e\n", bStiff);
printf("evalFailureStrainSens: xiStiff = %.4e\n", xiStiff);
printf("evalFailureStrainSens: rho0Stiff = %.4e\n", rho0Stiff);
printf("evalFailureStrainSens: genPoiss = %.4e\n", genPoiss);
printf("evalFailureStrainSens: zetaStiff = %.4e\n", zetaStiff);

// Compute panel dimensions, material props and non-dimensional parameters
TacsScalar N1stiff, N1CritCrippling;
N1CritCrippling = computeStiffenerCripplingLoad(
// Compute stiffener in plane load and crippling failure index
TacsScalar A11s_beam;
TacsScalar N1CritCrippling = computeStiffenerCripplingLoad(
D11s, D22s, xiStiff, rho0Stiff, genPoiss, zetaStiff);
N1stiff = -stiffenerStress[0];
TacsScalar N1stiff = computeStiffenerInPlaneLoad(stiffenerStrain, &A11s_beam);
fails[4] = N1stiff / N1CritCrippling;
// --- End of computeFailuresValues subsections ---

// backpropagate from fails[4] to N1 stiffener in plane load
TacsScalar stiffN1sens = dKSdf[4] * fails[4] / N1;
TacsScalar stiffN1sens = dKSdf[4] * fails[4] / N1stiff;
TacsScalar stiffN1critsens = dKSdf[4] * fails[4] * -1.0 / N1CritCrippling;

// backpropagate from N1 in plane load to material sensitivities for the
Expand Down Expand Up @@ -825,6 +710,9 @@ void TACSGPBladeStiffenedShellConstitutive::computeStiffenerCripplingStiffness(
TacsScalar* D = &C[12];
TacsScalar* As = &C[18];

// TODO : should we account for stiffener flange
// and smear in some average thickness from this? Right now I'm not..

// --- Zero out the C matrix ---
memset(C, 0, this->NUM_TANGENT_STIFFNESS_ENTRIES * sizeof(TacsScalar));

Expand Down Expand Up @@ -853,6 +741,21 @@ void TACSGPBladeStiffenedShellConstitutive::computeStiffenerCripplingStiffness(
C[21] = DRILLING_REGULARIZATION * 0.5 * (As[0] + As[2]);
}

TacsScalar TACSGPBladeStiffenedShellConstitutive::computeStiffenerInPlaneLoad(
const TacsScalar stiffenerStrain[], TacsScalar* A11s) {
int n = TACSBeamConstitutive::NUM_TANGENT_STIFFNESS_ENTRIES;
TacsScalar C[n];
memset(C, 0, n * sizeof(TacsScalar));
this->computeStiffenerStiffness(C);

// divide out the height (width of stiffener when viewed as vertical panel)
// this way N11 = load/width = stress * thickness is still satisfied
*A11s = C[0] / this->stiffenerHeight;

// return compressive strain * the A11 plate constant of the stiffener
return -stiffenerStrain[0] * (*A11s);
}

// Retrieve the global design variable numbers
int TACSGPBladeStiffenedShellConstitutive::getDesignVarNums(int elemIndex,
int dvLen,
Expand Down
10 changes: 10 additions & 0 deletions src/constitutive/TACSGPBladeStiffenedShellConstitutive.h
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,16 @@ class TACSGPBladeStiffenedShellConstitutive
const TacsScalar X[], const TacsScalar strain[],
int dvLen, TacsScalar dfdx[]);

TacsScalar evalFailure(int elemIndex, const double pt[], const TacsScalar X[],
const TacsScalar e[]);

// ==============================================================================
// Stiffener crippling helper functions
// ==============================================================================

TacsScalar computeStiffenerInPlaneLoad(const TacsScalar stiffenerStrain[],
TacsScalar* A11s);

void computeStiffenerCripplingStiffness(TacsScalar C[]);

// ==============================================================================
Expand Down
6 changes: 3 additions & 3 deletions tests/constitutive_tests/test_gp_blade_shell_constitutive.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,10 +372,10 @@ def setUp(self):
import argparse

parent_parser = argparse.ArgumentParser(add_help=False)
parent_parser.add_argument("--case", type=str)
parent_parser.add_argument("--case", type=str, default="full")
args = parent_parser.parse_args()

assert args.case in ["CF", "ML", "failStrain", "all"]
assert args.case in ["CF", "ML", "failStrain", "full"]

if args.case == "CF":
tester = GPConstitutiveCFTest()
Expand All @@ -392,5 +392,5 @@ def setUp(self):
# tester = GPConstitutiveMLTest()
tester.setUp()
tester.test_constitutive_failure_strain_sens()
elif args.case == "all":
elif args.case == "full":
unittest.main()
Loading