33 : TAG(
"acceleration"),
34 TAG_RELAX(
"relaxation"),
35 TAG_INIT_RELAX(
"initial-relaxation"),
36 TAG_MAX_USED_ITERATIONS(
"max-used-iterations"),
37 TAG_TIME_WINDOWS_REUSED(
"time-windows-reused"),
40 TAG_ESTIMATEJACOBIAN(
"estimate-jacobian"),
41 TAG_PRECONDITIONER(
"preconditioner"),
42 TAG_IMVJRESTART(
"imvj-restart-mode"),
45 ATTR_SCALING(
"scaling"),
47 ATTR_ENFORCE(
"enforce"),
48 ATTR_SINGULARITYLIMIT(
"limit"),
50 ATTR_BUILDJACOBIAN(
"always-build-jacobian"),
51 ATTR_IMVJCHUNKSIZE(
"chunk-size"),
52 ATTR_RSLS_REUSED_TIME_WINDOWS(
"reused-time-windows-at-restart"),
53 ATTR_RSSVD_TRUNCATIONEPS(
"truncation-threshold"),
54 ATTR_PRECOND_NONCONST_TIME_WINDOWS(
"freeze-after"),
55 VALUE_CONSTANT(
"constant"),
56 VALUE_AITKEN(
"aitken"),
57 VALUE_IQNILS(
"IQN-ILS"),
58 VALUE_IQNIMVJ(
"IQN-IMVJ"),
59 VALUE_QR1FILTER(
"QR1"),
60 VALUE_QR1_ABSFILTER(
"QR1-absolute"),
61 VALUE_QR2FILTER(
"QR2"),
62 VALUE_CONSTANT_PRECONDITIONER(
"constant"),
63 VALUE_VALUE_PRECONDITIONER(
"value"),
64 VALUE_RESIDUAL_PRECONDITIONER(
"residual"),
65 VALUE_RESIDUAL_SUM_PRECONDITIONER(
"residual-sum"),
66 VALUE_LS_RESTART(
"RS-LS"),
67 VALUE_ZERO_RESTART(
"RS-0"),
68 VALUE_SVD_RESTART(
"RS-SVD"),
69 VALUE_SLIDE_RESTART(
"RS-SLIDE"),
70 VALUE_NO_RESTART(
"no-restart"),
71 _meshConfig(meshConfig),
87 XMLTag::Occurrence occ = XMLTag::OCCUR_NOT_OR_ONCE;
91 tag.setDocumentation(
"Accelerates coupling data with constant underrelaxation.");
97 tag.setDocumentation(
"Accelerates coupling data with dynamic Aitken under-relaxation.");
103 tag.setDocumentation(
"Accelerates coupling data with the interface quasi-Newton inverse least-squares method.");
109 tag.setDocumentation(
"Accelerates coupling data with the interface quasi-Newton inverse multi-vector Jacobian method.");
112 .setDocumentation(
"If set to true, the IMVJ will set up the Jacobian matrix"
113 " in each coupling iteration, which is inefficient. If set to false (or not set)"
114 " the Jacobian is only build in the last iteration and the updates are computed using (relatively) cheap MATVEC products.");
115 tag.addAttribute(alwaybuildJacobian);
121 for (XMLTag &tag : tags) {
150 "You have provided a subtag <data name=\"{}\" mesh=\"{}\"/> more than once in your <acceleration:.../>. "
151 "Please remove the duplicated entry.",
155 double scaling = 1.0;
161 "Data with name \"{0}\" associated to mesh \"{1}\" not found on configuration of acceleration. "
162 "Add \"{0}\" to the \"<mesh name={1}>\" tag, or change the data name in the acceleration scheme.",
204#ifndef PRECICE_NO_MPI
208 "Please remove 'always-build-jacobian' from the configuration file or do not run in restart mode.");
226 PRECICE_ERROR(
"Acceleration IQN-IMVJ only works if preCICE is compiled with MPI");
283#ifndef PRECICE_NO_MPI
304 PRECICE_ERROR(
"Acceleration IQN-IMVJ only works if preCICE is compiled with MPI");
331 "To improve the performance of a parallel or a multi coupling schemes, "
332 "each data set can be manually scaled using this scaling factor with preconditioner type = \"constant\". For all other preconditioner types, the factor is ignored. "
333 "We recommend, however, to use an automatic scaling via a preconditioner.");
341 "maintain good conditioning in the least-squares system. Possible filters:\n"
342 " - `QR1-filter`: updateQR-dec with (relative) test \\\\(R(i,i) < \\epsilon *\\lVert R\\rVert_F\\\\)\n"
343 " - `QR1_absolute-filter`: updateQR-dec with (absolute) test \\\\(R(i, i) < \\epsilon\\\\)\n"
344 " - `QR2-filter`: en-block QR-dec with test \\\\(\\lVert v_\\text{orth} \\rVert_2 < \\epsilon * \\lVert v \\rVert_2\\\\)\n\n"
345 "Please note that a QR1 is based on Given's rotations whereas QR2 uses "
346 "modified Gram-Schmidt. This can give different results even when no columns "
347 "are filtered out.\n"
348 "When this tag is not provided, the QR2-filter with the limit value 1e-2 is used.");
356 .setDocumentation(
"Type of the filter.");
387 "To improve the performance of a parallel or a multi coupling schemes, "
388 "each data set can be manually scaled using this scaling factor with preconditioner type = \"constant\". For all other preconditioner types, the factor is ignored. "
389 "We recommend, however, to use an automatic scaling via a preconditioner.");
397 " can be applied. A constant preconditioner scales every acceleration data by a constant value, which you can define as"
398 " an attribute of data. "
399 " A value preconditioner scales every acceleration data by the norm of the data in the previous time window."
400 " A residual preconditioner scales every acceleration data by the current residual."
401 " A residual-sum preconditioner scales every acceleration data by the sum of the residuals from the current time window.");
407 .setDocumentation(
"The type of the preconditioner.");
411 "After the given number of time windows, the preconditioner weights "
412 "are frozen and the preconditioner acts like a constant preconditioner.");
428 tagMaxUsedIter.
setDocumentation(
"Maximum number of columns used in low-rank approximation of Jacobian. If this tag is not provided, the attribute value of 100 is used.");
435 tagTimeWindowsReused.
setDocumentation(
"Number of past time windows from which columns are used to approximate Jacobian. If this tag is not provided, the default attribute value of 10 is used.");
446 "- A constant preconditioner scales every acceleration data by a constant value, which you can define as an attribute of data. \n "
447 "- A value preconditioner scales every acceleration data by the norm of the data in the previous time window.\n"
448 "- A residual preconditioner scales every acceleration data by the current residual.\n"
449 "- A residual-sum preconditioner scales every acceleration data by the sum of the residuals from the current time window.\n"
450 " If this tag is not provided, the residual-sum preconditioner is employed.");
456 .setDocumentation(
"The type of the preconditioner.");
460 "After the given number of time windows, the preconditioner weights "
461 "are frozen and the preconditioner acts like a constant preconditioner.");
485 "- `no-restart`: IMVJ runs in normal mode with explicit representation of Jacobian\n"
486 "- `RS-ZERO`: IMVJ runs in restart mode. After M time windows all Jacobain information is dropped, restart with no information\n"
487 "- `RS-LS`: IMVJ runs in restart mode. After M time windows a IQN-LS like approximation for the initial guess of the Jacobian is computed.\n"
488 "- `RS-SVD`: IMVJ runs in restart mode. After M time windows a truncated SVD of the Jacobian is updated.\n"
489 "- `RS-SLIDE`: IMVJ runs in sliding window restart mode.\n"
490 "If this tag is not provided, IMVJ runs in normal mode with explicit representation of Jacobian.");
492 .
setDocumentation(
"Specifies the number of time windows M after which the IMVJ restarts, if run in restart-mode. Default value is M=8.");
494 .
setDocumentation(
"If IMVJ restart-mode=RS-LS, the number of reused time windows at restart can be specified.");
496 .
setDocumentation(
"If IMVJ restart-mode=RS-SVD, the truncation threshold for the updated SVD can be set.");
503 tagMaxUsedIter.
setDocumentation(
"Maximum number of columns used in low-rank approximation of Jacobian. If this tag is not provided, the default attribute value of 20 is used.");
510 tagTimeWindowsReused.
setDocumentation(
"Number of past time windows from which columns are used to approximate Jacobian. If this tag is not provided, the attribute value of 0 is used.");
518 "To improve the performance of a parallel or a multi coupling schemes a preconditioner can be applied."
519 "- A constant preconditioner scales every acceleration data by a constant value, which you can define as an attribute of data.\n"
520 "- A value preconditioner scales every acceleration data by the norm of the data in the previous time window.\n"
521 "- A residual preconditioner scales every acceleration data by the current residual.\n"
522 "- A residual-sum preconditioner scales every acceleration data by the sum of the residuals from the current time window.\n"
523 " If this tag is not provided, the residual-sum preconditioner is employed.");
529 .setDocumentation(
"Type of the preconditioner.");
532 .
setDocumentation(
"After the given number of time windows, the preconditioner weights are frozen and the preconditioner acts like a constant preconditioner.");
537 PRECICE_ERROR(
"Acceleration of type \"{}\" is unknown. Please choose a valid acceleration scheme or check the spelling in the configuration file.", tag.
getName());
#define PRECICE_ERROR(...)
#define PRECICE_TRACE(...)
#define PRECICE_CHECK(check,...)
#define PRECICE_ASSERT(...)
virtual void xmlEndTagCallback(const xml::ConfigurationContext &context, xml::XMLTag &callingTag)
Callback method required when using xml::XMLTag.
const std::string VALUE_ZERO_RESTART
const std::string VALUE_VALUE_PRECONDITIONER
void addCommonIQNSubtags(xml::XMLTag &tag)
const std::string TAG_FILTER
const std::string VALUE_RESIDUAL_PRECONDITIONER
std::set< std::pair< std::string, std::string > > _uniqueDataAndMeshNames
const std::string ATTR_RSSVD_TRUNCATIONEPS
const std::string VALUE_AITKEN
const std::string ATTR_SINGULARITYLIMIT
const std::string TAG_RELAX
const std::string VALUE_QR2FILTER
const std::string ATTR_PRECOND_NONCONST_TIME_WINDOWS
const std::string ATTR_RSLS_REUSED_TIME_WINDOWS
const std::string VALUE_NO_RESTART
const std::string ATTR_NAME
const mesh::PtrMeshConfiguration _meshConfig
struct precice::acceleration::AccelerationConfiguration::UserDefinitions _userDefinitions
impl::PtrPreconditioner _preconditioner
const std::string ATTR_ENFORCE
const std::string VALUE_RESIDUAL_SUM_PRECONDITIONER
const std::string TAG_MAX_USED_ITERATIONS
std::vector< std::string > _neededMeshes
const std::string VALUE_IQNILS
struct precice::acceleration::AccelerationConfiguration::ConfigurationData _config
const struct precice::acceleration::AccelerationConfiguration::DefaultValuesIMVJ _defaultValuesIQNIMVJ
PtrAcceleration getAcceleration()
Returns the configured coupling scheme.
const std::string ATTR_TYPE
void connectTags(xml::XMLTag &tag)
Connect tags.
const std::string TAG_DATA
const std::string VALUE_QR1_ABSFILTER
const std::string VALUE_LS_RESTART
PtrAcceleration _acceleration
const std::string VALUE_CONSTANT_PRECONDITIONER
const std::string TAG_INIT_RELAX
AccelerationConfiguration(const mesh::PtrMeshConfiguration &meshConfig)
const std::string TAG_IMVJRESTART
const struct precice::acceleration::AccelerationConfiguration::DefaultValuesIQN _defaultValuesIQNILS
const std::string TAG_TIME_WINDOWS_REUSED
const std::string VALUE_QR1FILTER
const std::string VALUE_CONSTANT
const std::string VALUE_SVD_RESTART
void clear()
Removes configured acceleration.
const std::string TAG_PRECONDITIONER
const std::string ATTR_MESH
const std::string VALUE_SLIDE_RESTART
const std::string ATTR_BUILDJACOBIAN
const std::string ATTR_SCALING
const std::string ATTR_IMVJCHUNKSIZE
const std::string ATTR_VALUE
void addTypeSpecificSubtags(xml::XMLTag &tag)
const std::string VALUE_IQNIMVJ
virtual void xmlTagCallback(const xml::ConfigurationContext &context, xml::XMLTag &callingTag)
Callback method required when using xml::XMLTag.
static const int QR1FILTER_ABS
static const int QR2FILTER
static const int QR1FILTER
Interface quasi-Newton with interface least-squares approximation.
Multi vector quasi-Newton update scheme.
static const int RS_SLIDE
static const int NO_RESTART
Preconditioner that uses the constant user-defined factors to scale the quasi-Newton system.
Preconditioner that uses the recent residual to scale the quasi-Newton system.
Preconditioner that uses the residuals of all iterations of the current time window summed up to scal...
Preconditioner that uses the values from the previous time window to scale the quasi-Newton system.
XMLAttribute & setOptions(std::vector< ATTRIBUTE_T > options)
XMLAttribute & setDocumentation(std::string documentation)
Sets a documentation string for the attribute.
Represents an XML tag to be configured automatically.
const std::string & getNamespace() const
Returns xml namespace.
bool hasAttribute(const std::string &attributeName)
std::string getStringAttributeValue(const std::string &name, std::optional< std::string > default_value=std::nullopt) const
bool getBooleanAttributeValue(const std::string &name, std::optional< bool > default_value=std::nullopt) const
XMLTag & setDocumentation(const std::string &documentation)
Adds a description of the purpose of this XML tag.
const std::string & getName() const
Returns name (without namespace).
const std::string & getFullName() const
Returns full name consisting of xml namespace + ":" + name.
int getIntAttributeValue(const std::string &name, std::optional< int > default_value=std::nullopt) const
double getDoubleAttributeValue(const std::string &name, std::optional< double > default_value=std::nullopt) const
XMLTag & addAttribute(const XMLAttribute< double > &attribute)
Removes the XML subtag with given name.
XMLTag & addSubtag(const XMLTag &tag)
Adds an XML tag as subtag by making a copy of the given tag.
std::shared_ptr< Preconditioner > PtrPreconditioner
contains implementations of acceleration schemes.
std::shared_ptr< Acceleration > PtrAcceleration
contains the XML configuration parser.
std::vector< double > scalingFactorsInOrder() const
int imvjRSLS_reusedTimeWindows
std::vector< int > dataIDs
std::string preconditionerType
double imvjRSSVD_truncationEps
int precond_nbNonConstTWindows
std::map< int, double > scalings
bool forceInitialRelaxation
int precond_nbNonConstTWindows
bool definedPreconditionerType
bool definedMaxIterationsUsed
bool definedRelaxationFactor
bool definedTimeWindowsReused
Tightly coupled to the parameters of Participant()