24template <
short_t d,
typename T>
27 public ModelParameters {
72 u.setup(
bc_, gismo::dirichlet::l2Projection, 0);
82 typename gismo::gsSparseSolver<T>::CGDiagonal
solver;
99 const std::array<int64_t, d> ncoeffs,
100 const std::array<int64_t, d> npatches)
106 Aopt.addInt(
"DirichletStrategy",
107 "Method for enforcement of Dirichlet BCs [11..14]", 11);
108 Aopt.addInt(
"DirichletValues",
109 "Method for computation of Dirichlet DoF values [100..103]",
111 Aopt.addInt(
"InterfaceStrategy",
112 "Method of treatment of patch interfaces [0..3]", 1);
114 "bdA",
"Estimated nonzeros per column of the matrix: bdA*deg + bdB", 2);
116 "bdB",
"Estimated nonzeros per column of the matrix: bdA*deg + bdB", 1);
119 "Overhead of sparse mem. allocation: (1+bdO)(bdA*deg + bdB) [0..1]",
121 Aopt.addReal(
"quA",
"Number of quadrature points: quA*deg + quB", 1);
122 Aopt.addInt(
"quB",
"Number of quadrature points: quA*deg + quB", 1);
123 Aopt.addInt(
"quRule",
"Quadrature rule [1:GaussLegendre, 2:GaussLobatto]",
134 if constexpr (
d == 1)
136 else if constexpr (
d == 2)
138 else if constexpr (
d == 3)
141 else if constexpr (
d == 4)
145 bc_.addCondition(
i + 1, gismo::condition_type::dirichlet, &
bcFunc_[
i]);
160 return "GismoKLShell" + std::to_string(
d) +
"d";
165 return "G+Smo Kirchhoff-Love Shell model in " + std::to_string(
d) +
173 "description" : "Solution of the Kirchhoff-Love shell model",
180 if constexpr (
d == 1)
183 "description" : "Boundary condition at the east boundary",
189 "description" : "Boundary condition at the west boundary",
195 "description" : "Right-hand side function",
200 else if constexpr (
d == 2)
203 "description" : "Boundary condition at the north boundary",
209 "description" : "Boundary condition at the east boundary",
215 "description" : "Boundary condition at the south boundary",
221 "description" : "Boundary condition at the west boundary",
227 "description" : "Right-hand side function",
232 else if constexpr (
d == 3)
235 "description" : "Boundary condition at the north boundary",
241 "description" : "Boundary condition at the east boundary",
247 "description" : "Boundary condition at the south boundary",
253 "description" : "Boundary condition at the west boundary",
259 "description" : "Boundary condition at the front boundary",
265 "description" : "Boundary condition at the back boundary",
271 "description" : "Right-hand side function",
276 else if constexpr (
d == 4)
279 "description" : "Boundary condition at the north boundary",
285 "description" : "Boundary condition at the east boundary",
291 "description" : "Boundary condition at the south boundary",
297 "description" : "Boundary condition at the west boundary",
303 "description" : "Boundary condition at the front boundary",
309 "description" : "Boundary condition at the back boundary",
315 "description" : "Boundary condition at the start-time boundary",
321 "description" : "Boundary condition at the end-time boundary",
327 "description" : "Right-hand side function",
333 return R
"({ INVALID REQUEST })"_json;
339 const nlohmann::json &
json)
override {
344 if (!
json.contains(
"data"))
349 bcFunc_[gismo::boundary::north] =
354 if (!
json.contains(
"data"))
359 bcFunc_[gismo::boundary::east] =
364 if (!
json.contains(
"data"))
369 bcFunc_[gismo::boundary::south] =
374 if (!
json.contains(
"data"))
379 bcFunc_[gismo::boundary::west] =
384 if (!
json.contains(
"data"))
389 bcFunc_[gismo::boundary::front] =
394 if (!
json.contains(
"data"))
399 bcFunc_[gismo::boundary::back] =
404 if (!
json.contains(
"data"))
409 bcFunc_[gismo::boundary::stime] =
414 if (!
json.contains(
"data"))
419 bcFunc_[gismo::boundary::etime] =
424 if (!
json.contains(
"data"))
443 const nlohmann::json &
json)
const override {
453 if (
json.contains(
"data"))
455 auto res =
json[
"data"][
"resolution"].get<std::array<int64_t, d>>();
457 for (std::size_t
i = 0;
i <
d; ++
i)
477 int num = 1, dim = -1;
479 if (
json.contains(
"data")) {
481 num =
json[
"data"][
"num"].get<
int>();
488 basis_.basis(0).uniformRefine(
num, 1, dim);
Model evaluator.
Definition model.hpp:98
virtual nlohmann::json updateAttribute(const std::string &patch, const std::string &component, const std::string &attribute, const nlohmann::json &json)
Updates the attributes of the model.
Definition model.hpp:297
virtual void refine(const nlohmann::json &json)=0
Refines model.
gismo::gsMultiPatch< T > geo_
Multi-patch geometry.
Definition GismoGeometryModel.hpp:39
G+Smo Kirchhoff-Love shell model.
Definition GismoKLShellModel.hpp:27
gsMultiBasis< T > basis_
Multi-patch basis.
Definition GismoKLShellModel.hpp:46
nlohmann::json getParameters() const override
Returns the model's parameters.
Definition GismoKLShellModel.hpp:178
gsMultiPatch< T > solution_
Solution.
Definition GismoKLShellModel.hpp:61
void solve()
Solve the Poisson problem.
Definition GismoKLShellModel.hpp:64
GismoKLShellModel(const std::array< short_t, d > degrees, const std::array< int64_t, d > ncoeffs, const std::array< int64_t, d > npatches)
Constructor for equidistant knot vectors.
Definition GismoKLShellModel.hpp:98
typename gsExprAssembler< T >::space space_type
Type of the function space.
Definition GismoKLShellModel.hpp:40
gsBoundaryConditions< T > bc_
Boundary conditions.
Definition GismoKLShellModel.hpp:49
typename gsExprAssembler< T >::geometryMap geometryMap_type
Type of the geometry mapping.
Definition GismoKLShellModel.hpp:34
typename gsExprAssembler< T >::variable variable_type
Type of the variable.
Definition GismoKLShellModel.hpp:37
nlohmann::json eval(const std::string &component, const nlohmann::json &json) const override
Evaluates the model.
Definition GismoKLShellModel.hpp:442
~GismoKLShellModel()
Destructor.
Definition GismoKLShellModel.hpp:156
gsFunctionExpr< T > rhsFunc_
Right-hand side values.
Definition GismoKLShellModel.hpp:52
typename gsExprAssembler< T >::solution solution_type
Type of the solution.
Definition GismoKLShellModel.hpp:43
gsExprAssembler< T > assembler_
Expression assembler.
Definition GismoKLShellModel.hpp:58
std::string getDescription() const override
Returns the model's description.
Definition GismoKLShellModel.hpp:164
nlohmann::json updateAttribute(const std::string &component, const std::string &attribute, const nlohmann::json &json) override
Updates the attributes of the model.
Definition GismoKLShellModel.hpp:337
nlohmann::json getOutputs() const override
Returns the model's outputs.
Definition GismoKLShellModel.hpp:170
std::array< gsFunctionExpr< T >, 2 *d > bcFunc_
Boundary values.
Definition GismoKLShellModel.hpp:55
void refine(const nlohmann::json &json=NULL) override
Refines the model.
Definition GismoKLShellModel.hpp:469
std::string getName() const override
Returns the model's name.
Definition GismoKLShellModel.hpp:159
GismoKLShellModel()=delete
Default constructor.
G+Smo PDE model.
Definition GismoPdeModel.hpp:58
auto to_json(const torch::TensorAccessor< T, N > &accessor)
Converts a torch::TensorAccessor object to a JSON object.
Definition serialize.hpp:41
Definition boundary.hpp:22
constexpr bool is_SplineType_v
Alias to the value of is_SplineType.
Definition bspline.hpp:3243
short int short_t
Definition core.hpp:74
InvalidModelAttribute exception.
Definition model.hpp:42