Skip to content

Commit

Permalink
Update coefficient writing to match Cylinder.
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-petersen committed Oct 3, 2023
1 parent 18d4acc commit 267f26f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/CBrockDisk.cc
Original file line number Diff line number Diff line change
Expand Up @@ -898,11 +898,10 @@ void CBrockDisk::dump_coefs_h5(const std::string& file)
cylCoefs.add(cur);
cylCoefs.ExtendH5Coefs(file);
} else {

// Copy the YAML config. We only need this on the first call.
std::ostringstream sout; sout << conf;
size_t hsize = sout.str().size() + 1;
cur->buf = std::shared_ptr<char[]>(new char [hsize]);
sout.str().copy(cur->buf.get(), hsize); // Copy to CoefStruct buffer
cur->buf = sout.str(); // Copy to CoefStruct buffer

// Add the name attribute. We only need this on the first call.
cylCoefs.setName(component->name);
Expand Down

1 comment on commit 267f26f

@The9Cat
Copy link
Contributor

@The9Cat The9Cat commented on 267f26f Oct 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's the updated design; use a std::string to manage the char buffer. The original way was pretty silly.

Please sign in to comment.