feat(cpp-object-oriented-modular-refactoring): step 3 - foundation-google-style
This commit is contained in:
@@ -126,7 +126,7 @@ std::string elementIdentity(const std::array<const Node*, kNodeCount>& nodes) {
|
||||
if (!identity.empty()) {
|
||||
identity += "-";
|
||||
}
|
||||
identity += node->sourceId.sourceLabelText;
|
||||
identity += node->sourceId.source_label_text;
|
||||
}
|
||||
return identity;
|
||||
}
|
||||
@@ -136,9 +136,9 @@ Result<Mitc4Shell> modelFailure(
|
||||
const SourceLocation& location,
|
||||
const std::string& identity,
|
||||
std::string message) {
|
||||
return Result<Mitc4Shell>::failure(Status::failure(
|
||||
FailureCategory::model,
|
||||
{{Severity::error,
|
||||
return Result<Mitc4Shell>::Failure(Status::Failure(
|
||||
FailureCategory::kModel,
|
||||
{{Severity::kError,
|
||||
std::move(code),
|
||||
location,
|
||||
"*ELEMENT",
|
||||
@@ -205,9 +205,9 @@ std::array<double, 5> localEngineeringComponents(
|
||||
}
|
||||
|
||||
Matrix scaledMatrix(const Matrix& source, double factor) {
|
||||
Matrix result{source.rows(), source.columns()};
|
||||
for (std::size_t row = 0U; row < source.rows(); ++row) {
|
||||
for (std::size_t column = 0U; column < source.columns(); ++column) {
|
||||
Matrix result{source.Rows(), source.Columns()};
|
||||
for (std::size_t row = 0U; row < source.Rows(); ++row) {
|
||||
for (std::size_t column = 0U; column < source.Columns(); ++column) {
|
||||
result(row, column) = factor * source(row, column);
|
||||
}
|
||||
}
|
||||
@@ -215,17 +215,17 @@ Matrix scaledMatrix(const Matrix& source, double factor) {
|
||||
}
|
||||
|
||||
Matrix congruence(const Matrix& local, const Matrix& transformation) {
|
||||
if (local.rows() != local.columns() ||
|
||||
local.rows() != transformation.rows()) {
|
||||
if (local.Rows() != local.Columns() ||
|
||||
local.Rows() != transformation.Rows()) {
|
||||
throw std::invalid_argument{"MITC4 congruence dimensions are incompatible."};
|
||||
}
|
||||
Matrix result{transformation.columns(), transformation.columns()};
|
||||
for (std::size_t row = 0U; row < result.rows(); ++row) {
|
||||
for (std::size_t column = row; column < result.columns(); ++column) {
|
||||
Matrix result{transformation.Columns(), transformation.Columns()};
|
||||
for (std::size_t row = 0U; row < result.Rows(); ++row) {
|
||||
for (std::size_t column = row; column < result.Columns(); ++column) {
|
||||
double value = 0.0;
|
||||
for (std::size_t localRow = 0U; localRow < local.rows(); ++localRow) {
|
||||
for (std::size_t localRow = 0U; localRow < local.Rows(); ++localRow) {
|
||||
for (std::size_t localColumn = 0U;
|
||||
localColumn < local.columns(); ++localColumn) {
|
||||
localColumn < local.Columns(); ++localColumn) {
|
||||
value += transformation(localRow, row) *
|
||||
local(localRow, localColumn) *
|
||||
transformation(localColumn, column);
|
||||
@@ -239,8 +239,8 @@ Matrix congruence(const Matrix& local, const Matrix& transformation) {
|
||||
}
|
||||
|
||||
bool isFinite(const Matrix& matrix) {
|
||||
for (std::size_t row = 0U; row < matrix.rows(); ++row) {
|
||||
for (std::size_t column = 0U; column < matrix.columns(); ++column) {
|
||||
for (std::size_t row = 0U; row < matrix.Rows(); ++row) {
|
||||
for (std::size_t column = 0U; column < matrix.Columns(); ++column) {
|
||||
if (!std::isfinite(matrix(row, column))) {
|
||||
return false;
|
||||
}
|
||||
@@ -250,7 +250,7 @@ bool isFinite(const Matrix& matrix) {
|
||||
}
|
||||
|
||||
bool isFinite(const Vector& vector) {
|
||||
for (std::size_t index = 0U; index < vector.size(); ++index) {
|
||||
for (std::size_t index = 0U; index < vector.Size(); ++index) {
|
||||
if (!std::isfinite(vector[index])) {
|
||||
return false;
|
||||
}
|
||||
@@ -262,9 +262,9 @@ Result<Mitc4Stiffness> stiffnessFailure(
|
||||
const SourceLocation& location,
|
||||
const std::string& identity,
|
||||
std::string message) {
|
||||
return Result<Mitc4Stiffness>::failure(Status::failure(
|
||||
FailureCategory::model,
|
||||
{{Severity::error,
|
||||
return Result<Mitc4Stiffness>::Failure(Status::Failure(
|
||||
FailureCategory::kModel,
|
||||
{{Severity::kError,
|
||||
"invalid-shell-stiffness",
|
||||
location,
|
||||
"*ELEMENT",
|
||||
@@ -276,9 +276,9 @@ Result<Mitc4PhysicalRecovery> recoveryFailure(
|
||||
const SourceLocation& location,
|
||||
const std::string& identity,
|
||||
std::string message) {
|
||||
return Result<Mitc4PhysicalRecovery>::failure(Status::failure(
|
||||
FailureCategory::model,
|
||||
{{Severity::error,
|
||||
return Result<Mitc4PhysicalRecovery>::Failure(Status::Failure(
|
||||
FailureCategory::kModel,
|
||||
{{Severity::kError,
|
||||
"invalid-shell-recovery",
|
||||
location,
|
||||
"*ELEMENT",
|
||||
@@ -430,7 +430,7 @@ Result<Mitc4Shell> Mitc4Shell::create(
|
||||
}
|
||||
}
|
||||
|
||||
return Result<Mitc4Shell>::success(std::move(shell));
|
||||
return Result<Mitc4Shell>::Success(std::move(shell));
|
||||
}
|
||||
|
||||
Mitc4ShapeFunctions Mitc4Shell::shapeFunctions(
|
||||
@@ -688,7 +688,7 @@ Result<Mitc4Stiffness> Mitc4Shell::stiffness() const {
|
||||
"MITC4 transformed stiffness must contain only finite values.");
|
||||
}
|
||||
|
||||
return Result<Mitc4Stiffness>::success(Mitc4Stiffness{
|
||||
return Result<Mitc4Stiffness>::Success(Mitc4Stiffness{
|
||||
std::move(physicalLocal),
|
||||
std::move(physicalGlobal),
|
||||
std::move(drillingGlobal),
|
||||
@@ -698,7 +698,7 @@ Result<Mitc4Stiffness> Mitc4Shell::stiffness() const {
|
||||
|
||||
Result<Mitc4PhysicalRecovery> Mitc4Shell::recoverPhysical(
|
||||
const Vector& globalElementDisplacement24) const {
|
||||
if (globalElementDisplacement24.size() != kGlobalDofCount) {
|
||||
if (globalElementDisplacement24.Size() != kGlobalDofCount) {
|
||||
return recoveryFailure(
|
||||
sourceLocation_, identity_,
|
||||
"MITC4 physical recovery requires exactly 24 global element DOFs.");
|
||||
@@ -710,7 +710,7 @@ Result<Mitc4PhysicalRecovery> Mitc4Shell::recoverPhysical(
|
||||
}
|
||||
|
||||
const Vector physicalDisplacement =
|
||||
physicalTransformation20().multiply(globalElementDisplacement24);
|
||||
physicalTransformation20().Multiply(globalElementDisplacement24);
|
||||
const Matrix tyingSamples = covariantTyingShearSamples20();
|
||||
const Matrix constitutive = materialConstitutive5();
|
||||
const Matrix planeStress = planeStressConstitutive();
|
||||
@@ -742,8 +742,8 @@ Result<Mitc4PhysicalRecovery> Mitc4Shell::recoverPhysical(
|
||||
const Matrix strainMatrix = strainDisplacement(
|
||||
point.naturalCoordinates[0], point.naturalCoordinates[1], zeta,
|
||||
&tyingSamples);
|
||||
const Vector strain = strainMatrix.multiply(physicalDisplacement);
|
||||
const Vector stress = constitutive.multiply(strain);
|
||||
const Vector strain = strainMatrix.Multiply(physicalDisplacement);
|
||||
const Vector stress = constitutive.Multiply(strain);
|
||||
GeometryData geometry{};
|
||||
if (!evaluateGeometry(
|
||||
point.naturalCoordinates[0], point.naturalCoordinates[1],
|
||||
@@ -769,7 +769,7 @@ Result<Mitc4PhysicalRecovery> Mitc4Shell::recoverPhysical(
|
||||
0.5 * thickness_ * stress[3U + component];
|
||||
}
|
||||
recovery.strainEnergy +=
|
||||
0.5 * strain.dot(stress) * geometry.jacobian;
|
||||
0.5 * strain.Dot(stress) * geometry.jacobian;
|
||||
}
|
||||
|
||||
for (std::size_t position = 0U;
|
||||
@@ -785,12 +785,12 @@ Result<Mitc4PhysicalRecovery> Mitc4Shell::recoverPhysical(
|
||||
const Vector strain = strainDisplacement(
|
||||
point.naturalCoordinates[0], point.naturalCoordinates[1],
|
||||
sectionPositions[position], &tyingSamples)
|
||||
.multiply(physicalDisplacement);
|
||||
.Multiply(physicalDisplacement);
|
||||
Vector inPlaneStrain{3U};
|
||||
for (std::size_t component = 0U; component < 3U; ++component) {
|
||||
inPlaneStrain[component] = strain[component];
|
||||
}
|
||||
const Vector stress = planeStress.multiply(inPlaneStrain);
|
||||
const Vector stress = planeStress.Multiply(inPlaneStrain);
|
||||
for (std::size_t component = 0U; component < 3U; ++component) {
|
||||
point.inPlaneStress[position][component] = stress[component];
|
||||
}
|
||||
@@ -819,7 +819,7 @@ Result<Mitc4PhysicalRecovery> Mitc4Shell::recoverPhysical(
|
||||
}
|
||||
}
|
||||
|
||||
return Result<Mitc4PhysicalRecovery>::success(std::move(recovery));
|
||||
return Result<Mitc4PhysicalRecovery>::Success(std::move(recovery));
|
||||
}
|
||||
|
||||
Mitc4Shell::Mitc4Shell(
|
||||
|
||||
Reference in New Issue
Block a user