From 7ab53dbcfbd27c071b134680859af0f1d821f0d7 Mon Sep 17 00:00:00 2001 From: Edward Palmer Date: Thu, 1 Feb 2024 17:11:54 +0000 Subject: [PATCH 01/16] Revert "Merge pull request #79 from aurora-multiphysics/revert-75-EdwardPalmer99/MultiApp-Vector-Transfer-Action-V2" This reverts commit c0f8cf53aa331a883143424c1ddd793793e3453c, reversing changes made to f99dc2103f18a67cc54e3f12c3f7fb8a4a56748e. --- include/actions/AddVectorTransferAction.h | 226 ++++++++ .../VectorVariableFromComponentsAux.h | 21 +- .../VectorVariableToComponentsAux.h | 13 +- include/auxkernels/WritableVectorAuxKernel.h | 35 +- include/base/ApolloVectorTransferFlags.h | 9 + .../transfers/MultiAppGeneralVectorTransfer.h | 40 ++ src/actions/AddVectorTransferAction.C | 541 ++++++++++++++++++ ...grange_vector_copy_transfer_master_out.csv | 3 + ...r_nearest_location_transfer_master_out.csv | 3 + ...nomial_vector_copy_transfer_master_out.csv | 3 + ...ctor_copy_transfer_master_out_sub_app0.csv | 3 + ...ctor_copy_transfer_master_out_sub_app0.csv | 3 + ...grange_vector_copy_transfer_master_out.csv | 3 + ...nomial_vector_copy_transfer_master_out.csv | 3 + .../VectorVariableFromComponentsAux.C | 66 +-- .../VectorVariableToComponentsAux.C | 16 +- src/auxkernels/WritableVectorAuxKernel.C | 67 ++- src/base/ApolloApp.C | 10 + src/base/ApolloVectorTransferFlags.C | 8 + .../ElementVectorL2Difference.C | 6 +- src/transfers/MultiAppGeneralVectorTransfer.C | 54 ++ ...r_nearest_location_transfer_master_out.csv | 3 + ...r_nearest_location_transfer_master_out.csv | 3 + ..._location_transfer_master_out_sub_app0.csv | 3 + ..._location_transfer_master_out_sub_app0.csv | 3 + ...r_nearest_location_transfer_master_out.csv | 3 + ...r_nearest_location_transfer_master_out.csv | 3 + ..._vector_nearest_location_transfer_master.i | 78 +++ ..._vector_nearest_location_transfer_subapp.i | 58 ++ ..._vector_nearest_location_transfer_master.i | 78 +++ ..._vector_nearest_location_transfer_subapp.i | 58 ++ ..._vector_nearest_location_transfer_master.i | 60 ++ ..._vector_nearest_location_transfer_subapp.i | 75 +++ ..._vector_nearest_location_transfer_master.i | 60 ++ ..._vector_nearest_location_transfer_subapp.i | 75 +++ ..._vector_nearest_location_transfer_master.i | 85 +++ ..._vector_nearest_location_transfer_subapp.i | 40 ++ ..._vector_nearest_location_transfer_master.i | 85 +++ ..._vector_nearest_location_transfer_subapp.i | 40 ++ test/tests/unit/actions/tests | 45 ++ 40 files changed, 1911 insertions(+), 77 deletions(-) create mode 100644 include/actions/AddVectorTransferAction.h create mode 100644 include/base/ApolloVectorTransferFlags.h create mode 100644 include/transfers/MultiAppGeneralVectorTransfer.h create mode 100644 src/actions/AddVectorTransferAction.C create mode 100644 src/actions/gold/pull_lagrange_vector_copy_transfer_master_out.csv create mode 100644 src/actions/gold/pull_lagrange_vector_nearest_location_transfer_master_out.csv create mode 100644 src/actions/gold/pull_monomial_vector_copy_transfer_master_out.csv create mode 100644 src/actions/gold/push_lagrange_vector_copy_transfer_master_out_sub_app0.csv create mode 100644 src/actions/gold/push_monomial_vector_copy_transfer_master_out_sub_app0.csv create mode 100644 src/actions/gold/push_pull_lagrange_vector_copy_transfer_master_out.csv create mode 100644 src/actions/gold/push_pull_monomial_vector_copy_transfer_master_out.csv create mode 100644 src/base/ApolloVectorTransferFlags.C create mode 100644 src/transfers/MultiAppGeneralVectorTransfer.C create mode 100644 test/tests/unit/actions/gold/pull_lagrange_vector_nearest_location_transfer_master_out.csv create mode 100644 test/tests/unit/actions/gold/pull_monomial_vector_nearest_location_transfer_master_out.csv create mode 100644 test/tests/unit/actions/gold/push_lagrange_vector_nearest_location_transfer_master_out_sub_app0.csv create mode 100644 test/tests/unit/actions/gold/push_monomial_vector_nearest_location_transfer_master_out_sub_app0.csv create mode 100644 test/tests/unit/actions/gold/push_pull_lagrange_vector_nearest_location_transfer_master_out.csv create mode 100644 test/tests/unit/actions/gold/push_pull_monomial_vector_nearest_location_transfer_master_out.csv create mode 100644 test/tests/unit/actions/pull_lagrange_vector_nearest_location_transfer_master.i create mode 100644 test/tests/unit/actions/pull_lagrange_vector_nearest_location_transfer_subapp.i create mode 100644 test/tests/unit/actions/pull_monomial_vector_nearest_location_transfer_master.i create mode 100644 test/tests/unit/actions/pull_monomial_vector_nearest_location_transfer_subapp.i create mode 100644 test/tests/unit/actions/push_lagrange_vector_nearest_location_transfer_master.i create mode 100644 test/tests/unit/actions/push_lagrange_vector_nearest_location_transfer_subapp.i create mode 100644 test/tests/unit/actions/push_monomial_vector_nearest_location_transfer_master.i create mode 100644 test/tests/unit/actions/push_monomial_vector_nearest_location_transfer_subapp.i create mode 100644 test/tests/unit/actions/push_pull_lagrange_vector_nearest_location_transfer_master.i create mode 100644 test/tests/unit/actions/push_pull_lagrange_vector_nearest_location_transfer_subapp.i create mode 100644 test/tests/unit/actions/push_pull_monomial_vector_nearest_location_transfer_master.i create mode 100644 test/tests/unit/actions/push_pull_monomial_vector_nearest_location_transfer_subapp.i create mode 100644 test/tests/unit/actions/tests diff --git a/include/actions/AddVectorTransferAction.h b/include/actions/AddVectorTransferAction.h new file mode 100644 index 00000000..9badf588 --- /dev/null +++ b/include/actions/AddVectorTransferAction.h @@ -0,0 +1,226 @@ +#pragma once + +#include "MooseObjectAction.h" +#include "AuxiliarySystem.h" + +class AddVectorTransferAction : public MooseObjectAction +{ +public: + static InputParameters validParams(); + + AddVectorTransferAction(const InputParameters & params); + + virtual void act() override; + +protected: + /** + * Returns a shared pointer to or from the multiapp. + */ + const std::shared_ptr getFromMultiApp() const; + const std::shared_ptr getToMultiApp() const; + + /** + * Returns to/from problem variable names. + */ + const std::vector & getFromVarNames() const; + const std::vector & getToVarNames() const; + + const std::vector & getFromVarNamesConverted(); + const std::vector & getToVarNamesConverted(); + + /** + * An enumeration used internally to specify the component of a vector variable. + */ + enum class VectorComponent + { + X, + Y, + Z + }; + + /** + * An enumeration used to specify the auxkernel to build. + */ + enum class VectorAuxKernelType + { + PREPARE_VECTOR_FOR_TRANSFER, + RECOVER_VECTOR_POST_TRANSFER + }; + + /** + * Finds the FEProblemBase depending on the direction. + */ + FEProblemBase & getFromProblem() const; + FEProblemBase & getToProblem() const; + + /** + * Returns references to the auxsystem. + */ + AuxiliarySystem & getFromAuxSystem() const; + AuxiliarySystem & getToAuxSystem() const; + + /** + * Adds a vector auxkernel to the problem. + */ + void + addVectorAuxKernel(FEProblemBase & problem, std::string & vector_name, VectorAuxKernelType type); + + /** + * This method is called internally to locate all vector variables. For each vector variable + * it locates, it will create standard scalar variables. When the methods getFromVarNames() + * and getToVarNames() are called, they will return a vector containing only the standard + * variable names. + */ + void convertAllVariables(); + + /** + * This method will iterate through the variable names. If the variable associated with the name + * happens to be a vector variable, the standard variables for its components will be created. + * Returns a vector containing the updated variable names (adding all new standard variables and + * removing any vector variables). + */ + template + std::vector + convertVariables(FEProblemBase & problem, + std::vector & input_variable_names); + + /** + * This method verifies that source_type is a valid parameter. If it is and there is at least one + * vector variable supplied then we need to duplicate its source type for the new standard + * variable components. + */ + void convertSourceTypes(); + + /** + * Returns true is "source_type" is a valid parameter. + */ + bool hasSourceTypesParameter() const; + + /** + * Returns a reference to a vector of converted source types. + */ + std::vector & getSourceTypeConverted(); + + /** + * Returns all vector source variable names. + */ + std::set & getVectorSourceNames(); + + /** + * Returns true if variable name corresponds to a source vector variable. + */ + bool isSourceVectorVariable(const std::string & var_name); + + /** + * Creates component standard variables for the x, y and z components of a vector variable. + */ + void buildVectorComponents(FEProblemBase & problem, MooseVariableFEBase & vector_variable); + + /** + * Returns the extension for a given vector component. + */ + std::string buildVectorComponentExtension(VectorComponent component) const; + /** + * Creates the FEType of a variable corresponding to a component of a vector variable. + */ + InputParameters buildInputParametersForComponents(MooseVariableFEBase & vector_variable) const; + + /** + * Check whether the variable is a vector variable of the supported family/order. + */ + bool isSupportedVectorVariable(MooseVariableFEBase & vector_variable) const; + + /** + * Check whether the component variable is of a valid family. + */ + bool isSupportedComponentVariable(MooseVariableFEBase & variable) const; + + /** + * Checks whether a vector variable is compatible with a component variable. + */ + bool areCompatibleVariables(MooseVariableFEBase & vector_variable, + MooseVariableFEBase & component_variable) const; + + bool isPushTransfer() const; + bool isPullTransfer() const; + bool isSupportedTransfer() const; + + /** + * Helper methods. + */ + MooseVariableFEBase & + getVariable(FEProblemBase & problem, + std::string & variable_name, + Moose::VarFieldType type = Moose::VarFieldType::VAR_FIELD_ANY) const; + + /** + * Returns components of the enum class. This allows iterating over the components. + */ + std::array getAllComponents() const; + + /** + * Creates the name of the variable corresponding to a component of a vector variable. + */ + inline std::string buildVectorComponentName(const std::string & vector_name, + VectorComponent component) const; + + /** + * Creates the type name of the transfer suitable for vector variables. + */ + inline std::string buildVectorTransferTypeName(const std::string & transfer_type) const; + + /** + * Returns family/order of variable. + */ + inline libMesh::FEFamily getVariableFamily(const MooseVariableFEBase & variable) const; + inline libMesh::Order getVariableOrder(const MooseVariableFEBase & variable) const; + +private: + // Names of all source vector variables. + std::set _vector_source_names; + + // New variable names. + std::vector _from_var_names_converted; + std::vector _to_var_names_converted; + + // New source types (if present). + std::vector _source_type_converted; + + bool _has_converted_variables; + bool _has_converted_source_types; +}; + +inline std::string +AddVectorTransferAction::buildVectorComponentName(const std::string & vector_name, + VectorComponent component) const +{ + return (vector_name + buildVectorComponentExtension(component)); +} + +inline std::string +AddVectorTransferAction::buildVectorTransferTypeName(const std::string & transfer_type) const +{ + return (transfer_type + "Vector"); +} + +inline std::array +AddVectorTransferAction::getAllComponents() const +{ + + std::array components = { + VectorComponent::X, VectorComponent::Y, VectorComponent::Z}; + + return components; +} + +inline libMesh::FEFamily +AddVectorTransferAction::getVariableFamily(const MooseVariableFEBase & variable) const +{ + return variable.feType().family; +} + +inline libMesh::Order +AddVectorTransferAction::getVariableOrder(const MooseVariableFEBase & variable) const +{ + return variable.order(); +} \ No newline at end of file diff --git a/include/auxkernels/VectorVariableFromComponentsAux.h b/include/auxkernels/VectorVariableFromComponentsAux.h index 5da2a6da..fdb77c1b 100644 --- a/include/auxkernels/VectorVariableFromComponentsAux.h +++ b/include/auxkernels/VectorVariableFromComponentsAux.h @@ -12,18 +12,13 @@ class VectorVariableFromComponentsAux : public WritableVectorAuxKernel VectorVariableFromComponentsAux(const InputParameters & parameters); -protected: - virtual void compute() override; - - MooseVariable & _component_x; - MooseVariable & _component_y; - MooseVariable & _component_z; + void compute() override; - const Order & _vector_order; - const FEFamily _vector_family; - -private: - void checkVectorVariable() const; - void checkVectorComponents() const; - void checkVectorComponent(const MooseVariable & component_variable) const; +protected: + /** + * Non-writable references to component variables. + */ + const MooseVariable & _component_x; + const MooseVariable & _component_y; + const MooseVariable & _component_z; }; diff --git a/include/auxkernels/VectorVariableToComponentsAux.h b/include/auxkernels/VectorVariableToComponentsAux.h index 5f98c59c..6c9cf57f 100644 --- a/include/auxkernels/VectorVariableToComponentsAux.h +++ b/include/auxkernels/VectorVariableToComponentsAux.h @@ -1,17 +1,24 @@ #pragma once -#include "VectorVariableFromComponentsAux.h" +#include "WritableVectorAuxKernel.h" /** * Set 3 standard variables from a vector variable. */ -class VectorVariableToComponentsAux : public VectorVariableFromComponentsAux +class VectorVariableToComponentsAux : public WritableVectorAuxKernel { public: static InputParameters validParams(); VectorVariableToComponentsAux(const InputParameters & parameters); + void compute() override; + protected: - virtual void compute() override; + /** + * Writable references to component variables. + */ + MooseVariable & _component_x; + MooseVariable & _component_y; + MooseVariable & _component_z; }; diff --git a/include/auxkernels/WritableVectorAuxKernel.h b/include/auxkernels/WritableVectorAuxKernel.h index ba77bc5e..72033592 100644 --- a/include/auxkernels/WritableVectorAuxKernel.h +++ b/include/auxkernels/WritableVectorAuxKernel.h @@ -13,12 +13,41 @@ class WritableVectorAuxKernel : public VectorAuxKernel public: static InputParameters validParams() { return VectorAuxKernel::validParams(); } - WritableVectorAuxKernel(const InputParameters & parameters) : VectorAuxKernel(parameters) {} + WritableVectorAuxKernel(const InputParameters & parameters); protected: // NB: not used. virtual RealVectorValue computeValue() override { mooseError("Unused"); } - // NB: see "writableVariable" method defined in "Coupleable.h". - MooseVariable & writableVariable(const std::string & var_name, unsigned int comp = 0); + const Order _vector_order; + const FEFamily _vector_family; + + /** + * This method is based on "writableVariable" defined in "Coupleable.h". Due to a limitation of + * MOOSE it is not possible to call this from a VectorAuxKernel class. + * + * NB: only a single AuxKernel can obtain a writable reference to a variable. This becomes a + * problem for transfers where we need to push and pull the same variable using the auxkernels + * inheriting from this class. + * + * For VectorVariableToComponentsAux, we require writable references. + */ + MooseVariable & getWritableCoupledVariable(const std::string & var_name, unsigned int comp = 0); + + /** + * Returns a const-qualified reference to the coupled variable. This is required for + * VectorVariableFromComponentsAux since we don't need to update the values of the component + * variables. + */ + const MooseVariable & getNonWritableCoupledVariable(const std::string & var_name, + unsigned int comp = 0); + + /** + * Check component variables are consistent with the vector variable. + */ + void checkVectorVariable() const; + void checkVectorComponent(const MooseVariable & component_variable) const; + void checkVectorComponents(const MooseVariable & component_x, + const MooseVariable & component_y, + const MooseVariable & component_z) const; }; diff --git a/include/base/ApolloVectorTransferFlags.h b/include/base/ApolloVectorTransferFlags.h new file mode 100644 index 00000000..d55be0d6 --- /dev/null +++ b/include/base/ApolloVectorTransferFlags.h @@ -0,0 +1,9 @@ +#pragma once + +#include "Moose.h" + +namespace ApolloApp +{ +extern const ExecFlagType EXEC_PREPARE_VECTOR_FOR_TRANSFER; +extern const ExecFlagType EXEC_RECOVER_VECTOR_POST_TRANSFER; +}; \ No newline at end of file diff --git a/include/transfers/MultiAppGeneralVectorTransfer.h b/include/transfers/MultiAppGeneralVectorTransfer.h new file mode 100644 index 00000000..dd82f027 --- /dev/null +++ b/include/transfers/MultiAppGeneralVectorTransfer.h @@ -0,0 +1,40 @@ +#pragma once + +/** + * Include headers of all MultiApp Transfers we would like. + */ +#include "AuxKernel.h" +#include "AuxiliarySystem.h" + +// Forwards declaration. +template +class MultiAppVectorTransferTemplate; + +class MultiAppGeneralFieldNearestLocationTransfer; +class MultiAppCopyTransfer; // NB: CopyTransfer can handle vector variables. + +/** + * Create all transfer types using template here. Don't forget to register them in .C file. + */ +typedef MultiAppVectorTransferTemplate + MultiAppGeneralFieldNearestLocationTransferVector; +typedef MultiAppVectorTransferTemplate MultiAppCopyTransferVector; + +template +class MultiAppVectorTransferTemplate : public MultiAppTransferClassType +{ +public: + static InputParameters validParams(); + + MultiAppVectorTransferTemplate(const InputParameters & parameters); + + void execute() override final; + +protected: + inline AuxiliarySystem & getFromAuxSystem() const { return _from_aux_system; } + inline AuxiliarySystem & getToAuxSystem() const { return _to_aux_system; } + +private: + AuxiliarySystem & _from_aux_system; + AuxiliarySystem & _to_aux_system; +}; \ No newline at end of file diff --git a/src/actions/AddVectorTransferAction.C b/src/actions/AddVectorTransferAction.C new file mode 100644 index 00000000..555cbf14 --- /dev/null +++ b/src/actions/AddVectorTransferAction.C @@ -0,0 +1,541 @@ +#include "AddVectorTransferAction.h" +#include "AuxiliarySystem.h" +#include "AuxKernel.h" +#include "FEProblem.h" + +#include "ApolloVectorTransferFlags.h" + +registerMooseAction("MooseApp", AddVectorTransferAction, "add_vector_transfer"); + +InputParameters +AddVectorTransferAction::validParams() +{ + InputParameters params = MooseObjectAction::validParams(); + params.addClassDescription("Add a Transfer object that can handle vectors to the simulation."); + return params; +} + +AddVectorTransferAction::AddVectorTransferAction(const InputParameters & params) + : MooseObjectAction(params) +{ +} + +void +AddVectorTransferAction::act() +{ + // Modify the input parameters. + if (hasSourceTypesParameter()) + { + getObjectParams().set>("source_type") = getSourceTypeConverted(); + } + + // NB: set at end in case we need to call getTo(From)VarNames(). + getObjectParams().set>("source_variable") = getFromVarNamesConverted(); + getObjectParams().set>("variable") = getToVarNamesConverted(); + + // Add required pointers to the auxiliary systems of both the fromProblem and the toProblem. + getObjectParams().set("from_aux_system") = &getFromAuxSystem(); + getObjectParams().set("to_aux_system") = &getToAuxSystem(); + + // Create the transfer using the wrapped transfer (which modifies the execute method). + _problem->addTransfer(buildVectorTransferTypeName(_type), _name, getObjectParams()); +} + +const std::shared_ptr +AddVectorTransferAction::getFromMultiApp() const +{ + if (getObjectParams().isParamValid("from_multi_app")) + { + return _problem->getMultiApp(getObjectParams().get("from_multi_app")); + } + + return nullptr; +} + +const std::shared_ptr +AddVectorTransferAction::getToMultiApp() const +{ + if (getObjectParams().isParamValid("to_multi_app")) + { + return _problem->getMultiApp(getObjectParams().get("to_multi_app")); + } + + return nullptr; +} + +const std::vector & +AddVectorTransferAction::getFromVarNames() const +{ + return getObjectParams().get>("source_variable"); +} + +const std::vector & +AddVectorTransferAction::getToVarNames() const +{ + return getObjectParams().get>("variable"); +} + +const std::vector & +AddVectorTransferAction::getFromVarNamesConverted() +{ + if (!_has_converted_variables) + { + convertAllVariables(); + } + + return _from_var_names_converted; +} + +const std::vector & +AddVectorTransferAction::getToVarNamesConverted() +{ + if (!_has_converted_variables) + { + convertAllVariables(); + } + + return _to_var_names_converted; +} + +std::set & +AddVectorTransferAction::getVectorSourceNames() +{ + if (!_has_converted_variables) + { + convertAllVariables(); // Must be run first! + } + + return _vector_source_names; +} + +bool +AddVectorTransferAction::isSourceVectorVariable(const std::string & var_name) +{ + return getVectorSourceNames().count(var_name); +} + +FEProblemBase & +AddVectorTransferAction::getToProblem() const +{ + if (isPullTransfer()) // subapp (FROM) --> master. + { + auto & subapp = getFromMultiApp(); + + return subapp->problemBase(); + } + else if (isPushTransfer()) // master (FROM) --> subapp + { + auto & subapp = getToMultiApp(); + + for (unsigned int iapp = 0; iapp < subapp->numGlobalApps(); iapp++) + { + if (subapp->hasLocalApp(iapp)) + { + return subapp->appProblemBase(iapp); + } + } + } + + mooseError("The FEProblemBase could not be located."); +} + +FEProblemBase & +AddVectorTransferAction::getFromProblem() const +{ + if (isPullTransfer()) // subapp --> master (TO). + { + auto & subapp = getFromMultiApp(); + + for (unsigned int iapp = 0; iapp < subapp->numGlobalApps(); iapp++) + { + if (subapp->hasLocalApp(iapp)) + { + return subapp->appProblemBase(iapp); + } + } + } + else if (isPushTransfer()) // master --> subapp (TO). + { + auto & subapp = getToMultiApp(); + + return subapp->problemBase(); + } + + mooseError("The FEProblemBase could not be located."); +} + +AuxiliarySystem & +AddVectorTransferAction::getFromAuxSystem() const +{ + return getFromProblem().getAuxiliarySystem(); +} + +AuxiliarySystem & +AddVectorTransferAction::getToAuxSystem() const +{ + return getToProblem().getAuxiliarySystem(); +} + +void +AddVectorTransferAction::addVectorAuxKernel(FEProblemBase & problem, + std::string & vector_name, + VectorAuxKernelType type) +{ + std::string aux_kernel_name; + std::string unique_aux_kernel_name; + + ExecFlagType exec_flag; + + switch (type) + { + case VectorAuxKernelType::RECOVER_VECTOR_POST_TRANSFER: + aux_kernel_name = "VectorVariableFromComponentsAux"; + unique_aux_kernel_name = vector_name + "_from_components"; + exec_flag = ApolloApp::EXEC_RECOVER_VECTOR_POST_TRANSFER; + break; + case VectorAuxKernelType::PREPARE_VECTOR_FOR_TRANSFER: + aux_kernel_name = "VectorVariableToComponentsAux"; + unique_aux_kernel_name = vector_name + "_to_components"; + exec_flag = ApolloApp::EXEC_PREPARE_VECTOR_FOR_TRANSFER; + break; + default: + mooseError("Unsupported vector auxkernel type."); + break; + } + + auto params = _factory.getValidParams(aux_kernel_name); + + params.set("variable") = vector_name; + params.set>("component_x") = { + buildVectorComponentName(vector_name, VectorComponent::X)}; + params.set>("component_y") = { + buildVectorComponentName(vector_name, VectorComponent::Y)}; + params.set>("component_z") = { + buildVectorComponentName(vector_name, VectorComponent::Z)}; + + // Set execution flag. This will prevent the auxkernels being called elsewhere. The auxkernels + // will be triggered in the template transfer class which wraps around the existing transfer + // class. + params.set("execute_on") = exec_flag; + + problem.addAuxKernel(aux_kernel_name, unique_aux_kernel_name, params); +} + +void +AddVectorTransferAction::convertAllVariables() +{ + // Check if this method has been called before. + if (_has_converted_variables) + { + return; + } + + _has_converted_variables = true; + + // Extract the to/from variable names from the base class. + std::vector from_var_names = getFromVarNames(); + std::vector to_var_names = getToVarNames(); + + // Locate any vector variables. For these variables, create the corrresponding standard + // variables for their components. Return updated vector strings which contain the new + // standard variables but exclude the vector variables. + FEProblemBase & from_problem = getFromProblem(); + FEProblemBase & to_problem = getToProblem(); + + _to_var_names_converted = convertVariables(to_problem, to_var_names); + _from_var_names_converted = convertVariables(from_problem, from_var_names); +} + +bool +AddVectorTransferAction::hasSourceTypesParameter() const +{ + return getObjectParams().isParamValid("source_type"); +} + +std::vector & +AddVectorTransferAction::getSourceTypeConverted() +{ + if (!hasSourceTypesParameter()) + { + mooseError("No 'source_type' parameter exists for this transfer."); + } + + if (!_has_converted_source_types) + { + convertSourceTypes(); + } + + return _source_type_converted; +} + +void +AddVectorTransferAction::convertSourceTypes() +{ + // Safety check. Ensure that the 'source_type' parameter exists. + if (!hasSourceTypesParameter()) + { + mooseError("No 'source_type' parameter exists for this transfer."); + } + + // Has method been called before? + if (_has_converted_source_types) + { + return; + } + + _has_converted_source_types = true; + + // 1. Get source types: + const std::vector & current_source_types = + getObjectParams().get>("source_type"); + + // 2. If there are no vector source variables, then set to the current source type. + // NB: ensure we call accessor. + if (getVectorSourceNames().empty()) + { + _source_type_converted = current_source_types; + return; + } + + // 3. Iterate over original variable names. + std::vector new_source_types; + + int isource = 0; + for (auto & var_name : getFromVarNames()) + { + auto source_type = current_source_types[isource++]; + + _source_type_converted.push_back(source_type); + + if (isSourceVectorVariable(var_name)) + { + _source_type_converted.push_back(source_type); // y component + _source_type_converted.push_back(source_type); // z component + } + } + + _source_type_converted.shrink_to_fit(); +} + +template +std::vector +AddVectorTransferAction::convertVariables(FEProblemBase & problem, + std::vector & input_variable_names) +{ + std::vector output_variable_names; + + for (auto & variable_name : input_variable_names) + { + MooseVariableFEBase & variable = getVariable(problem, variable_name); + + if (!isSupportedVectorVariable(variable)) + { + // Nothing to do here. Pushback variable. + output_variable_names.push_back(variable_name); + continue; + } + + // Create corresponding standard variables for components. Add to output array. + buildVectorComponents(problem, variable); + + auto component_x_name = buildVectorComponentName(variable_name, VectorComponent::X); + auto component_y_name = buildVectorComponentName(variable_name, VectorComponent::Y); + auto component_z_name = buildVectorComponentName(variable_name, VectorComponent::Z); + + output_variable_names.push_back(component_x_name); + output_variable_names.push_back(component_y_name); + output_variable_names.push_back(component_z_name); + + /** + * Case 1: "from problem" --> Update vector components. These will be transferred. + * Case 2: "to problem" --> Received vector components. Rebuild vector from components. + */ + if (&problem == &getFromProblem()) + { + // Add vector name to set for checking later. + _vector_source_names.insert(variable_name); + + addVectorAuxKernel(problem, variable_name, VectorAuxKernelType::PREPARE_VECTOR_FOR_TRANSFER); + } + else if (&problem == &getToProblem()) + { + addVectorAuxKernel(problem, variable_name, VectorAuxKernelType::RECOVER_VECTOR_POST_TRANSFER); + } + else + { + mooseError("Unknown FEProblemBase."); + } + } + + output_variable_names.shrink_to_fit(); + + return output_variable_names; +} + +void +AddVectorTransferAction::buildVectorComponents(FEProblemBase & problem, + MooseVariableFEBase & vector_variable) +{ + // Safety check. + if (!isSupportedVectorVariable(vector_variable)) + { + mooseError("The variable '", vector_variable.name(), "' is not a supported vector variable."); + } + + // Iterate over all components. + for (auto component : getAllComponents()) + { + // Create vector variable component name. + std::string component_name = buildVectorComponentName(vector_variable.name(), component); + + // Does the component exist? If so, is it of the correct type. If it is not compatible then we + // have a problem. + bool component_already_exists = problem.hasVariable(component_name); + + if (component_already_exists) + { + // Component already exists! Check that it is compatible with the vector variable and emit a + // warning that the variable already exists so we don't blindly overwrite the user's values. + MooseVariableFEBase & component_variable = getVariable(problem, component_name); + + if (areCompatibleVariables(vector_variable, component_variable)) + { + mooseWarning("Found existing variable '", + component_name, + "' which is compatible with vector '", + vector_variable.name(), + "'."); + } + else + { + mooseError("Found existing variable '", + component_name, + "' which is incompatible with vector '", + vector_variable.name(), + "'."); + } + } + else + { + // Attempt to add the auxiliary variable. + auto component_parameters = buildInputParametersForComponents(vector_variable); + + problem.addAuxVariable("MooseVariable", component_name, component_parameters); + } + } +} + +std::string +AddVectorTransferAction::buildVectorComponentExtension(VectorComponent component) const +{ + std::string extension; + + switch (component) + { + case VectorComponent::X: + extension = "_x"; + break; + case VectorComponent::Y: + extension = "_y"; + break; + case VectorComponent::Z: + extension = "_z"; + break; + default: + mooseError("An unsupported vector component was detected."); + break; + } + + return extension; +} + +InputParameters +AddVectorTransferAction::buildInputParametersForComponents( + MooseVariableFEBase & vector_variable) const +{ + if (!isSupportedVectorVariable(vector_variable)) + { + mooseError("'", vector_variable.name(), "' is not a supported vector variable."); + } + + const auto vector_order = getVariableOrder(vector_variable); + const auto vector_family = getVariableFamily(vector_variable); + + InputParameters params = _factory.getValidParams("MooseVariable"); + + // Should be same order as vector variable but obviously of a different family. + params.set("order") = Utility::enum_to_string(OrderWrapper{vector_order}); + params.set("family") = (vector_family == LAGRANGE_VEC ? "LAGRANGE" : "MONOMIAL"); + + return params; +} + +bool +AddVectorTransferAction::isSupportedVectorVariable(MooseVariableFEBase & variable) const +{ + const auto family = getVariableFamily(variable); + const auto order = getVariableOrder(variable); + + return (family == LAGRANGE_VEC || (family == MONOMIAL_VEC && order == CONSTANT)); +} + +bool +AddVectorTransferAction::isSupportedComponentVariable(MooseVariableFEBase & variable) const +{ + const auto family = getVariableFamily(variable); + const auto order = getVariableOrder(variable); + + return (family == LAGRANGE || (family == MONOMIAL && order == CONSTANT)); +} + +bool +AddVectorTransferAction::areCompatibleVariables(MooseVariableFEBase & vector_variable, + MooseVariableFEBase & component_variable) const +{ + bool supported_vector = isSupportedVectorVariable(vector_variable); + bool supported_component = isSupportedComponentVariable(component_variable); + + if (!supported_vector || !supported_component) + { + return false; + } + + const auto component_family = component_variable.feType().family; + const auto component_order = component_variable.order(); + + const auto vector_family = vector_variable.feType().family; + const auto vector_order = vector_variable.order(); + + bool compatibleFamilies = (component_family == LAGRANGE && vector_family == LAGRANGE_VEC) || + (component_family == MONOMIAL && vector_family == MONOMIAL_VEC); + + bool compatibleOrders = (component_order == vector_order); + + return (compatibleFamilies && compatibleOrders); +} + +bool +AddVectorTransferAction::isPushTransfer() const +{ + return getObjectParams().isParamValid("to_multi_app"); +} + +bool +AddVectorTransferAction::isPullTransfer() const +{ + return getObjectParams().isParamValid("from_multi_app"); +} + +bool +AddVectorTransferAction::isSupportedTransfer() const +{ + return (isPushTransfer() || isPullTransfer()); +} + +MooseVariableFEBase & +AddVectorTransferAction::getVariable(FEProblemBase & problem, + std::string & variable_name, + Moose::VarFieldType type) const +{ + return problem.getVariable(0, variable_name, Moose::VarKindType::VAR_ANY, type); +} diff --git a/src/actions/gold/pull_lagrange_vector_copy_transfer_master_out.csv b/src/actions/gold/pull_lagrange_vector_copy_transfer_master_out.csv new file mode 100644 index 00000000..f260eb1a --- /dev/null +++ b/src/actions/gold/pull_lagrange_vector_copy_transfer_master_out.csv @@ -0,0 +1,3 @@ +time,vector_l2_difference +0,0 +1,0 diff --git a/src/actions/gold/pull_lagrange_vector_nearest_location_transfer_master_out.csv b/src/actions/gold/pull_lagrange_vector_nearest_location_transfer_master_out.csv new file mode 100644 index 00000000..f260eb1a --- /dev/null +++ b/src/actions/gold/pull_lagrange_vector_nearest_location_transfer_master_out.csv @@ -0,0 +1,3 @@ +time,vector_l2_difference +0,0 +1,0 diff --git a/src/actions/gold/pull_monomial_vector_copy_transfer_master_out.csv b/src/actions/gold/pull_monomial_vector_copy_transfer_master_out.csv new file mode 100644 index 00000000..f260eb1a --- /dev/null +++ b/src/actions/gold/pull_monomial_vector_copy_transfer_master_out.csv @@ -0,0 +1,3 @@ +time,vector_l2_difference +0,0 +1,0 diff --git a/src/actions/gold/push_lagrange_vector_copy_transfer_master_out_sub_app0.csv b/src/actions/gold/push_lagrange_vector_copy_transfer_master_out_sub_app0.csv new file mode 100644 index 00000000..f260eb1a --- /dev/null +++ b/src/actions/gold/push_lagrange_vector_copy_transfer_master_out_sub_app0.csv @@ -0,0 +1,3 @@ +time,vector_l2_difference +0,0 +1,0 diff --git a/src/actions/gold/push_monomial_vector_copy_transfer_master_out_sub_app0.csv b/src/actions/gold/push_monomial_vector_copy_transfer_master_out_sub_app0.csv new file mode 100644 index 00000000..f260eb1a --- /dev/null +++ b/src/actions/gold/push_monomial_vector_copy_transfer_master_out_sub_app0.csv @@ -0,0 +1,3 @@ +time,vector_l2_difference +0,0 +1,0 diff --git a/src/actions/gold/push_pull_lagrange_vector_copy_transfer_master_out.csv b/src/actions/gold/push_pull_lagrange_vector_copy_transfer_master_out.csv new file mode 100644 index 00000000..f260eb1a --- /dev/null +++ b/src/actions/gold/push_pull_lagrange_vector_copy_transfer_master_out.csv @@ -0,0 +1,3 @@ +time,vector_l2_difference +0,0 +1,0 diff --git a/src/actions/gold/push_pull_monomial_vector_copy_transfer_master_out.csv b/src/actions/gold/push_pull_monomial_vector_copy_transfer_master_out.csv new file mode 100644 index 00000000..f260eb1a --- /dev/null +++ b/src/actions/gold/push_pull_monomial_vector_copy_transfer_master_out.csv @@ -0,0 +1,3 @@ +time,vector_l2_difference +0,0 +1,0 diff --git a/src/auxkernels/VectorVariableFromComponentsAux.C b/src/auxkernels/VectorVariableFromComponentsAux.C index 05febe92..ce93c05f 100644 --- a/src/auxkernels/VectorVariableFromComponentsAux.C +++ b/src/auxkernels/VectorVariableFromComponentsAux.C @@ -1,4 +1,5 @@ #include "VectorVariableFromComponentsAux.h" +#include "ApolloVectorTransferFlags.h" registerMooseObject("MooseApp", VectorVariableFromComponentsAux); @@ -7,6 +8,9 @@ VectorVariableFromComponentsAux::validParams() { InputParameters params = WritableVectorAuxKernel::validParams(); + ExecFlagEnum & exec = params.set("execute_on"); + exec.addAvailableFlags(ApolloApp::EXEC_RECOVER_VECTOR_POST_TRANSFER); + params.addRequiredCoupledVar("component_x", "The x-component of the vector variable."); params.addRequiredCoupledVar("component_y", "The y-component of the vector variable."); params.addRequiredCoupledVar("component_z", "The z-component of the vector variable."); @@ -18,63 +22,21 @@ VectorVariableFromComponentsAux::validParams() VectorVariableFromComponentsAux::VectorVariableFromComponentsAux(const InputParameters & parameters) : WritableVectorAuxKernel(parameters), - _component_x(writableVariable("component_x")), - _component_y(writableVariable("component_y")), - _component_z(writableVariable("component_z")), - _vector_order(_var.order()), - _vector_family(_var.feType().family) + _component_x(getNonWritableCoupledVariable("component_x")), + _component_y(getNonWritableCoupledVariable("component_y")), + _component_z(getNonWritableCoupledVariable("component_z")) { - checkVectorVariable(); - checkVectorComponents(); + checkVectorComponents(_component_x, _component_y, _component_z); } void VectorVariableFromComponentsAux::compute() { - _variable->setDofValue(_component_x.dofValues()[0], 0); - _variable->setDofValue(_component_y.dofValues()[0], 1); - _variable->setDofValue(_component_z.dofValues()[0], 2); -} - -void -VectorVariableFromComponentsAux::checkVectorVariable() const -{ - if (_vector_family != LAGRANGE_VEC && _vector_family != MONOMIAL_VEC) - { - mooseError("Only Lagrange and Monomial vectors are supported."); - } - - if (_vector_family == MONOMIAL_VEC && _vector_order != CONSTANT) - { - mooseError("Monomial vectors are supported only for constant order."); - } -} + Real value_x = _component_x.dofValues()[0]; + Real value_y = _component_y.dofValues()[0]; + Real value_z = _component_z.dofValues()[0]; -void -VectorVariableFromComponentsAux::checkVectorComponents() const -{ - checkVectorComponent(_component_x); - checkVectorComponent(_component_y); - checkVectorComponent(_component_z); + _variable->setDofValue(value_x, 0); + _variable->setDofValue(value_y, 1); + _variable->setDofValue(value_z, 2); } - -void -VectorVariableFromComponentsAux::checkVectorComponent( - const MooseVariable & component_variable) const -{ - auto component_order = component_variable.order(); - auto component_family = component_variable.feType().family; - - bool correct_family = ((component_family == LAGRANGE && _vector_family == LAGRANGE_VEC) || - (component_family == MONOMIAL && _vector_family == MONOMIAL_VEC)); - if (!correct_family) - { - mooseError("Component '", component_variable.name(), "' is of the incorrect family."); - } - - bool correct_order = (component_order == _vector_order); - if (!correct_order) - { - mooseError("Component '", component_variable.name(), "' has a different order to the vector."); - } -} \ No newline at end of file diff --git a/src/auxkernels/VectorVariableToComponentsAux.C b/src/auxkernels/VectorVariableToComponentsAux.C index 5b09fd86..0450a5a3 100644 --- a/src/auxkernels/VectorVariableToComponentsAux.C +++ b/src/auxkernels/VectorVariableToComponentsAux.C @@ -1,11 +1,19 @@ #include "VectorVariableToComponentsAux.h" +#include "ApolloVectorTransferFlags.h" registerMooseObject("MooseApp", VectorVariableToComponentsAux); InputParameters VectorVariableToComponentsAux::validParams() { - InputParameters params = VectorVariableFromComponentsAux::validParams(); + InputParameters params = WritableVectorAuxKernel::validParams(); + + ExecFlagEnum & exec = params.set("execute_on"); + exec.addAvailableFlags(ApolloApp::EXEC_PREPARE_VECTOR_FOR_TRANSFER); + + params.addRequiredCoupledVar("component_x", "The x-component of the vector variable."); + params.addRequiredCoupledVar("component_y", "The y-component of the vector variable."); + params.addRequiredCoupledVar("component_z", "The z-component of the vector variable."); params.addClassDescription("Extract the components of a vector."); @@ -13,8 +21,12 @@ VectorVariableToComponentsAux::validParams() } VectorVariableToComponentsAux::VectorVariableToComponentsAux(const InputParameters & parameters) - : VectorVariableFromComponentsAux(parameters) + : WritableVectorAuxKernel(parameters), + _component_x(getWritableCoupledVariable("component_x")), + _component_y(getWritableCoupledVariable("component_y")), + _component_z(getWritableCoupledVariable("component_z")) { + checkVectorComponents(_component_x, _component_y, _component_z); } void diff --git a/src/auxkernels/WritableVectorAuxKernel.C b/src/auxkernels/WritableVectorAuxKernel.C index 8fafacba..3147f74c 100644 --- a/src/auxkernels/WritableVectorAuxKernel.C +++ b/src/auxkernels/WritableVectorAuxKernel.C @@ -2,13 +2,76 @@ registerMooseObject("MooseApp", WritableVectorAuxKernel); +WritableVectorAuxKernel::WritableVectorAuxKernel(const InputParameters & parameters) + : VectorAuxKernel(parameters), _vector_order(_var.order()), _vector_family(_var.feType().family) +{ + checkVectorVariable(); +} + +const MooseVariable & +WritableVectorAuxKernel::getNonWritableCoupledVariable(const std::string & var_name, + unsigned int comp) +{ + const MooseVariable * var = getVar(var_name, comp); + if (!var) + { + mooseError("Could not find coupled variable with name '", var_name, "'."); + } + + return *var; +} + MooseVariable & -WritableVectorAuxKernel::writableVariable(const std::string & var_name, unsigned int comp) +WritableVectorAuxKernel::getWritableCoupledVariable(const std::string & var_name, unsigned int comp) { - auto * var = dynamic_cast(getVar(var_name, comp)); + auto * var = getVar(var_name, comp); // Make sure only one object can access a variable. checkWritableVar(var); return *var; } + +void +WritableVectorAuxKernel::checkVectorVariable() const +{ + if (_vector_family != LAGRANGE_VEC && _vector_family != MONOMIAL_VEC) + { + mooseError("Only Lagrange and Monomial vectors are supported."); + } + + if (_vector_family == MONOMIAL_VEC && _vector_order != CONSTANT) + { + mooseError("Monomial vectors are supported only for constant order."); + } +} + +void +WritableVectorAuxKernel::checkVectorComponent(const MooseVariable & component_variable) const +{ + auto component_order = component_variable.order(); + auto component_family = component_variable.feType().family; + + bool correct_family = ((component_family == LAGRANGE && _vector_family == LAGRANGE_VEC) || + (component_family == MONOMIAL && _vector_family == MONOMIAL_VEC)); + if (!correct_family) + { + mooseError("Component '", component_variable.name(), "' is of the incorrect family."); + } + + bool correct_order = (component_order == _vector_order); + if (!correct_order) + { + mooseError("Component '", component_variable.name(), "' has a different order to the vector."); + } +} + +void +WritableVectorAuxKernel::checkVectorComponents(const MooseVariable & component_x, + const MooseVariable & component_y, + const MooseVariable & component_z) const +{ + checkVectorComponent(component_x); + checkVectorComponent(component_y); + checkVectorComponent(component_z); +} diff --git a/src/base/ApolloApp.C b/src/base/ApolloApp.C index 11a47314..794c1ece 100644 --- a/src/base/ApolloApp.C +++ b/src/base/ApolloApp.C @@ -3,6 +3,9 @@ #include "AppFactory.h" #include "ModulesApp.h" #include "MooseSyntax.h" +#include "Transfer.h" +#include "MultiAppTransfer.h" +#include "MultiAppCopyTransfer.h" InputParameters ApolloApp::validParams() @@ -63,6 +66,13 @@ associateSyntaxInner(Syntax & syntax, ActionFactory & /*action_factory*/) addTaskDependency("add_elemental_field_variable", "add_mfem_fespaces"); addTaskDependency("add_kernel", "add_mfem_fespaces"); addTaskDependency("add_mfem_sources", "add_mfem_fespaces"); + + // Custom vector transfer + registerSyntaxTask("AddVectorTransferAction", "VectorTransfers/*", "add_vector_transfer"); + registerMooseObjectTask("add_vector_transfer", Transfer, false); + appendMooseObjectTask("add_vector_transfer", MultiAppTransfer); + appendMooseObjectTask("add_vector_transfer", MultiAppCopyTransfer); + addTaskDependency("add_transfer", "add_vector_transfer"); } void diff --git a/src/base/ApolloVectorTransferFlags.C b/src/base/ApolloVectorTransferFlags.C new file mode 100644 index 00000000..480f5ded --- /dev/null +++ b/src/base/ApolloVectorTransferFlags.C @@ -0,0 +1,8 @@ +#include "ApolloVectorTransferFlags.h" + +#include "ExecFlagRegistry.h" + +const ExecFlagType ApolloApp::EXEC_PREPARE_VECTOR_FOR_TRANSFER = + registerExecFlag("PREPARE_VECTOR_FOR_TRANSFER"); +const ExecFlagType ApolloApp::EXEC_RECOVER_VECTOR_POST_TRANSFER = + registerExecFlag("RECOVER_VECTOR_POST_TRANSFER"); \ No newline at end of file diff --git a/src/postprocessors/ElementVectorL2Difference.C b/src/postprocessors/ElementVectorL2Difference.C index a8a58b29..066d09a8 100644 --- a/src/postprocessors/ElementVectorL2Difference.C +++ b/src/postprocessors/ElementVectorL2Difference.C @@ -47,13 +47,15 @@ ElementVectorL2Difference::computeQpIntegral() return difference_vector.norm_sq(); // dot product of difference vector. } -void ElementVectorL2Difference::checkVectorVariables() const +void +ElementVectorL2Difference::checkVectorVariables() const { auto & coupled_vector_variables = getCoupledVectorMooseVars(); if (coupled_vector_variables.size() != 2) { - mooseError("There are ", coupled_vector_variables.size(), " coupled vector variables. Expected 2."); + mooseError( + "There are ", coupled_vector_variables.size(), " coupled vector variables. Expected 2."); } auto first = coupled_vector_variables[0]; diff --git a/src/transfers/MultiAppGeneralVectorTransfer.C b/src/transfers/MultiAppGeneralVectorTransfer.C new file mode 100644 index 00000000..acc3469c --- /dev/null +++ b/src/transfers/MultiAppGeneralVectorTransfer.C @@ -0,0 +1,54 @@ +#include "MultiAppGeneralVectorTransfer.h" +#include "AuxiliarySystem.h" + +#include "MultiAppGeneralFieldNearestLocationTransfer.h" +#include "MultiAppCopyTransfer.h" + +#include "ApolloVectorTransferFlags.h" + +/** + * Register all Moose objects that we would like here. + */ +registerMooseObject("MooseApp", MultiAppGeneralFieldNearestLocationTransferVector); +registerMooseObject("MooseApp", MultiAppCopyTransferVector); + +template +InputParameters +MultiAppVectorTransferTemplate::validParams() +{ + InputParameters params = MultiAppTransferClassType::validParams(); + + params.addRequiredParam( + "from_aux_system", + "The auxiliary system for the problem we are transferrring variables from."); + params.addRequiredParam( + "to_aux_system", "The auxiliary system for the problem we are transferring variables to."); + + // Combine class description for original class with template class. + params.addClassDescription(params.getClassDescription() + " (allows vector variables)."); + + return params; +} + +template +MultiAppVectorTransferTemplate::MultiAppVectorTransferTemplate( + const InputParameters & parameters) + : MultiAppTransferClassType(parameters), + _from_aux_system(*parameters.get("from_aux_system")), + _to_aux_system(*parameters.get("to_aux_system")) +{ +} + +template +void +MultiAppVectorTransferTemplate::execute() +{ + // Update all components of the vector variables. + getFromAuxSystem().compute(ApolloApp::EXEC_PREPARE_VECTOR_FOR_TRANSFER); + + // Call execute on inherited class which will work on component variables. + MultiAppTransferClassType::execute(); + + // Rebuild all vector variables from their components. + getToAuxSystem().compute(ApolloApp::EXEC_RECOVER_VECTOR_POST_TRANSFER); +} diff --git a/test/tests/unit/actions/gold/pull_lagrange_vector_nearest_location_transfer_master_out.csv b/test/tests/unit/actions/gold/pull_lagrange_vector_nearest_location_transfer_master_out.csv new file mode 100644 index 00000000..f260eb1a --- /dev/null +++ b/test/tests/unit/actions/gold/pull_lagrange_vector_nearest_location_transfer_master_out.csv @@ -0,0 +1,3 @@ +time,vector_l2_difference +0,0 +1,0 diff --git a/test/tests/unit/actions/gold/pull_monomial_vector_nearest_location_transfer_master_out.csv b/test/tests/unit/actions/gold/pull_monomial_vector_nearest_location_transfer_master_out.csv new file mode 100644 index 00000000..f260eb1a --- /dev/null +++ b/test/tests/unit/actions/gold/pull_monomial_vector_nearest_location_transfer_master_out.csv @@ -0,0 +1,3 @@ +time,vector_l2_difference +0,0 +1,0 diff --git a/test/tests/unit/actions/gold/push_lagrange_vector_nearest_location_transfer_master_out_sub_app0.csv b/test/tests/unit/actions/gold/push_lagrange_vector_nearest_location_transfer_master_out_sub_app0.csv new file mode 100644 index 00000000..f260eb1a --- /dev/null +++ b/test/tests/unit/actions/gold/push_lagrange_vector_nearest_location_transfer_master_out_sub_app0.csv @@ -0,0 +1,3 @@ +time,vector_l2_difference +0,0 +1,0 diff --git a/test/tests/unit/actions/gold/push_monomial_vector_nearest_location_transfer_master_out_sub_app0.csv b/test/tests/unit/actions/gold/push_monomial_vector_nearest_location_transfer_master_out_sub_app0.csv new file mode 100644 index 00000000..f260eb1a --- /dev/null +++ b/test/tests/unit/actions/gold/push_monomial_vector_nearest_location_transfer_master_out_sub_app0.csv @@ -0,0 +1,3 @@ +time,vector_l2_difference +0,0 +1,0 diff --git a/test/tests/unit/actions/gold/push_pull_lagrange_vector_nearest_location_transfer_master_out.csv b/test/tests/unit/actions/gold/push_pull_lagrange_vector_nearest_location_transfer_master_out.csv new file mode 100644 index 00000000..f260eb1a --- /dev/null +++ b/test/tests/unit/actions/gold/push_pull_lagrange_vector_nearest_location_transfer_master_out.csv @@ -0,0 +1,3 @@ +time,vector_l2_difference +0,0 +1,0 diff --git a/test/tests/unit/actions/gold/push_pull_monomial_vector_nearest_location_transfer_master_out.csv b/test/tests/unit/actions/gold/push_pull_monomial_vector_nearest_location_transfer_master_out.csv new file mode 100644 index 00000000..f260eb1a --- /dev/null +++ b/test/tests/unit/actions/gold/push_pull_monomial_vector_nearest_location_transfer_master_out.csv @@ -0,0 +1,3 @@ +time,vector_l2_difference +0,0 +1,0 diff --git a/test/tests/unit/actions/pull_lagrange_vector_nearest_location_transfer_master.i b/test/tests/unit/actions/pull_lagrange_vector_nearest_location_transfer_master.i new file mode 100644 index 00000000..b1322716 --- /dev/null +++ b/test/tests/unit/actions/pull_lagrange_vector_nearest_location_transfer_master.i @@ -0,0 +1,78 @@ +[Mesh] + type = GeneratedMesh + dim = 3 + nx = 5 + ny = 5 + nz = 5 +[] + +[Problem] + solve = false +[] + +[AuxVariables] + [received_vector] + family = LAGRANGE_VEC + order = FIRST + [] + + [expected_vector] + family = LAGRANGE_VEC + order = FIRST + [] +[] + +[Functions] + [set_vector] + type = ParsedVectorFunction + expression_x = '100*x*x' + expression_y = '100*y*y' + expression_z = '100*z*z' + [] +[] + +[ICs] + [set_vector] + type = VectorFunctionIC + variable = expected_vector + function = set_vector + [] +[] + +[MultiApps] + [sub_app] + type = TransientMultiApp + positions = '0 0 0' + input_files = 'pull_lagrange_vector_nearest_location_transfer_subapp.i' + execute_on = timestep_begin + [] +[] + +[VectorTransfers] + [pull] + type = MultiAppGeneralFieldNearestLocationTransfer + from_multi_app = sub_app + source_variable = sent_vector + variable = received_vector + [] +[] + +[Postprocessors] + [vector_l2_difference] + type = ElementVectorL2Difference + variable = received_vector + other_variable = expected_vector + execute_on = timestep_end + [] +[] + +[Executioner] + type = Transient + dt = 1.0 + start_time = 0.0 + end_time = 1.0 +[] + +[Outputs] + csv = true +[] \ No newline at end of file diff --git a/test/tests/unit/actions/pull_lagrange_vector_nearest_location_transfer_subapp.i b/test/tests/unit/actions/pull_lagrange_vector_nearest_location_transfer_subapp.i new file mode 100644 index 00000000..1da2065f --- /dev/null +++ b/test/tests/unit/actions/pull_lagrange_vector_nearest_location_transfer_subapp.i @@ -0,0 +1,58 @@ +[Mesh] + type = GeneratedMesh + dim = 3 + nx = 5 + ny = 5 + nz = 5 +[] + +[Problem] + solve = false +[] + +[AuxVariables] + [sent_vector] + family = LAGRANGE_VEC + order = FIRST + [] + + [sent_vector_x] + family = LAGRANGE + order = FIRST + [] + + [sent_vector_y] + family = LAGRANGE + order = FIRST + [] + + [sent_vector_z] + family = LAGRANGE + order = FIRST + [] +[] + + +[Functions] + [set_vector] + type = ParsedVectorFunction + expression_x = '100*x*x' + expression_y = '100*y*y' + expression_z = '100*z*z' + [] +[] + +[ICs] + [set_vector] + type = VectorFunctionIC + variable = sent_vector + function = set_vector + [] +[] + +[Executioner] + type = Transient + dt = 1.0 + start_time = 0.0 + end_time = 1.0 +[] diff --git a/test/tests/unit/actions/pull_monomial_vector_nearest_location_transfer_master.i b/test/tests/unit/actions/pull_monomial_vector_nearest_location_transfer_master.i new file mode 100644 index 00000000..2d30e9b7 --- /dev/null +++ b/test/tests/unit/actions/pull_monomial_vector_nearest_location_transfer_master.i @@ -0,0 +1,78 @@ +[Mesh] + type = GeneratedMesh + dim = 3 + nx = 5 + ny = 5 + nz = 5 +[] + +[Problem] + solve = false +[] + +[AuxVariables] + [received_vector] + family = MONOMIAL_VEC + order = CONSTANT + [] + + [expected_vector] + family = MONOMIAL_VEC + order = CONSTANT + [] +[] + +[Functions] + [set_vector] + type = ParsedVectorFunction + expression_x = '100*x*x' + expression_y = '100*y*y' + expression_z = '100*z*z' + [] +[] + +[ICs] + [set_vector] + type = VectorFunctionIC + variable = expected_vector + function = set_vector + [] +[] + +[MultiApps] + [sub_app] + type = TransientMultiApp + positions = '0 0 0' + input_files = 'pull_monomial_vector_nearest_location_transfer_subapp.i' + execute_on = timestep_begin + [] +[] + +[VectorTransfers] + [pull] + type = MultiAppGeneralFieldNearestLocationTransfer + from_multi_app = sub_app + source_variable = sent_vector + variable = received_vector + [] +[] + +[Postprocessors] + [vector_l2_difference] + type = ElementVectorL2Difference + variable = received_vector + other_variable = expected_vector + execute_on = timestep_end + [] +[] + +[Executioner] + type = Transient + dt = 1.0 + start_time = 0.0 + end_time = 1.0 +[] + +[Outputs] + csv = true +[] \ No newline at end of file diff --git a/test/tests/unit/actions/pull_monomial_vector_nearest_location_transfer_subapp.i b/test/tests/unit/actions/pull_monomial_vector_nearest_location_transfer_subapp.i new file mode 100644 index 00000000..b8856d77 --- /dev/null +++ b/test/tests/unit/actions/pull_monomial_vector_nearest_location_transfer_subapp.i @@ -0,0 +1,58 @@ +[Mesh] + type = GeneratedMesh + dim = 3 + nx = 5 + ny = 5 + nz = 5 +[] + +[Problem] + solve = false +[] + +[AuxVariables] + [sent_vector] + family = MONOMIAL_VEC + order = CONSTANT + [] + + [sent_vector_x] + family = MONOMIAL + order = CONSTANT + [] + + [sent_vector_y] + family = MONOMIAL + order = CONSTANT + [] + + [sent_vector_z] + family = MONOMIAL + order = CONSTANT + [] +[] + + +[Functions] + [set_vector] + type = ParsedVectorFunction + expression_x = '100*x*x' + expression_y = '100*y*y' + expression_z = '100*z*z' + [] +[] + +[ICs] + [set_vector] + type = VectorFunctionIC + variable = sent_vector + function = set_vector + [] +[] + +[Executioner] + type = Transient + dt = 1.0 + start_time = 0.0 + end_time = 1.0 +[] diff --git a/test/tests/unit/actions/push_lagrange_vector_nearest_location_transfer_master.i b/test/tests/unit/actions/push_lagrange_vector_nearest_location_transfer_master.i new file mode 100644 index 00000000..8fe42a58 --- /dev/null +++ b/test/tests/unit/actions/push_lagrange_vector_nearest_location_transfer_master.i @@ -0,0 +1,60 @@ +[Mesh] + type = GeneratedMesh + dim = 3 + nx = 5 + ny = 5 + nz = 5 +[] + +[Problem] + solve = false +[] + +[AuxVariables] + [sent_vector] + family = LAGRANGE_VEC + order = FIRST + [] +[] + +[Functions] + [set_vector] + type = ParsedVectorFunction + expression_x = '100*x*x' + expression_y = '100*y*y' + expression_z = '100*z*z' + [] +[] + +[ICs] + [set_vector] + type = VectorFunctionIC + variable = sent_vector + function = set_vector + [] +[] + +[MultiApps] + [sub_app] + type = TransientMultiApp + positions = '0 0 0' + input_files = 'push_lagrange_vector_nearest_location_transfer_subapp.i' + execute_on = timestep_begin + [] +[] + +[VectorTransfers] + [push] + type = MultiAppGeneralFieldNearestLocationTransfer + to_multi_app = sub_app + source_variable = sent_vector + variable = received_vector_sub_app + [] +[] + +[Executioner] + type = Transient + dt = 1.0 + start_time = 0.0 + end_time = 1.0 +[] \ No newline at end of file diff --git a/test/tests/unit/actions/push_lagrange_vector_nearest_location_transfer_subapp.i b/test/tests/unit/actions/push_lagrange_vector_nearest_location_transfer_subapp.i new file mode 100644 index 00000000..e5f26b7a --- /dev/null +++ b/test/tests/unit/actions/push_lagrange_vector_nearest_location_transfer_subapp.i @@ -0,0 +1,75 @@ +[Mesh] + type = GeneratedMesh + dim = 3 + nx = 5 + ny = 5 + nz = 5 +[] + +[Problem] + solve = false +[] + +[AuxVariables] + [expected_vector] + family = LAGRANGE_VEC + order = FIRST + [] + + [received_vector_sub_app] + family = LAGRANGE_VEC + order = FIRST + [] + + [received_vector_sub_app_x] + family = LAGRANGE + order = FIRST + [] + + [received_vector_sub_app_y] + family = LAGRANGE + order = FIRST + [] + + [received_vector_sub_app_z] + family = LAGRANGE + order = FIRST + [] +[] + +[Functions] + [set_vector] + type = ParsedVectorFunction + expression_x = '100*x*x' + expression_y = '100*y*y' + expression_z = '100*z*z' + [] +[] + +[ICs] + [set_vector] + type = VectorFunctionIC + variable = expected_vector + function = set_vector + [] +[] + +[Postprocessors] + [vector_l2_difference] + type = ElementVectorL2Difference + variable = received_vector_sub_app + other_variable = expected_vector + execute_on = timestep_end + [] +[] + +[Executioner] + type = Transient + dt = 1.0 + start_time = 0.0 + end_time = 1.0 +[] + +[Outputs] + csv = true +[] diff --git a/test/tests/unit/actions/push_monomial_vector_nearest_location_transfer_master.i b/test/tests/unit/actions/push_monomial_vector_nearest_location_transfer_master.i new file mode 100644 index 00000000..6b67dfe1 --- /dev/null +++ b/test/tests/unit/actions/push_monomial_vector_nearest_location_transfer_master.i @@ -0,0 +1,60 @@ +[Mesh] + type = GeneratedMesh + dim = 3 + nx = 5 + ny = 5 + nz = 5 +[] + +[Problem] + solve = false +[] + +[AuxVariables] + [sent_vector] + family = MONOMIAL_VEC + order = CONSTANT + [] +[] + +[Functions] + [set_vector] + type = ParsedVectorFunction + expression_x = '100*x*x' + expression_y = '100*y*y' + expression_z = '100*z*z' + [] +[] + +[ICs] + [set_vector] + type = VectorFunctionIC + variable = sent_vector + function = set_vector + [] +[] + +[MultiApps] + [sub_app] + type = TransientMultiApp + positions = '0 0 0' + input_files = 'push_monomial_vector_nearest_location_transfer_subapp.i' + execute_on = timestep_begin + [] +[] + +[VectorTransfers] + [push] + type = MultiAppGeneralFieldNearestLocationTransfer + to_multi_app = sub_app + source_variable = sent_vector + variable = received_vector_sub_app + [] +[] + +[Executioner] + type = Transient + dt = 1.0 + start_time = 0.0 + end_time = 1.0 +[] \ No newline at end of file diff --git a/test/tests/unit/actions/push_monomial_vector_nearest_location_transfer_subapp.i b/test/tests/unit/actions/push_monomial_vector_nearest_location_transfer_subapp.i new file mode 100644 index 00000000..57c85fd6 --- /dev/null +++ b/test/tests/unit/actions/push_monomial_vector_nearest_location_transfer_subapp.i @@ -0,0 +1,75 @@ +[Mesh] + type = GeneratedMesh + dim = 3 + nx = 5 + ny = 5 + nz = 5 +[] + +[Problem] + solve = false +[] + +[AuxVariables] + [expected_vector] + family = MONOMIAL_VEC + order = CONSTANT + [] + + [received_vector_sub_app] + family = MONOMIAL_VEC + order = CONSTANT + [] + + [received_vector_sub_app_x] + family = MONOMIAL + order = CONSTANT + [] + + [received_vector_sub_app_y] + family = MONOMIAL + order = CONSTANT + [] + + [received_vector_sub_app_z] + family = MONOMIAL + order = CONSTANT + [] +[] + +[Functions] + [set_vector] + type = ParsedVectorFunction + expression_x = '100*x*x' + expression_y = '100*y*y' + expression_z = '100*z*z' + [] +[] + +[ICs] + [set_vector] + type = VectorFunctionIC + variable = expected_vector + function = set_vector + [] +[] + +[Postprocessors] + [vector_l2_difference] + type = ElementVectorL2Difference + variable = received_vector_sub_app + other_variable = expected_vector + execute_on = timestep_end + [] +[] + +[Executioner] + type = Transient + dt = 1.0 + start_time = 0.0 + end_time = 1.0 +[] + +[Outputs] + csv = true +[] diff --git a/test/tests/unit/actions/push_pull_lagrange_vector_nearest_location_transfer_master.i b/test/tests/unit/actions/push_pull_lagrange_vector_nearest_location_transfer_master.i new file mode 100644 index 00000000..b3f9f5f5 --- /dev/null +++ b/test/tests/unit/actions/push_pull_lagrange_vector_nearest_location_transfer_master.i @@ -0,0 +1,85 @@ +[Mesh] + type = GeneratedMesh + dim = 3 + nx = 5 + ny = 5 + nz = 5 +[] + +[Problem] + solve = false +[] + +[AuxVariables] + [sent_vector] + family = LAGRANGE_VEC + order = FIRST + [] + + [received_vector] + family = LAGRANGE_VEC + order = FIRST + [] +[] + +[Functions] + [set_vector] + type = ParsedVectorFunction + expression_x = '100*x*x' + expression_y = '100*y*y' + expression_z = '100*z*z' + [] +[] + +[ICs] + [set_vector] + type = VectorFunctionIC + variable = sent_vector + function = set_vector + [] +[] + +[MultiApps] + [sub_app] + type = TransientMultiApp + positions = '0 0 0' + input_files = 'push_pull_lagrange_vector_nearest_location_transfer_subapp.i' + execute_on = timestep_begin + [] +[] + +[VectorTransfers] + [push] + type = MultiAppGeneralFieldNearestLocationTransfer + to_multi_app = sub_app + source_variable = sent_vector + variable = received_vector_sub_app + [] + + [pull] + type = MultiAppGeneralFieldNearestLocationTransfer + from_multi_app = sub_app + source_variable = received_vector_sub_app + variable = received_vector + [] +[] + +[Postprocessors] + [vector_l2_difference] + type = ElementVectorL2Difference + variable = sent_vector + other_variable = received_vector + execute_on = timestep_end + [] +[] + +[Executioner] + type = Transient + dt = 1.0 + start_time = 0.0 + end_time = 1.0 +[] + +[Outputs] + csv = true +[] \ No newline at end of file diff --git a/test/tests/unit/actions/push_pull_lagrange_vector_nearest_location_transfer_subapp.i b/test/tests/unit/actions/push_pull_lagrange_vector_nearest_location_transfer_subapp.i new file mode 100644 index 00000000..89ca98ad --- /dev/null +++ b/test/tests/unit/actions/push_pull_lagrange_vector_nearest_location_transfer_subapp.i @@ -0,0 +1,40 @@ +[Mesh] + type = GeneratedMesh + dim = 3 + nx = 5 + ny = 5 + nz = 5 +[] + +[Problem] + solve = false +[] + +[AuxVariables] + [received_vector_sub_app] + family = LAGRANGE_VEC + order = FIRST + [] + + [received_vector_sub_app_x] + family = LAGRANGE + order = FIRST + [] + + [received_vector_sub_app_y] + family = LAGRANGE + order = FIRST + [] + + [received_vector_sub_app_z] + family = LAGRANGE + order = FIRST + [] +[] + +[Executioner] + type = Transient + dt = 1.0 + start_time = 0.0 + end_time = 1.0 +[] diff --git a/test/tests/unit/actions/push_pull_monomial_vector_nearest_location_transfer_master.i b/test/tests/unit/actions/push_pull_monomial_vector_nearest_location_transfer_master.i new file mode 100644 index 00000000..911ed713 --- /dev/null +++ b/test/tests/unit/actions/push_pull_monomial_vector_nearest_location_transfer_master.i @@ -0,0 +1,85 @@ +[Mesh] + type = GeneratedMesh + dim = 3 + nx = 5 + ny = 5 + nz = 5 +[] + +[Problem] + solve = false +[] + +[AuxVariables] + [sent_vector] + family = MONOMIAL_VEC + order = CONSTANT + [] + + [received_vector] + family = MONOMIAL_VEC + order = CONSTANT + [] +[] + +[Functions] + [set_vector] + type = ParsedVectorFunction + expression_x = '100*x*x' + expression_y = '100*y*y' + expression_z = '100*z*z' + [] +[] + +[ICs] + [set_vector] + type = VectorFunctionIC + variable = sent_vector + function = set_vector + [] +[] + +[MultiApps] + [sub_app] + type = TransientMultiApp + positions = '0 0 0' + input_files = 'push_pull_monomial_vector_nearest_location_transfer_subapp.i' + execute_on = timestep_begin + [] +[] + +[VectorTransfers] + [push] + type = MultiAppGeneralFieldNearestLocationTransfer + to_multi_app = sub_app + source_variable = sent_vector + variable = received_vector_sub_app + [] + + [pull] + type = MultiAppGeneralFieldNearestLocationTransfer + from_multi_app = sub_app + source_variable = received_vector_sub_app + variable = received_vector + [] +[] + +[Postprocessors] + [vector_l2_difference] + type = ElementVectorL2Difference + variable = sent_vector + other_variable = received_vector + execute_on = timestep_end + [] +[] + +[Executioner] + type = Transient + dt = 1.0 + start_time = 0.0 + end_time = 1.0 +[] + +[Outputs] + csv = true +[] \ No newline at end of file diff --git a/test/tests/unit/actions/push_pull_monomial_vector_nearest_location_transfer_subapp.i b/test/tests/unit/actions/push_pull_monomial_vector_nearest_location_transfer_subapp.i new file mode 100644 index 00000000..0ae23c3c --- /dev/null +++ b/test/tests/unit/actions/push_pull_monomial_vector_nearest_location_transfer_subapp.i @@ -0,0 +1,40 @@ +[Mesh] + type = GeneratedMesh + dim = 3 + nx = 5 + ny = 5 + nz = 5 +[] + +[Problem] + solve = false +[] + +[AuxVariables] + [received_vector_sub_app] + family = MONOMIAL_VEC + order = CONSTANT + [] + + [received_vector_sub_app_x] + family = MONOMIAL + order = CONSTANT + [] + + [received_vector_sub_app_y] + family = MONOMIAL + order = CONSTANT + [] + + [received_vector_sub_app_z] + family = MONOMIAL + order = CONSTANT + [] +[] + +[Executioner] + type = Transient + dt = 1.0 + start_time = 0.0 + end_time = 1.0 +[] diff --git a/test/tests/unit/actions/tests b/test/tests/unit/actions/tests new file mode 100644 index 00000000..9ea5fa22 --- /dev/null +++ b/test/tests/unit/actions/tests @@ -0,0 +1,45 @@ +[Tests] + design = 'syntax/Problem/index.md' + + [./PullLagrangeVectorNearestLocationTransfer] + type = 'CSVDiff' + input = 'pull_lagrange_vector_nearest_location_transfer_master.i' + csvdiff = 'pull_lagrange_vector_nearest_location_transfer_master_out.csv' + requirement = 'Apollo shall have the ability to pull a Lagrange vector from a subapp using the MultiAppGeneralFieldNearestLocationTransfer transfer.' + [] + + [./PushLagrangeVectorNearestLocationTransfer] + type = 'CSVDiff' + input = 'push_lagrange_vector_nearest_location_transfer_master.i' + csvdiff = 'push_lagrange_vector_nearest_location_transfer_master_out_sub_app0.csv' + requirement = 'Apollo shall have the ability to push a Lagrange vector to a subapp using the MultiAppGeneralFieldNearestLocationTransfer transfer.' + [] + + [./PushPullLagrangeVectorNearestLocationTransfer] + type = 'CSVDiff' + input = 'push_pull_lagrange_vector_nearest_location_transfer_master.i' + csvdiff = 'push_pull_lagrange_vector_nearest_location_transfer_master_out.csv' + requirement = 'Apollo shall have the ability to push and pull a Lagrange vector using the MultiAppGeneralFieldNearestLocationTransfer transfer.' + [] + + [./PullMonomialVectorNearestLocationTransfer] + type = 'CSVDiff' + input = 'pull_monomial_vector_nearest_location_transfer_master.i' + csvdiff = 'pull_monomial_vector_nearest_location_transfer_master_out.csv' + requirement = 'Apollo shall have the ability to pull a Monomial vector from a subapp using the MultiAppGeneralFieldNearestLocationTransfer transfer.' + [] + + [./PushMonomialVectorNearestLocationTransfer] + type = 'CSVDiff' + input = 'push_monomial_vector_nearest_location_transfer_master.i' + csvdiff = 'push_monomial_vector_nearest_location_transfer_master_out_sub_app0.csv' + requirement = 'Apollo shall have the ability to push a Monomial vector to a subapp using the MultiAppGeneralFieldNearestLocationTransfer transfer.' + [] + + [./PushPullMonomialVectorNearestLocationTransfer] + type = 'CSVDiff' + input = 'push_pull_monomial_vector_nearest_location_transfer_master.i' + csvdiff = 'push_pull_monomial_vector_nearest_location_transfer_master_out.csv' + requirement = 'Apollo shall have the ability to push and pull a Monomial vector using the MultiAppGeneralFieldNearestLocationTransfer transfer.' + [] +[] From fc1454f31b9ec6635f96ac61a6b1c6e99c9364f4 Mon Sep 17 00:00:00 2001 From: Edward Palmer Date: Thu, 1 Feb 2024 17:19:41 +0000 Subject: [PATCH 02/16] Renamed "ApolloApp" namespace to "Apollo" to avoid clashes with ApolloApp class. --- include/base/ApolloVectorTransferFlags.h | 4 +- src/actions/AddVectorTransferAction.C | 4 +- .../VectorVariableFromComponentsAux.C | 2 +- .../VectorVariableToComponentsAux.C | 2 +- src/base/ApolloVectorTransferFlags.C | 4 +- src/transfers/ApolloTestApp.C | 54 +++++++++++++++++++ src/transfers/MultiAppGeneralVectorTransfer.C | 4 +- 7 files changed, 64 insertions(+), 10 deletions(-) create mode 100644 src/transfers/ApolloTestApp.C diff --git a/include/base/ApolloVectorTransferFlags.h b/include/base/ApolloVectorTransferFlags.h index d55be0d6..7ade1981 100644 --- a/include/base/ApolloVectorTransferFlags.h +++ b/include/base/ApolloVectorTransferFlags.h @@ -1,8 +1,8 @@ -#pragma once +#pragma once #include "Moose.h" -namespace ApolloApp +namespace Apollo { extern const ExecFlagType EXEC_PREPARE_VECTOR_FOR_TRANSFER; extern const ExecFlagType EXEC_RECOVER_VECTOR_POST_TRANSFER; diff --git a/src/actions/AddVectorTransferAction.C b/src/actions/AddVectorTransferAction.C index 555cbf14..491abd73 100644 --- a/src/actions/AddVectorTransferAction.C +++ b/src/actions/AddVectorTransferAction.C @@ -191,12 +191,12 @@ AddVectorTransferAction::addVectorAuxKernel(FEProblemBase & problem, case VectorAuxKernelType::RECOVER_VECTOR_POST_TRANSFER: aux_kernel_name = "VectorVariableFromComponentsAux"; unique_aux_kernel_name = vector_name + "_from_components"; - exec_flag = ApolloApp::EXEC_RECOVER_VECTOR_POST_TRANSFER; + exec_flag = Apollo::EXEC_RECOVER_VECTOR_POST_TRANSFER; break; case VectorAuxKernelType::PREPARE_VECTOR_FOR_TRANSFER: aux_kernel_name = "VectorVariableToComponentsAux"; unique_aux_kernel_name = vector_name + "_to_components"; - exec_flag = ApolloApp::EXEC_PREPARE_VECTOR_FOR_TRANSFER; + exec_flag = Apollo::EXEC_PREPARE_VECTOR_FOR_TRANSFER; break; default: mooseError("Unsupported vector auxkernel type."); diff --git a/src/auxkernels/VectorVariableFromComponentsAux.C b/src/auxkernels/VectorVariableFromComponentsAux.C index ce93c05f..c019d7b4 100644 --- a/src/auxkernels/VectorVariableFromComponentsAux.C +++ b/src/auxkernels/VectorVariableFromComponentsAux.C @@ -9,7 +9,7 @@ VectorVariableFromComponentsAux::validParams() InputParameters params = WritableVectorAuxKernel::validParams(); ExecFlagEnum & exec = params.set("execute_on"); - exec.addAvailableFlags(ApolloApp::EXEC_RECOVER_VECTOR_POST_TRANSFER); + exec.addAvailableFlags(Apollo::EXEC_RECOVER_VECTOR_POST_TRANSFER); params.addRequiredCoupledVar("component_x", "The x-component of the vector variable."); params.addRequiredCoupledVar("component_y", "The y-component of the vector variable."); diff --git a/src/auxkernels/VectorVariableToComponentsAux.C b/src/auxkernels/VectorVariableToComponentsAux.C index 0450a5a3..b4d2a90a 100644 --- a/src/auxkernels/VectorVariableToComponentsAux.C +++ b/src/auxkernels/VectorVariableToComponentsAux.C @@ -9,7 +9,7 @@ VectorVariableToComponentsAux::validParams() InputParameters params = WritableVectorAuxKernel::validParams(); ExecFlagEnum & exec = params.set("execute_on"); - exec.addAvailableFlags(ApolloApp::EXEC_PREPARE_VECTOR_FOR_TRANSFER); + exec.addAvailableFlags(Apollo::EXEC_PREPARE_VECTOR_FOR_TRANSFER); params.addRequiredCoupledVar("component_x", "The x-component of the vector variable."); params.addRequiredCoupledVar("component_y", "The y-component of the vector variable."); diff --git a/src/base/ApolloVectorTransferFlags.C b/src/base/ApolloVectorTransferFlags.C index 480f5ded..6983e769 100644 --- a/src/base/ApolloVectorTransferFlags.C +++ b/src/base/ApolloVectorTransferFlags.C @@ -2,7 +2,7 @@ #include "ExecFlagRegistry.h" -const ExecFlagType ApolloApp::EXEC_PREPARE_VECTOR_FOR_TRANSFER = +const ExecFlagType Apollo::EXEC_PREPARE_VECTOR_FOR_TRANSFER = registerExecFlag("PREPARE_VECTOR_FOR_TRANSFER"); -const ExecFlagType ApolloApp::EXEC_RECOVER_VECTOR_POST_TRANSFER = +const ExecFlagType Apollo::EXEC_RECOVER_VECTOR_POST_TRANSFER = registerExecFlag("RECOVER_VECTOR_POST_TRANSFER"); \ No newline at end of file diff --git a/src/transfers/ApolloTestApp.C b/src/transfers/ApolloTestApp.C new file mode 100644 index 00000000..818b8145 --- /dev/null +++ b/src/transfers/ApolloTestApp.C @@ -0,0 +1,54 @@ +#include "ApolloTestApp.h" +#include "ApolloApp.h" +#include "Moose.h" +#include "AppFactory.h" +#include "MooseSyntax.h" +#include "ModulesApp.h" + +InputParameters +ApolloTestApp::validParams() +{ + InputParameters params = Apollo::validParams(); + return params; +} + +ApolloTestApp::ApolloTestApp(InputParameters parameters) : MooseApp(parameters) +{ + ApolloTestApp::registerAll( + _factory, _action_factory, _syntax, getParam("allow_test_objects")); +} + +ApolloTestApp::~ApolloTestApp() {} + +void +ApolloTestApp::registerAll(Factory & f, ActionFactory & af, Syntax & s, bool use_test_objs) +{ + Apollo::registerAll(f, af, s); + if (use_test_objs) + { + Registry::registerObjectsTo(f, {"ApolloTestApp"}); + Registry::registerActionsTo(af, {"ApolloTestApp"}); + } +} + +void +ApolloTestApp::registerApps() +{ + registerApp(ApolloApp); + registerApp(ApolloTestApp); +} + +/*************************************************************************************************** + *********************** Dynamic Library Entry Points - DO NOT MODIFY ****************************** + **************************************************************************************************/ +// External entry point for dynamic application loading +extern "C" void +ApolloTestApp__registerAll(Factory & f, ActionFactory & af, Syntax & s) +{ + ApolloTestApp::registerAll(f, af, s); +} +extern "C" void +ApolloTestApp__registerApps() +{ + ApolloTestApp::registerApps(); +} diff --git a/src/transfers/MultiAppGeneralVectorTransfer.C b/src/transfers/MultiAppGeneralVectorTransfer.C index acc3469c..887de555 100644 --- a/src/transfers/MultiAppGeneralVectorTransfer.C +++ b/src/transfers/MultiAppGeneralVectorTransfer.C @@ -44,11 +44,11 @@ void MultiAppVectorTransferTemplate::execute() { // Update all components of the vector variables. - getFromAuxSystem().compute(ApolloApp::EXEC_PREPARE_VECTOR_FOR_TRANSFER); + getFromAuxSystem().compute(Apollo::EXEC_PREPARE_VECTOR_FOR_TRANSFER); // Call execute on inherited class which will work on component variables. MultiAppTransferClassType::execute(); // Rebuild all vector variables from their components. - getToAuxSystem().compute(ApolloApp::EXEC_RECOVER_VECTOR_POST_TRANSFER); + getToAuxSystem().compute(Apollo::EXEC_RECOVER_VECTOR_POST_TRANSFER); } From 88e0f737d65f9c0044d2048dc5d3a63b0041999e Mon Sep 17 00:00:00 2001 From: Edward Palmer Date: Thu, 1 Feb 2024 17:21:59 +0000 Subject: [PATCH 03/16] Revert "Renamed "ApolloApp" namespace to "Apollo" to avoid clashes with ApolloApp class." This reverts commit fc1454f31b9ec6635f96ac61a6b1c6e99c9364f4. --- include/base/ApolloVectorTransferFlags.h | 4 +- src/actions/AddVectorTransferAction.C | 4 +- .../VectorVariableFromComponentsAux.C | 2 +- .../VectorVariableToComponentsAux.C | 2 +- src/base/ApolloVectorTransferFlags.C | 4 +- src/transfers/ApolloTestApp.C | 54 ------------------- src/transfers/MultiAppGeneralVectorTransfer.C | 4 +- 7 files changed, 10 insertions(+), 64 deletions(-) delete mode 100644 src/transfers/ApolloTestApp.C diff --git a/include/base/ApolloVectorTransferFlags.h b/include/base/ApolloVectorTransferFlags.h index 7ade1981..d55be0d6 100644 --- a/include/base/ApolloVectorTransferFlags.h +++ b/include/base/ApolloVectorTransferFlags.h @@ -1,8 +1,8 @@ -#pragma once +#pragma once #include "Moose.h" -namespace Apollo +namespace ApolloApp { extern const ExecFlagType EXEC_PREPARE_VECTOR_FOR_TRANSFER; extern const ExecFlagType EXEC_RECOVER_VECTOR_POST_TRANSFER; diff --git a/src/actions/AddVectorTransferAction.C b/src/actions/AddVectorTransferAction.C index 491abd73..555cbf14 100644 --- a/src/actions/AddVectorTransferAction.C +++ b/src/actions/AddVectorTransferAction.C @@ -191,12 +191,12 @@ AddVectorTransferAction::addVectorAuxKernel(FEProblemBase & problem, case VectorAuxKernelType::RECOVER_VECTOR_POST_TRANSFER: aux_kernel_name = "VectorVariableFromComponentsAux"; unique_aux_kernel_name = vector_name + "_from_components"; - exec_flag = Apollo::EXEC_RECOVER_VECTOR_POST_TRANSFER; + exec_flag = ApolloApp::EXEC_RECOVER_VECTOR_POST_TRANSFER; break; case VectorAuxKernelType::PREPARE_VECTOR_FOR_TRANSFER: aux_kernel_name = "VectorVariableToComponentsAux"; unique_aux_kernel_name = vector_name + "_to_components"; - exec_flag = Apollo::EXEC_PREPARE_VECTOR_FOR_TRANSFER; + exec_flag = ApolloApp::EXEC_PREPARE_VECTOR_FOR_TRANSFER; break; default: mooseError("Unsupported vector auxkernel type."); diff --git a/src/auxkernels/VectorVariableFromComponentsAux.C b/src/auxkernels/VectorVariableFromComponentsAux.C index c019d7b4..ce93c05f 100644 --- a/src/auxkernels/VectorVariableFromComponentsAux.C +++ b/src/auxkernels/VectorVariableFromComponentsAux.C @@ -9,7 +9,7 @@ VectorVariableFromComponentsAux::validParams() InputParameters params = WritableVectorAuxKernel::validParams(); ExecFlagEnum & exec = params.set("execute_on"); - exec.addAvailableFlags(Apollo::EXEC_RECOVER_VECTOR_POST_TRANSFER); + exec.addAvailableFlags(ApolloApp::EXEC_RECOVER_VECTOR_POST_TRANSFER); params.addRequiredCoupledVar("component_x", "The x-component of the vector variable."); params.addRequiredCoupledVar("component_y", "The y-component of the vector variable."); diff --git a/src/auxkernels/VectorVariableToComponentsAux.C b/src/auxkernels/VectorVariableToComponentsAux.C index b4d2a90a..0450a5a3 100644 --- a/src/auxkernels/VectorVariableToComponentsAux.C +++ b/src/auxkernels/VectorVariableToComponentsAux.C @@ -9,7 +9,7 @@ VectorVariableToComponentsAux::validParams() InputParameters params = WritableVectorAuxKernel::validParams(); ExecFlagEnum & exec = params.set("execute_on"); - exec.addAvailableFlags(Apollo::EXEC_PREPARE_VECTOR_FOR_TRANSFER); + exec.addAvailableFlags(ApolloApp::EXEC_PREPARE_VECTOR_FOR_TRANSFER); params.addRequiredCoupledVar("component_x", "The x-component of the vector variable."); params.addRequiredCoupledVar("component_y", "The y-component of the vector variable."); diff --git a/src/base/ApolloVectorTransferFlags.C b/src/base/ApolloVectorTransferFlags.C index 6983e769..480f5ded 100644 --- a/src/base/ApolloVectorTransferFlags.C +++ b/src/base/ApolloVectorTransferFlags.C @@ -2,7 +2,7 @@ #include "ExecFlagRegistry.h" -const ExecFlagType Apollo::EXEC_PREPARE_VECTOR_FOR_TRANSFER = +const ExecFlagType ApolloApp::EXEC_PREPARE_VECTOR_FOR_TRANSFER = registerExecFlag("PREPARE_VECTOR_FOR_TRANSFER"); -const ExecFlagType Apollo::EXEC_RECOVER_VECTOR_POST_TRANSFER = +const ExecFlagType ApolloApp::EXEC_RECOVER_VECTOR_POST_TRANSFER = registerExecFlag("RECOVER_VECTOR_POST_TRANSFER"); \ No newline at end of file diff --git a/src/transfers/ApolloTestApp.C b/src/transfers/ApolloTestApp.C deleted file mode 100644 index 818b8145..00000000 --- a/src/transfers/ApolloTestApp.C +++ /dev/null @@ -1,54 +0,0 @@ -#include "ApolloTestApp.h" -#include "ApolloApp.h" -#include "Moose.h" -#include "AppFactory.h" -#include "MooseSyntax.h" -#include "ModulesApp.h" - -InputParameters -ApolloTestApp::validParams() -{ - InputParameters params = Apollo::validParams(); - return params; -} - -ApolloTestApp::ApolloTestApp(InputParameters parameters) : MooseApp(parameters) -{ - ApolloTestApp::registerAll( - _factory, _action_factory, _syntax, getParam("allow_test_objects")); -} - -ApolloTestApp::~ApolloTestApp() {} - -void -ApolloTestApp::registerAll(Factory & f, ActionFactory & af, Syntax & s, bool use_test_objs) -{ - Apollo::registerAll(f, af, s); - if (use_test_objs) - { - Registry::registerObjectsTo(f, {"ApolloTestApp"}); - Registry::registerActionsTo(af, {"ApolloTestApp"}); - } -} - -void -ApolloTestApp::registerApps() -{ - registerApp(ApolloApp); - registerApp(ApolloTestApp); -} - -/*************************************************************************************************** - *********************** Dynamic Library Entry Points - DO NOT MODIFY ****************************** - **************************************************************************************************/ -// External entry point for dynamic application loading -extern "C" void -ApolloTestApp__registerAll(Factory & f, ActionFactory & af, Syntax & s) -{ - ApolloTestApp::registerAll(f, af, s); -} -extern "C" void -ApolloTestApp__registerApps() -{ - ApolloTestApp::registerApps(); -} diff --git a/src/transfers/MultiAppGeneralVectorTransfer.C b/src/transfers/MultiAppGeneralVectorTransfer.C index 887de555..acc3469c 100644 --- a/src/transfers/MultiAppGeneralVectorTransfer.C +++ b/src/transfers/MultiAppGeneralVectorTransfer.C @@ -44,11 +44,11 @@ void MultiAppVectorTransferTemplate::execute() { // Update all components of the vector variables. - getFromAuxSystem().compute(Apollo::EXEC_PREPARE_VECTOR_FOR_TRANSFER); + getFromAuxSystem().compute(ApolloApp::EXEC_PREPARE_VECTOR_FOR_TRANSFER); // Call execute on inherited class which will work on component variables. MultiAppTransferClassType::execute(); // Rebuild all vector variables from their components. - getToAuxSystem().compute(Apollo::EXEC_RECOVER_VECTOR_POST_TRANSFER); + getToAuxSystem().compute(ApolloApp::EXEC_RECOVER_VECTOR_POST_TRANSFER); } From e91bbc55882a20575b6f03ea5fc5482dd9a508aa Mon Sep 17 00:00:00 2001 From: Edward Palmer Date: Thu, 1 Feb 2024 17:24:28 +0000 Subject: [PATCH 04/16] Renaemd "ApolloApp" namespace to "Apollo" to avoid clashes. --- include/base/ApolloVectorTransferFlags.h | 6 +++--- src/actions/AddVectorTransferAction.C | 4 ++-- src/auxkernels/VectorVariableFromComponentsAux.C | 2 +- src/auxkernels/VectorVariableToComponentsAux.C | 2 +- src/base/ApolloVectorTransferFlags.C | 4 ++-- src/transfers/MultiAppGeneralVectorTransfer.C | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/include/base/ApolloVectorTransferFlags.h b/include/base/ApolloVectorTransferFlags.h index d55be0d6..0448e755 100644 --- a/include/base/ApolloVectorTransferFlags.h +++ b/include/base/ApolloVectorTransferFlags.h @@ -1,9 +1,9 @@ -#pragma once +#pragma once #include "Moose.h" -namespace ApolloApp +namespace Apollo { extern const ExecFlagType EXEC_PREPARE_VECTOR_FOR_TRANSFER; extern const ExecFlagType EXEC_RECOVER_VECTOR_POST_TRANSFER; -}; \ No newline at end of file +} \ No newline at end of file diff --git a/src/actions/AddVectorTransferAction.C b/src/actions/AddVectorTransferAction.C index 555cbf14..491abd73 100644 --- a/src/actions/AddVectorTransferAction.C +++ b/src/actions/AddVectorTransferAction.C @@ -191,12 +191,12 @@ AddVectorTransferAction::addVectorAuxKernel(FEProblemBase & problem, case VectorAuxKernelType::RECOVER_VECTOR_POST_TRANSFER: aux_kernel_name = "VectorVariableFromComponentsAux"; unique_aux_kernel_name = vector_name + "_from_components"; - exec_flag = ApolloApp::EXEC_RECOVER_VECTOR_POST_TRANSFER; + exec_flag = Apollo::EXEC_RECOVER_VECTOR_POST_TRANSFER; break; case VectorAuxKernelType::PREPARE_VECTOR_FOR_TRANSFER: aux_kernel_name = "VectorVariableToComponentsAux"; unique_aux_kernel_name = vector_name + "_to_components"; - exec_flag = ApolloApp::EXEC_PREPARE_VECTOR_FOR_TRANSFER; + exec_flag = Apollo::EXEC_PREPARE_VECTOR_FOR_TRANSFER; break; default: mooseError("Unsupported vector auxkernel type."); diff --git a/src/auxkernels/VectorVariableFromComponentsAux.C b/src/auxkernels/VectorVariableFromComponentsAux.C index ce93c05f..c019d7b4 100644 --- a/src/auxkernels/VectorVariableFromComponentsAux.C +++ b/src/auxkernels/VectorVariableFromComponentsAux.C @@ -9,7 +9,7 @@ VectorVariableFromComponentsAux::validParams() InputParameters params = WritableVectorAuxKernel::validParams(); ExecFlagEnum & exec = params.set("execute_on"); - exec.addAvailableFlags(ApolloApp::EXEC_RECOVER_VECTOR_POST_TRANSFER); + exec.addAvailableFlags(Apollo::EXEC_RECOVER_VECTOR_POST_TRANSFER); params.addRequiredCoupledVar("component_x", "The x-component of the vector variable."); params.addRequiredCoupledVar("component_y", "The y-component of the vector variable."); diff --git a/src/auxkernels/VectorVariableToComponentsAux.C b/src/auxkernels/VectorVariableToComponentsAux.C index 0450a5a3..b4d2a90a 100644 --- a/src/auxkernels/VectorVariableToComponentsAux.C +++ b/src/auxkernels/VectorVariableToComponentsAux.C @@ -9,7 +9,7 @@ VectorVariableToComponentsAux::validParams() InputParameters params = WritableVectorAuxKernel::validParams(); ExecFlagEnum & exec = params.set("execute_on"); - exec.addAvailableFlags(ApolloApp::EXEC_PREPARE_VECTOR_FOR_TRANSFER); + exec.addAvailableFlags(Apollo::EXEC_PREPARE_VECTOR_FOR_TRANSFER); params.addRequiredCoupledVar("component_x", "The x-component of the vector variable."); params.addRequiredCoupledVar("component_y", "The y-component of the vector variable."); diff --git a/src/base/ApolloVectorTransferFlags.C b/src/base/ApolloVectorTransferFlags.C index 480f5ded..6983e769 100644 --- a/src/base/ApolloVectorTransferFlags.C +++ b/src/base/ApolloVectorTransferFlags.C @@ -2,7 +2,7 @@ #include "ExecFlagRegistry.h" -const ExecFlagType ApolloApp::EXEC_PREPARE_VECTOR_FOR_TRANSFER = +const ExecFlagType Apollo::EXEC_PREPARE_VECTOR_FOR_TRANSFER = registerExecFlag("PREPARE_VECTOR_FOR_TRANSFER"); -const ExecFlagType ApolloApp::EXEC_RECOVER_VECTOR_POST_TRANSFER = +const ExecFlagType Apollo::EXEC_RECOVER_VECTOR_POST_TRANSFER = registerExecFlag("RECOVER_VECTOR_POST_TRANSFER"); \ No newline at end of file diff --git a/src/transfers/MultiAppGeneralVectorTransfer.C b/src/transfers/MultiAppGeneralVectorTransfer.C index acc3469c..887de555 100644 --- a/src/transfers/MultiAppGeneralVectorTransfer.C +++ b/src/transfers/MultiAppGeneralVectorTransfer.C @@ -44,11 +44,11 @@ void MultiAppVectorTransferTemplate::execute() { // Update all components of the vector variables. - getFromAuxSystem().compute(ApolloApp::EXEC_PREPARE_VECTOR_FOR_TRANSFER); + getFromAuxSystem().compute(Apollo::EXEC_PREPARE_VECTOR_FOR_TRANSFER); // Call execute on inherited class which will work on component variables. MultiAppTransferClassType::execute(); // Rebuild all vector variables from their components. - getToAuxSystem().compute(ApolloApp::EXEC_RECOVER_VECTOR_POST_TRANSFER); + getToAuxSystem().compute(Apollo::EXEC_RECOVER_VECTOR_POST_TRANSFER); } From 17ee6c2dbe41b40d09f0f346ed150aef1fd94812 Mon Sep 17 00:00:00 2001 From: Edward Palmer Date: Thu, 1 Feb 2024 18:11:18 +0000 Subject: [PATCH 05/16] Fixed incorrect subapp specified in input file. --- ...push_pull_multi_element_order2_distributed_transfer_master.i | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/tests/unit/transfers/push_pull_multi_element_order2_distributed_transfer_master.i b/test/tests/unit/transfers/push_pull_multi_element_order2_distributed_transfer_master.i index bb921238..acac57fc 100644 --- a/test/tests/unit/transfers/push_pull_multi_element_order2_distributed_transfer_master.i +++ b/test/tests/unit/transfers/push_pull_multi_element_order2_distributed_transfer_master.i @@ -48,7 +48,7 @@ [sub_app] type = TransientMultiApp positions = '0 0 0' - input_files = 'push_pull_multi_element_order2_transfer_sub_app.i' + input_files = 'push_pull_multi_element_order2_distributed_transfer_sub_app.i' execute_on = timestep_begin [] [] From 2e22547fe0a0533a15055b53819d1051150169c9 Mon Sep 17 00:00:00 2001 From: Edward Palmer Date: Thu, 1 Feb 2024 19:15:00 +0000 Subject: [PATCH 06/16] Registered MultiAppShapeEvaluationTransferVector. --- include/transfers/MultiAppGeneralVectorTransfer.h | 5 ++++- src/transfers/MultiAppGeneralVectorTransfer.C | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/include/transfers/MultiAppGeneralVectorTransfer.h b/include/transfers/MultiAppGeneralVectorTransfer.h index dd82f027..26dd1866 100644 --- a/include/transfers/MultiAppGeneralVectorTransfer.h +++ b/include/transfers/MultiAppGeneralVectorTransfer.h @@ -10,12 +10,15 @@ template class MultiAppVectorTransferTemplate; -class MultiAppGeneralFieldNearestLocationTransfer; class MultiAppCopyTransfer; // NB: CopyTransfer can handle vector variables. +class MultiAppShapeEvaluationTransfer; +class MultiAppGeneralFieldNearestLocationTransfer; /** * Create all transfer types using template here. Don't forget to register them in .C file. */ +typedef MultiAppVectorTransferTemplate + MultiAppShapeEvaluationTransferVector; typedef MultiAppVectorTransferTemplate MultiAppGeneralFieldNearestLocationTransferVector; typedef MultiAppVectorTransferTemplate MultiAppCopyTransferVector; diff --git a/src/transfers/MultiAppGeneralVectorTransfer.C b/src/transfers/MultiAppGeneralVectorTransfer.C index 887de555..47887000 100644 --- a/src/transfers/MultiAppGeneralVectorTransfer.C +++ b/src/transfers/MultiAppGeneralVectorTransfer.C @@ -2,6 +2,7 @@ #include "AuxiliarySystem.h" #include "MultiAppGeneralFieldNearestLocationTransfer.h" +#include "MultiAppShapeEvaluationTransfer.h" #include "MultiAppCopyTransfer.h" #include "ApolloVectorTransferFlags.h" @@ -9,6 +10,7 @@ /** * Register all Moose objects that we would like here. */ +registerMooseObject("MooseApp", MultiAppShapeEvaluationTransferVector); registerMooseObject("MooseApp", MultiAppGeneralFieldNearestLocationTransferVector); registerMooseObject("MooseApp", MultiAppCopyTransferVector); From 381f17709c0a154bccedf77193615d4088060be1 Mon Sep 17 00:00:00 2001 From: Edward Palmer Date: Fri, 2 Feb 2024 11:31:40 +0000 Subject: [PATCH 07/16] Added push/pull test cases for shape evaluation transfers. --- ...r_shape_evaluation_transfer_master_out.csv | 3 + ...r_shape_evaluation_transfer_master_out.csv | 3 + ..._vector_shape_evaluation_transfer_master.i | 85 +++++++++++++++++++ ..._vector_shape_evaluation_transfer_subapp.i | 40 +++++++++ ..._vector_shape_evaluation_transfer_master.i | 85 +++++++++++++++++++ ..._vector_shape_evaluation_transfer_subapp.i | 40 +++++++++ test/tests/unit/actions/tests | 14 +++ 7 files changed, 270 insertions(+) create mode 100644 test/tests/unit/actions/gold/push_pull_lagrange_vector_shape_evaluation_transfer_master_out.csv create mode 100644 test/tests/unit/actions/gold/push_pull_monomial_vector_shape_evaluation_transfer_master_out.csv create mode 100644 test/tests/unit/actions/push_pull_lagrange_vector_shape_evaluation_transfer_master.i create mode 100644 test/tests/unit/actions/push_pull_lagrange_vector_shape_evaluation_transfer_subapp.i create mode 100644 test/tests/unit/actions/push_pull_monomial_vector_shape_evaluation_transfer_master.i create mode 100644 test/tests/unit/actions/push_pull_monomial_vector_shape_evaluation_transfer_subapp.i diff --git a/test/tests/unit/actions/gold/push_pull_lagrange_vector_shape_evaluation_transfer_master_out.csv b/test/tests/unit/actions/gold/push_pull_lagrange_vector_shape_evaluation_transfer_master_out.csv new file mode 100644 index 00000000..f260eb1a --- /dev/null +++ b/test/tests/unit/actions/gold/push_pull_lagrange_vector_shape_evaluation_transfer_master_out.csv @@ -0,0 +1,3 @@ +time,vector_l2_difference +0,0 +1,0 diff --git a/test/tests/unit/actions/gold/push_pull_monomial_vector_shape_evaluation_transfer_master_out.csv b/test/tests/unit/actions/gold/push_pull_monomial_vector_shape_evaluation_transfer_master_out.csv new file mode 100644 index 00000000..f260eb1a --- /dev/null +++ b/test/tests/unit/actions/gold/push_pull_monomial_vector_shape_evaluation_transfer_master_out.csv @@ -0,0 +1,3 @@ +time,vector_l2_difference +0,0 +1,0 diff --git a/test/tests/unit/actions/push_pull_lagrange_vector_shape_evaluation_transfer_master.i b/test/tests/unit/actions/push_pull_lagrange_vector_shape_evaluation_transfer_master.i new file mode 100644 index 00000000..bc3101d7 --- /dev/null +++ b/test/tests/unit/actions/push_pull_lagrange_vector_shape_evaluation_transfer_master.i @@ -0,0 +1,85 @@ +[Mesh] + type = GeneratedMesh + dim = 3 + nx = 5 + ny = 5 + nz = 5 +[] + +[Problem] + solve = false +[] + +[AuxVariables] + [sent_vector] + family = LAGRANGE_VEC + order = FIRST + [] + + [received_vector] + family = LAGRANGE_VEC + order = FIRST + [] +[] + +[Functions] + [set_vector] + type = ParsedVectorFunction + expression_x = '100*x*x' + expression_y = '100*y*y' + expression_z = '100*z*z' + [] +[] + +[ICs] + [set_vector] + type = VectorFunctionIC + variable = sent_vector + function = set_vector + [] +[] + +[MultiApps] + [sub_app] + type = TransientMultiApp + positions = '0 0 0' + input_files = 'push_pull_lagrange_vector_shape_evaluation_transfer_subapp.i' + execute_on = timestep_begin + [] +[] + +[VectorTransfers] + [push] + type = MultiAppShapeEvaluationTransfer + to_multi_app = sub_app + source_variable = sent_vector + variable = received_vector_sub_app + [] + + [pull] + type = MultiAppShapeEvaluationTransfer + from_multi_app = sub_app + source_variable = received_vector_sub_app + variable = received_vector + [] +[] + +[Postprocessors] + [vector_l2_difference] + type = ElementVectorL2Difference + variable = sent_vector + other_variable = received_vector + execute_on = timestep_end + [] +[] + +[Executioner] + type = Transient + dt = 1.0 + start_time = 0.0 + end_time = 1.0 +[] + +[Outputs] + csv = true +[] \ No newline at end of file diff --git a/test/tests/unit/actions/push_pull_lagrange_vector_shape_evaluation_transfer_subapp.i b/test/tests/unit/actions/push_pull_lagrange_vector_shape_evaluation_transfer_subapp.i new file mode 100644 index 00000000..89ca98ad --- /dev/null +++ b/test/tests/unit/actions/push_pull_lagrange_vector_shape_evaluation_transfer_subapp.i @@ -0,0 +1,40 @@ +[Mesh] + type = GeneratedMesh + dim = 3 + nx = 5 + ny = 5 + nz = 5 +[] + +[Problem] + solve = false +[] + +[AuxVariables] + [received_vector_sub_app] + family = LAGRANGE_VEC + order = FIRST + [] + + [received_vector_sub_app_x] + family = LAGRANGE + order = FIRST + [] + + [received_vector_sub_app_y] + family = LAGRANGE + order = FIRST + [] + + [received_vector_sub_app_z] + family = LAGRANGE + order = FIRST + [] +[] + +[Executioner] + type = Transient + dt = 1.0 + start_time = 0.0 + end_time = 1.0 +[] diff --git a/test/tests/unit/actions/push_pull_monomial_vector_shape_evaluation_transfer_master.i b/test/tests/unit/actions/push_pull_monomial_vector_shape_evaluation_transfer_master.i new file mode 100644 index 00000000..c07a62b3 --- /dev/null +++ b/test/tests/unit/actions/push_pull_monomial_vector_shape_evaluation_transfer_master.i @@ -0,0 +1,85 @@ +[Mesh] + type = GeneratedMesh + dim = 3 + nx = 5 + ny = 5 + nz = 5 +[] + +[Problem] + solve = false +[] + +[AuxVariables] + [sent_vector] + family = MONOMIAL_VEC + order = CONSTANT + [] + + [received_vector] + family = MONOMIAL_VEC + order = CONSTANT + [] +[] + +[Functions] + [set_vector] + type = ParsedVectorFunction + expression_x = '100*x*x' + expression_y = '100*y*y' + expression_z = '100*z*z' + [] +[] + +[ICs] + [set_vector] + type = VectorFunctionIC + variable = sent_vector + function = set_vector + [] +[] + +[MultiApps] + [sub_app] + type = TransientMultiApp + positions = '0 0 0' + input_files = 'push_pull_monomial_vector_shape_evaluation_transfer_subapp.i' + execute_on = timestep_begin + [] +[] + +[VectorTransfers] + [push] + type = MultiAppShapeEvaluationTransfer + to_multi_app = sub_app + source_variable = sent_vector + variable = received_vector_sub_app + [] + + [pull] + type = MultiAppShapeEvaluationTransfer + from_multi_app = sub_app + source_variable = received_vector_sub_app + variable = received_vector + [] +[] + +[Postprocessors] + [vector_l2_difference] + type = ElementVectorL2Difference + variable = sent_vector + other_variable = received_vector + execute_on = timestep_end + [] +[] + +[Executioner] + type = Transient + dt = 1.0 + start_time = 0.0 + end_time = 1.0 +[] + +[Outputs] + csv = true +[] \ No newline at end of file diff --git a/test/tests/unit/actions/push_pull_monomial_vector_shape_evaluation_transfer_subapp.i b/test/tests/unit/actions/push_pull_monomial_vector_shape_evaluation_transfer_subapp.i new file mode 100644 index 00000000..0ae23c3c --- /dev/null +++ b/test/tests/unit/actions/push_pull_monomial_vector_shape_evaluation_transfer_subapp.i @@ -0,0 +1,40 @@ +[Mesh] + type = GeneratedMesh + dim = 3 + nx = 5 + ny = 5 + nz = 5 +[] + +[Problem] + solve = false +[] + +[AuxVariables] + [received_vector_sub_app] + family = MONOMIAL_VEC + order = CONSTANT + [] + + [received_vector_sub_app_x] + family = MONOMIAL + order = CONSTANT + [] + + [received_vector_sub_app_y] + family = MONOMIAL + order = CONSTANT + [] + + [received_vector_sub_app_z] + family = MONOMIAL + order = CONSTANT + [] +[] + +[Executioner] + type = Transient + dt = 1.0 + start_time = 0.0 + end_time = 1.0 +[] diff --git a/test/tests/unit/actions/tests b/test/tests/unit/actions/tests index 9ea5fa22..d0555795 100644 --- a/test/tests/unit/actions/tests +++ b/test/tests/unit/actions/tests @@ -22,6 +22,13 @@ requirement = 'Apollo shall have the ability to push and pull a Lagrange vector using the MultiAppGeneralFieldNearestLocationTransfer transfer.' [] + [./PushPullLagrangeVectorShapeEvaluationTransfer] + type = 'CSVDiff' + input = 'push_pull_lagrange_vector_shape_evaluation_transfer_master.i' + csvdiff = 'push_pull_lagrange_vector_shape_evaluation_transfer_master_out.csv' + requirement = 'Apollo shall have the ability to push and pull a Lagrange vector using the MultiAppShapeEvaluationTransfer transfer.' + [] + [./PullMonomialVectorNearestLocationTransfer] type = 'CSVDiff' input = 'pull_monomial_vector_nearest_location_transfer_master.i' @@ -42,4 +49,11 @@ csvdiff = 'push_pull_monomial_vector_nearest_location_transfer_master_out.csv' requirement = 'Apollo shall have the ability to push and pull a Monomial vector using the MultiAppGeneralFieldNearestLocationTransfer transfer.' [] + + [./PushPullMonomialVectorShapeEvaluationTransfer] + type = 'CSVDiff' + input = 'push_pull_monomial_vector_shape_evaluation_transfer_master.i' + csvdiff = 'push_pull_monomial_vector_shape_evaluation_transfer_master_out.csv' + requirement = 'Apollo shall have the ability to push and pull a Monomial vector using the MultiAppShapeEvaluationTransfer transfer.' + [] [] From b52d488283aa3fed8609df6624315205931b9dc8 Mon Sep 17 00:00:00 2001 From: Edward Palmer Date: Fri, 2 Feb 2024 11:38:23 +0000 Subject: [PATCH 08/16] Added MultiAppGeneralFieldShapeEvaluationTransfer vector support. --- include/transfers/MultiAppGeneralVectorTransfer.h | 5 ++++- src/transfers/MultiAppGeneralVectorTransfer.C | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/include/transfers/MultiAppGeneralVectorTransfer.h b/include/transfers/MultiAppGeneralVectorTransfer.h index 26dd1866..eaf4a758 100644 --- a/include/transfers/MultiAppGeneralVectorTransfer.h +++ b/include/transfers/MultiAppGeneralVectorTransfer.h @@ -13,6 +13,7 @@ class MultiAppVectorTransferTemplate; class MultiAppCopyTransfer; // NB: CopyTransfer can handle vector variables. class MultiAppShapeEvaluationTransfer; class MultiAppGeneralFieldNearestLocationTransfer; +class MultiAppGeneralFieldShapeEvaluationTransfer; /** * Create all transfer types using template here. Don't forget to register them in .C file. @@ -22,7 +23,9 @@ typedef MultiAppVectorTransferTemplate typedef MultiAppVectorTransferTemplate MultiAppGeneralFieldNearestLocationTransferVector; typedef MultiAppVectorTransferTemplate MultiAppCopyTransferVector; - +typedef MultiAppVectorTransferTemplate + MultiAppGeneralFieldShapeEvaluationTransferVector; + template class MultiAppVectorTransferTemplate : public MultiAppTransferClassType { diff --git a/src/transfers/MultiAppGeneralVectorTransfer.C b/src/transfers/MultiAppGeneralVectorTransfer.C index 47887000..d7916215 100644 --- a/src/transfers/MultiAppGeneralVectorTransfer.C +++ b/src/transfers/MultiAppGeneralVectorTransfer.C @@ -2,6 +2,7 @@ #include "AuxiliarySystem.h" #include "MultiAppGeneralFieldNearestLocationTransfer.h" +#include "MultiAppGeneralFieldShapeEvaluationTransfer.h" #include "MultiAppShapeEvaluationTransfer.h" #include "MultiAppCopyTransfer.h" @@ -12,6 +13,7 @@ */ registerMooseObject("MooseApp", MultiAppShapeEvaluationTransferVector); registerMooseObject("MooseApp", MultiAppGeneralFieldNearestLocationTransferVector); +registerMooseObject("MooseApp", MultiAppGeneralFieldShapeEvaluationTransferVector); registerMooseObject("MooseApp", MultiAppCopyTransferVector); template From 6e90101d98f6667af81dd5a9ea377c677c49d056 Mon Sep 17 00:00:00 2001 From: Edward Palmer Date: Fri, 2 Feb 2024 11:38:59 +0000 Subject: [PATCH 09/16] Converted ShapeEvaluationTransfer tests to GeneralFieldShapeEvaluationTransfer tests. --- ...sh_pull_lagrange_vector_shape_evaluation_transfer_master.i | 4 ++-- ...sh_pull_monomial_vector_shape_evaluation_transfer_master.i | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/tests/unit/actions/push_pull_lagrange_vector_shape_evaluation_transfer_master.i b/test/tests/unit/actions/push_pull_lagrange_vector_shape_evaluation_transfer_master.i index bc3101d7..fef19d08 100644 --- a/test/tests/unit/actions/push_pull_lagrange_vector_shape_evaluation_transfer_master.i +++ b/test/tests/unit/actions/push_pull_lagrange_vector_shape_evaluation_transfer_master.i @@ -50,14 +50,14 @@ [VectorTransfers] [push] - type = MultiAppShapeEvaluationTransfer + type = MultiAppGeneralFieldShapeEvaluationTransfer to_multi_app = sub_app source_variable = sent_vector variable = received_vector_sub_app [] [pull] - type = MultiAppShapeEvaluationTransfer + type = MultiAppGeneralFieldShapeEvaluationTransfer from_multi_app = sub_app source_variable = received_vector_sub_app variable = received_vector diff --git a/test/tests/unit/actions/push_pull_monomial_vector_shape_evaluation_transfer_master.i b/test/tests/unit/actions/push_pull_monomial_vector_shape_evaluation_transfer_master.i index c07a62b3..2a9574ad 100644 --- a/test/tests/unit/actions/push_pull_monomial_vector_shape_evaluation_transfer_master.i +++ b/test/tests/unit/actions/push_pull_monomial_vector_shape_evaluation_transfer_master.i @@ -50,14 +50,14 @@ [VectorTransfers] [push] - type = MultiAppShapeEvaluationTransfer + type = MultiAppGeneralFieldShapeEvaluationTransfer to_multi_app = sub_app source_variable = sent_vector variable = received_vector_sub_app [] [pull] - type = MultiAppShapeEvaluationTransfer + type = MultiAppGeneralFieldShapeEvaluationTransfer from_multi_app = sub_app source_variable = received_vector_sub_app variable = received_vector From 43a09e26dde10eec08c448cf26c6125ea48370cb Mon Sep 17 00:00:00 2001 From: Edward Palmer Date: Fri, 2 Feb 2024 11:44:37 +0000 Subject: [PATCH 10/16] Removed support for deprecated MultiAppShapeEvaluationTransfer. --- include/transfers/MultiAppGeneralVectorTransfer.h | 5 +---- src/transfers/MultiAppGeneralVectorTransfer.C | 2 -- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/include/transfers/MultiAppGeneralVectorTransfer.h b/include/transfers/MultiAppGeneralVectorTransfer.h index eaf4a758..b07dce52 100644 --- a/include/transfers/MultiAppGeneralVectorTransfer.h +++ b/include/transfers/MultiAppGeneralVectorTransfer.h @@ -11,21 +11,18 @@ template class MultiAppVectorTransferTemplate; class MultiAppCopyTransfer; // NB: CopyTransfer can handle vector variables. -class MultiAppShapeEvaluationTransfer; class MultiAppGeneralFieldNearestLocationTransfer; class MultiAppGeneralFieldShapeEvaluationTransfer; /** * Create all transfer types using template here. Don't forget to register them in .C file. */ -typedef MultiAppVectorTransferTemplate - MultiAppShapeEvaluationTransferVector; typedef MultiAppVectorTransferTemplate MultiAppGeneralFieldNearestLocationTransferVector; typedef MultiAppVectorTransferTemplate MultiAppCopyTransferVector; typedef MultiAppVectorTransferTemplate MultiAppGeneralFieldShapeEvaluationTransferVector; - + template class MultiAppVectorTransferTemplate : public MultiAppTransferClassType { diff --git a/src/transfers/MultiAppGeneralVectorTransfer.C b/src/transfers/MultiAppGeneralVectorTransfer.C index d7916215..0c331f30 100644 --- a/src/transfers/MultiAppGeneralVectorTransfer.C +++ b/src/transfers/MultiAppGeneralVectorTransfer.C @@ -3,7 +3,6 @@ #include "MultiAppGeneralFieldNearestLocationTransfer.h" #include "MultiAppGeneralFieldShapeEvaluationTransfer.h" -#include "MultiAppShapeEvaluationTransfer.h" #include "MultiAppCopyTransfer.h" #include "ApolloVectorTransferFlags.h" @@ -11,7 +10,6 @@ /** * Register all Moose objects that we would like here. */ -registerMooseObject("MooseApp", MultiAppShapeEvaluationTransferVector); registerMooseObject("MooseApp", MultiAppGeneralFieldNearestLocationTransferVector); registerMooseObject("MooseApp", MultiAppGeneralFieldShapeEvaluationTransferVector); registerMooseObject("MooseApp", MultiAppCopyTransferVector); From c36620fd4b66dd4ac98518dcfbc1a9fafa7dd42a Mon Sep 17 00:00:00 2001 From: Edward Palmer Date: Fri, 2 Feb 2024 11:46:13 +0000 Subject: [PATCH 11/16] Removed support for MultiAppCopyTransfer since it can now support vector variables. --- include/transfers/MultiAppGeneralVectorTransfer.h | 2 -- src/transfers/MultiAppGeneralVectorTransfer.C | 1 - 2 files changed, 3 deletions(-) diff --git a/include/transfers/MultiAppGeneralVectorTransfer.h b/include/transfers/MultiAppGeneralVectorTransfer.h index b07dce52..eabc40bb 100644 --- a/include/transfers/MultiAppGeneralVectorTransfer.h +++ b/include/transfers/MultiAppGeneralVectorTransfer.h @@ -10,7 +10,6 @@ template class MultiAppVectorTransferTemplate; -class MultiAppCopyTransfer; // NB: CopyTransfer can handle vector variables. class MultiAppGeneralFieldNearestLocationTransfer; class MultiAppGeneralFieldShapeEvaluationTransfer; @@ -19,7 +18,6 @@ class MultiAppGeneralFieldShapeEvaluationTransfer; */ typedef MultiAppVectorTransferTemplate MultiAppGeneralFieldNearestLocationTransferVector; -typedef MultiAppVectorTransferTemplate MultiAppCopyTransferVector; typedef MultiAppVectorTransferTemplate MultiAppGeneralFieldShapeEvaluationTransferVector; diff --git a/src/transfers/MultiAppGeneralVectorTransfer.C b/src/transfers/MultiAppGeneralVectorTransfer.C index 0c331f30..4a0b7faa 100644 --- a/src/transfers/MultiAppGeneralVectorTransfer.C +++ b/src/transfers/MultiAppGeneralVectorTransfer.C @@ -12,7 +12,6 @@ */ registerMooseObject("MooseApp", MultiAppGeneralFieldNearestLocationTransferVector); registerMooseObject("MooseApp", MultiAppGeneralFieldShapeEvaluationTransferVector); -registerMooseObject("MooseApp", MultiAppCopyTransferVector); template InputParameters From b21cbb134c85d36ef7bff4227f56801eb22f35e5 Mon Sep 17 00:00:00 2001 From: = <=> Date: Thu, 16 May 2024 16:18:06 +0000 Subject: [PATCH 12/16] Fixed a nasty bug where the incorrect factory was used to create auxkernels for a subproblem. This resulted in an error claiming that the auxkernels had not been created by the factory. --- src/actions/AddVectorTransferAction.C | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/actions/AddVectorTransferAction.C b/src/actions/AddVectorTransferAction.C index 491abd73..574d00ba 100644 --- a/src/actions/AddVectorTransferAction.C +++ b/src/actions/AddVectorTransferAction.C @@ -203,7 +203,8 @@ AddVectorTransferAction::addVectorAuxKernel(FEProblemBase & problem, break; } - auto params = _factory.getValidParams(aux_kernel_name); + // NB: we need to use the correct factory! + auto params = problem.getMooseApp().getFactory().getValidParams(aux_kernel_name); params.set("variable") = vector_name; params.set>("component_x") = { @@ -217,7 +218,6 @@ AddVectorTransferAction::addVectorAuxKernel(FEProblemBase & problem, // will be triggered in the template transfer class which wraps around the existing transfer // class. params.set("execute_on") = exec_flag; - problem.addAuxKernel(aux_kernel_name, unique_aux_kernel_name, params); } From 8d58a5ecec5d92625d21deff01f5260121874279 Mon Sep 17 00:00:00 2001 From: Edward Palmer Date: Thu, 16 May 2024 16:21:07 +0000 Subject: [PATCH 13/16] Purged use of _factory which could result in incorrect input parametesr being used in AddVectorTransferAction. --- include/actions/AddVectorTransferAction.h | 3 ++- src/actions/AddVectorTransferAction.C | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/actions/AddVectorTransferAction.h b/include/actions/AddVectorTransferAction.h index 9badf588..1457d6bc 100644 --- a/include/actions/AddVectorTransferAction.h +++ b/include/actions/AddVectorTransferAction.h @@ -123,7 +123,8 @@ class AddVectorTransferAction : public MooseObjectAction /** * Creates the FEType of a variable corresponding to a component of a vector variable. */ - InputParameters buildInputParametersForComponents(MooseVariableFEBase & vector_variable) const; + InputParameters buildInputParametersForComponents(FEProblemBase & problem, + MooseVariableFEBase & vector_variable) const; /** * Check whether the variable is a vector variable of the supported family/order. diff --git a/src/actions/AddVectorTransferAction.C b/src/actions/AddVectorTransferAction.C index 574d00ba..d23c09c4 100644 --- a/src/actions/AddVectorTransferAction.C +++ b/src/actions/AddVectorTransferAction.C @@ -418,7 +418,7 @@ AddVectorTransferAction::buildVectorComponents(FEProblemBase & problem, else { // Attempt to add the auxiliary variable. - auto component_parameters = buildInputParametersForComponents(vector_variable); + auto component_parameters = buildInputParametersForComponents(problem, vector_variable); problem.addAuxVariable("MooseVariable", component_name, component_parameters); } @@ -451,6 +451,7 @@ AddVectorTransferAction::buildVectorComponentExtension(VectorComponent component InputParameters AddVectorTransferAction::buildInputParametersForComponents( + FEProblemBase & problem, MooseVariableFEBase & vector_variable) const { if (!isSupportedVectorVariable(vector_variable)) @@ -461,7 +462,7 @@ AddVectorTransferAction::buildInputParametersForComponents( const auto vector_order = getVariableOrder(vector_variable); const auto vector_family = getVariableFamily(vector_variable); - InputParameters params = _factory.getValidParams("MooseVariable"); + InputParameters params = problem.getMooseApp().getFactory().getValidParams("MooseVariable"); // Should be same order as vector variable but obviously of a different family. params.set("order") = Utility::enum_to_string(OrderWrapper{vector_order}); From 35d945545f505c82877cbb697db8ccfde4ae0218 Mon Sep 17 00:00:00 2001 From: Edward Palmer Date: Thu, 16 May 2024 16:34:21 +0000 Subject: [PATCH 14/16] Merged master; updated hephaestus version. --- contrib/hephaestus | 2 +- include/problem/MFEMProblem.h | 24 +- ...lo-csd3.sh => build-apollo-csd3-cclake.sh} | 0 scripts/build-apollo-csd3-sapphire.sh | 262 ++++++++++++++++++ src/formulations/MagnetostaticFormulation.C | 3 + src/problem/MFEMProblem.C | 31 +-- 6 files changed, 295 insertions(+), 27 deletions(-) rename scripts/{build-apollo-csd3.sh => build-apollo-csd3-cclake.sh} (100%) create mode 100644 scripts/build-apollo-csd3-sapphire.sh diff --git a/contrib/hephaestus b/contrib/hephaestus index 1bac516a..ff359ff3 160000 --- a/contrib/hephaestus +++ b/contrib/hephaestus @@ -1 +1 @@ -Subproject commit 1bac516a390f1fdcf8c176ea20d06d9ef7c76e8e +Subproject commit ff359ff38f1706fa0a960367c20dc1f712ca29f2 diff --git a/include/problem/MFEMProblem.h b/include/problem/MFEMProblem.h index 967acd0e..bfe2c4e7 100644 --- a/include/problem/MFEMProblem.h +++ b/include/problem/MFEMProblem.h @@ -154,6 +154,26 @@ class MFEMProblem : public ExternalProblem void setMOOSENodalVarData(MooseVariableFieldBase & moose_variable); void setMOOSEElementalVarData(MooseVariableFieldBase & moose_variable); + /** + * Template method for adding kernels. We can only add kernels using equation system problem builders. + */ + template + void addKernel(std::string var_name, std::shared_ptr> kernel) + { + using namespace hephaestus; + + EquationSystemProblemBuilderInterface * eqn_system_problem_builder{nullptr}; + + if ((eqn_system_problem_builder = dynamic_cast(mfem_problem_builder.get()))) + { + eqn_system_problem_builder->AddKernel(std::move(var_name), std::move(kernel)); + } + else + { + mooseError("Cannot add kernel with name '" + var_name + "' because there is no equation system."); + } + } + std::string _input_mesh; std::string _formulation_name; int _order; @@ -165,6 +185,6 @@ class MFEMProblem : public ExternalProblem std::shared_ptr mfem_problem_builder{nullptr}; - std::unique_ptr mfem_problem; - std::unique_ptr executioner; + std::unique_ptr mfem_problem{nullptr}; + std::unique_ptr executioner{nullptr}; }; diff --git a/scripts/build-apollo-csd3.sh b/scripts/build-apollo-csd3-cclake.sh similarity index 100% rename from scripts/build-apollo-csd3.sh rename to scripts/build-apollo-csd3-cclake.sh diff --git a/scripts/build-apollo-csd3-sapphire.sh b/scripts/build-apollo-csd3-sapphire.sh new file mode 100644 index 00000000..233a700b --- /dev/null +++ b/scripts/build-apollo-csd3-sapphire.sh @@ -0,0 +1,262 @@ +#!/bin/bash +#SBATCH --nodes=1 +#SBATCH --ntasks=20 +#SBATCH --time=01:30:00 +#SBATCH --mail-type=none +#SBATCH -p sapphire +#SBATCH -A UKAEA-AP001-CPU +#SBATCH --cpus-per-task=1 +#SBATCH -o out_%j_%A_%a +#SBATCH --exclusive +. /etc/profile.d/modules.sh + +function load_modules() { + module purge + module load rhel8/default-icl cmake + module load intel-oneapi-mkl/2022.1.0/intel/mngj3ad6 + module load gcc/11 + module load curl + module load python/3.8 + module load ninja + + export STACK_SRC=`mktemp -d /tmp/moose_stack_src.XXXXXX` + export WORKDIR=`pwd` + export compile_cores=8 + export OMPI_MCA_mca_base_component_show_load_errors=0 + + USER=`whoami` + BUILD_DIR_NAME=${WORKDIR} + + ROOT_PATH=/home/${USER}/rds/rds-ukaea-ap001/${USER} + BUILD_PATH=${ROOT_PATH}/${BUILD_DIR_NAME} + USR_PATH=${BUILD_PATH}/usr + + HDF5_MAJ_VER=1.10 + HDF5_MIN_VER=10 + HDF5_DIR_NAME=hdf5 + HDF5_INSTALL_PATH=${WORKDIR}/${HDF5_DIR_NAME} + + PETSC_COMMIT=38aca504f6ea08cc814f159b2c9bcf837a5876f3 + PETSC_DIR_NAME=petsc + PETSC_INSTALL_DIR=${BUILD_PATH}/petsc + + MOOSE_COMMIT=4e99faf9804480e7be302895ff9b8ded5b9944ea + APOLLO_COMMIT=master + + export PATH=${BUILD_PATH}:${PATH} + + cd ${WORKDIR} + #Need to set some compiler flags via config file" + echo "-std=c++17" >> icpx.cfg + echo "-Wno-tautological-constant-compare" >> icpx.cfg + export ICPXCFG=${WORKDIR}/icpx.cfg + + export CC=mpiicc + export CXX=mpiicpc + export FC=mpiifort + export F77=mpiifort + + export I_MPI_CC=icx + export I_MPI_CXX=icpx + export I_MPI_F90=ifx + export I_MPI_FC=ifx + export I_MPI_F77=ifx +} + +function build_hdf5() { + cd ${WORKDIR} + mkdir -p ${HDF5_DIR_NAME} || { echo "Failed to create ${HDF5_DIR_NAME}" ; exit 1 ; } + + HDF5_MAJ_VER=1.10 + HDF5_MIN_VER=10 + HDF5_VER=${HDF5_MAJ_VER}.${HDF5_MIN_VER} + echo "Downloading HDF5" + curl -kLJO \ + https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-${HDF5_MAJ_VER}/hdf5-${HDF5_VER}/src/hdf5-${HDF5_VER}.tar.gz \ + || { echo "Failed to download hdf5" ; exit 1 ; } + tar -xf hdf5-${HDF5_VER}.tar.gz + + cd hdf5-${HDF5_VER} + make clean + ./configure --prefix=${HDF5_INSTALL_PATH} --enable-cxx --enable-fortran --enable-build-mode=production + make install -j ${compile_cores} + if [ $? -eq 2 ]; then + echo "HDF5 Build failed" + exit 1 + fi + echo "HDF5 built" +} + +function download_superlu_dist() { + cd $WORKDIR + echo "Downloading SuperLU_dist" + curl -kLJO https://github.com/xiaoyeli/superlu_dist/archive/refs/tags/v8.1.0.tar.gz +} + +function build_petsc() { + cd $WORKDIR + mkdir -p petsc + cd petsc + curl -kL -O http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-3.19.3.tar.gz + tar -xf petsc-3.19.3.tar.gz -C . + cd petsc-3.19.3 + ./configure \ + --with-cc=$CC --with-cxx=$CXX --with-fc=$FC -CXXPP=cpp \ + --prefix=${WORKDIR}/${PETSC_DIR_NAME} \ + --download-hypre=1 \ + --with-shared-libraries \ + --with-debugging=no \ + --with-hdf5-dir=${WORKDIR}/${HDF5_DIR_NAME} \ + --with-blaslapack-dir=${MKLROOT} \ + --download-metis=1 \ + --download-parmetis=1 \ + --download-ptscotch=1 \ + --download-mumps=1 \ + --download-superlu_dist=${WORKDIR}/superlu_dist-8.1.0.tar.gz \ + --download-scalapack=1 \ + --download-slepc=1 \ + --with-mpi=1 \ + --with-cxx-dialect=C++17 \ + --with-fortran-bindings=0 \ + --with-sowing=0 \ + --with-64-bit-indices \ + --with-make-np=${SLURM_NTASKS} \ + COPTFLAGS='-O3 -fno-slp-vectorize' \ + CXXOPTFLAGS='-O3 -fno-slp-vectorize' \ + FOPTFLAGS='-O3 -fno-slp-vectorize' \ + PETSC_DIR=`pwd` PETSC_ARCH=arch-linux-c-opt + make + make PETSC_DIR=${WORKDIR}/${PETSC_DIR_NAME}/petsc-3.19.3 PETSC_ARCH=arch-linux-c-opt install \ + || { echo "Failed to build petsc" ; exit 1 ; } + cd .. + cd .. + export PETSC_DIR=$WORKDIR/petsc +} + +function build_libtirpc() { + # Build libtirpc (libmesh dependency) + wget https://sourceforge.net/projects/libtirpc/files/libtirpc/1.3.3/libtirpc-1.3.3.tar.bz2 -O- | tar -xj + mkdir libtirpc + mv libtirpc-* libtirpc/build + cd libtirpc/build + ./configure --prefix=$WORKDIR/libtirpc --disable-gssapi --disable-static && make && make install +} + +function build_moose() { + export MOOSE_JOBS=32 + cd $WORKDIR + git clone https://github.com/idaholab/moose + cd moose + git checkout ${MOOSE_COMMIT} || { echo "Checkout failed" ; exit 1 ; } + if [ ! -f "$WORKDIR/petsc/lib/libpetsc.so" ] ; then + echo "PETSc Install Unsuccessful" + return + fi + export PETSC_DIR=$WORKDIR/petsc + export PETSC_ARCH=arch-linux-c-opt + + #libmesh configure fails with the llvm compilers so we set these back here + export I_MPI_CXX=icpc + export I_MPI_FC=ifort + export I_MPI_F90=ifort + export I_MPI_F77=ifort + export I_MPI_C=icc + + export CPPFLAGS=-I$WORKDIR/libtirpc/include/tirpc + export LDFLAGS=-L$WORKDIR/libtirpc/lib + + ./scripts/update_and_rebuild_libmesh.sh \ + --with-cxx-std=2017 \ + --with-cc=$CC \ + --with-cxx=$CXX \ + --with-fc=$FC + + export I_MPI_CXX=icpx + export I_MPI_FC=ifx + export I_MPI_F90=ifx + export I_MPI_F77=ifx + export I_MPI_C=icx + + ./configure --with-derivative-size=200 --with-ad-indexing-type=global + METHODS='opt' ./scripts/update_and_rebuild_wasp.sh + cd framework + METHOD=opt make -j"$compile_cores" + cd .. + cd modules + METHOD=opt make -j"$compile_cores" + cd .. + cd test + METHOD=opt make -j"$compile_cores" + ./run_tests -j"$compile_cores" + cd .. + cd .. +} + +function build_gslib() { + cd $WORKDIR + if [ -d "$WORKDIR/gslb" ] ; then + return + fi + git clone https://github.com/Nek5000/gslib.git + cd gslib + make CFLAGS='-O2 -fPIC' +} + +function build_mfem() { + cd $WORKDIR + git clone https://github.com/Heinrich-BR/mfem.git + cd mfem + git checkout SubmeshBoundary + sed -i "s|list|# list|g" $WORKDIR/mfem/config/cmake/modules/FindNetCDF.cmake + mkdir build + cd build + echo "Building MFEM" + cmake .. \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_POSITION_INDEPENDENT_CODE=YES \ + -DMFEM_USE_OPENMP=NO \ + -DMFEM_THREAD_SAFE=NO \ + -DHYPRE_DIR=/$WORKDIR/petsc/ \ + -DMFEM_USE_LAPACK=YES \ + -DMFEM_USE_MPI=YES \ + -DMFEM_USE_METIS_5=YES \ + -DMETIS_DIR=/$WORKDIR/petsc/ \ + -DParMETIS_DIR=/$WORKDIR/petsc/ \ + -DMFEM_USE_SUPERLU=YES \ + -DSuperLUDist_DIR=/$WORKDIR/petsc/ \ + -DSuperLUDist_VERSION_OK=YES \ + -DMFEM_USE_NETCDF=YES \ + -DNETCDF_LIBRARIES=$WORKDIR/moose/libmesh/installed/lib/libnetcdf.so \ + -DNETCDF_INCLUDE_DIRS=$WORKDIR/moose/libmesh/contrib/netcdf/netcdf-c-4.6.2/include \ + -DHDF5_DIR=/$WORKDIR/${HDF5_DIR_NAME}/ \ + -DMFEM_USE_GSLIB=YES \ + -DGSLIB_DIR=/$WORKDIR/gslib/build + make -j"$compile_cores" + cd miniapps/common + make -j"$compile_cores" +} + +function build_apollo() { + cd $WORKDIR + git clone https://github.com/aurora-multiphysics/apollo.git + cd apollo + git checkout ${APOLLO_COMMIT} + git submodule update --init --recursive + cd contrib/hephaestus/ + mkdir build + cd build + cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DMFEM_DIR=/$WORKDIR/mfem/build -DCMAKE_CATCH_DISCOVER_TESTS_DISCOVERY_MODE=PRE_TEST .. + ninja + cd /$WORKDIR/apollo + make -j"$compile_cores" +} + +load_modules +build_hdf5 +download_superlu_dist +build_petsc +build_libtirpc +build_moose +build_gslib +build_mfem +build_apollo diff --git a/src/formulations/MagnetostaticFormulation.C b/src/formulations/MagnetostaticFormulation.C index 203cd4f8..c246b45c 100644 --- a/src/formulations/MagnetostaticFormulation.C +++ b/src/formulations/MagnetostaticFormulation.C @@ -47,6 +47,9 @@ MagnetostaticFormulation::MagnetostaticFormulation(const InputParameters & param _magnetic_flux_density_name(isParamValid("magnetic_flux_density_name") ? getParam("magnetic_flux_density_name") : ""), + _lorentz_force_density_name(isParamValid("lorentz_force_density_name") + ? getParam("lorentz_force_density_name") + : ""), _external_magnetic_field_name(isParamValid("external_magnetic_field_name") ? getParam("external_magnetic_field_name") : ""), diff --git a/src/problem/MFEMProblem.C b/src/problem/MFEMProblem.C index 2876411f..0866335a 100644 --- a/src/problem/MFEMProblem.C +++ b/src/problem/MFEMProblem.C @@ -66,22 +66,8 @@ MFEMProblem::initialSetup() mfem_problem_builder->SetCoefficients(_coefficients); mfem_problem_builder->SetSolverOptions(_solver_options); - mfem_problem_builder->RegisterFESpaces(); - mfem_problem_builder->RegisterGridFunctions(); - mfem_problem_builder->RegisterAuxSolvers(); - mfem_problem_builder->RegisterCoefficients(); - - mfem_problem_builder->InitializeKernels(); - mfem_problem_builder->SetOperatorGridFunctions(); - - mfem_problem_builder->ConstructJacobianPreconditioner(); - mfem_problem_builder->ConstructJacobianSolver(); - mfem_problem_builder->ConstructNonlinearSolver(); - - mfem_problem_builder->ConstructState(); - mfem_problem_builder->ConstructTimestepper(); - mfem_problem_builder->InitializeAuxSolvers(); - mfem_problem_builder->InitializeOutputs(); + // NB: set to false to avoid reconstructing problem operator. + mfem_problem_builder->FinalizeProblem(false); hephaestus::InputParameters exec_params; @@ -102,7 +88,7 @@ MFEMProblem::initialSetup() exec_params.SetParam("EndTime", float(_moose_executioner->endTime())); exec_params.SetParam("VisualisationSteps", getParam("vis_steps")); exec_params.SetParam("Problem", - dynamic_cast(mfem_problem.get())); + static_cast(mfem_problem.get())); executioner = std::make_unique(exec_params); } @@ -118,7 +104,7 @@ MFEMProblem::initialSetup() mfem_problem = mfem_steady_problem_builder->ReturnProblem(); exec_params.SetParam("Problem", - dynamic_cast(mfem_problem.get())); + static_cast(mfem_problem.get())); executioner = std::make_unique(exec_params); } @@ -165,7 +151,6 @@ MFEMProblem::setFormulation(const std::string & user_object_name, mfem_problem_builder->SetMesh(std::make_shared(mfem_par_mesh)); mfem_problem_builder->ConstructOperator(); - mfem_problem_builder->ConstructEquationSystem(); } void @@ -278,14 +263,13 @@ MFEMProblem::addKernel(const std::string & kernel_name, if (dynamic_cast(kernel) != nullptr) { MFEMLinearFormKernel * lf_kernel(&getUserObject(name)); - mfem_problem_builder->AddKernel(parameters.get("variable"), - lf_kernel->getKernel()); + addKernel(parameters.get("variable"), lf_kernel->getKernel()); } else if (dynamic_cast(kernel) != nullptr) { MFEMBilinearFormKernel * blf_kernel(&getUserObject(name)); - mfem_problem_builder->AddKernel(parameters.get("variable"), - blf_kernel->getKernel()); + addKernel(parameters.get("variable"), + blf_kernel->getKernel()); } else { @@ -305,7 +289,6 @@ MFEMProblem::addAuxKernel(const std::string & kernel_name, FEProblemBase::addUserObject(kernel_name, name, parameters); MFEMAuxSolver * mfem_auxsolver(&getUserObject(name)); - // NB: - set own_data = false to prevent double-free. mfem_problem_builder->AddPostprocessor(name, mfem_auxsolver->getAuxSolver()); mfem_auxsolver->storeCoefficients(_coefficients); } From c2a2cf8746886b9ae533cba7bf174aa2ce3d45a9 Mon Sep 17 00:00:00 2001 From: Edward Palmer Date: Fri, 17 May 2024 14:28:43 +0000 Subject: [PATCH 15/16] Removed csv files accidentally added to src directory. --- .../gold/pull_lagrange_vector_copy_transfer_master_out.csv | 3 --- ...ll_lagrange_vector_nearest_location_transfer_master_out.csv | 3 --- .../gold/pull_monomial_vector_copy_transfer_master_out.csv | 3 --- .../push_lagrange_vector_copy_transfer_master_out_sub_app0.csv | 3 --- .../push_monomial_vector_copy_transfer_master_out_sub_app0.csv | 3 --- .../push_pull_lagrange_vector_copy_transfer_master_out.csv | 3 --- .../push_pull_monomial_vector_copy_transfer_master_out.csv | 3 --- 7 files changed, 21 deletions(-) delete mode 100644 src/actions/gold/pull_lagrange_vector_copy_transfer_master_out.csv delete mode 100644 src/actions/gold/pull_lagrange_vector_nearest_location_transfer_master_out.csv delete mode 100644 src/actions/gold/pull_monomial_vector_copy_transfer_master_out.csv delete mode 100644 src/actions/gold/push_lagrange_vector_copy_transfer_master_out_sub_app0.csv delete mode 100644 src/actions/gold/push_monomial_vector_copy_transfer_master_out_sub_app0.csv delete mode 100644 src/actions/gold/push_pull_lagrange_vector_copy_transfer_master_out.csv delete mode 100644 src/actions/gold/push_pull_monomial_vector_copy_transfer_master_out.csv diff --git a/src/actions/gold/pull_lagrange_vector_copy_transfer_master_out.csv b/src/actions/gold/pull_lagrange_vector_copy_transfer_master_out.csv deleted file mode 100644 index f260eb1a..00000000 --- a/src/actions/gold/pull_lagrange_vector_copy_transfer_master_out.csv +++ /dev/null @@ -1,3 +0,0 @@ -time,vector_l2_difference -0,0 -1,0 diff --git a/src/actions/gold/pull_lagrange_vector_nearest_location_transfer_master_out.csv b/src/actions/gold/pull_lagrange_vector_nearest_location_transfer_master_out.csv deleted file mode 100644 index f260eb1a..00000000 --- a/src/actions/gold/pull_lagrange_vector_nearest_location_transfer_master_out.csv +++ /dev/null @@ -1,3 +0,0 @@ -time,vector_l2_difference -0,0 -1,0 diff --git a/src/actions/gold/pull_monomial_vector_copy_transfer_master_out.csv b/src/actions/gold/pull_monomial_vector_copy_transfer_master_out.csv deleted file mode 100644 index f260eb1a..00000000 --- a/src/actions/gold/pull_monomial_vector_copy_transfer_master_out.csv +++ /dev/null @@ -1,3 +0,0 @@ -time,vector_l2_difference -0,0 -1,0 diff --git a/src/actions/gold/push_lagrange_vector_copy_transfer_master_out_sub_app0.csv b/src/actions/gold/push_lagrange_vector_copy_transfer_master_out_sub_app0.csv deleted file mode 100644 index f260eb1a..00000000 --- a/src/actions/gold/push_lagrange_vector_copy_transfer_master_out_sub_app0.csv +++ /dev/null @@ -1,3 +0,0 @@ -time,vector_l2_difference -0,0 -1,0 diff --git a/src/actions/gold/push_monomial_vector_copy_transfer_master_out_sub_app0.csv b/src/actions/gold/push_monomial_vector_copy_transfer_master_out_sub_app0.csv deleted file mode 100644 index f260eb1a..00000000 --- a/src/actions/gold/push_monomial_vector_copy_transfer_master_out_sub_app0.csv +++ /dev/null @@ -1,3 +0,0 @@ -time,vector_l2_difference -0,0 -1,0 diff --git a/src/actions/gold/push_pull_lagrange_vector_copy_transfer_master_out.csv b/src/actions/gold/push_pull_lagrange_vector_copy_transfer_master_out.csv deleted file mode 100644 index f260eb1a..00000000 --- a/src/actions/gold/push_pull_lagrange_vector_copy_transfer_master_out.csv +++ /dev/null @@ -1,3 +0,0 @@ -time,vector_l2_difference -0,0 -1,0 diff --git a/src/actions/gold/push_pull_monomial_vector_copy_transfer_master_out.csv b/src/actions/gold/push_pull_monomial_vector_copy_transfer_master_out.csv deleted file mode 100644 index f260eb1a..00000000 --- a/src/actions/gold/push_pull_monomial_vector_copy_transfer_master_out.csv +++ /dev/null @@ -1,3 +0,0 @@ -time,vector_l2_difference -0,0 -1,0 From 0d893096d7e1c9ee9b4351d8d80fba7b363bf101 Mon Sep 17 00:00:00 2001 From: Edward Palmer Date: Fri, 17 May 2024 14:31:03 +0000 Subject: [PATCH 16/16] Renamed test/tests/unit/actions to test/tests/unit/vector_transfers. --- .../pull_lagrange_vector_nearest_location_transfer_master_out.csv | 0 .../pull_monomial_vector_nearest_location_transfer_master_out.csv | 0 ...range_vector_nearest_location_transfer_master_out_sub_app0.csv | 0 ...omial_vector_nearest_location_transfer_master_out_sub_app0.csv | 0 ..._pull_lagrange_vector_nearest_location_transfer_master_out.csv | 0 ..._pull_lagrange_vector_shape_evaluation_transfer_master_out.csv | 0 ..._pull_monomial_vector_nearest_location_transfer_master_out.csv | 0 ..._pull_monomial_vector_shape_evaluation_transfer_master_out.csv | 0 .../pull_lagrange_vector_nearest_location_transfer_master.i | 0 .../pull_lagrange_vector_nearest_location_transfer_subapp.i | 0 .../pull_monomial_vector_nearest_location_transfer_master.i | 0 .../pull_monomial_vector_nearest_location_transfer_subapp.i | 0 .../push_lagrange_vector_nearest_location_transfer_master.i | 0 .../push_lagrange_vector_nearest_location_transfer_subapp.i | 0 .../push_monomial_vector_nearest_location_transfer_master.i | 0 .../push_monomial_vector_nearest_location_transfer_subapp.i | 0 .../push_pull_lagrange_vector_nearest_location_transfer_master.i | 0 .../push_pull_lagrange_vector_nearest_location_transfer_subapp.i | 0 .../push_pull_lagrange_vector_shape_evaluation_transfer_master.i | 0 .../push_pull_lagrange_vector_shape_evaluation_transfer_subapp.i | 0 .../push_pull_monomial_vector_nearest_location_transfer_master.i | 0 .../push_pull_monomial_vector_nearest_location_transfer_subapp.i | 0 .../push_pull_monomial_vector_shape_evaluation_transfer_master.i | 0 .../push_pull_monomial_vector_shape_evaluation_transfer_subapp.i | 0 test/tests/unit/{actions => vector_transfers}/tests | 0 25 files changed, 0 insertions(+), 0 deletions(-) rename test/tests/unit/{actions => vector_transfers}/gold/pull_lagrange_vector_nearest_location_transfer_master_out.csv (100%) rename test/tests/unit/{actions => vector_transfers}/gold/pull_monomial_vector_nearest_location_transfer_master_out.csv (100%) rename test/tests/unit/{actions => vector_transfers}/gold/push_lagrange_vector_nearest_location_transfer_master_out_sub_app0.csv (100%) rename test/tests/unit/{actions => vector_transfers}/gold/push_monomial_vector_nearest_location_transfer_master_out_sub_app0.csv (100%) rename test/tests/unit/{actions => vector_transfers}/gold/push_pull_lagrange_vector_nearest_location_transfer_master_out.csv (100%) rename test/tests/unit/{actions => vector_transfers}/gold/push_pull_lagrange_vector_shape_evaluation_transfer_master_out.csv (100%) rename test/tests/unit/{actions => vector_transfers}/gold/push_pull_monomial_vector_nearest_location_transfer_master_out.csv (100%) rename test/tests/unit/{actions => vector_transfers}/gold/push_pull_monomial_vector_shape_evaluation_transfer_master_out.csv (100%) rename test/tests/unit/{actions => vector_transfers}/pull_lagrange_vector_nearest_location_transfer_master.i (100%) rename test/tests/unit/{actions => vector_transfers}/pull_lagrange_vector_nearest_location_transfer_subapp.i (100%) rename test/tests/unit/{actions => vector_transfers}/pull_monomial_vector_nearest_location_transfer_master.i (100%) rename test/tests/unit/{actions => vector_transfers}/pull_monomial_vector_nearest_location_transfer_subapp.i (100%) rename test/tests/unit/{actions => vector_transfers}/push_lagrange_vector_nearest_location_transfer_master.i (100%) rename test/tests/unit/{actions => vector_transfers}/push_lagrange_vector_nearest_location_transfer_subapp.i (100%) rename test/tests/unit/{actions => vector_transfers}/push_monomial_vector_nearest_location_transfer_master.i (100%) rename test/tests/unit/{actions => vector_transfers}/push_monomial_vector_nearest_location_transfer_subapp.i (100%) rename test/tests/unit/{actions => vector_transfers}/push_pull_lagrange_vector_nearest_location_transfer_master.i (100%) rename test/tests/unit/{actions => vector_transfers}/push_pull_lagrange_vector_nearest_location_transfer_subapp.i (100%) rename test/tests/unit/{actions => vector_transfers}/push_pull_lagrange_vector_shape_evaluation_transfer_master.i (100%) rename test/tests/unit/{actions => vector_transfers}/push_pull_lagrange_vector_shape_evaluation_transfer_subapp.i (100%) rename test/tests/unit/{actions => vector_transfers}/push_pull_monomial_vector_nearest_location_transfer_master.i (100%) rename test/tests/unit/{actions => vector_transfers}/push_pull_monomial_vector_nearest_location_transfer_subapp.i (100%) rename test/tests/unit/{actions => vector_transfers}/push_pull_monomial_vector_shape_evaluation_transfer_master.i (100%) rename test/tests/unit/{actions => vector_transfers}/push_pull_monomial_vector_shape_evaluation_transfer_subapp.i (100%) rename test/tests/unit/{actions => vector_transfers}/tests (100%) diff --git a/test/tests/unit/actions/gold/pull_lagrange_vector_nearest_location_transfer_master_out.csv b/test/tests/unit/vector_transfers/gold/pull_lagrange_vector_nearest_location_transfer_master_out.csv similarity index 100% rename from test/tests/unit/actions/gold/pull_lagrange_vector_nearest_location_transfer_master_out.csv rename to test/tests/unit/vector_transfers/gold/pull_lagrange_vector_nearest_location_transfer_master_out.csv diff --git a/test/tests/unit/actions/gold/pull_monomial_vector_nearest_location_transfer_master_out.csv b/test/tests/unit/vector_transfers/gold/pull_monomial_vector_nearest_location_transfer_master_out.csv similarity index 100% rename from test/tests/unit/actions/gold/pull_monomial_vector_nearest_location_transfer_master_out.csv rename to test/tests/unit/vector_transfers/gold/pull_monomial_vector_nearest_location_transfer_master_out.csv diff --git a/test/tests/unit/actions/gold/push_lagrange_vector_nearest_location_transfer_master_out_sub_app0.csv b/test/tests/unit/vector_transfers/gold/push_lagrange_vector_nearest_location_transfer_master_out_sub_app0.csv similarity index 100% rename from test/tests/unit/actions/gold/push_lagrange_vector_nearest_location_transfer_master_out_sub_app0.csv rename to test/tests/unit/vector_transfers/gold/push_lagrange_vector_nearest_location_transfer_master_out_sub_app0.csv diff --git a/test/tests/unit/actions/gold/push_monomial_vector_nearest_location_transfer_master_out_sub_app0.csv b/test/tests/unit/vector_transfers/gold/push_monomial_vector_nearest_location_transfer_master_out_sub_app0.csv similarity index 100% rename from test/tests/unit/actions/gold/push_monomial_vector_nearest_location_transfer_master_out_sub_app0.csv rename to test/tests/unit/vector_transfers/gold/push_monomial_vector_nearest_location_transfer_master_out_sub_app0.csv diff --git a/test/tests/unit/actions/gold/push_pull_lagrange_vector_nearest_location_transfer_master_out.csv b/test/tests/unit/vector_transfers/gold/push_pull_lagrange_vector_nearest_location_transfer_master_out.csv similarity index 100% rename from test/tests/unit/actions/gold/push_pull_lagrange_vector_nearest_location_transfer_master_out.csv rename to test/tests/unit/vector_transfers/gold/push_pull_lagrange_vector_nearest_location_transfer_master_out.csv diff --git a/test/tests/unit/actions/gold/push_pull_lagrange_vector_shape_evaluation_transfer_master_out.csv b/test/tests/unit/vector_transfers/gold/push_pull_lagrange_vector_shape_evaluation_transfer_master_out.csv similarity index 100% rename from test/tests/unit/actions/gold/push_pull_lagrange_vector_shape_evaluation_transfer_master_out.csv rename to test/tests/unit/vector_transfers/gold/push_pull_lagrange_vector_shape_evaluation_transfer_master_out.csv diff --git a/test/tests/unit/actions/gold/push_pull_monomial_vector_nearest_location_transfer_master_out.csv b/test/tests/unit/vector_transfers/gold/push_pull_monomial_vector_nearest_location_transfer_master_out.csv similarity index 100% rename from test/tests/unit/actions/gold/push_pull_monomial_vector_nearest_location_transfer_master_out.csv rename to test/tests/unit/vector_transfers/gold/push_pull_monomial_vector_nearest_location_transfer_master_out.csv diff --git a/test/tests/unit/actions/gold/push_pull_monomial_vector_shape_evaluation_transfer_master_out.csv b/test/tests/unit/vector_transfers/gold/push_pull_monomial_vector_shape_evaluation_transfer_master_out.csv similarity index 100% rename from test/tests/unit/actions/gold/push_pull_monomial_vector_shape_evaluation_transfer_master_out.csv rename to test/tests/unit/vector_transfers/gold/push_pull_monomial_vector_shape_evaluation_transfer_master_out.csv diff --git a/test/tests/unit/actions/pull_lagrange_vector_nearest_location_transfer_master.i b/test/tests/unit/vector_transfers/pull_lagrange_vector_nearest_location_transfer_master.i similarity index 100% rename from test/tests/unit/actions/pull_lagrange_vector_nearest_location_transfer_master.i rename to test/tests/unit/vector_transfers/pull_lagrange_vector_nearest_location_transfer_master.i diff --git a/test/tests/unit/actions/pull_lagrange_vector_nearest_location_transfer_subapp.i b/test/tests/unit/vector_transfers/pull_lagrange_vector_nearest_location_transfer_subapp.i similarity index 100% rename from test/tests/unit/actions/pull_lagrange_vector_nearest_location_transfer_subapp.i rename to test/tests/unit/vector_transfers/pull_lagrange_vector_nearest_location_transfer_subapp.i diff --git a/test/tests/unit/actions/pull_monomial_vector_nearest_location_transfer_master.i b/test/tests/unit/vector_transfers/pull_monomial_vector_nearest_location_transfer_master.i similarity index 100% rename from test/tests/unit/actions/pull_monomial_vector_nearest_location_transfer_master.i rename to test/tests/unit/vector_transfers/pull_monomial_vector_nearest_location_transfer_master.i diff --git a/test/tests/unit/actions/pull_monomial_vector_nearest_location_transfer_subapp.i b/test/tests/unit/vector_transfers/pull_monomial_vector_nearest_location_transfer_subapp.i similarity index 100% rename from test/tests/unit/actions/pull_monomial_vector_nearest_location_transfer_subapp.i rename to test/tests/unit/vector_transfers/pull_monomial_vector_nearest_location_transfer_subapp.i diff --git a/test/tests/unit/actions/push_lagrange_vector_nearest_location_transfer_master.i b/test/tests/unit/vector_transfers/push_lagrange_vector_nearest_location_transfer_master.i similarity index 100% rename from test/tests/unit/actions/push_lagrange_vector_nearest_location_transfer_master.i rename to test/tests/unit/vector_transfers/push_lagrange_vector_nearest_location_transfer_master.i diff --git a/test/tests/unit/actions/push_lagrange_vector_nearest_location_transfer_subapp.i b/test/tests/unit/vector_transfers/push_lagrange_vector_nearest_location_transfer_subapp.i similarity index 100% rename from test/tests/unit/actions/push_lagrange_vector_nearest_location_transfer_subapp.i rename to test/tests/unit/vector_transfers/push_lagrange_vector_nearest_location_transfer_subapp.i diff --git a/test/tests/unit/actions/push_monomial_vector_nearest_location_transfer_master.i b/test/tests/unit/vector_transfers/push_monomial_vector_nearest_location_transfer_master.i similarity index 100% rename from test/tests/unit/actions/push_monomial_vector_nearest_location_transfer_master.i rename to test/tests/unit/vector_transfers/push_monomial_vector_nearest_location_transfer_master.i diff --git a/test/tests/unit/actions/push_monomial_vector_nearest_location_transfer_subapp.i b/test/tests/unit/vector_transfers/push_monomial_vector_nearest_location_transfer_subapp.i similarity index 100% rename from test/tests/unit/actions/push_monomial_vector_nearest_location_transfer_subapp.i rename to test/tests/unit/vector_transfers/push_monomial_vector_nearest_location_transfer_subapp.i diff --git a/test/tests/unit/actions/push_pull_lagrange_vector_nearest_location_transfer_master.i b/test/tests/unit/vector_transfers/push_pull_lagrange_vector_nearest_location_transfer_master.i similarity index 100% rename from test/tests/unit/actions/push_pull_lagrange_vector_nearest_location_transfer_master.i rename to test/tests/unit/vector_transfers/push_pull_lagrange_vector_nearest_location_transfer_master.i diff --git a/test/tests/unit/actions/push_pull_lagrange_vector_nearest_location_transfer_subapp.i b/test/tests/unit/vector_transfers/push_pull_lagrange_vector_nearest_location_transfer_subapp.i similarity index 100% rename from test/tests/unit/actions/push_pull_lagrange_vector_nearest_location_transfer_subapp.i rename to test/tests/unit/vector_transfers/push_pull_lagrange_vector_nearest_location_transfer_subapp.i diff --git a/test/tests/unit/actions/push_pull_lagrange_vector_shape_evaluation_transfer_master.i b/test/tests/unit/vector_transfers/push_pull_lagrange_vector_shape_evaluation_transfer_master.i similarity index 100% rename from test/tests/unit/actions/push_pull_lagrange_vector_shape_evaluation_transfer_master.i rename to test/tests/unit/vector_transfers/push_pull_lagrange_vector_shape_evaluation_transfer_master.i diff --git a/test/tests/unit/actions/push_pull_lagrange_vector_shape_evaluation_transfer_subapp.i b/test/tests/unit/vector_transfers/push_pull_lagrange_vector_shape_evaluation_transfer_subapp.i similarity index 100% rename from test/tests/unit/actions/push_pull_lagrange_vector_shape_evaluation_transfer_subapp.i rename to test/tests/unit/vector_transfers/push_pull_lagrange_vector_shape_evaluation_transfer_subapp.i diff --git a/test/tests/unit/actions/push_pull_monomial_vector_nearest_location_transfer_master.i b/test/tests/unit/vector_transfers/push_pull_monomial_vector_nearest_location_transfer_master.i similarity index 100% rename from test/tests/unit/actions/push_pull_monomial_vector_nearest_location_transfer_master.i rename to test/tests/unit/vector_transfers/push_pull_monomial_vector_nearest_location_transfer_master.i diff --git a/test/tests/unit/actions/push_pull_monomial_vector_nearest_location_transfer_subapp.i b/test/tests/unit/vector_transfers/push_pull_monomial_vector_nearest_location_transfer_subapp.i similarity index 100% rename from test/tests/unit/actions/push_pull_monomial_vector_nearest_location_transfer_subapp.i rename to test/tests/unit/vector_transfers/push_pull_monomial_vector_nearest_location_transfer_subapp.i diff --git a/test/tests/unit/actions/push_pull_monomial_vector_shape_evaluation_transfer_master.i b/test/tests/unit/vector_transfers/push_pull_monomial_vector_shape_evaluation_transfer_master.i similarity index 100% rename from test/tests/unit/actions/push_pull_monomial_vector_shape_evaluation_transfer_master.i rename to test/tests/unit/vector_transfers/push_pull_monomial_vector_shape_evaluation_transfer_master.i diff --git a/test/tests/unit/actions/push_pull_monomial_vector_shape_evaluation_transfer_subapp.i b/test/tests/unit/vector_transfers/push_pull_monomial_vector_shape_evaluation_transfer_subapp.i similarity index 100% rename from test/tests/unit/actions/push_pull_monomial_vector_shape_evaluation_transfer_subapp.i rename to test/tests/unit/vector_transfers/push_pull_monomial_vector_shape_evaluation_transfer_subapp.i diff --git a/test/tests/unit/actions/tests b/test/tests/unit/vector_transfers/tests similarity index 100% rename from test/tests/unit/actions/tests rename to test/tests/unit/vector_transfers/tests