97 #include "../common/mfem-common.hpp"
102 using namespace mfem;
105 int main (
int argc,
char *argv[])
109 MPI_Init(&argc, &argv);
110 MPI_Comm_size(MPI_COMM_WORLD, &num_procs);
111 MPI_Comm_rank(MPI_COMM_WORLD, &myid);
114 const char *mesh_file =
"icf.mesh";
115 int mesh_poly_deg = 1;
121 double lim_const = 0.0;
122 double adapt_lim_const = 0.0;
126 int solver_iter = 20;
127 double solver_rtol = 1e-10;
128 int solver_art_type = 0;
130 int max_lin_iter = 100;
131 bool move_bnd =
true;
133 bool normalization =
false;
134 bool visualization =
true;
135 int verbosity_level = 0;
136 bool fdscheme =
false;
138 bool exactaction =
false;
139 const char *devopt =
"cpu";
144 args.
AddOption(&mesh_file,
"-m",
"--mesh",
145 "Mesh file to use.");
146 args.
AddOption(&mesh_poly_deg,
"-o",
"--order",
147 "Polynomial degree of mesh finite element space.");
148 args.
AddOption(&rs_levels,
"-rs",
"--refine-serial",
149 "Number of times to refine the mesh uniformly in serial.");
150 args.
AddOption(&rp_levels,
"-rp",
"--refine-parallel",
151 "Number of times to refine the mesh uniformly in parallel.");
152 args.
AddOption(&jitter,
"-ji",
"--jitter",
153 "Random perturbation scaling factor.");
154 args.
AddOption(&metric_id,
"-mid",
"--metric-id",
155 "Mesh optimization metric:\n\t"
157 "1 : |T|^2 -- 2D shape\n\t"
158 "2 : 0.5|T|^2/tau-1 -- 2D shape (condition number)\n\t"
159 "7 : |T-T^-t|^2 -- 2D shape+size\n\t"
160 "9 : tau*|T-T^-t|^2 -- 2D shape+size\n\t"
161 "14 : |T-I|^2 -- 2D shape+size+orientation\n\t"
162 "22 : 0.5(|T|^2-2*tau)/(tau-tau_0) -- 2D untangling\n\t"
163 "50 : 0.5|T^tT|^2/tau^2-1 -- 2D shape\n\t"
164 "55 : (tau-1)^2 -- 2D size\n\t"
165 "56 : 0.5(sqrt(tau)-1/sqrt(tau))^2 -- 2D size\n\t"
166 "58 : |T^tT|^2/(tau^2)-2*|T|^2/tau+2 -- 2D shape\n\t"
167 "77 : 0.5(tau-1/tau)^2 -- 2D size\n\t"
168 "80 : (1-gamma)mu_2 + gamma mu_77 -- 2D shape+size\n\t"
169 "85 : |T-|T|/sqrt(2)I|^2 -- 2D shape+orientation\n\t"
170 "98 : (1/tau)|T-I|^2 -- 2D shape+size+orientation\n\t"
173 "301: (|T||T^-1|)/3-1 -- 3D shape\n\t"
174 "302: (|T|^2|T^-1|^2)/9-1 -- 3D shape\n\t"
175 "303: (|T|^2)/3*tau^(2/3)-1 -- 3D shape\n\t"
177 "313: (|T|^2)(tau-tau0)^(-2/3)/3 -- 3D untangling\n\t"
178 "315: (tau-1)^2 -- 3D size\n\t"
179 "316: 0.5(sqrt(tau)-1/sqrt(tau))^2 -- 3D size\n\t"
180 "321: |T-T^-t|^2 -- 3D shape+size\n\t"
183 "11 : (1/4*alpha)|A-(adjA)^T(W^TW)/omega|^2 -- 2D shape\n\t"
184 "36 : (1/alpha)|A-W|^2 -- 2D shape+size+orientation\n\t"
185 "107: (1/2*alpha)|A-|A|/|W|W|^2 -- 2D shape+orientation\n\t"
186 "126: (1-gamma)nu_11 + gamma*nu_14a -- 2D shape+size\n\t"
188 args.
AddOption(&target_id,
"-tid",
"--target-id",
189 "Target (ideal element) type:\n\t"
190 "1: Ideal shape, unit size\n\t"
191 "2: Ideal shape, equal size\n\t"
192 "3: Ideal shape, initial size\n\t"
193 "4: Given full analytic Jacobian (in physical space)\n\t"
194 "5: Ideal shape, given size (in physical space)");
195 args.
AddOption(&lim_const,
"-lc",
"--limit-const",
"Limiting constant.");
196 args.
AddOption(&adapt_lim_const,
"-alc",
"--adapt-limit-const",
197 "Adaptive limiting coefficient constant.");
198 args.
AddOption(&quad_type,
"-qt",
"--quad-type",
199 "Quadrature rule type:\n\t"
200 "1: Gauss-Lobatto\n\t"
201 "2: Gauss-Legendre\n\t"
202 "3: Closed uniform points");
203 args.
AddOption(&quad_order,
"-qo",
"--quad_order",
204 "Order of the quadrature rule.");
205 args.
AddOption(&solver_type,
"-st",
"--solver-type",
206 " Type of solver: (default) 0: Newton, 1: LBFGS");
207 args.
AddOption(&solver_iter,
"-ni",
"--newton-iters",
208 "Maximum number of Newton iterations.");
209 args.
AddOption(&solver_rtol,
"-rtol",
"--newton-rel-tolerance",
210 "Relative tolerance for the Newton solver.");
211 args.
AddOption(&solver_art_type,
"-art",
"--adaptive-rel-tol",
212 "Type of adaptive relative linear solver tolerance:\n\t"
213 "0: None (default)\n\t"
214 "1: Eisenstat-Walker type 1\n\t"
215 "2: Eisenstat-Walker type 2");
216 args.
AddOption(&lin_solver,
"-ls",
"--lin-solver",
221 "3: MINRES + Jacobi preconditioner\n\t"
222 "4: MINRES + l1-Jacobi preconditioner");
223 args.
AddOption(&max_lin_iter,
"-li",
"--lin-iter",
224 "Maximum number of iterations in the linear solve.");
225 args.
AddOption(&move_bnd,
"-bnd",
"--move-boundary",
"-fix-bnd",
227 "Enable motion along horizontal and vertical boundaries.");
228 args.
AddOption(&combomet,
"-cmb",
"--combo-type",
229 "Combination of metrics options:\n\t"
230 "0: Use single metric\n\t"
231 "1: Shape + space-dependent size given analytically\n\t"
232 "2: Shape + adapted size given discretely; shared target");
233 args.
AddOption(&normalization,
"-nor",
"--normalization",
"-no-nor",
234 "--no-normalization",
235 "Make all terms in the optimization functional unitless.");
236 args.
AddOption(&fdscheme,
"-fd",
"--fd_approximation",
237 "-no-fd",
"--no-fd-approx",
238 "Enable finite difference based derivative computations.");
239 args.
AddOption(&exactaction,
"-ex",
"--exact_action",
240 "-no-ex",
"--no-exact-action",
241 "Enable exact action of TMOP_Integrator.");
242 args.
AddOption(&visualization,
"-vis",
"--visualization",
"-no-vis",
243 "--no-visualization",
244 "Enable or disable GLVis visualization.");
245 args.
AddOption(&verbosity_level,
"-vl",
"--verbosity-level",
246 "Set the verbosity level - 0, 1, or 2.");
247 args.
AddOption(&adapt_eval,
"-ae",
"--adaptivity-evaluator",
248 "0 - Advection based (DEFAULT), 1 - GSLIB.");
249 args.
AddOption(&devopt,
"-d",
"--device",
250 "Device configuration string, see Device::Configure().");
251 args.
AddOption(&pa,
"-pa",
"--partial-assembly",
"-no-pa",
252 "--no-partial-assembly",
"Enable Partial Assembly.");
262 if (myid == 0) { device.
Print();}
265 Mesh *mesh =
new Mesh(mesh_file, 1, 1,
false);
266 for (
int lev = 0; lev < rs_levels; lev++)
273 cout <<
"Mesh curvature: ";
275 else { cout <<
"(NONE)"; }
282 for (
int lev = 0; lev < rp_levels; lev++)
292 if (mesh_poly_deg <= 0)
321 double vol_loc = 0.0;
323 for (
int i = 0; i < pmesh->
GetNE(); i++)
329 for (
int j = 0; j < dofs.
Size(); j++)
331 h0(dofs[j]) = min(h0(dofs[j]), hi);
336 MPI_Allreduce(&vol_loc, &volume, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD);
337 const double small_phys_size = pow(volume, 1.0 / dim) / 100.0;
350 for (
int i = 0; i < pfespace->
GetNDofs(); i++)
352 for (
int d = 0; d <
dim; d++)
358 for (
int i = 0; i < pfespace->
GetNBE(); i++)
363 for (
int j = 0; j < vdofs.
Size(); j++) { rdm(vdofs[j]) = 0.0; }
374 ostringstream mesh_name;
375 mesh_name <<
"perturbed.mesh";
376 ofstream mesh_ofs(mesh_name.str().c_str());
377 mesh_ofs.precision(8);
386 double tauval = -0.1;
422 if (myid == 0) { cout <<
"Unknown metric_id: " << metric_id << endl; }
461 #ifdef MFEM_USE_GSLIB
464 MFEM_ABORT(
"MFEM is not built with GSLIB.");
470 size.ProjectCoefficient(ind_coeff);
475 size.ProjectCoefficient(ind_coeff);
488 disc.ProjectCoefficient(ind_coeff);
495 #ifdef MFEM_USE_GSLIB
498 MFEM_ABORT(
"MFEM is not built with GSLIB.");
505 disc.GetDerivative(1,0,d_x);
506 disc.GetDerivative(1,1,d_y);
509 for (
int i = 0; i < size.Size(); i++)
511 size(i) = std::pow(d_x(i),2)+std::pow(d_y(i),2);
513 const double max = size.Max();
515 MPI_Allreduce(&max, &max_all, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD);
517 for (
int i = 0; i < d_x.Size(); i++)
519 d_x(i) = std::abs(d_x(i));
520 d_y(i) = std::abs(d_y(i));
522 const double eps = 0.01;
523 const double aspr_ratio = 20.0;
524 const double size_ratio = 40.0;
526 for (
int i = 0; i < size.Size(); i++)
528 size(i) = (size(i)/max_all);
529 aspr(i) = (d_x(i)+eps)/(d_y(i)+eps);
530 aspr(i) = 0.1 + 0.9*(1-size(i))*(1-size(i));
531 if (aspr(i) > aspr_ratio) {aspr(i) = aspr_ratio;}
532 if (aspr(i) < 1.0/aspr_ratio) {aspr(i) = 1.0/aspr_ratio;}
535 const int NE = pmesh->
GetNE();
536 double volume = 0.0, volume_ind = 0.0;
538 for (
int i = 0; i < NE; i++)
543 size.GetValues(i, ir, vals);
552 double volume_all, volume_ind_all;
553 MPI_Allreduce(&volume, &volume_all, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD);
554 MPI_Allreduce(&volume_ind, &volume_ind_all, 1, MPI_DOUBLE, MPI_SUM,
558 const double avg_zone_size = volume_all / NE_ALL;
560 const double small_avg_ratio =
561 (volume_ind_all + (volume_all - volume_ind_all) / size_ratio)
564 const double small_zone_size = small_avg_ratio * avg_zone_size;
565 const double big_zone_size = size_ratio * small_zone_size;
567 for (
int i = 0; i < size.Size(); i++)
569 const double val = size(i);
570 const double a = (big_zone_size - small_zone_size) / small_zone_size;
571 size(i) = big_zone_size / (1.0+a*val);
592 #ifdef MFEM_USE_GSLIB
595 MFEM_ABORT(
"MFEM is not built with GSLIB.");
614 #ifdef MFEM_USE_GSLIB
617 MFEM_ABORT(
"MFEM is not built with GSLIB.");
621 if (metric_id == 14 || metric_id == 36)
624 size.ProjectCoefficient(ind_coeff);
631 aspr.ProjectCoefficient(aspr_coeff);
643 if (myid == 0) { cout <<
"Unknown target_id: " << target_id << endl; }
647 if (target_c == NULL)
657 MFEM_VERIFY(pa ==
false,
"PA for finite differences is not implemented.");
671 if (myid == 0) { cout <<
"Unknown quad_type: " << quad_type << endl; }
675 if (myid == 0 && dim == 2)
677 cout <<
"Triangle quadrature points: "
679 <<
"\nQuadrilateral quadrature points: "
682 if (myid == 0 && dim == 3)
684 cout <<
"Tetrahedron quadrature points: "
686 <<
"\nHexahedron quadrature points: "
688 <<
"\nPrism quadrature points: "
700 if (normalization) { dist = small_phys_size; }
702 if (lim_const != 0.0) { he_nlf_integ->
EnableLimiting(x0, dist, lim_coeff); }
708 if (adapt_lim_const > 0.0)
710 MFEM_VERIFY(pa ==
false,
"PA is not implemented for adaptive limiting");
715 if (adapt_eval == 0) { adapt_evaluator =
new AdvectorCG(al); }
716 else if (adapt_eval == 1)
718 #ifdef MFEM_USE_GSLIB
721 MFEM_ABORT(
"MFEM is not built with GSLIB support!");
724 else { MFEM_ABORT(
"Bad interpolation option."); }
776 if (lim_const != 0.0) { combo->
EnableLimiting(x0, dist, lim_coeff); }
782 if (pa) { a.
Setup(); }
786 const int NE = pmesh->
GetNE();
787 for (
int i = 0; i < NE; i++)
799 MPI_Allreduce(&tauval, &minJ0, 1, MPI_DOUBLE, MPI_MIN, MPI_COMM_WORLD);
802 { cout <<
"Minimum det(J) of the original mesh is " << tauval << endl; }
804 if (tauval < 0.0 && metric_id != 22 && metric_id != 211 && metric_id != 252
805 && metric_id != 311 && metric_id != 313 && metric_id != 352)
807 MFEM_ABORT(
"The input mesh is inverted! Try an untangling metric.");
812 "Untangling is supported only for ideal targets.");
816 tauval /= Wideal.
Det();
818 double h0min = h0.Min(), h0min_all;
819 MPI_Allreduce(&h0min, &h0min_all, 1, MPI_DOUBLE, MPI_MIN, MPI_COMM_WORLD);
821 tauval -= 0.01 * h0min_all;
830 char title[] =
"Initial metric values";
839 if (move_bnd ==
false)
848 for (
int i = 0; i < pmesh->
GetNBE(); i++)
852 MFEM_VERIFY(!(dim == 2 && attr == 3),
853 "Boundary attribute 3 must be used only for 3D meshes. "
854 "Adjust the attributes (1/2/3/4 for fixed x/y/z/all "
855 "components, rest for free nodes), or use -fix-bnd.");
856 if (attr == 1 || attr == 2 || attr == 3) { n += nd; }
857 if (attr == 4) { n += nd *
dim; }
861 for (
int i = 0; i < pmesh->
GetNBE(); i++)
868 for (
int j = 0; j < nd; j++)
869 { ess_vdofs[n++] = vdofs[j]; }
873 for (
int j = 0; j < nd; j++)
874 { ess_vdofs[n++] = vdofs[j+nd]; }
878 for (
int j = 0; j < nd; j++)
879 { ess_vdofs[n++] = vdofs[j+2*nd]; }
883 for (
int j = 0; j < vdofs.
Size(); j++)
884 { ess_vdofs[n++] = vdofs[j]; }
892 Solver *S = NULL, *S_prec = NULL;
893 const double linsol_rtol = 1e-12;
898 else if (lin_solver == 1)
914 else { minres->
SetPrintLevel(verbosity_level == 2 ? 3 : -1); }
915 if (lin_solver == 3 || lin_solver == 4)
919 MFEM_VERIFY(lin_solver != 4,
"PA l1-Jacobi is not implemented");
940 if (solver_type == 0)
943 solver.SetPreconditioner(*S);
946 if (tauval < 0.0) { solver.SetMinDetPtr(&tauval); }
947 solver.SetMaxIter(solver_iter);
948 solver.SetRelTol(solver_rtol);
949 solver.SetAbsTol(0.0);
950 if (solver_art_type > 0)
952 solver.SetAdaptiveLinRtol(solver_art_type, 0.5, 0.9);
954 solver.SetPrintLevel(verbosity_level >= 1 ? 1 : -1);
955 solver.SetOperator(a);
958 if (myid == 0 && solver.GetConverged() ==
false)
960 cout <<
"Nonlinear solver: rtol = " << solver_rtol <<
" not achieved.\n";
966 ostringstream mesh_name;
967 mesh_name <<
"optimized.mesh";
968 ofstream mesh_ofs(mesh_name.str().c_str());
969 mesh_ofs.precision(8);
975 double metric_part = fin_energy;
976 if (lim_const > 0.0 || adapt_lim_const > 0.0)
982 coef_zeta.
constant = adapt_lim_const;
986 cout <<
"Initial strain energy: " << init_energy
987 <<
" = metrics: " << init_energy
988 <<
" + limiting term: " << 0.0 << endl;
989 cout <<
" Final strain energy: " << fin_energy
990 <<
" = metrics: " << metric_part
991 <<
" + limiting term: " << fin_energy - metric_part << endl;
992 cout <<
"The strain energy decreased by: " << setprecision(12)
993 << (init_energy - fin_energy) * 100.0 / init_energy <<
" %." << endl;
999 char title[] =
"Final metric values";
1003 if (adapt_lim_const > 0.0 && visualization)
1007 600, 600, 300, 300);
1017 sock.
open(
"localhost", 19916);
1018 sock <<
"solution\n";
1024 sock <<
"window_title 'Displacements'\n"
1025 <<
"window_geometry "
1026 << 1200 <<
" " << 0 <<
" " << 600 <<
" " << 600 <<
"\n"
1027 <<
"keys jRmclA" << endl;
1037 delete adapt_evaluator;
int GetNPoints() const
Returns the number of the points in the integration rule.
void vis_tmop_metric_p(int order, TMOP_QualityMetric &qm, const TargetConstructor &tc, ParMesh &pmesh, char *title, int position)
void discrete_aspr_3d(const Vector &x, Vector &v)
virtual void SetParDiscreteTargetSize(const ParGridFunction &tspec_)
int Size() const
Return the logical size of the array.
Conjugate gradient method.
int GetNDofs() const
Returns number of degrees of freedom.
AssemblyLevel
Enumeration defining the assembly level for bilinear and nonlinear form classes derived from Operator...
Class for an integration rule - an Array of IntegrationPoint.
void EnableFiniteDifferences(const GridFunction &x)
Enables FD-based approximation and computes dx.
int DofToVDof(int dof, int vd, int ndofs=-1) const
double discrete_size_2d(const Vector &x)
3D barrier Shape+Size (VS) metric.
Data type for scaled Jacobi-type smoother of sparse matrix.
const IntegrationRule & Get(int GeomType, int Order)
Returns an integration rule for given GeomType and Order.
IntegrationRules IntRulesLo(0, Quadrature1D::GaussLobatto)
void SetIntegrationRules(IntegrationRules &irules, int order)
Prescribe a set of integration rules; relevant for mixed meshes.
void SetFromTrueVector()
Shortcut for calling SetFromTrueDofs() with GetTrueVector() as argument.
A coefficient that is constant across space and time.
long GetGlobalNE() const
Return the total (global) number of elements.
int GetNBE() const
Returns number of boundary elements.
3D barrier Shape (S) metric.
void SetAdaptivityEvaluator(AdaptivityEvaluator *ae)
2D barrier Shape+Size (VS) metric (polyconvex).
Container class for integration rules.
Data type dense matrix using column-major storage.
3D barrier Shape (S) metric.
void SetVolumeScale(double vol_scale)
Used by target type IDEAL_SHAPE_EQUAL_SIZE. The default volume scale is 1.
2D barrier shape (S) metric (polyconvex).
void EnableAdaptiveLimiting(const GridFunction &z0, Coefficient &coeff, AdaptivityEvaluator &ae)
Restriction of the node positions to certain regions.
3D non-barrier Size (V) metric.
2D barrier size (V) metric (polyconvex).
void SetIntegrationRules(IntegrationRules &irules, int order)
Prescribe a set of integration rules; relevant for mixed meshes.
int GetNE() const
Returns number of elements.
2D barrier Shape+Size (VS) metric (polyconvex).
void Print(std::ostream &out=mfem::out)
Print the configuration of the MFEM virtual device object.
Abstract parallel finite element space.
virtual void ProjectCoefficient(Coefficient &coeff)
Project coeff Coefficient to this GridFunction. The projection computation depends on the choice of t...
void SetExactActionFlag(bool flag_)
Flag to control if exact action of Integration is effected.
void Randomize(int seed=0)
Set random values in the vector.
2D barrier Shape+Size (VS) metric (not polyconvex).
Geometry::Type GetElementBaseGeometry(int i) const
void EnableLimiting(const GridFunction &n0, const GridFunction &dist, Coefficient &w0, TMOP_LimiterFunction *lfunc=NULL)
Adds the limiting term to the first integrator. Disables it for the rest.
2D Shifted barrier form of shape metric (mu_2).
const DenseMatrix & GetGeomToPerfGeomJac(int GeomType) const
2D barrier shape (S) metric (not polyconvex).
Geometry::Type GetGeomType() const
Returns the Geometry::Type of the reference element.
Abstract class for local mesh quality metrics in the target-matrix optimization paradigm (TMOP) by P...
IntegrationPoint & IntPoint(int i)
Returns a reference to the i-th integration point.
void SetTrueVector()
Shortcut for calling GetTrueDofs() with GetTrueVector() as argument.
virtual void SetPreconditioner(Solver &pr)
This should be called before SetOperator.
void SetPrintLevel(int print_lvl)
double GetElementSize(ElementTransformation *T, int type=0)
virtual const FiniteElement * GetFE(int i) const
void EnableLimiting(const GridFunction &n0, const GridFunction &dist, Coefficient &w0, TMOP_LimiterFunction *lfunc=NULL)
Limiting of the mesh displacements (general version).
int GetNBE() const
Returns number of boundary elements in the mesh.
void Parse()
Parse the command-line options. Note that this function expects all the options provided through the ...
void SetCoefficient(Coefficient &w1)
Sets a scaling Coefficient for the quality metric term of the integrator.
2D non-barrier size (V) metric (not polyconvex).
3D barrier Size (V) metric.
Jacobi smoothing for a given bilinear form (no matrix necessary).
void UniformRefinement(int i, const DSTable &, int *, int *, int *)
void SetNodes(const GridFunction &n)
Set the nodes to be used in the target-matrix construction.
void SetMaxIter(int max_it)
T Max() const
Find the maximal element in the array, using the comparison operator < for class T.
Version of QuadraticFECollection with positive basis functions.
virtual void SetParDiscreteTargetAspectRatio(const ParGridFunction &tspec_)
int GetAttribute() const
Return element's attribute.
double discrete_ori_2d(const Vector &x)
Parallel smoothers in hypre.
void ParEnableNormalization(const ParGridFunction &x)
2D barrier Shape+Size+Orientation (VOS) metric (polyconvex).
void SetNodalFESpace(FiniteElementSpace *nfes)
void PrintUsage(std::ostream &out) const
Print the usage message.
void DiffuseField(ParGridFunction &field, int smooth_steps)
2D barrier Shape+Orientation (OS) metric (polyconvex).
const Vector & GetTrueVector() const
Read only access to the (optional) internal true-dof Vector.
A general vector function coefficient.
void SetAbsTol(double atol)
Array< int > bdr_attributes
A list of all unique boundary attributes used by the Mesh.
void SetRelTol(double rtol)
2D barrier (not a shape) metric (polyconvex).
int GetDof() const
Returns the number of degrees of freedom in the finite element.
double weight_fun(const Vector &x)
2D barrier size (V) metric (polyconvex).
Collection of finite elements from the same family in multiple dimensions. This class is used to matc...
void AddOption(bool *var, const char *enable_short_name, const char *enable_long_name, const char *disable_short_name, const char *disable_long_name, const char *description, bool required=false)
Add a boolean option and set 'var' to receive the value. Enable/disable tags are used to set the bool...
double adapt_lim_fun(const Vector &x)
void AddTMOPIntegrator(TMOP_Integrator *ti)
Adds a new TMOP_Integrator to the combination.
void SaveAsOne(const char *fname, int precision=16) const
double material_indicator_2d(const Vector &x)
2D barrier Shape+Size (VS) metric (not polyconvex).
virtual void GetElementDofs(int i, Array< int > &dofs) const
Returns indexes of degrees of freedom in array dofs for i'th element.
double discrete_size_3d(const Vector &x)
double discrete_aspr_2d(const Vector &x)
Class for integration point with weight.
void GetElementTransformation(int i, IsoparametricTransformation *ElTr)
2D barrier Shape+Size+Orientation (VOS) metric (polyconvex).
3D Shape (S) metric, untangling version of 303.
IntegrationRules IntRulesCU(0, Quadrature1D::ClosedUniform)
void PrintOptions(std::ostream &out) const
Print the options.
double infinity()
Define a shortcut for std::numeric_limits<double>::infinity()
int open(const char hostname[], int port)
Open the socket stream on 'port' at 'hostname'.
A general function coefficient.
void VisualizeField(socketstream &sock, const char *vishost, int visport, GridFunction &gf, const char *title, int x, int y, int w, int h, const char *keys, bool vec)
void GetNodes(Vector &node_coord) const
void PrintAsOne(std::ostream &out=mfem::out) const
Arbitrary order H1-conforming (continuous) finite elements.
TargetType
Target-matrix construction algorithms supported by this class.
virtual void SetParDiscreteTargetOrientation(const ParGridFunction &tspec_)
Class for parallel grid function.
const FiniteElement * GetBE(int i) const
Returns pointer to the FiniteElement in the FiniteElementCollection associated with i'th boundary fac...
void GetBdrElementVDofs(int i, Array< int > &vdofs) const
Returns indexes of degrees of freedom for i'th boundary element.
void SetNodalGridFunction(GridFunction *nodes, bool make_owner=false)
Base class representing target-matrix construction algorithms for mesh optimization via the target-ma...
The MFEM Device class abstracts hardware devices such as GPUs, as well as programming models such as ...
virtual void SetAnalyticTargetSpec(Coefficient *sspec, VectorCoefficient *vspec, TMOPMatrixCoefficient *mspec)
Class for parallel meshes.
IntegrationRules IntRules(0, Quadrature1D::GaussLegendre)
A global object with all integration rules (defined in intrules.cpp)
void SetType(HypreSmoother::Type type, int relax_times=1)
Set the relaxation type and number of sweeps.
2D barrier Shape+Orientation (OS) metric (polyconvex).
virtual double * HostReadWrite()
Shortcut for mfem::ReadWrite(vec.GetMemory(), vec.Size(), false).
void ParEnableNormalization(const ParGridFunction &x)
double GetElementVolume(int i)
const Element * GetBdrElement(int i) const
3D barrier Shape (S) metric.
2D non-barrier metric without a type.
bool Good() const
Return true if the command line options were parsed successfully.
A TMOP integrator class based on any given TMOP_QualityMetric and TargetConstructor.
2D non-barrier Shape+Size+Orientation (VOS) metric (polyconvex).