Skip to content

Commit

Permalink
Shape mismatch for vector data
Browse files Browse the repository at this point in the history
  • Loading branch information
TLCFEM committed Oct 31, 2023
1 parent 53e3b80 commit 5587cd0
Show file tree
Hide file tree
Showing 18 changed files with 54 additions and 54 deletions.
6 changes: 3 additions & 3 deletions Element/Cube/C3D8.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,10 +235,10 @@ void C3D8::Setup() {

mat C3D8::GetData(const OutputType P) {
mat A(int_pt.size(), 7);
mat B(int_pt.size(), 6, fill::zeros);
mat B(6, int_pt.size(), fill::zeros);

for(size_t I = 0; I < int_pt.size(); ++I) {
if(const auto C = int_pt[I].c_material->record(P); !C.empty()) B(I, 0, size(C[0])) = C[0];
if(const auto C = int_pt[I].c_material->record(P); !C.empty()) B(0, I, size(C[0])) = C[0];
A.row(I) = interpolation::linear(int_pt[I].coor);
}

Expand All @@ -253,7 +253,7 @@ mat C3D8::GetData(const OutputType P) {
data.row(6) = interpolation::linear(1., 1., 1.);
data.row(7) = interpolation::linear(-1., 1., 1.);

return (data * solve(A, B)).t();
return (data * solve(A, B.t())).t();
}

void C3D8::GetData(vtkSmartPointer<vtkDoubleArray>& arrays, const OutputType type) {
Expand Down
6 changes: 3 additions & 3 deletions Element/Cube/C3D8I.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,10 @@ void C3D8I::Setup() {

mat C3D8I::GetData(const OutputType P) {
mat A(int_pt.size(), 7);
mat B(int_pt.size(), 6, fill::zeros);
mat B(6, int_pt.size(), fill::zeros);

for(size_t I = 0; I < int_pt.size(); ++I) {
if(const auto C = int_pt[I].c_material->record(P); !C.empty()) B(I, 0, size(C[0])) = C[0];
if(const auto C = int_pt[I].c_material->record(P); !C.empty()) B(0, I, size(C[0])) = C[0];
A.row(I) = interpolation::linear(int_pt[I].coor);
}

Expand All @@ -189,7 +189,7 @@ mat C3D8I::GetData(const OutputType P) {
data.row(6) = interpolation::linear(1., 1., 1.);
data.row(7) = interpolation::linear(-1., 1., 1.);

return (data * solve(A, B)).t();
return (data * solve(A, B.t())).t();
}

void C3D8I::GetData(vtkSmartPointer<vtkDoubleArray>& arrays, const OutputType type) {
Expand Down
6 changes: 3 additions & 3 deletions Element/Cube/DC3D8.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,10 @@ mat DC3D8::GetData(const OutputType P) {
}

mat A(int_pt.size(), 7);
mat B(int_pt.size(), 6, fill::zeros);
mat B(6, int_pt.size(), fill::zeros);

for(size_t I = 0; I < int_pt.size(); ++I) {
if(const auto C = int_pt[I].c_material->record(P); !C.empty()) B(I, 0, size(C[0])) = C[0];
if(const auto C = int_pt[I].c_material->record(P); !C.empty()) B(0, I, size(C[0])) = C[0];
A.row(I) = interpolation::linear(int_pt[I].coor);
}

Expand All @@ -185,7 +185,7 @@ mat DC3D8::GetData(const OutputType P) {
data.row(6) = interpolation::linear(1., 1., 1.);
data.row(7) = interpolation::linear(-1., 1., 1.);

return (data * solve(A, B)).t();
return (data * solve(A, B.t())).t();
}

void DC3D8::GetData(vtkSmartPointer<vtkDoubleArray>& arrays, const OutputType type) {
Expand Down
6 changes: 3 additions & 3 deletions Element/Membrane/CSM/CSMQ.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,10 +233,10 @@ void CSMQ::GetData(vtkSmartPointer<vtkDoubleArray>& arrays, const OutputType typ

mat CSMQ::GetData(const OutputType P) {
mat A(int_pt.size(), 9);
mat B(int_pt.size(), 6, fill::zeros);
mat B(6, int_pt.size(), fill::zeros);

for(size_t I = 0; I < int_pt.size(); ++I) {
if(const auto C = int_pt[I].m_material->record(P); !C.empty()) B(I, 0, size(C[0])) = C[0];
if(const auto C = int_pt[I].m_material->record(P); !C.empty()) B(0, I, size(C[0])) = C[0];
A.row(I) = interpolation::quadratic(int_pt[I].coor);
}

Expand All @@ -251,7 +251,7 @@ mat CSMQ::GetData(const OutputType P) {
data.row(6) = interpolation::quadratic(0., 1.);
data.row(7) = interpolation::quadratic(-1., 0.);

return (data * solve(A, B)).t();
return (data * solve(A, B.t())).t();
}

void CSMQ::SetDeformation(vtkSmartPointer<vtkPoints>& nodes, const double amplifier) {
Expand Down
6 changes: 3 additions & 3 deletions Element/Membrane/CSM/CSMQ4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,10 +245,10 @@ void CSMQ4::GetData(vtkSmartPointer<vtkDoubleArray>& arrays, const OutputType ty

mat CSMQ4::GetData(const OutputType P) {
mat A(int_pt.size(), 4);
mat B(int_pt.size(), 6, fill::zeros);
mat B(6, int_pt.size(), fill::zeros);

for(size_t I = 0; I < int_pt.size(); ++I) {
if(const auto C = int_pt[I].m_material->record(P); !C.empty()) B(I, 0, size(C[0])) = C[0];
if(const auto C = int_pt[I].m_material->record(P); !C.empty()) B(0, I, size(C[0])) = C[0];
A.row(I) = interpolation::linear(int_pt[I].coor);
}

Expand All @@ -259,7 +259,7 @@ mat CSMQ4::GetData(const OutputType P) {
data.row(2) = interpolation::linear(1., 1.);
data.row(3) = interpolation::linear(-1., 1.);

return (data * solve(A, B)).t();
return (data * solve(A, B.t())).t();
}

void CSMQ4::SetDeformation(vtkSmartPointer<vtkPoints>& nodes, const double amplifier) {
Expand Down
6 changes: 3 additions & 3 deletions Element/Membrane/CSM/CSMQ8.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,10 +227,10 @@ void CSMQ8::GetData(vtkSmartPointer<vtkDoubleArray>& arrays, const OutputType ty

mat CSMQ8::GetData(const OutputType P) {
mat A(int_pt.size(), 9);
mat B(int_pt.size(), 6, fill::zeros);
mat B(6, int_pt.size(), fill::zeros);

for(size_t I = 0; I < int_pt.size(); ++I) {
if(const auto C = int_pt[I].m_material->record(P); !C.empty()) B(I, 0, size(C[0])) = C[0];
if(const auto C = int_pt[I].m_material->record(P); !C.empty()) B(0, I, size(C[0])) = C[0];
A.row(I) = interpolation::quadratic(int_pt[I].coor);
}

Expand All @@ -245,7 +245,7 @@ mat CSMQ8::GetData(const OutputType P) {
data.row(6) = interpolation::quadratic(0., 1.);
data.row(7) = interpolation::quadratic(-1., 0.);

return (data * solve(A, B)).t();
return (data * solve(A, B.t())).t();
}

void CSMQ8::SetDeformation(vtkSmartPointer<vtkPoints>& nodes, const double amplifier) {
Expand Down
6 changes: 3 additions & 3 deletions Element/Membrane/Drilling/GCMQ.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -355,10 +355,10 @@ mat GCMQ::GetData(const OutputType P) {
}

mat A(int_pt.size(), 9);
mat B(int_pt.size(), 6, fill::zeros);
mat B(6, int_pt.size(), fill::zeros);

for(size_t I = 0; I < int_pt.size(); ++I) {
if(const auto C = int_pt[I].m_material->record(P); !C.empty()) B(I, 0, size(C[0])) = C[0];
if(const auto C = int_pt[I].m_material->record(P); !C.empty()) B(0, I, size(C[0])) = C[0];
A.row(I) = interpolation::quadratic(int_pt[I].coor);
}

Expand All @@ -369,7 +369,7 @@ mat GCMQ::GetData(const OutputType P) {
data.row(2) = interpolation::quadratic(1., 1.);
data.row(3) = interpolation::quadratic(-1., 1.);

return (data * solve(A, B)).t();
return (data * solve(A, B.t())).t();
}

#endif
6 changes: 3 additions & 3 deletions Element/Membrane/Drilling/GQ12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,10 @@ void GQ12::GetData(vtkSmartPointer<vtkDoubleArray>& arrays, const OutputType typ

mat GQ12::GetData(const OutputType P) {
mat A(int_pt.size(), 4);
mat B(int_pt.size(), 6, fill::zeros);
mat B(6, int_pt.size(), fill::zeros);

for(size_t I = 0; I < int_pt.size(); ++I) {
if(const auto C = int_pt[I].m_material->record(P); !C.empty()) B(I, 0, size(C[0])) = C[0];
if(const auto C = int_pt[I].m_material->record(P); !C.empty()) B(0, I, size(C[0])) = C[0];
A.row(I) = interpolation::linear(int_pt[I].coor);
}

Expand All @@ -219,7 +219,7 @@ mat GQ12::GetData(const OutputType P) {
data.row(2) = interpolation::linear(1., 1.);
data.row(3) = interpolation::linear(-1., 1.);

return (data * solve(A, B)).t();
return (data * solve(A, B.t())).t();
}

void GQ12::SetDeformation(vtkSmartPointer<vtkPoints>& nodes, const double amplifier) {
Expand Down
6 changes: 3 additions & 3 deletions Element/Membrane/Drilling/SGCMQ.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -323,10 +323,10 @@ mat SGCMQ::GetData(const OutputType P) {
}

mat A(int_pt.size(), 9);
mat B(int_pt.size(), 6, fill::zeros);
mat B(6, int_pt.size(), fill::zeros);

for(size_t I = 0; I < int_pt.size(); ++I) {
if(const auto C = int_pt[I].m_material->record(P); !C.empty()) B(I, 0, size(C[0])) = C[0];
if(const auto C = int_pt[I].m_material->record(P); !C.empty()) B(0, I, size(C[0])) = C[0];
A.row(I) = interpolation::quadratic(int_pt[I].coor);
}

Expand All @@ -337,7 +337,7 @@ mat SGCMQ::GetData(const OutputType P) {
data.row(2) = interpolation::quadratic(1., 1.);
data.row(3) = interpolation::quadratic(-1., 1.);

return (data * solve(A, B, solve_opts::fast)).t();
return (data * solve(A, B.t())).t();
}

void SGCMQ::SetDeformation(vtkSmartPointer<vtkPoints>& nodes, const double amplifier) {
Expand Down
6 changes: 3 additions & 3 deletions Element/Membrane/Mixed/QE2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,10 +271,10 @@ mat QE2::GetData(const OutputType P) {
}

mat A(int_pt.size(), 9);
mat B(int_pt.size(), 6, fill::zeros);
mat B(6, int_pt.size(), fill::zeros);

for(size_t I = 0; I < int_pt.size(); ++I) {
if(const auto C = int_pt[I].m_material->record(P); !C.empty()) B(I, 0, size(C[0])) = C[0];
if(const auto C = int_pt[I].m_material->record(P); !C.empty()) B(0, I, size(C[0])) = C[0];
A.row(I) = interpolation::quadratic(int_pt[I].coor);
}

Expand All @@ -285,7 +285,7 @@ mat QE2::GetData(const OutputType P) {
data.row(2) = interpolation::quadratic(1., 1.);
data.row(3) = interpolation::quadratic(-1., 1.);

return (data * solve(A, B)).t();
return (data * solve(A, B.t())).t();
}

void QE2::SetDeformation(vtkSmartPointer<vtkPoints>& nodes, const double amplifier) {
Expand Down
6 changes: 3 additions & 3 deletions Element/Membrane/PFM/DCP4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,10 @@ mat DCP4::GetData(const OutputType P) {
}

mat A(int_pt.size(), 4);
mat B(int_pt.size(), 6, fill::zeros);
mat B(6, int_pt.size(), fill::zeros);

for(size_t I = 0; I < int_pt.size(); ++I) {
if(const auto C = int_pt[I].m_material->record(P); !C.empty()) B(I, 0, size(C[0])) = C[0];
if(const auto C = int_pt[I].m_material->record(P); !C.empty()) B(0, I, size(C[0])) = C[0];
A.row(I) = interpolation::linear(int_pt[I].coor);
}

Expand All @@ -233,7 +233,7 @@ mat DCP4::GetData(const OutputType P) {
data.row(2) = interpolation::linear(1., 1.);
data.row(3) = interpolation::linear(-1., 1.);

return (data * solve(A, B)).t();
return (data * solve(A, B.t())).t();
}

void DCP4::SetDeformation(vtkSmartPointer<vtkPoints>& nodes, const double amplifier) {
Expand Down
6 changes: 3 additions & 3 deletions Element/Membrane/Plane/CP4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -433,10 +433,10 @@ void CP4::GetData(vtkSmartPointer<vtkDoubleArray>& arrays, const OutputType type

mat CP4::GetData(const OutputType P) {
mat A(int_pt.size(), 4);
mat B(int_pt.size(), 6, fill::zeros);
mat B(6, int_pt.size(), fill::zeros);

for(size_t I = 0; I < int_pt.size(); ++I) {
if(const auto C = int_pt[I].m_material->record(P); !C.empty()) B(I, 0, size(C[0])) = C[0];
if(const auto C = int_pt[I].m_material->record(P); !C.empty()) B(0, I, size(C[0])) = C[0];
A.row(I) = interpolation::linear(int_pt[I].coor);
}

Expand All @@ -447,7 +447,7 @@ mat CP4::GetData(const OutputType P) {
data.row(2) = interpolation::linear(1., 1.);
data.row(3) = interpolation::linear(-1., 1.);

return (data * solve(A, B)).t();
return (data * solve(A, B.t())).t();
}

void CP4::SetDeformation(vtkSmartPointer<vtkPoints>& nodes, const double amplifier) {
Expand Down
6 changes: 3 additions & 3 deletions Element/Membrane/Plane/CP4I.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -387,10 +387,10 @@ void CP4I::GetData(vtkSmartPointer<vtkDoubleArray>& arrays, const OutputType typ

mat CP4I::GetData(const OutputType P) {
mat A(int_pt.size(), 4);
mat B(int_pt.size(), 6, fill::zeros);
mat B(6, int_pt.size(), fill::zeros);

for(size_t I = 0; I < int_pt.size(); ++I) {
if(const auto C = int_pt[I].m_material->record(P); !C.empty()) B(I, 0, size(C[0])) = C[0];
if(const auto C = int_pt[I].m_material->record(P); !C.empty()) B(0, I, size(C[0])) = C[0];
A.row(I) = interpolation::linear(int_pt[I].coor);
}

Expand All @@ -401,7 +401,7 @@ mat CP4I::GetData(const OutputType P) {
data.row(2) = interpolation::linear(1., 1.);
data.row(3) = interpolation::linear(-1., 1.);

return (data * solve(A, B)).t();
return (data * solve(A, B.t())).t();
}

void CP4I::SetDeformation(vtkSmartPointer<vtkPoints>& nodes, const double amplifier) {
Expand Down
6 changes: 3 additions & 3 deletions Element/Membrane/Plane/CP8.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,10 +215,10 @@ void CP8::GetData(vtkSmartPointer<vtkDoubleArray>& arrays, const OutputType type

mat CP8::GetData(const OutputType P) {
mat A(int_pt.size(), 9);
mat B(int_pt.size(), 6, fill::zeros);
mat B(6, int_pt.size(), fill::zeros);

for(size_t I = 0; I < int_pt.size(); ++I) {
if(const auto C = int_pt[I].m_material->record(P); !C.empty()) B(I, 0, size(C[0])) = C[0];
if(const auto C = int_pt[I].m_material->record(P); !C.empty()) B(0, I, size(C[0])) = C[0];
A.row(I) = interpolation::quadratic(int_pt[I].coor);
}

Expand All @@ -233,7 +233,7 @@ mat CP8::GetData(const OutputType P) {
data.row(6) = interpolation::quadratic(0., 1.);
data.row(7) = interpolation::quadratic(-1., 0.);

return (data * solve(A, B)).t();
return (data * solve(A, B.t())).t();
}

void CP8::SetDeformation(vtkSmartPointer<vtkPoints>& nodes, const double amplifier) {
Expand Down
6 changes: 3 additions & 3 deletions Element/Membrane/Porous/PCPE4DC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,10 +245,10 @@ void PCPE4DC::GetData(vtkSmartPointer<vtkDoubleArray>& arrays, const OutputType

mat PCPE4DC::GetData(const OutputType P) {
mat A(int_pt.size(), 4);
mat B(int_pt.size(), 6, fill::zeros);
mat B(6, int_pt.size(), fill::zeros);

for(size_t I = 0; I < int_pt.size(); ++I) {
if(const auto C = int_pt[I].m_material->record(P); !C.empty()) B(I, 0, size(C[0])) = C[0];
if(const auto C = int_pt[I].m_material->record(P); !C.empty()) B(0, I, size(C[0])) = C[0];
A.row(I) = interpolation::linear(int_pt[I].coor);
}

Expand All @@ -259,7 +259,7 @@ mat PCPE4DC::GetData(const OutputType P) {
data.row(2) = interpolation::linear(1., 1.);
data.row(3) = interpolation::linear(-1., 1.);

return (data * solve(A, B)).t();
return (data * solve(A, B.t())).t();
}

void PCPE4DC::SetDeformation(vtkSmartPointer<vtkPoints>& nodes, const double amplifier) {
Expand Down
6 changes: 3 additions & 3 deletions Element/Membrane/Porous/PCPE4UC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,10 @@ void PCPE4UC::GetData(vtkSmartPointer<vtkDoubleArray>& arrays, const OutputType

mat PCPE4UC::GetData(const OutputType P) {
mat A(int_pt.size(), 4);
mat B(int_pt.size(), 6, fill::zeros);
mat B(6, int_pt.size(), fill::zeros);

for(size_t I = 0; I < int_pt.size(); ++I) {
if(const auto C = int_pt[I].m_material->record(P); !C.empty()) B(I, 0, size(C[0])) = C[0];
if(const auto C = int_pt[I].m_material->record(P); !C.empty()) B(0, I, size(C[0])) = C[0];
A.row(I) = interpolation::linear(int_pt[I].coor);
}

Expand All @@ -224,7 +224,7 @@ mat PCPE4UC::GetData(const OutputType P) {
data.row(2) = interpolation::linear(1., 1.);
data.row(3) = interpolation::linear(-1., 1.);

return (data * solve(A, B)).t();
return (data * solve(A, B.t())).t();
}

void PCPE4UC::SetDeformation(vtkSmartPointer<vtkPoints>& nodes, const double amplifier) {
Expand Down
6 changes: 3 additions & 3 deletions Element/Membrane/Porous/PCPE8DC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,10 +229,10 @@ void PCPE8DC::GetData(vtkSmartPointer<vtkDoubleArray>& arrays, const OutputType

mat PCPE8DC::GetData(const OutputType P) {
mat A(int_pt.size(), 9);
mat B(int_pt.size(), 6, fill::zeros);
mat B(6, int_pt.size(), fill::zeros);

for(size_t I = 0; I < int_pt.size(); ++I) {
if(const auto C = int_pt[I].m_material->record(P); !C.empty()) B(I, 0, size(C[0])) = C[0];
if(const auto C = int_pt[I].m_material->record(P); !C.empty()) B(0, I, size(C[0])) = C[0];
A.row(I) = interpolation::quadratic(int_pt[I].coor);
}

Expand All @@ -247,7 +247,7 @@ mat PCPE8DC::GetData(const OutputType P) {
data.row(6) = interpolation::quadratic(0., 1.);
data.row(7) = interpolation::quadratic(-1., 0.);

return (data * solve(A, B)).t();
return (data * solve(A, B.t())).t();
}

void PCPE8DC::SetDeformation(vtkSmartPointer<vtkPoints>& nodes, const double amplifier) {
Expand Down
6 changes: 3 additions & 3 deletions Element/Membrane/Porous/PCPE8UC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,10 @@ void PCPE8UC::GetData(vtkSmartPointer<vtkDoubleArray>& arrays, const OutputType

mat PCPE8UC::GetData(const OutputType P) {
mat A(int_pt.size(), 9);
mat B(int_pt.size(), 6, fill::zeros);
mat B(6, int_pt.size(), fill::zeros);

for(size_t I = 0; I < int_pt.size(); ++I) {
if(const auto C = int_pt[I].m_material->record(P); !C.empty()) B(I, 0, size(C[0])) = C[0];
if(const auto C = int_pt[I].m_material->record(P); !C.empty()) B(0, I, size(C[0])) = C[0];
A.row(I) = interpolation::quadratic(int_pt[I].coor);
}

Expand All @@ -212,7 +212,7 @@ mat PCPE8UC::GetData(const OutputType P) {
data.row(6) = interpolation::quadratic(0., 1.);
data.row(7) = interpolation::quadratic(-1., 0.);

return (data * solve(A, B)).t();
return (data * solve(A, B.t())).t();
}

void PCPE8UC::SetDeformation(vtkSmartPointer<vtkPoints>& nodes, const double amplifier) {
Expand Down

0 comments on commit 5587cd0

Please sign in to comment.