12#ifndef MFEM_TMOP_TOOLS_HPP
13#define MFEM_TMOP_TOOLS_HPP
34 void ComputeAtNewPositionScalar(
const Vector &new_mesh_nodes,
39 real_t timestep_scale = 0.5)
41 ode_solver(), nodes0(), field0(), dt_scale(timestep_scale), al(al) { }
44 const Vector &init_field)
override;
48 MFEM_ABORT(
"Not supported by AdvectorCG.");
62 MFEM_ABORT(
"Not supported by AdvectorCG.");
85 const Vector &init_field)
override;
316 MFEM_VERIFY(factor > 1.0,
"Scaling factor must be greater than 1.");
354 "Fitting error based convergence requires the user to "
355 "first set the error threshold."
356 "See SetTerminationWithMaxSurfaceFittingError");
380 else { MFEM_ABORT(
"Invalid type"); }
386 const TargetConstructor &tc, Mesh &pmesh,
387 char *title,
int position);
390 const TargetConstructor &tc, ParMesh &pmesh,
391 char *title,
int position);
396 const FiniteElementSpace &fesL2,
397 const FiniteElementSpace &fesH1, Vector &x);
AdvectorCG(AssemblyLevel al=AssemblyLevel::LEGACY, real_t timestep_scale=0.5)
void SetInitialField(const Vector &init_nodes, const Vector &init_field) override
void SetNewFieldFESpace(const FiniteElementSpace &fes) override
void ComputeAtGivenPositions(const Vector &positions, Vector &values, int p_ordering=Ordering::byNODES) override
Using the source mesh and field given by SetInitialField(), compute corresponding values at specified...
void ComputeAtNewPosition(const Vector &new_mesh_nodes, Vector &new_field, int nodes_ordering=Ordering::byNODES) override
void SetMemoryType(MemoryType mt)
FindPointsGSLIB can robustly evaluate a GridFunction on an arbitrary collection of points.
Class FiniteElementSpace - responsible for providing FEM view of the mesh, mainly managing the set of...
Abstract class for all finite elements.
Geometry::Type GetGeomType() const
Returns the Geometry::Type of the reference element.
Class for grid function - Vector with associated FE space.
Class for an integration rule - an Array of IntegrationPoint.
Container class for integration rules.
const IntegrationRule & Get(int GeomType, int Order)
Returns an integration rule for given GeomType and Order.
void ComputeAtGivenPositions(const Vector &positions, Vector &values, int p_ordering=Ordering::byNODES) override
Direct interpolation of field0_gf at the given positions.
virtual void SetNewFieldFESpace(const FiniteElementSpace &fes) override
void SetInitialField(const Vector &init_nodes, const Vector &init_field) override
void ComputeAtNewPosition(const Vector &new_mesh_nodes, Vector &new_field, int nodes_ordering=Ordering::byNODES) override
const FindPointsGSLIB * GetFindPointsGSLIB() const
void SetSolver(Solver &solver) override
Set the linear solver for inverting the Jacobian.
virtual void SetSolver(Solver &solver)
Set the linear solver for inverting the Jacobian.
Performs a single remap advection step in parallel.
ParAdvectorCGOper(const Vector &x_start, GridFunction &vel, ParFiniteElementSpace &pfes, AssemblyLevel al=AssemblyLevel::LEGACY, MemoryType mt=MemoryType::DEFAULT)
VectorGridFunctionCoefficient u_coeff
void Mult(const Vector &ind, Vector &di_dt) const override
Operator application: y=A(x).
Abstract parallel finite element space.
The classical explicit forth-order Runge-Kutta method, RK4.
Performs a single remap advection step in serial.
VectorGridFunctionCoefficient u_coeff
SerialAdvectorCGOper(const Vector &x_start, GridFunction &vel, FiniteElementSpace &fes, AssemblyLevel al=AssemblyLevel::LEGACY)
void Mult(const Vector &ind, Vector &di_dt) const override
Operator application: y=A(x).
void SetAdaptiveSurfaceFittingScalingFactor(real_t factor)
real_t surf_fit_max_err_limit
real_t ComputeScalingFactor(const Vector &d, const Vector &b) const override
virtual void GetSurfaceFittingError(const Vector &d_loc, real_t &err_avg, real_t &err_max) const
void SetMinimumDeterminantThreshold(real_t threshold)
Set minimum determinant enforced during line-search.
void Mult(const Vector &b, Vector &x) const override
Optimizes the mesh positions given by x.
real_t surf_fit_scale_factor
void SetPreconditioner(Solver &pr) override
This should be called before SetOperator.
void SetTempMemoryType(MemoryType mt)
Set the memory type for temporary memory allocations.
bool IsSurfaceFittingEnabled() const
Check if surface fitting is enabled.
real_t surf_fit_err_rel_change_limit
real_t MinDetJpr_3D(const FiniteElementSpace *, const Vector &) const
real_t surf_fit_weight_limit
const IntegrationRule & ir
int surf_fit_adapt_count_limit
IntegrationRules * IntegRules
void SetIntegrationRules(IntegrationRules &irules, int order)
Prescribe a set of integration rules; relevant for mixed meshes.
const IntegrationRule & GetIntegrationRule(const FiniteElement &el) const
bool surf_fit_coeff_update
void UpdateSurfaceFittingWeight(real_t factor) const
Update surface fitting weight as surf_fit_weight *= factor.
real_t surf_fit_avg_err_prvs
real_t MinDetJpr_2D(const FiniteElementSpace *, const Vector &) const
void SetAdaptiveSurfaceFittingRelativeChangeThreshold(real_t threshold)
void SetMaxNumberofIncrementsForAdaptiveFitting(int count)
void ProcessNewState(const Vector &dx) const override
void SetMinDetPtr(real_t *md_ptr)
void SetSurfaceFittingMaxErrorLimit(real_t max_error)
Could be used with both error-based or residual-based convergence.
TMOPNewtonSolver(const IntegrationRule &irule, int type=0)
void SetSurfaceFittingConvergenceBasedOnError(bool mode)
Toggle convergence based on residual or error.
bool compute_metric_quantile_flag
void SetTerminationWithMaxSurfaceFittingError(real_t max_error)
Used for error-based surface fitting termination.
real_t ComputeMinDet(const Vector &d_loc, const FiniteElementSpace &fes) const
bool surf_fit_converge_error
void SetSolver(Solver &solver) override
Set the linear solver for inverting the Jacobian.
void GetSurfaceFittingWeight(Array< real_t > &weights) const
Get the surface fitting weight for all the TMOP integrators.
void SetSurfaceFittingWeightLimit(real_t weight)
Used for residual-based surface fitting termination.
TMOPNewtonSolver(MPI_Comm comm, const IntegrationRule &irule, int type=0)
Base abstract class for first order time dependent operators.
Vector coefficient defined by a vector GridFunction.
AssemblyLevel
Enumeration defining the assembly level for bilinear and nonlinear form classes derived from Operator...
void vis_tmop_metric_s(int order, TMOP_QualityMetric &qm, const TargetConstructor &tc, Mesh &mesh, char *title, int position)
void vis_tmop_metric_p(int order, TMOP_QualityMetric &qm, const TargetConstructor &tc, ParMesh &pmesh, char *title, int position)
void GetPeriodicPositions(const Vector &x_0, const Vector &dx, const FiniteElementSpace &fesL2, const FiniteElementSpace &fesH1, Vector &x)
MemoryType
Memory types supported by MFEM.
void vel(const Vector &x, real_t t, Vector &u)