Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: added dummy AllOutput to old API #280

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions source/MoorDyn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,3 +281,11 @@ GetNodePos(int LineNum, int NodeNum, double pos[3])
auto line = MoorDyn_GetLine(md_singleton, LineNum);
return MoorDyn_GetLineNodePos(line, NodeNum, pos);
}

void DECLDIR
AllOutput(double t, double dt)
{
if (!md_singleton)
return;
std::cout << "In version 2, AllOutput is automatically called by MoorDynInit and MoorDynStep" << std::endl;
}
2 changes: 1 addition & 1 deletion source/MoorDyn.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ extern "C"
int DECLDIR GetPointForce(int l, double force[3]);
int DECLDIR GetNodePos(int LineNum, int NodeNum, double pos[3]);

int AllOutput(double, double);
void DECLDIR AllOutput(double, double);

/**
* @}
Expand Down
6 changes: 3 additions & 3 deletions source/MoorDyn2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@ moordyn::MoorDyn::Init(const double* x, const double* xd, bool skip_ic)
}

// write t=0 output
return AllOutput(0.0, 0.0);
return WriteOutputs(0.0, 0.0);
}

moordyn::error_id DECLDIR
Expand Down Expand Up @@ -761,7 +761,7 @@ moordyn::MoorDyn::Step(const double* x,
// specifying max tension things)

// ------------------------ write outputs --------------------------
const moordyn::error_id err = AllOutput(t, dt);
const moordyn::error_id err = WriteOutputs(t, dt);
if (err != MOORDYN_SUCCESS)
return err;

Expand Down Expand Up @@ -2325,7 +2325,7 @@ moordyn::MoorDyn::detachLines(FailProps* failure)
}

moordyn::error_id
moordyn::MoorDyn::AllOutput(double t, double dt)
moordyn::MoorDyn::WriteOutputs(double t, double dt)
{
if (disableOutput)
return MOORDYN_SUCCESS;
Expand Down
2 changes: 1 addition & 1 deletion source/MoorDyn2.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -847,7 +847,7 @@ class MoorDyn final : public io::IO
* @return MOORDYN_SUCCESS if the output is correctly printed, an error
* code otherwise
*/
moordyn::error_id AllOutput(double t, double dt);
moordyn::error_id WriteOutputs(double t, double dt);
};

} // ::moordyn
Loading