Skip to content
Merged
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
18 changes: 18 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,24 @@

Please see the release notes in ``doc/devsim.pdf`` or at [https://devsim.net](https://devsim.net) for more detailed information about changes.

## Version 2.8.0

### Centos 7 End Of Life

### Data output

#### Reduction in data file sizes

Based on a contribution by [@simbilod](https://github.com/simbilod) `devsim.write_devices` now supports reducing the file size of data files by specifying a callback function to reduce data usage. This is through the `include_test` option. This option is a function that takes a string and returns `True` if the model should be written. It is only supported for the `tecplot` and `vtk` formats.

An example is provided in `testing/XXXXX.py`

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

should XXXXX be mesh2d.py ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

thanks, I'll clean this up at the end.



#### FLOOPS Data File Output

The `floops` option for `devsim.write_devices` has been removed.


## Version 2.7.3

Fixed issue [#133](https://github.com/devsim/devsim/issues/133) identified by [@yh-kwok](https://github.com/yh-kwok).
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ INCLUDE(${PROJECT_SOURCE_DIR}/cmake/${DEVSIM_CONFIG}.cmake OPTIONAL)
INCLUDE(${PROJECT_SOURCE_DIR}/local.cmake OPTIONAL)

#also change this in setup.cfg
ADD_DEFINITIONS(-DDEVSIM_VERSION_STRING=\"2.7.3\")
ADD_DEFINITIONS(-DDEVSIM_VERSION_STRING=\"2.8.0\")
ADD_DEFINITIONS(-DDEVSIM_COPYRIGHT_YEAR=\"2009-2024\")

IF (DEVSIM_MATERIALDB)
Expand Down
2 changes: 1 addition & 1 deletion dist/bdist_wheel/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
py-limited-api = cp37
#plat-name=
[metadata]
version = 2.7.3
version = 2.8.0
classifiers =
Development Status :: 5 - Production/Stable
Intended Audience :: Science/Research
Expand Down
4 changes: 2 additions & 2 deletions examples/mobility/gmsh_mos2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
)
from devsim.python_packages.model_create import CreateSolution


device = "mos2d"
silicon_regions = ("gate", "bulk")
oxide_regions = ("oxide",)
Expand Down Expand Up @@ -57,8 +58,7 @@

solve(type="dc", absolute_error=1.0e-13, relative_error=1e-12, maximum_iterations=30)
solve(type="dc", absolute_error=1.0e-13, relative_error=1e-12, maximum_iterations=30)
#
##write_devices -file gmsh_mos2d_potentialonly.flps -type floops

write_devices(file="gmsh_mos2d_potentialonly", type="vtk")

for i in silicon_regions:
Expand Down
3 changes: 1 addition & 2 deletions examples/mobility/gmsh_mos2d_kla.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,7 @@
# write_devices(file="foo.msh", type="devsim")
solve(type="dc", absolute_error=1.0e-13, relative_error=1e-12, maximum_iterations=30)
solve(type="dc", absolute_error=1.0e-13, relative_error=1e-12, maximum_iterations=30)
#
##write_devices -file gmsh_mos2d_potentialonly.flps -type floops

write_devices(file="gmsh_mos2d_potentialonly", type="vtk")

for i in silicon_regions:
Expand Down
15 changes: 0 additions & 15 deletions src/MathEval/MathEval.cc

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It is not immediately obvious to me how this change relates to the commit message and PR. Having a separate commit with a message explaining why this is removed could be good for documentation purposes. But we can just merge this time :)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The format was very used. It was supposed to be compatible this FLOOPS/FLOODS simulator output for visualization in a software named Postmini

Original file line number Diff line number Diff line change
Expand Up @@ -594,21 +594,6 @@ bool MathEval<DoubleType>::AddTclMath(const std::string &funcname, ObjectHolder
}
return error.empty();
}
#if 0
template <typename DoubleType>
void MathEval<DoubleType>::AddTclMath(const std::string &funcname, size_t numargs)
{
///Really need to make sure number of arguments make sense in tcl api
tclMathFuncMap_[funcname] = numargs;
}
#endif

template <typename DoubleType>
void MathEval<DoubleType>::RemoveTclMath(const std::string &funcname)
{
/// Does this throw?
tclMathFuncMap_.erase(funcname);
}

template class MathEval<double>;

Expand Down
1 change: 0 additions & 1 deletion src/MathEval/MathEval.hh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ class MathEval {
static void DestroyInstance();

bool AddTclMath(const std::string &, ObjectHolder, size_t, std::string & /*error_string*/);
void RemoveTclMath(const std::string &);

private:
MathEval();
Expand Down
55 changes: 23 additions & 32 deletions src/commands/MeshingCommands.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ SPDX-License-Identifier: Apache-2.0
#include "DevsimReader.hh"
#include "DevsimWriter.hh"
#include "DevsimRestartWriter.hh"
#include "FloodsWriter.hh"
#include "VTKWriter.hh"
#include "TecplotWriter.hh"
#include "dsAssert.hh"
Expand Down Expand Up @@ -722,9 +721,7 @@ loadDevicesCmd(CommandHandler &data)
const std::string commandName = data.GetCommandName();

using namespace dsGetArgs;
// TODO: "specify list of solutions to read/write"
// TODO: "delete device if there is a problem"
// TODO: "specify option to only load the mesh creator, but don't instantiate"

static dsGetArgs::Option option[] = {
{"file", "", dsGetArgs::optionType::STRING, dsGetArgs::requiredType::REQUIRED, nullptr},
{nullptr, nullptr, dsGetArgs::optionType::STRING, dsGetArgs::requiredType::OPTIONAL, nullptr}
Expand Down Expand Up @@ -765,8 +762,7 @@ writeDevicesCmd(CommandHandler &data)
{"file", "", dsGetArgs::optionType::STRING, dsGetArgs::requiredType::REQUIRED, nullptr},
{"device", "", dsGetArgs::optionType::STRING, dsGetArgs::requiredType::OPTIONAL, nullptr},
{"type", "", dsGetArgs::optionType::STRING, dsGetArgs::requiredType::OPTIONAL, nullptr},
{"include", "", dsGetArgs::optionType::LIST, dsGetArgs::requiredType::OPTIONAL, nullptr},
{"exclude", "", dsGetArgs::optionType::LIST, dsGetArgs::requiredType::OPTIONAL, nullptr},
{"include_test", "", dsGetArgs::optionType::STRING, dsGetArgs::requiredType::OPTIONAL, nullptr},
{nullptr, nullptr, dsGetArgs::optionType::STRING, dsGetArgs::requiredType::OPTIONAL, nullptr}
};
bool error = data.processOptions(option, errorString);
Expand All @@ -780,36 +776,35 @@ writeDevicesCmd(CommandHandler &data)
const std::string &fileName = data.GetStringOption("file");
const std::string &device = data.GetStringOption("device");
const std::string &type = data.GetStringOption("type");
std::vector<std::string> include;
std::vector<std::string> exclude;

ObjectHolder include_test;

if (data.IsSpecified("include_test"))
{
ObjectHolder includeData = data.GetObjectHolder("include");
if (includeData.IsList())
if (type == "tecplot" || type == "vtk")
{
bool ok = includeData.GetStringList(include);
include_test = data.GetObjectHolder("include_test");
bool ok = include_test.IsCallable();
if (!ok)
{
std::ostringstream os;
os << "Option \"include\" could not be converted to a list of strings\n";
os << "Option \"include_test\" is not a function\n";
errorString += os.str();
data.SetErrorResult(errorString);
return;
}
}
}

{
ObjectHolder excludeData = data.GetObjectHolder("exclude");
if (excludeData.IsList())
else
{
bool ok = excludeData.GetStringList(exclude);
if (!ok)
{
std::ostringstream os;
os << "Option \"exclude\" could not be converted to a list of strings\n";
errorString += os.str();
}
errorString += R"(Option "include_test" only supported when "type" is "vtk" or "tecplot".)" "\n";
data.SetErrorResult(errorString);
return;
}
}
else
{
include_test = ObjectHolder("");
}

std::unique_ptr<MeshWriter> mw;

Expand All @@ -821,16 +816,12 @@ writeDevicesCmd(CommandHandler &data)
{
mw = std::unique_ptr<MeshWriter>(new DevsimWriter());
}
else if (type == "floops")
{
mw = std::unique_ptr<MeshWriter>(new FloodsWriter());
}
else if (type == "vtk")
{
#ifdef VTKWRITER
mw = std::unique_ptr<MeshWriter>(new VTKWriter());
#else
errorString += "VTK support was not built into this version. Please select from \"devsim\", \"devsim_data\", \"floops\", or \"tecplot\".\n";
errorString += "VTK support was not built into this version. Please select from \"devsim\", \"devsim_data\", or \"tecplot\".\n";
data.SetErrorResult(errorString);
return;
#endif
Expand All @@ -841,19 +832,19 @@ writeDevicesCmd(CommandHandler &data)
}
else
{
errorString += "type: " + type + " is not a valid type. Please select from \"devsim\", \"devsim_data\", \"floops\", \"vtk\", or \"tecplot\".\n";
errorString += "type: " + type + " is not a valid type. Please select from \"devsim\", \"devsim_data\", \"vtk\", or \"tecplot\".\n";
data.SetErrorResult(errorString);
return;
}

bool ret = true;
if (device.empty())
{
ret = mw->WriteMeshes(fileName, include, exclude, errorString);
ret = mw->WriteMeshes(fileName, include_test, errorString);
}
else
{
ret = mw->WriteMesh(device, fileName, include, exclude, errorString);
ret = mw->WriteMesh(device, fileName, include_test, errorString);
}

if (!ret)
Expand Down
1 change: 1 addition & 0 deletions src/common_api/CommandHandler.hh
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ class CommandHandler
int GetIntegerOption(const std::string &) const;
bool GetBooleanOption(const std::string &) const;
ObjectHolder GetObjectHolder(const std::string &) const;
bool IsSpecified(const std::string &) const;


private:
Expand Down
6 changes: 6 additions & 0 deletions src/common_api/GetArgsCommon.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ ObjectHolder GetArgs::GetObjectHolder(const std::string &s) const
return val;
}

bool GetArgs::IsSpecified(const std::string &s) const
{
bool ret = selections.count(s) != 0;
return ret;
}

std::string GetArgs::GetStringOption(const std::string &s) const
{
const ObjectHolder &tobj = GetObjectHolder(s);
Expand Down
1 change: 0 additions & 1 deletion src/math/MKLPardisoPreconditioner.cc
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ MKLPardisoData::MKLPardisoData(int numeqn) {
iparm[17] = -1; /* Output: Number of nonzeros in the factor LU */
iparm[18] = -1; /* Output: Mflops for LU factorization */
iparm[19] = 0; /* Output: Numbers of CG Iterations */
//#warning "set to 0 after done debugging"
iparm[26] = 0; /* matrix checker */
iparm[27] = 0; /* double precision */
iparm[34] = 1; /* 0 based solve */
Expand Down
1 change: 0 additions & 1 deletion src/meshing/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ SET (CXX_SRCS
MeshKeeper.cc
Mesh.cc
MeshWriter.cc
FloodsWriter.cc
MeshUtil.cc
Mesh1d.cc
Mesh1dStructs.cc
Expand Down
4 changes: 2 additions & 2 deletions src/meshing/DevsimRestartWriter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ DevsimRestartWriter::~DevsimRestartWriter()
{
}

bool DevsimRestartWriter::WriteMesh_(const std::string &deviceName, const std::string &filename, std::vector<std::string> &include, std::vector<std::string> &exclude, std::string &errorString)
bool DevsimRestartWriter::WriteMesh_(const std::string &deviceName, const std::string &filename, MeshWriterTest_t, std::string &errorString)
{
bool ret = true;
std::ostringstream os;
Expand All @@ -418,7 +418,7 @@ bool DevsimRestartWriter::WriteMesh_(const std::string &deviceName, const std::s
return ret;
}

bool DevsimRestartWriter::WriteMeshes_(const std::string &filename, std::vector<std::string> &include, std::vector<std::string> &exclude, std::string &errorString)
bool DevsimRestartWriter::WriteMeshes_(const std::string &filename, MeshWriterTest_t, std::string &errorString)
{
bool ret = true;
std::ostringstream os;
Expand Down
4 changes: 2 additions & 2 deletions src/meshing/DevsimRestartWriter.hh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class DevsimRestartWriter : public MeshWriter {
public:
~DevsimRestartWriter();
private:
bool WriteMeshes_(const std::string &/*filename*/, std::vector<std::string> &/*include*/, std::vector<std::string> &/*exclude*/, std::string &/*errorString*/);
bool WriteMesh_(const std::string &/*deviceName*/, const std::string &/*filename*/, std::vector<std::string> &/*include*/, std::vector<std::string> &/*exclude*/, std::string &/*errorString*/);
bool WriteMeshes_(const std::string &/*filename*/, MeshWriterTest_t /*include*/, std::string &/*errorString*/);
bool WriteMesh_(const std::string &/*deviceName*/, const std::string &/*filename*/, MeshWriterTest_t /*include*/, std::string &/*errorString*/);
};
#endif
4 changes: 2 additions & 2 deletions src/meshing/DevsimWriter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ DevsimWriter::~DevsimWriter()
{
}

bool DevsimWriter::WriteMesh_(const std::string &deviceName, const std::string &filename, std::vector<std::string> &include, std::vector<std::string> &exclude, std::string &errorString)
bool DevsimWriter::WriteMesh_(const std::string &deviceName, const std::string &filename, MeshWriterTest_t, std::string &errorString)
{
bool ret = true;
std::ostringstream os;
Expand All @@ -257,7 +257,7 @@ bool DevsimWriter::WriteMesh_(const std::string &deviceName, const std::string &
return ret;
}

bool DevsimWriter::WriteMeshes_(const std::string &filename, std::vector<std::string> &include, std::vector<std::string> &exclude, std::string &errorString)
bool DevsimWriter::WriteMeshes_(const std::string &filename, MeshWriterTest_t, std::string &errorString)
{
bool ret = true;
std::ostringstream os;
Expand Down
4 changes: 2 additions & 2 deletions src/meshing/DevsimWriter.hh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class DevsimWriter : public MeshWriter {
public:
~DevsimWriter();
private:
bool WriteMeshes_(const std::string &/*filename*/, std::vector<std::string> &/*include*/, std::vector<std::string> &/*exclude*/, std::string &/*errorString*/);
bool WriteMesh_(const std::string &/*deviceName*/, const std::string &/*filename*/, std::vector<std::string> &/*include*/, std::vector<std::string> &/*exclude*/, std::string &/*errorString*/);
bool WriteMeshes_(const std::string &/*filename*/, MeshWriterTest_t /*include*/, std::string &/*errorString*/);
bool WriteMesh_(const std::string &/*deviceName*/, const std::string &/*filename*/, MeshWriterTest_t /*include*/, std::string &/*errorString*/);
};
#endif
Loading