57 std::string path(_pathToTests +
"parallel-implicit-cplscheme-relax-const-config.xml");
60 PtrDataConfiguration dataConfig(
new DataConfiguration(root));
61 PtrMeshConfiguration meshConfig(
new MeshConfiguration(root, dataConfig));
77 auto m2n = context.connectPrimaryRanks(
"Participant0",
"Participant1", options);
88 const auto dataID0 =
mesh->createData(
"Data0", 1, 0_dataID)->getID();
89 const auto dataID1 =
mesh->createData(
"Data1", 3, 1_dataID)->getID();
90 mesh->createVertex(Eigen::Vector3d::Zero());
91 mesh->allocateDataValues();
97 int maxTimeWindows = 3;
98 const double timeWindowSize = 0.1;
99 const double timeStepSize = timeWindowSize;
102 int sendDataIndex = -1;
103 int receiveDataIndex = -1;
104 bool dataRequiresInitialization =
false;
105 if (context.isNamed(nameParticipant0)) {
106 sendDataIndex = dataID0;
107 receiveDataIndex = dataID1;
108 dataRequiresInitialization =
true;
110 sendDataIndex = dataID1;
111 receiveDataIndex = dataID0;
112 dataRequiresInitialization =
true;
116 const int minIterations = 1;
117 const int maxIterations = 3;
122 CouplingData *sendCouplingData = Fixture::getSendData(cplScheme, sendDataIndex);
124 CouplingData *receiveCouplingData = Fixture::getReceiveData(cplScheme, receiveDataIndex);
127 if (context.isNamed(nameParticipant0)) {
129 BOOST_TEST(receiveCouplingData->
values().size() == 3);
131 BOOST_TEST(sendCouplingData->
values().size() == 1);
132 BOOST_TEST(Fixture::isImplicitCouplingScheme(cplScheme));
160 BOOST_TEST(context.isNamed(nameParticipant1));
162 Eigen::VectorXd v(3);
167 BOOST_TEST(receiveCouplingData->
values().size() == 1);
169 BOOST_TEST(sendCouplingData->
values().size() == 3);
BOOST_AUTO_TEST_CASE(testIQNIMVJPPWithSubsteps)
BOOST_AUTO_TEST_SUITE(PreProcess)
BOOST_AUTO_TEST_SUITE_END()
BOOST_AUTO_TEST_CASE(testParseConfigurationWithRelaxation)
#define PRECICE_TEST_SETUP(...)
Creates and attaches a TestSetup to a Boost test case.
Performs XML configuration of a participant.
bool isCouplingOngoing() const final override
Returns true, when the coupled simulation is still ongoing.
ChangedMeshes secondSynchronization() final override
bool addComputedTime(double timeToAdd) final override
Adds newly computed time. Has to be called before every advance.
double getNextTimeStepMaxSize() const final override
Returns the maximal size of the next time step to be computed.
ChangedMeshes firstSynchronization(const ChangedMeshes &changes) final override
void finalize() final override
Finalizes the coupling scheme.
bool hasDataBeenReceived() const final override
getter for _hasDataBeenReceived
double getTime() const final override
getter for _time
void initialize() final override
Initializes the coupling scheme and establishes a communication connection to the coupling partner....
void markActionFulfilled(Action action) final override
Tells the coupling scheme that the accessor has performed the given action.
bool isActionRequired(Action action) const final override
Returns true, if the given action has to be performed by the accessor.
void firstExchange() final override
void secondExchange() final override
void addDataToReceive(const mesh::PtrData &data, mesh::PtrMesh mesh, bool requiresInitialization, bool exchangeSubsteps)
Adds data to be received on data exchange.
void addDataToSend(const mesh::PtrData &data, mesh::PtrMesh mesh, bool requiresInitialization, bool exchangeSubsteps)
Adds data to be sent on data exchange and possibly be modified during coupling iterations.
void determineInitialDataExchange() override
Determines which data is initialized and therefore has to be exchanged during initialize.
const Eigen::VectorXd & values() const
Returns a const reference to the data values.
const Eigen::VectorXd & previousIteration() const
returns data value from previous iteration
void setSampleAtTime(double time, time::Sample sample)
Add sample at given time to _timeStepsStorage.
int getPreviousIterationSize() const
returns size of previous iteration
Configuration for coupling schemes.
acceleration::PtrAccelerationConfiguration _accelerationConfig
@ WriteCheckpoint
Is the participant required to write a checkpoint?
@ ReadCheckpoint
Is the participant required to read a previously written checkpoint?
@ InitializeData
Is the initialization of coupling data required?
Coupling scheme for parallel coupling, i.e. simultaneous execution of two coupled participants.
Configuration for communication channels between solvers.
std::shared_ptr< M2NConfiguration > SharedPointer
Performs and provides configuration for Data objects from XML files.
void addMesh(const mesh::PtrMesh &mesh)
void insertMeshToMeshDimensionsMap(const std::string &mesh, int dimensions)
Initialize the map between meshes and dimensions, for unit tests that directly create mesh objects wi...
Container and creator for meshes.
Represents an XML tag to be configured automatically.
std::shared_ptr< ParticipantConfiguration > PtrParticipantConfiguration
contains implementations of coupling schemes for coupled simulations.
contains the logic of the parallel communication between participants.
provides Mesh, Data and primitives.
std::shared_ptr< DataConfiguration > PtrDataConfiguration
std::shared_ptr< Mesh > PtrMesh
@ Events
Require to initialize Event.
boost::test_tools::predicate_result equals(const std::vector< float > &VectorA, const std::vector< float > &VectorB, float tolerance)
equals to be used in tests. Compares two std::vectors using a given tolerance. Prints both operands o...
std::string getPathToSources()
Returns the base path to the sources.
XMLTag getRootTag()
Returns an empty root tag with name "configuration".
std::string configure(XMLTag &tag, const precice::xml::ConfigurationContext &context, std::string_view configurationFilename)
Configures the given configuration from file configurationFilename.
Main namespace of the precice library.
ParallelImplicitCouplingSchemeFixture()
Tightly coupled to the parameters of Participant()