49 u.setup(options.
askInt(
"Continuity",-1));
55 A.
assemble(u*u.tr() * meas(G),u * f * meas(G));
59 solver->compute(A.
matrix());
60 coefs = solver->solve(A.
rhs());
62 if (options.
askSwitch(
"ComputeError",
true))
67 return ev.
integral((sol-f).sqNorm() * meas(G));
82 mp.addPatch(geometry);
86 space u = A.
getSpace(mb,mp.targetDim());
88 geometryMap G = A.
getMap(mp);
94 A.
assemble(u*u.tr() * meas(G),u * f * meas(G));
97 solver->compute(A.
matrix());
98 result = solver->solve(A.
rhs());
102 return ev.
integral((sol-f).sqNorm() * meas(G));
120 geometryMap G = A.
getMap(geometry);
126 A.
assemble(u*u.tr() * meas(G),u * f * meas(G));
129 solver->compute(A.
matrix());
130 solVector = solver->solve(A.
rhs());
137 return ev.
integral((sol-f).sqNorm() * meas(G));
149 geometryMap G = A.
getMap(geometry);
155 A.
assemble(u*u.tr() * meas(G),u * f * meas(G));
158 solver->compute(A.
matrix());
159 result = solver->solve(A.
rhs());
163 return ev.
integral((sol-f).sqNorm() * meas(G));
168 const gsMappedBasis<2,T> & basis,
177 geometryMap G = A.
getMap(geometry);
183 A.
assemble(u*u.tr()*meas(G),u * f*meas(G));
186 solver->compute(A.
matrix());
187 result = solver->solve(A.
rhs());
191 return ev.
integral((sol-f).sqNorm() * meas(G));
209 geometryMap G = A.
getMap(geometry);
215 A.
assemble(u*u.tr() * meas(G),u * f * meas(G));
218 solver->compute(A.
matrix());
219 solVector = solver->solve(A.
rhs());
225 return ev.
integral((sol-f).sqNorm() * meas(G));
240 geometryMap G = A.
getMap(geometry);
246 A.
assemble(u*u.tr() * meas(G),u * f * meas(G));
249 solver->compute(A.
matrix());
250 result = solver->solve(A.
rhs());
252 return ev.
integral((sol-f).sqNorm() * meas(G));
258 const gsMappedBasis<2,T>& basis,
268 geometryMap G = A.
getMap(geometry);
274 A.
assemble(u*u.tr()*meas(G),u * f *meas(G));
277 solver->compute(A.
matrix());
278 result = solver->solve(A.
rhs());
282 return ev.
integral((sol-f).sqNorm() * meas(G));
298 geometryMap G = A.
getMap(geometry);
300 std::vector<gsMultiPatch<T>> coords(geometry.
geoDim());
302 coords[p] = geometry.coord(p);
307 for (
typename gsMultiPatch<T>::const_biterator bit = geometry.
bBegin(); bit != geometry.
bEnd(); ++bit)
310 u.setup(bc, dirichlet::l2Projection, 0);
315 A.
assemble(u*u.tr()*meas(G),u * G*meas(G));
318 solver->compute(A.
matrix());
319 solVector = solver->solve(A.
rhs());
325 return ev.
integral((sol-G).sqNorm() * meas(G));
343 geometryMap G = A.
getMap(geometry);
345 element el = A.getElement();
347 std::vector<gsMultiPatch<T>> coords(geometry.
geoDim());
349 coords[p] = geometry.coord(p);
354 for (
typename gsMultiPatch<T>::const_biterator bit = geometry.
bBegin(); bit != geometry.
bEnd(); ++bit)
358 u.setup(bc, dirichlet::l2Projection, -1);
361 std::vector<boundaryInterface> iFace;
362 for (
typename gsMultiPatch<T>::const_iiterator iit = geometry.
iBegin(); iit != geometry.
iEnd(); ++iit)
363 iFace.push_back(*iit);
368 A.
assemble(u*u.tr()*meas(G),u * Gvar*meas(G));
370 bc.
get(
"Weak Dirichlet"),
371 -(penalty / el.area(G) * u * u.tr()) * tv(G).norm()
375 penalty / el.area(G) * u.left() * u.left().tr() * tv(G).norm()
377 - penalty / el.area(G) * u.right()* u.left() .tr() * tv(G).norm()
379 - penalty / el.area(G) * u.left() * u.right().tr() * tv(G).norm()
381 penalty / el.area(G) * u.right()* u.right().tr() * tv(G).norm()
385 solver->compute(A.
matrix());
386 solVector = solver->solve(A.
rhs());
392 return ev.
integral((Gvar-G).sqNorm() * meas(G));
A basis represents a family of scalar basis functions defined over a common parameter domain.
Definition gsBasis.h:79
Class containing a set of boundary conditions.
Definition gsBoundaryConditions.h:342
void addCondition(int p, boxSide s, condition_type::type t, gsFunctionSet< T > *f, short_t unknown=0, bool parametric=false, int comp=-1)
Adds another boundary condition.
Definition gsBoundaryConditions.h:650
bcRefList get(const std::string &label, const short_t unk=0, int comp=-1) const
Definition gsBoundaryConditions.h:420
void setGeoMap(const gsFunctionSet< T > &gm)
Set the geometry map to evaluate boundary conditions.
Definition gsBoundaryConditions.h:916
const_iiterator iEnd() const
Definition gsBoxTopology.h:124
const_biterator bBegin() const
Definition gsBoxTopology.h:139
const_biterator bEnd() const
Definition gsBoxTopology.h:144
const_iiterator iBegin() const
Definition gsBoxTopology.h:119
Definition gsExprAssembler.h:33
void setIntegrationElements(const gsMultiBasis< T > &mesh)
Sets the domain of integration.
Definition gsExprAssembler.h:161
void assembleBdr(const bcRefList &BCs, expr &... args)
Adds the expressions args to the system matrix/rhs The arguments are considered as integrals over the...
Definition gsExprAssembler.h:1167
gsExprHelper< T >::geometryMap geometryMap
Geometry map type.
Definition gsExprAssembler.h:65
space getSpace(const gsFunctionSet< T > &mp, index_t dim=1, index_t id=0)
Definition gsExprAssembler.h:191
const gsMatrix< T > & rhs() const
Returns the right-hand side vector(s)
Definition gsExprAssembler.h:154
solution getSolution(const expr::gsFeSpace< T > &s, gsMatrix< T > &cf) const
Registers a representation of a solution variable from space s, based on the vector cf.
Definition gsExprAssembler.h:299
geometryMap getMap(const gsFunctionSet< T > &g)
Registers g as an isogeometric geometry map and return a handle to it.
Definition gsExprAssembler.h:186
void initSystem(const index_t numRhs=1)
Initializes the sparse system (sparse matrix and rhs)
Definition gsExprAssembler.h:315
variable getCoeff(const gsFunctionSet< T > &func)
Definition gsExprAssembler.h:285
void assemble(const expr &... args)
Adds the expressions args to the system matrix/rhs The arguments are considered as integrals over the...
Definition gsExprAssembler.h:1077
const gsSparseMatrix< T > & matrix() const
Returns the left-hand global matrix.
Definition gsExprAssembler.h:127
Generic evaluator of isogeometric expressions.
Definition gsExprEvaluator.h:39
T integral(const expr::_expr< E > &expr)
Calculates the integral of the expression expr on the whole integration domain.
Definition gsExprEvaluator.h:154
Interface for the set of functions defined on a domain (the total number of functions in the set equa...
Definition gsFunctionSet.h:219
virtual short_t targetDim() const
Dimension of the target space.
Definition gsFunctionSet.h:595
Abstract base class representing a geometry map.
Definition gsGeometry.h:93
A matrix with arbitrary coefficient type and fixed or dynamic size.
Definition gsMatrix.h:41
Holds a set of patch-wise bases and their topology information.
Definition gsMultiBasis.h:37
Container class for a set of geometry patches and their topology, that is, the interface connections ...
Definition gsMultiPatch.h:100
bool computeTopology(T tol=1e-4, bool cornersOnly=false, bool tjunctions=false)
Attempt to compute interfaces and boundaries automatically.
Definition gsMultiPatch.hpp:377
short_t geoDim() const
Dimension of the geometry (must match for all patches).
Definition gsMultiPatch.hpp:150
void clear()
Clear (delete) all patches.
Definition gsMultiPatch.h:388
void closeGaps(T tol=1e-4)
Attempt to close gaps between the interfaces. Assumes that the topology is computed,...
Definition gsMultiPatch.hpp:577
Class which holds a list of parameters/options, and provides easy access to them.
Definition gsOptionList.h:33
bool askSwitch(const std::string &label, const bool &value=false) const
Reads value for option label from options.
Definition gsOptionList.cpp:128
index_t askInt(const std::string &label, const index_t &value=0) const
Reads value for option label from options.
Definition gsOptionList.cpp:117
std::string askString(const std::string &label, const std::string &value="") const
Reads value for option label from options.
Definition gsOptionList.cpp:106
Abstract class for solvers. The solver interface is base on 3 methods: -compute set the system matrix...
Definition gsSparseSolver.h:67
Provides gsBoundaryConditions class.
Provides structs and classes related to interfaces and boundaries.
#define index_t
Definition gsConfig.h:32
Generic expressions matrix assembly.
Generic expressions evaluator.
abstract interfaces for solvers and wrapper around Eigen solvers
The G+Smo namespace, containing all definitions for the library.
@ dirichlet
Dirichlet type.
Definition gsBoundaryConditions.h:31
static GISMO_DEPRECATED T projectFunction(const gsMultiBasis< T > &basis, const gsFunctionSet< T > &source, const gsMultiPatch< T > &geometry, gsMatrix< T > &result)
Projects a function on a basis.
Definition gsL2Projection.hpp:229
static T _project(const gsMultiBasis< T > &integrationBasis, const gsFunctionSet< T > &projectionBasis, const gsFunctionSet< T > &geometryMap, const gsFunctionSet< T > &sourceFunction, gsMatrix< T > &coefs, const gsOptionList &options)
Projects a source function onto a projection basis using a geometry map.
Definition gsL2Projection.hpp:23
static GISMO_DEPRECATED T projectGeometry(const gsBasis< T > &basis, const gsGeometry< T > &geometry, gsMatrix< T > &result)
Projects a source geometry onto basis and returns it in result.
Definition gsL2Projection.hpp:74
static GISMO_DEPRECATED T projectGeometryBoundaries(const gsMultiBasis< T > &basis, const gsMultiPatch< T > &geometry, gsMultiPatch< T > &result)
Projects a source geometry onto basis and returns it in result. Fixes the boundaries.
Definition gsL2Projection.hpp:286
static GISMO_DEPRECATED T projectGeometryPenalty(const gsMultiBasis< T > &basis, const gsMultiPatch< T > &geometry, gsMultiPatch< T > &result, T penalty=1e3)
Projects a source geometry onto basis and returns it in result. Penalizes interfaces and boundaries.
Definition gsL2Projection.hpp:330